|
| Language.Haskell.Derive.Gadt.Unify |
|
|
| Description |
| A clusterfrolick at the moment. Among other things,
the Exists con in the Type type isn't handled
correctly (or at all really, it's just pretended
that it's Forall because I don't know how to
handle it).
|
|
| Synopsis |
|
| unify :: Type -> Type -> Q (Either String (Substs, Substs)) | | | type Substs = Map Name [Type] | | | type SubstMap = Map Name [Name] | | | type UnifyMap = Map Name [Type] | | | data UnifyEnv = UnifyEnv {} | | | varT :: String -> Type | | | tupT :: [Type] -> Type | | | listT :: Type -> Type | | | invertSubstMap :: SubstMap -> SubstMap | | | invertSubsts :: SubstMap -> SubstMap -> Map Name ([Name], [Name]) | | | checkForDups :: Map Name ([Name], [Name]) -> Either String (Map Name (Name, Name)) | | | extractSubsts :: UnifyEnv -> Either String (Substs, Substs) | | | (|.|) :: (Ord a, Ord b) => Map b c -> Map a b -> Map a c | | | renameT :: Type -> Type | | | noDupsMapToFinalSubsts :: Map Name (Name, Name) -> Either String (Map Name Name) | | | buildUMap :: [(Type, Type)] -> ((UnifyMap, UnifyMap), [(Type, Type)]) | | | splitSubsts :: [(Type, Type)] -> Q UnifyEnv | | | matchTypes :: Type -> Type -> [(Type, Type)] | | | typeViaT :: ViaT Type Type Type | | | typeToT :: Type -> T Type | | | typeFromT :: T Type -> Type | | | firstNameMap :: Map Name [Name] -> [(Name, Type)] | | | isInf :: Name -> Type -> Bool | | | bothVars :: (Type, Type) -> Bool | | | varOnLeft :: (Type, Type) -> Bool | | | varOnRight :: (Type, Type) -> Bool | | | | | | | ftvs :: Type -> Set Name | | | btvs :: Type -> Set Name | | | closeT :: Type -> Type | | | openT :: Type -> Type | | | (.->.) :: Type -> Type -> Type | | | unwindFunT :: Type -> (Type, [Type]) | | | unwindAppT :: Type -> (Type, [Type]) | | | substT :: [(Name, Type)] -> Type -> Type | | | listName :: Name | | | tupName :: Int -> Name | | | listCon :: Type | | | tupCon :: Int -> Type | | | testType0 :: Type | | | idType :: Type -> Type | | | testType1 :: Type | | | testType2 :: Type | | | pprName :: Name -> Doc | | | pprType :: Type -> Doc | | | pprParenType :: Type -> Doc | | | newtype Q a = Q (IO a) | | | runQ :: Q a -> IO a | | | runIO :: IO a -> Q a | | | unQ :: Q a -> a | | | newName :: String -> Q Name | | | mkName :: String -> Name | | | mkNameG :: String -> Name | | | mkNameL :: String -> Name | | | mkNameU :: String -> Int -> Name | | | newUniq :: Q Int | | | gensymQ :: IORef Int | | | tick :: IORef Int -> Q Int | | | reset :: IORef Int -> Q () | | | resetQ :: Q () | | newtype S s a = S {| unS :: forall o. (a -> s -> o) -> s -> o | } | | | get :: S s s | | | gets :: (s -> a) -> S s a | | | set :: s -> S s () | | | modify :: (s -> s) -> S s () | | | runS :: S s a -> s -> (a, s) | | | evalS :: S s a -> s -> a | | | execS :: S s a -> s -> s | | | type SubstM a = S SubstEnv a | | | data SubstEnv = SubstEnv {} | | | initSubstEnv :: [(Name, Type)] -> SubstEnv | | | runSubstM :: SubstM a -> SubstEnv -> a | | | bindM :: Name -> SubstM () | | | substM :: Name -> SubstM Type | | | localM :: SubstM a -> SubstM a | | | | | toListT :: T a -> [a] | | | fromListT :: [a] -> [T a] | | | toTreeT :: (Maybe a -> b) -> T a -> Tree b | | | foldrT :: (a -> b -> b) -> b -> T a -> b | | | foldlT :: (a -> b -> a) -> a -> T b -> a | | | foldl'T :: (a -> b -> a) -> a -> T b -> a | | | sumT :: Num a => T a -> a | | | prodT :: Num a => T a -> a | | | andT :: T Bool -> Bool | | | orT :: T Bool -> Bool | | | unifyT :: (Either a (T a) -> c) -> (Either b (T b) -> d) -> (c -> d -> e) -> T a -> T b -> T e | | | zipT :: (T a -> T b -> c) -> T a -> T b -> T c | | | matchT :: (a -> T x) -> (b -> T y) -> (T x -> c) -> (T y -> d) -> (c -> d -> e) -> a -> b -> T e | | | data ViaT a b c = ViaT {} | | | match :: ViaT a x c -> ViaT b y d -> (c -> d -> e) -> a -> b -> [e] |
|
|
| Documentation |
|
|
| .
|
|
|
|
|
|
|
|
|
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Constructors | | Instances | |
|
|
|
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Constructors | | S | | | unS :: forall o. (a -> s -> o) -> s -> o | |
|
| Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
| foldrT :: (a -> b -> b) -> b -> T a -> b | Source |
|
|
| foldlT :: (a -> b -> a) -> a -> T b -> a | Source |
|
|
| foldl'T :: (a -> b -> a) -> a -> T b -> a | Source |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| matchT :: (a -> T x) -> (b -> T y) -> (T x -> c) -> (T y -> d) -> (c -> d -> e) -> a -> b -> T e | Source |
|
|
|
| Constructors | | ViaT | | | toT :: a -> T b | | | fromT :: T b -> c | |
|
|
|
|
| match :: ViaT a x c -> ViaT b y d -> (c -> d -> e) -> a -> b -> [e] | Source |
|
|
| Produced by Haddock version 2.4.2 |