Folks,
My student Levent Erkok and I have been playing about with the idea of mutual
recursive bindings in the do notation. Mostly it's clear how they should behave, but
we struggle with the following example. I would love to hear some (considered)
opinions about this.
John.
--------------------
test :: [Int]
test = do (x,z) <- [(y,1),(2*y,2), (3*y,3)]
Just y <- map isEven [z .. 2*z]
return (x+y)
isEven x = if even x then Just x else Nothing
- Re: Here's a puzzle to fry your brains .... John Launchbury
- Re: Here's a puzzle to fry your brains .... Wolfram Kahl
- Re: Here's a puzzle to fry your brains .... Ross Paterson
