What is a "record PUN"?  Looking at the example,

        > module Main where
        > data Point = Point {x :: Int, y :: Int}
        > main = print $ f $ Point 1 2
        > f (Point{x}) = x

is the problem that "x" is used simultaneously as a field selector
and a variable?

Something very similar is accepted by SML/NJ:

    datatype point = POINT of { x : int, y : int };

    fun f (POINT {x, y}) = x;

    print (Int.toString (f (POINT {x = 1, y = 2})) ^ "\n");

The MLton compiler also likes it.

I should also point out that it's not just Yhc and Hugs that like
the Haskell version; the copy of hbc I have also likes it.

_______________________________________________
Hugs-Users mailing list
Hugs-Users@haskell.org
http://www.haskell.org/mailman/listinfo/hugs-users

Reply via email to