I am a beginner of Haskell. What is wrong with this expression?:
Prelude> let { f op [] = [] ; f op (h:t) = op h : f op t }
Prelude> f (+) []
<interactive>:337:1:
No instance for (Show (t0 -> t0))
arising from a use of `print'
Possible fix: add an instance declaration for (Show (t0 -> t0))
In a stmt of an interactive GHCi command: print it
Many thanks for support.
Function
(+)has type(+) :: Num a => a -> a -> aand functionfhas typef :: (t -> a) -> [t] -> [a].fexpects a function of one argument.f (+1) []will be correct