fundeps syntax is ugly

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Thu Feb 2 06:17:42 EST 2006


>    Multi-parameter classes with functional dependencies

When I first learned functional dependencies
I remember I was really confused by their syntax.

First, it is hard to find it defined:
The GHC docs have barely three lines
http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#functional-dependencies
and they refer to Mark Jones' paper
which has a different notation than GHC's

In Mark Jones' paper, the syntax is "tuple" notation,
GHC uses  | a b c -> d e  where concatenation stands for grouping.
where one would expect  'a b c' to mean application in Haskell
(at the values level and at the type level).
So when I first saw this, I thought this must be a kind error
(if a has kind *)

Otherwise in Haskell, we use parentheses and commas
for grouping (export lists, type constraints, deriving)
which is somehow wrong because the group in this case
is a set, not a tuple.

(With that respect, braces in records and let and where are OK,
since order is irrelevant, but in  do { .. }  they are not,
but that's how we show our sympathy to C and Java, right.)
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- http://www.imn.htwk-leipzig.de/~waldmann/ -------



More information about the Haskell-prime mailing list