Skip to content

Instantly share code, notes, and snippets.

@imalsogreg
Created June 4, 2014 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imalsogreg/98092ade3a086b14d356 to your computer and use it in GitHub Desktop.
Save imalsogreg/98092ade3a086b14d356 to your computer and use it in GitHub Desktop.
map-syntax testing
module Main where
import qualified Data.Map as M
import Data.Map.Syntax
-- prints: Right (fromList [("blobz",10),("smootz",12)])
main = print . runMapSyntax M.lookup M.insert $ do
foo
mapK (++ "a") bar
"extra" #! 1234
mapK (++ "z") baz
foo = do
"java" #! (1 :: Int)
"haskel" #! 2
bar = do
"c" #! 1
"haskell" #! 3
baz = do
"blob" #! 10
"smoot" #! 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment