Ah, now I have the solution:

{-# LANGUAGE CPP #-}

(|>) = flip ($)

#define LET(p, e) (e) |> \ (p) ->

bla = LET(x, 5)
      LET(Just x, Just (x+1))
      x

#define MLET(p, e) (e) |> \ (p) -> do

main = do
  MLET((x, y), (5, 3))
  print (x + y)

Beautiful, ain't it?  Sigh.

--Andreas

On 11.07.2013 17:40, Carter Schonwald wrote:
Yup. Nested cases *are* non recursive lets.

(Can't believe I forgot about that )

On Thursday, July 11, 2013, Edward Kmett wrote:


    blah = case foo 1 [] of
       (x, s) -> case bar x s of
          (y, s) -> case baz x y s of
            (z, s) -> ...

    -Edward


--
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.a...@ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to