ghc-7.10.2: The GHC API

Safe HaskellNone
LanguageHaskell2010

CoAxiom

Description

Module for coercion axioms, used to represent type family instances and newtypes

Synopsis

Documentation

data BranchList a br where

Constructors

FirstBranch :: a -> BranchList a br 
NextBranch :: a -> BranchList a br -> BranchList a Branched 

Instances

fromBranchList :: BranchList a br -> [a]

brListMap :: (a -> b) -> BranchList a br -> [b]

brListFoldr :: (a -> b -> b) -> b -> BranchList a br -> b

brListMapM :: Monad m => (a -> m b) -> BranchList a br -> m [b]

brListFoldlM_ :: forall a b m br. Monad m => (a -> b -> m a) -> a -> BranchList b br -> m ()

brListZipWith :: (a -> b -> c) -> BranchList a br1 -> BranchList b br2 -> [c]

data CoAxiom br

A CoAxiom is a "coercion constructor", i.e. a named equality axiom.

Instances

data CoAxBranch

Constructors

CoAxBranch 

data CoAxiomRule

For now, we work only with nominal equality.

Constructors

CoAxiomRule 

Fields

coaxrName :: FastString
 
coaxrTypeArity :: Int
 
coaxrAsmpRoles :: [Role]
 
coaxrRole :: Role
 
coaxrProves :: [Type] -> [Eqn] -> Maybe Eqn

coaxrProves returns Nothing when it doesn't like the supplied arguments. When this happens in a coercion that means that the coercion is ill-formed, and Core Lint checks for that.

type Eqn = Pair Type

A more explicit representation for `t1 ~ t2`.

data BuiltInSynFamily

Constructors

BuiltInSynFamily 

Fields

sfMatchFam :: [Type] -> Maybe (CoAxiomRule, [Type], Type)
 
sfInteractTop :: [Type] -> Type -> [Eqn]
 
sfInteractInert :: [Type] -> Type -> [Type] -> Type -> [Eqn]