Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file: -- http://angg.twu.net/HASKELL/DoNotation1.hs.html -- http://angg.twu.net/HASKELL/DoNotation1.hs -- (find-angg "HASKELL/DoNotation1.hs") -- Author: Eduardo Ochs <eduardoochs@gmail.com> -- -- (defun e () (interactive) (find-angg "HASKELL/DoNotation1.hs")) -- (find-books "__comp/__comp.el" "haskell-hutton") -- (find-books "__comp/__comp.el" "haskell-hutton" "do notation") -- (find-huttonbookpage 196 "m1 >>= \\x1 ->") -- (find-huttonbooktext 196 "m1 >>= \\x1 ->") -- (find-angg "HASKELL/Comprehensions1.hs") {- do va <- tma vb <- tmb vc <- tmc tmd tma >>= \va -> tmb >>= \vb -> tmc >>= \vc -> tmd tma >>= \va -> tmb >>= \vb -> tmc >>= \vc -> tmd ===== === ===== === ===== ==== ===== ::m a ::a ::m b ::b ::m c :: c ::m d ============== ::c->m d ======================== ::m d ================================ ::b->m d ========================================== ::m d ================================================== ::a->m d ============================================================ ::m d -} -- (find-es "haskell" "list-comprehensions") {- * (eepitch-ghci) * (eepitch-kill) * (eepitch-ghci) :load Comprehensions1.hs [10*x+y | x <- [1..3], y <- [1..x]] [10*x+y | x <- [1..3], y <- [1..x], x+y<6] do x <- [1..3]; y <- [1..x]; return (x,y) do x <- [1..3]; y <- [1..x]; return (10*x+y) do x <- [1..3]; y <- [1..x]; guard (x+y<=6); return (10*x+y) do x <- [1..3]; y <- [1..x]; _ <- guard (x+y<=6); return (10*x+y) [1..3] >>= \x -> [1..x] >>= \y -> return (10*x+y) [1..3] >>= \x -> [1..x] >>= \y -> guard (x+y<=6) >>= \_ -> return (10*x+y) :t [1..3] >>= \x -> [1..x] >>= \y -> guard (x+y<=6) >>= \_ -> return (10*x+y) :t [1..3] :t \x -> [1..x] >>= \y -> guard (x+y<=6) >>= \_ -> return (10*x+y) :t \x -> \y -> guard (x+y<=6) >>= \_ -> return (10*x+y) :t return -} -- Local Variables: -- coding: utf-8-unix -- End: