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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With