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

2006-01-08 Thread Bulat Ziganshin
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, Bulatmailto:[EMAIL PROTECTED]

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

2006-01-08 Thread Marc Weber
On Sun, Jan 08, 2006 at 12:19:40PM +0300, Bulat Ziganshin wrote: 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] list4= take 2 $ [2*x+1,x-[0..]] ;-) Hi Bulat.. Thanks

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

2006-01-08 Thread Daniel Fischer
Am Sonntag, 8. Januar 2006 01:19 schrieb Marc Weber: Here is a simple program implementing the above function in 4 different ways.. See my comments to get to know where I have problems: -- begin test.hs -- module Main where import IO import Control.Monad.List {-

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

2006-01-07 Thread Marc Weber
Here is a simple program implementing the above function in 4 different ways.. See my comments to get to know where I have problems: -- begin test.hs -- module Main where import IO import Control.Monad.List {- list1,2 are both implementations of the same function f=[1,3] ;-)