Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell is

Name: Anonymous 2008-06-17 17:37

the white man's burden of programming languages.

Name: Anonymous 2008-06-21 19:50

>>76,78
IO monad:
main = do
  mapM_ putStrLn ["hey","guise"]


STM monad:
withdraw :: Account -> Int -> STM ()
withdraw acc amount
  = do { bal <- readTVar acc
       ; writeTVar acc (bal - amount) }


Parser (Parsec) monad:
parens  :: Parser ()
parens  = do{ char '('
            ; parens
            ; char ')'
            ; parens
            }
        <|> return ()


Do you see a pattern forming here? Thank god we abstracted that shit, yo!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List