The Hazy Haskell Compiler

Have you seen the import proposals? Several proposals for Import syntax. I’m kinda like exposing (with my addendum: import-exposing-impqual by akhra · Pull Request #763 · ghc-proposals/ghc-proposals · GitHub).

If there were implemented, there would have to be some questions regarding fields and instance definitions that have to be answered. Consider something like this:

import Point (Point, x as abc, y as xyz)
p1 = Point { abc = 1, xyz = 2 }
p2 = Point { x = 1, y = 2 }

Here, p1 would be legal if selectors are their own standalone thing while p2 would be legal if fields are attached to constructors. Haskell 2010 leans more toward p1, while Hazy (with ConstructorsFields) would use p2. A similar problem would happen with instance definitions too.

2 Likes