Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
damncabbage
on July 5, 2014
|
parent
|
context
|
favorite
| on:
3d scene representation in Haskell
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
on July 5, 2014
|
next
[–]
Nah, 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
on July 5, 2014
|
prev
[–]
This is an example of a 'phantom type'. See
http://www.haskell.org/haskellwiki/Phantom_type
(and references therein) for an explanation (including a motivation) of this technique.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: