6

For (a cut-down) example,

class SemigroupOps[F] (val self: F)(val F: Semigroup[F]) extends Ops[F] {
  def |+|(other: => F): F = F.append(self, other)
}

F in this case is a variable so I'd expect to see it as f in Java-like libraries.

Why does Scalaz use the upper-case convention? Is it a haskell convention?

Why?

For extra merit, what's the motivation behind it? So far, it's more confusing than helpful but I'm aware I'm missing the reason behind the convention.

Toby
  • 9,523
  • 8
  • 36
  • 59
  • It [mostly looks like Scalaz convention for implicits](https://github.com/scalaz/scalaz/blob/series/7.3.x/CONTRIBUTING.md#parameters) where you have a value `F` and an implicit of type `M[F]`. Perhaps this is specific case is a typo? – Yuval Itzchakov May 23 '16 at 08:19
  • 2
    @Toby It's definitely not a Haskell convention, as in Haskell value names (except constructors), and thus function parameters, cannot be uppercase. – phipsgabler May 23 '16 at 08:57
  • @YuvalItzchakov I think the answer you deleted was OK - it's just that they use this convention for all typeclasses, not just for implicit parameters. Typeclasses are more often than not passed as an implicit parameter, so these two "categories" often overlap. I think `Contributing.MD` should be updated. – dcastro May 23 '16 at 10:08
  • @dcastro Yeah, I wasn't sure I was hitting the nail here because the parameter in the example isn't implicit. – Yuval Itzchakov May 23 '16 at 10:20
  • Would you like to move the comment to an answer? Is the convention unique to Scalaz or is a more widely adopted one? I'm interesting in it's lineage..! – Toby Nov 29 '17 at 09:52

0 Answers0