Copyright | Copyright (c) 2017 the Hakaru team |
---|---|
License | BSD3 |
Stability | experimental |
Portability | GHC-only |
Safe Haskell | None |
Language | Haskell2010 |
Ad-hoc implementation of unification (ad-hoc because polytypes are inexpressible, and this module makes no attempt to express them).
Documentation
type Metadata = Maybe SourceSpan Source #
type Unify1 (t :: Hakaru -> Hakaru) r x = Sing x -> Metadata -> (forall a. x ~ t a => Sing a -> TypeCheckMonad r) -> TypeCheckMonad r Source #
type Unify2 (t :: Hakaru -> Hakaru -> Hakaru) r x = Sing x -> Metadata -> (forall a b. x ~ t a b => Sing a -> Sing b -> TypeCheckMonad r) -> TypeCheckMonad r Source #
class TCMTypeRepr x where Source #
Instances
TCMTypeRepr () Source # | |
Defined in Language.Hakaru.Syntax.TypeCheck.Unification | |
TCMTypeRepr Text Source # | |
Defined in Language.Hakaru.Syntax.TypeCheck.Unification | |
TCMTypeRepr (Sing x) Source # | |
Defined in Language.Hakaru.Syntax.TypeCheck.Unification |
unifyMeasure :: Unify1 'HMeasure r x Source #
unifyArray :: Unify1 'HArray r x Source #
matchTypes :: (TCMTypeRepr t0, TCMTypeRepr t1) => Sing (x :: Hakaru) -> Sing y -> Metadata -> t0 -> t1 -> (x ~ y => TypeCheckMonad r) -> TypeCheckMonad r Source #