这是一个快速的概念性问题,我目前正在努力学习和更好地理解Haskell.
我知道Show函数用于将值转换为字符串,但为什么函数类型不能与show一起使用?
Prelude> (\x -> x*3)
<interactive>:7:1:
No instance for (Show (a0 -> a0))
arising from a use of `print'
Possible fix: add an instance declaration for (Show (a0 -> a0))
In a stmt of an interactive GHCi command: print it
Prelude>
Run Code Online (Sandbox Code Playgroud) haskell ×1