Skip to content

Instantly share code, notes, and snippets.

@pbadenski
Created May 13, 2012 14:20
Show Gist options
  • Save pbadenski/2688654 to your computer and use it in GitHub Desktop.
Save pbadenski/2688654 to your computer and use it in GitHub Desktop.
haskell money types
data Dollars = Dollars
data Euro = Euro
class Money a where
(+) :: (Int, a) -> (Int, a) -> Int
(+) (a, _) (b, _) = (Prelude.+) a b
instance Money Dollars
instance Money Euro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment