5 ms·
I think there may be a typo with the first example: newtype ID a = ID Int deriving (Eq,Ord,Show) Should possibly just be: newtype ID a = ID a deriving (E
by damncabbage 12y ago
I think there may be a typo with the first example:
newtype ID a = ID Int deriving (Eq,Ord,Show)
Should possibly just be:
newtype ID a = ID a deriving (Eq,Ord,Show)
- edwardkmett 12y agoNah, it is a type of numeric ID's for different types of things. The parameter 'a' is just a phantom type parameter to keep you from mixing up a mesh ID with a texture ID.
- ajtulloch 12y agoThis is an example of a 'phantom type'. See http://www.haskell.org/haskellwiki/Phantom_type http://www.haskell.org/haskellwiki/Phantom_type (and references therein) for an explanation (including a motivation) of this technique.