Re:Let the Type System do the Work
by jweese on Monday April 21, 2014 @03:12PM
(#7623030)
That's why you want
which has no runtime overhead but does enforce the fact the Kilogram is a distinct type.
[ Parent
| on HN ]
We probably wanna add to it to make it useful
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype Kilogram = Kilogram Double deriving (Show, Eq, Ord, Num, Real, Fractional, Floating, ...)
And remind ourselves that Haskell is really quite expressive.