FAQ: How to Use Extensible Records in GHCi

I feel like I have way too much code of the form: changeGpart (C a b c d e f g h i) g' = C a b c d e f g' h i So, I got excited reading Simon and Mark's "Lightweight Extensible Records For Haskell" paper as a way to get rid of this cruft. I immediately started GHCi, typed {a="Hello world"}, and got an error. Is the feature described in the paper just a proposal or is there a switch somethere to enable it? Alternatively, perhaps this code is a common beginner mistake due to ignorance of the proper idiom... -Alex- _________________________________________________________________ S. Alexander Jacobson mailto:me@alexjacobson.com tel:917-770-6565 http://alexjacobson.com

Is the feature described in the paper just a proposal or is there a switch somethere to enable it?
I think you used the wrong compiler. It's called Hugs :-) Prelude> #a ( a='a', b=True ) ERROR - Trex.insertField not in scope *** Possible cause: "Trex" module not imported Prelude> :l Trex Trex> #a ( a='a', b=True ) 'a' Trex> #b ( a='a', b=True ) True Documentation is here: http://cvs.haskell.org/Hugs/pages/hugsman/exts.html#sect7.2 -- Alastair Reid
participants (2)
-
Alastair Reid
-
S. Alexander Jacobson