Possible Duplicate:
What’s the “|” for in a Haskell class definition?
In the following (from Data.HList.HListPrelude
, how do I interpret the | l l' -> l''
part?
class HAppend l l' l'' | l l' -> l''
where
hAppend :: l -> l' -> l''
And is it a part of standard Haskell (i.e. Haskell 2010) or an extension?
It is an extension called Functional Dependencies which you can spot in future by looking at the top of the file.
It essentially says l''
is uniquely determined from l
and l'
.
It is required because HAppend
is a multiparameter typeclass (which is also an extension).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With