
21 Dec
2012
21 Dec
'12
8:36 a.m.
Using a simple type I gave earlier from my monadic type question... code: -------- data Socket3 a b c = Socket3 a b c deriving (Show) -------- Is it possible somehow to layer on record syntax onto a synonym of the type? The idea would be something like this... code: -------- type SpaceShip = Socket3 { engine :: Last Engine , hull :: Last Hull , guns :: [Guns] } -------- ...purely for the convenience. But this doesn't seem to work with "type" as it assumes you are referring to already made constructors, and evidently "newtype" only allows use of a single record. I could wrap it in a normal "data" declaration but that would add an extra layer of complexity I think. -- frigidcode.com