I try to compose two function with type specifying.
foo :: Num a => a -> a
foo a = a + 2
bar :: Num a => a -> a
bar a = a * 2
fooBarCompose :: (Num a, Num b, Num c) => (a -> b) -> (c -> a) -> c -> b
fooBarCompose f g = f . g
My module compiles, but in runtime when I invoke
fooBarCompose bar foo
I get an error:
No instance for (Show (b0 -> b0))
(maybe you haven't applied enough arguments to a function?)
arising from a use of ‘print’
In the first argument of ‘print’, namely ‘it’
In a stmt of an interactive GHCi command: print it
Any ideas why I get this?