获取有关函数应用程序运算符

时间:2017-03-28 08:43:01

标签: haskell operators ghci

GHCI中,您可以获得有关各种内容的信息,例如

Prelude> :i map
map :: (a -> b) -> [a] -> [b]   -- Defined in `GHC.Base'
Prelude> :i (+)
class Num a where
  (+) :: a -> a -> a
  ...
        -- Defined in `GHC.Num'
infixl 6 +
Prelude> :i :
data [] a = ... | a : [a]       -- Defined in `GHC.Types'
infixr 5 :

我读过类似“函数应用程序具有最高优先级”的内容,这意味着

f "hello" * g 'w'

相当于

(f "hello") * (g 'w')

我可以获得有关功能应用的信息吗?它是一个真正的运营商吗?

以下工作

Prelude> :i ( )

<interactive>:1:2: error:
    parse error (possibly incorrect indentation or mismatched brackets)
Prelude>

0 个答案:

没有答案
相关问题