
16 Sep
2013
16 Sep
'13
8:05 a.m.
On Mon, Sep 16, 2013 at 12:00 PM, Vinay Emani
I've never seen '|' in the middle of a class definition, could some one explain this? It's used in the guard syntax as well as to separate data constructors in a type definition.
You're quite right. The vertical bar is used in /defining/ (1) a /typeclass/ that has functional dependencies (2) a /function/ using pattern guards (3) a /datatype/ that is a sum of two or more datatypes. These are all different, as you've guessed. The reason the syntax conflation works is that all these constructs are different. The canonical intro to fundeps is the container/element example. See Section 3 on collection types in http://web.cecs.pdx.edu/~mpj/pubs/fundeps.html -- Kim-Ee