Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. module HW where
  2.  
  3.  
  4. import Control.Monad.State hiding (when)
  5.  
  6.  
  7.  
  8. tick :: Int -> State String ()
  9. tick _= do
  10. -- get last intermediate valueP
  11. n <- get
  12. put $ show n
  13. return ()
  14.  
  15.  
  16.  
  17. test :: String -> String
  18. test = execState (tick 0)
  19.  
  20.  
  21. -- y :: State Int Int
  22. -- y = state $ \x -> (x,x+1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement