[Yhc] single element tuple

Tom Hawkins tomahawkins at gmail.com
Fri Mar 14 10:28:52 EDT 2008


Hi,

Printing the core one of my programs I see:

  data Prelude;1() a =
    Preluse;1() a

What is this?  A single element tuple?  I didn't think Haskell had
these.  My program has a monad similar to IO.  It appears these
Prelude;1() things are created in the lambda lifted version of f1.
Perhaps is it the parenthesis around (System m)?

data Return a = Return a World
data System a = System (World -> Return a)
data World = World
instance Monad System where
  (System m) >>= k = System f1
    where
    f1 w = f2 w'
      where
      Return r w' = m w
      System f2 = k r

  return a = System (\ w -> Return a w)


It's a bit difficult to correlate arguments of lifted lambdas to the
original source.  Is there a convention YHC uses for adding the extra
arguments to lifted lambdas?

Thanks!

-Tom


More information about the Yhc mailing list