6
votes

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.

It mostly looks like Scalaz convention for implicits where you have a value F and an implicit of type M[F]. Perhaps this is specific case is a typo? - Yuval Itzchakov
@Toby It's definitely not a Haskell convention, as in Haskell value names (except constructors), and thus function parameters, cannot be uppercase. - phipsgabler
@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
@dcastro Yeah, I wasn't sure I was hitting the nail here because the parameter in the example isn't implicit. - Yuval Itzchakov
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