Type inference rocks

I just wrote the following snippet of code for my dissertation:


intNatI :: Int :~= Nat
intNatI = Iso {
            to   = fromInteger . toInteger,
            from = fromInteger . toInteger }

The components to and from have totally different types (to is Int -> Nat, from is Nat -> Int). Yay for type inference! :)

Leave a Reply