Haskell运算符“<>”的含义是什么? [英] What is the meaning of the Haskell operator "<>"?
本文介绍了Haskell运算符“<>”的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<>< $ code>运算符的含义是什么(与<>< /& c>或< $>
)。在研究 optparse-applicative包时,我看到了它的参考资料。 Google和LYAH似乎都没有任何信息。 haskell.org/package/base-4.9.0.0/docs/Data-Monoid.html#v:mappendrel =noreferrer> mappend
,from Data.Monoid $ (<>):: Monoid m => m - > m - > m
(<>)= mappend
mappend
一起打破两个monoidal值。例如,使用list monoid,
ghci> [1,2,3]<> [4,5,6]
[1,2,3,4,5,6]
当您看到一个您无法识别的功能时,您通常可以在API搜索引擎上找到它,例如 Hoogle 或 Hayoo 。
In Haskell, what is the meaning of the <>
operator (as distinct from <*>
or <$>
). I am seeing references to it while researching the optparse-applicative package. Neither Google nor LYAH seem to have any information.
解决方案 It's an alias for mappend
, from the Data.Monoid
module.
(<>) :: Monoid m => m -> m -> m
(<>) = mappend
mappend
smashes two monoidal values together. For example, using the list monoid,
ghci> [1,2,3] <> [4,5,6]
[1,2,3,4,5,6]
When you see a function you don't recognise, you can often find it on API search engines like Hoogle or Hayoo.
这篇关于Haskell运算符“<>”的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文