Skip to content

Instantly share code, notes, and snippets.

@yangsu
Last active December 16, 2015 14:19
Show Gist options
  • Save yangsu/5447819 to your computer and use it in GitHub Desktop.
Save yangsu/5447819 to your computer and use it in GitHub Desktop.
Haskell Simple Monad
module Main where
stagger :: (Num t) => t -> t
stagger d = d + 2
crawl d = d + 1
treasureMap d =
crawl (
stagger (
stagger d))
letTreasureMap (v, d) = let d1 = stagger d
d2 = stagger d1
d3 = crawl d2
in d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment