
21 Aug
2002
21 Aug
'02
12:54 p.m.
Simon Guest asked:
Please could someone explain the meaning of | in this class declaration (from Andrew's example):
class (Ord k) => Map m k v | m -> k v where lookupM :: m -> k -> Maybe v
I couldn't find reference to this in any of my standard Haskell tutorials, nor the Haskell 98 report. Any references?
It might not have become clear from the previous answers: this construction is not Haskell 98, but an extension. That's why it's not in the report. BTW: Already multi parameter type classes (such as "class (Ord k) => Map m k v where ...") ^ ^ ^ only one type variable allowed here aren't Haskell 98. All the best Christian Sievers