Guest User

Untitled

a guest
Feb 27th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Amount.hs:
  2.  
  3. module Money
  4. (
  5.     Currency
  6. ) where
  7.  
  8. class (Eq a, Show a) => Currency a where
  9.     code :: a -> String
  10.     intSep :: a -> Char
  11.     decSep :: a -> Char
  12.     symbol :: a -> String
  13.     decPlaces :: a -> Word8
  14.  
  15.  
  16. Currencies.hs:
  17.  
  18. import qualified Money(Amount, Currency)
  19.  
  20. data COP = COP
  21. instance Money.Currency COP where
  22.     code = "COP"
  23.     intSep = '.'
  24.     decSep = ','
  25.     symbol = "$"
  26.     decPlaces = 2
  27.  
Advertisement
Add Comment
Please, Sign In to add comment