fundeps syntax is ugly

Ian Lynagh igloo at earth.li
Thu Feb 2 16:31:46 EST 2006


On Thu, Feb 02, 2006 at 07:06:07PM +0000, Ben Rudiak-Gould wrote:
> Johannes Waldmann wrote:
> >(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.)
> 
> You forget "let { f [] _ = 1 ; f _ [] = 2 } in f [] []".

Also, order is relevant in many situations with records, e.g.

    data Foo = Foo { x :: Char, y :: Bool }

defines Foo :: Char -> Bool -> Foo as well as the corresponding pattern
constructor, and with

    foo (Foo { x = 'a', y = False }) = 'c'
    foo _ = 'd'

    bar (Foo { y = False, x = 'a' }) = 'c'
    bar _ = 'd'

we have

    foo (Foo { x = 'z', y = undefined }) == 'd'
    bar (Foo { x = 'z', y = undefined }) == undefined

(Err, where "we" == hugs. If "we" == ghci then they're both 'd', but I
think this is wrong given my reading of both 3.17.2 and 3.17.3 in the
H98 report)


Thanks
Ian



More information about the Haskell-prime mailing list