• eir@cis.upenn.edu's avatar
    Refactor the typechecker to use ExpTypes. · 00cbbab3
    eir@cis.upenn.edu authored
    The idea here is described in [wiki:Typechecker]. Briefly,
    this refactor keeps solid track of "synthesis" mode vs
    "checking" in GHC's bidirectional type-checking algorithm.
    When in synthesis mode, the expected type is just an IORef
    to write to.
    In addition, this patch does a significant reworking of
    RebindableSyntax, allowing much more freedom in the types
    of the rebindable operators. For example, we can now have
    `negate :: Int -> Bool` and
    `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic
    is in tcSyntaxOp.
    This addresses tickets #11397, #11452, and #11458.
MonadUtils.hs 7.05 KB