[Haskell-cafe] do {x<-[1,2,3]; True <- return (odd x); return x}.. why? (do notation, monads, guards)

Bulat Ziganshin bulatz at HotPOP.com
Sun Jan 8 04:19:40 EST 2006


Hello Marc,

Sunday, January 08, 2006, 3:19:56 AM, you wrote:

MW> list2=do { x <- [1,2,3]; guard (odd x); return x} -- <- provided by xerox

list3 = [ x | x <- [1,2,3], odd x]

-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Haskell-Cafe mailing list