shithub: MicroHs

ref: e58eace5b4c5f50e1e1a9b6dd0f8e04122478512
dir: /tests/Multi.hs/

View raw version
module Multi(main) where
import Prelude

class C a b where
  conv :: a -> b

instance C Int Bool where
  conv x = x /= 0

instance C Int Char where
  conv = chr

instance C Char Int where
  conv = ord

main :: IO ()
main = do
  print (conv (100::Int) :: Bool)
  print (conv (100::Int) :: Char)
  print (conv 'a' :: Int)