Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module for coercion axioms, used to represent type family instances and newtypes
Synopsis
- data BranchFlag
- type Branched = 'Branched
- type Unbranched = 'Unbranched
- type BranchIndex = Int
- newtype Branches (br :: BranchFlag) = MkBranches {}
- manyBranches :: [CoAxBranch] -> Branches Branched
- unbranched :: CoAxBranch -> Branches Unbranched
- fromBranches :: Branches br -> [CoAxBranch]
- numBranches :: Branches br -> Int
- mapAccumBranches :: ([CoAxBranch] -> CoAxBranch -> CoAxBranch) -> Branches br -> Branches br
- data CoAxiom br = CoAxiom {
- co_ax_unique :: Unique
- co_ax_name :: Name
- co_ax_role :: Role
- co_ax_tc :: TyCon
- co_ax_branches :: Branches br
- co_ax_implicit :: Bool
- data CoAxBranch = CoAxBranch {}
- toBranchedAxiom :: CoAxiom br -> CoAxiom Branched
- toUnbranchedAxiom :: CoAxiom br -> CoAxiom Unbranched
- coAxiomName :: CoAxiom br -> Name
- coAxiomArity :: CoAxiom br -> BranchIndex -> Arity
- coAxiomBranches :: CoAxiom br -> Branches br
- coAxiomTyCon :: CoAxiom br -> TyCon
- isImplicitCoAxiom :: CoAxiom br -> Bool
- coAxiomNumPats :: CoAxiom br -> Int
- coAxiomNthBranch :: CoAxiom br -> BranchIndex -> CoAxBranch
- coAxiomSingleBranch_maybe :: CoAxiom br -> Maybe CoAxBranch
- coAxiomRole :: CoAxiom br -> Role
- coAxiomSingleBranch :: CoAxiom Unbranched -> CoAxBranch
- coAxBranchTyVars :: CoAxBranch -> [TyVar]
- coAxBranchCoVars :: CoAxBranch -> [CoVar]
- coAxBranchRoles :: CoAxBranch -> [Role]
- coAxBranchLHS :: CoAxBranch -> [Type]
- coAxBranchRHS :: CoAxBranch -> Type
- coAxBranchSpan :: CoAxBranch -> SrcSpan
- coAxBranchIncomps :: CoAxBranch -> [CoAxBranch]
- placeHolderIncomps :: [CoAxBranch]
- data Role
- fsFromRole :: Role -> FastString
- data CoAxiomRule = CoAxiomRule {
- coaxrName :: FastString
- coaxrAsmpRoles :: [Role]
- coaxrRole :: Role
- coaxrProves :: [TypeEqn] -> Maybe TypeEqn
- type TypeEqn = Pair Type
- data BuiltInSynFamily = BuiltInSynFamily {
- sfMatchFam :: [Type] -> Maybe (CoAxiomRule, [Type], Type)
- sfInteractTop :: [Type] -> Type -> [TypeEqn]
- sfInteractInert :: [Type] -> Type -> [Type] -> Type -> [TypeEqn]
- trivialBuiltInFamily :: BuiltInSynFamily
Documentation
data BranchFlag Source #
type Unbranched = 'Unbranched Source #
type BranchIndex = Int Source #
newtype Branches (br :: BranchFlag) Source #
manyBranches :: [CoAxBranch] -> Branches Branched Source #
fromBranches :: Branches br -> [CoAxBranch] Source #
numBranches :: Branches br -> Int Source #
mapAccumBranches :: ([CoAxBranch] -> CoAxBranch -> CoAxBranch) -> Branches br -> Branches br Source #
The [CoAxBranch]
passed into the mapping function is a list of
all previous branches, reversed
A CoAxiom
is a "coercion constructor", i.e. a named equality axiom.
CoAxiom | |
|
Instances
Eq (CoAxiom br) Source # | |
Typeable br => Data (CoAxiom br) Source # | |
Defined in CoAxiom gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoAxiom br -> c (CoAxiom br) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CoAxiom br) # toConstr :: CoAxiom br -> Constr # dataTypeOf :: CoAxiom br -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (CoAxiom br)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CoAxiom br)) # gmapT :: (forall b. Data b => b -> b) -> CoAxiom br -> CoAxiom br # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoAxiom br -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoAxiom br -> r # gmapQ :: (forall d. Data d => d -> u) -> CoAxiom br -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CoAxiom br -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoAxiom br -> m (CoAxiom br) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoAxiom br -> m (CoAxiom br) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoAxiom br -> m (CoAxiom br) # | |
Outputable (CoAxiom br) Source # | |
Uniquable (CoAxiom br) Source # | |
NamedThing (CoAxiom br) Source # | |
data CoAxBranch Source #
Instances
Data CoAxBranch Source # | |
Defined in CoAxiom gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoAxBranch -> c CoAxBranch # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoAxBranch # toConstr :: CoAxBranch -> Constr # dataTypeOf :: CoAxBranch -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoAxBranch) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoAxBranch) # gmapT :: (forall b. Data b => b -> b) -> CoAxBranch -> CoAxBranch # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoAxBranch -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoAxBranch -> r # gmapQ :: (forall d. Data d => d -> u) -> CoAxBranch -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CoAxBranch -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoAxBranch -> m CoAxBranch # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoAxBranch -> m CoAxBranch # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoAxBranch -> m CoAxBranch # | |
Outputable CoAxBranch Source # | |
toUnbranchedAxiom :: CoAxiom br -> CoAxiom Unbranched Source #
coAxiomName :: CoAxiom br -> Name Source #
coAxiomArity :: CoAxiom br -> BranchIndex -> Arity Source #
coAxiomBranches :: CoAxiom br -> Branches br Source #
coAxiomTyCon :: CoAxiom br -> TyCon Source #
isImplicitCoAxiom :: CoAxiom br -> Bool Source #
coAxiomNumPats :: CoAxiom br -> Int Source #
coAxiomNthBranch :: CoAxiom br -> BranchIndex -> CoAxBranch Source #
coAxiomSingleBranch_maybe :: CoAxiom br -> Maybe CoAxBranch Source #
coAxiomRole :: CoAxiom br -> Role Source #
coAxBranchTyVars :: CoAxBranch -> [TyVar] Source #
coAxBranchCoVars :: CoAxBranch -> [CoVar] Source #
coAxBranchRoles :: CoAxBranch -> [Role] Source #
coAxBranchLHS :: CoAxBranch -> [Type] Source #
coAxBranchRHS :: CoAxBranch -> Type Source #
coAxBranchSpan :: CoAxBranch -> SrcSpan Source #
coAxBranchIncomps :: CoAxBranch -> [CoAxBranch] Source #
Instances
Eq Role Source # | |
Data Role Source # | |
Defined in CoAxiom gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role # dataTypeOf :: Role -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) # gmapT :: (forall b. Data b => b -> b) -> Role -> Role # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # | |
Ord Role Source # | |
Outputable Role Source # | |
Binary Role Source # | |
fsFromRole :: Role -> FastString Source #
data CoAxiomRule Source #
For now, we work only with nominal equality.
CoAxiomRule | |
|
Instances
data BuiltInSynFamily Source #
BuiltInSynFamily | |
|