miscellaneous Core questions

Adam Megacz megacz at cs.berkeley.edu
Thu Feb 24 20:08:48 CET 2011


Here are the leftover questions I had that weren't very urgent (I
kludged my way around most of them and am now going back to clean stuff
up)....

  - Can I count on the desugarer and core-to-core passes preserving the
    syntactic order of the branches in a (Let (Rec branches) e)?

  - It isn't possible for a single Case to have *both* LitAlt's and
    DataAlt's, is it?  Seems like any given Case should have only one
    or the other (and possibly a DEFAULT).

  - In SystemFC1 the (+>)_\kappa operator is indexed by a kind.  If I
    encounter this in Core:

      FunTy (EqPred t1 t2) t3

    I should expect t1 and t2 to have the same kind, and that would be
    the kind-index of the (+>)-type-function-constant, right?

  - I haven't been able to figure out how to ask GHC for the Kind of a
    Type.  I expected to find a "kindOfType" or similar but couldn't
    find it in Type.lhs or TypeRep.lhs.  Does GHC know how to compute
    the Kind of a Type?

  - Is there a way to extract the varType field from a Var?  It doesn't
    seem to be exported from Var.lhs; I had to add my own function to that
    file so I could access this field in other modules.

  - Is it possible to turn a Name (say, of some magic identifier from
    PrelNames.lhs) into a global Var outside of GHC's various monads?
    I'd like to add a Var for a global name in a core-to-core pass that
    isn't of monadic type.




More information about the Cvs-ghc mailing list