Preferred syntax for append
Mark McConnell via Haskell-Cafe <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cafe |
|---|---|
| Message-ID | <[email protected]> |
We know that lists have map. Sometimes we want to take the higher perspective of Functor, replacing map with fmap, then replacing fmap with <$> . This post asks the corresponding question about append. The notation for append within List itself is ++ . Often we think of lists as Monads. Applicative generalizes Monad, and Alternative specializes Applicative. Alternative has <|> which behaves as ++ on List. I have been using <|> for this purpose. Recently, I have begun to read and enjoy "Effective Haskell". In Chapter 1, this book uses <> for append. Clearly they are thinking of List as a Semigroup. I'm curious about your thoughts on ++ versus <|> versus <> . _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.