I have the following scala class definition (found in a paper), modeling categories:
trait Category[~>[_, _]] {
def compose[A, B, C]
(f: B ~> C)
(g: A ~> B)
: A ~> C
def id[A]: A ~> A
}
can someone explain me what the ‘~>’ means in the Category type parameter, and in the methods return type?
Or direct me to a resource that explains it…
I’m new to Scala (coming from Java), so forgive me if that’s something a scala user should have known…
Thank you in advance
~>is just the placeholder-name for the type-parameter ofCategory. Like theTinclass Option[T].Additionally, Scala syntax allows you to write
B ~> Cas a shorthand for~>[B, C].Maybe things get clearer, if you rename it: