class Foo a where foo :: a data List a = Nil | Cons a (List a) r x = Cons foo (r x) main = (1.0 :: Double) -- 1.0