反引号操作符的固定性? [英] Fixity of backtick operators?
问题描述
反引号操作符的固定性是什么? 例如,在 code> ghci的> (1+)`fmap` [1,2,3] ++ [4,5,6] 显而易见,反向操作符 任何缺乏固定声明的操作符都被认为是infixl 9 任何运算符都包含反引号中的正常函数名称。 您的示例显示<因为 What is the fixity of backtick operators? For instance in this code from Real World Haskell: It's evident the backtick operator §4.4.2 of the Haskell Report states that Any operator lacking a fixity declaration is assumed to be infixl 9 "Any operator" includes normal function names in backticks. Your example shows that 这篇关于反引号操作符的固定性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
[2,3,4,4,5,6]
`fmap`
的固定性高于 ++
,但没有任何由GHCi提供 。 Haskell报告指出:
$ b blockquote>
++
`fmap` 确实比 ++
c>作用于 fmap
的结果。ghci> (1+) `fmap` [1,2,3] ++ [4,5,6]
[2,3,4,4,5,6]
`fmap`
has a higher fixity than ++
, but none is given by GHCi.
`fmap`
does have higher fixity than ++
, because ++
acts on the result of the fmap
.