Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created August 19, 2015 11:40
Show Gist options
  • Select an option

  • Save shigemk2/816c66d28374dbdb2b7a to your computer and use it in GitHub Desktop.

Select an option

Save shigemk2/816c66d28374dbdb2b7a to your computer and use it in GitHub Desktop.
import Data.Monoid
-- instance Monoid [a] where
-- mempty = []
-- mappend = (++)
main = do
print $ [1,2,3] `mappend` [4,5,6]
print $ ("one" `mappend` "two") `mappend` "tree"
print $ "one" `mappend` ("two" `mappend` "tree")
print $ "one" `mappend` "two" `mappend` "tree"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment