Skip to content

Instantly share code, notes, and snippets.

@lgastako
Last active January 1, 2016 08:28
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 lgastako/8117999 to your computer and use it in GitHub Desktop.
Save lgastako/8117999 to your computer and use it in GitHub Desktop.
Haskell implementation of https://gist.github.com/amontalenti/8114359 from a non-haskell programmer.
module Main where
import Data.Map (Map)
import qualified Data.Map as Map
main = let someItems = [1, 2, 3, 4]
someMapping = Map.fromList [ ("ST", "started")
, ("IP", "in progress")
, ("DN", "done")
]
in do mapM_ (putStrLn . show) someItems
mapM_ (putStrLn . format) (Map.toList someMapping)
where format (k, v) = k ++ " => " ++ v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment