Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type ReadTerm src ss ts = Source src => SourceInj (TypeVT src) src => SourceInj (KindK src) src => SourceInj (AST_Type src) src => Constable (->) => CtxTy src ts -> AST_Term src ss -> Either (Error_Term src) (TermVT src ss ts)
- readTerm :: forall src ss ts. ReadTerm src ss ts
- teVar :: forall ss src ts. Source src => NameTe -> CtxTy src ts -> Either (Error_Term src) (TermVT src ss ts)
- teApp :: Source src => Constable (->) => Term src ss ts '[Proxy (a :: Type), Proxy (b :: Type)] (() #> ((a -> b) -> a -> b))
- reduceTeApp :: AST_Term src ss -> AST_Term src ss
- newtype ReadTermCF src ss = ReadTermCF {
- unReadTermCF :: forall ts. ReadTerm src ss ts
- readTermWithCtx :: Foldable f => Source src => SourceInj (TypeVT src) src => SourceInj (KindK src) src => SourceInj (AST_Type src) src => Constable (->) => f (NameTe, TermT src ss '[] '[]) -> AST_Term src ss -> Either (Error_Term src) (TermVT src ss '[])
- readTermWithCtxPush :: Foldable f => f (NameTe, TermT src ss '[] '[]) -> (forall ts'. ReadTerm src ss ts') -> ReadTerm src ss ts
- readTermWithCtxPush1 :: (NameTe, TermT src ss '[] '[]) -> (forall ts'. ReadTerm src ss ts') -> ReadTerm src ss ts
- readTermWithCtxClose :: (forall ts'. ReadTerm src ss ts') -> Source src => SourceInj (TypeVT src) src => SourceInj (KindK src) src => SourceInj (AST_Type src) src => Constable (->) => AST_Term src ss -> Either (Error_Term src) (TermVT src ss '[])
- data CtxTy src ts where
- appendCtxTy :: CtxTy src ts0 -> CtxTy src ts1 -> CtxTy src (ts0 ++ ts1)
- data Error_Term src
- = Error_Term_unknown NameTe
- | Error_Term_polymorphic (TypeVT src)
- | Error_Term_qualified (TypeVT src)
- | Error_Term_proofless (TypeVT src)
- | Error_Term_Type (Error_Type src)
- | Error_Term_Beta (Error_Beta src)
- data SrcTe inp ss
- = SrcTe_Less
- | SrcTe_Input (Span inp)
- | SrcTe_AST_Term (AST_Term (SrcTe inp ss) ss)
- | SrcTe_AST_Type (AST_Type (SrcTe inp ss))
- | SrcTe_Kind (KindK (SrcTe inp ss))
- | SrcTe_Type (TypeVT (SrcTe inp ss))
- | SrcTe_Term
Type ReadTerm
type ReadTerm src ss ts = Source src => SourceInj (TypeVT src) src => SourceInj (KindK src) src => SourceInj (AST_Type src) src => Constable (->) => CtxTy src ts -> AST_Term src ss -> Either (Error_Term src) (TermVT src ss ts) Source #
Convenient type alias for readTerm
and related functions.
teVar :: forall ss src ts. Source src => NameTe -> CtxTy src ts -> Either (Error_Term src) (TermVT src ss ts) Source #
teApp :: Source src => Constable (->) => Term src ss ts '[Proxy (a :: Type), Proxy (b :: Type)] (() #> ((a -> b) -> a -> b)) Source #
reduceTeApp :: AST_Term src ss -> AST_Term src ss Source #
Reduce number of Token_Term_App
in given AST_Term
by converting them into BinTree2
.
NOTE: Token_Term_App
exists only to handle unifix operators applied to arguments.
Type ReadTermCF
newtype ReadTermCF src ss Source #
Like ReadTerm
, but CtxTe
-free.
Useful in readTermWithCtx
to help GHC's type solver, which
"Cannot instantiate unification variable with a type involving foralls".
ReadTermCF | |
|
readTermWithCtx :: Foldable f => Source src => SourceInj (TypeVT src) src => SourceInj (KindK src) src => SourceInj (AST_Type src) src => Constable (->) => f (NameTe, TermT src ss '[] '[]) -> AST_Term src ss -> Either (Error_Term src) (TermVT src ss '[]) Source #
Like readTerm
but with given context, and no more.
readTermWithCtxPush :: Foldable f => f (NameTe, TermT src ss '[] '[]) -> (forall ts'. ReadTerm src ss ts') -> ReadTerm src ss ts Source #
Like readTerm
but with given context.
readTermWithCtxPush1 :: (NameTe, TermT src ss '[] '[]) -> (forall ts'. ReadTerm src ss ts') -> ReadTerm src ss ts Source #
readTermWithCtxClose :: (forall ts'. ReadTerm src ss ts') -> Source src => SourceInj (TypeVT src) src => SourceInj (KindK src) src => SourceInj (AST_Type src) src => Constable (->) => AST_Term src ss -> Either (Error_Term src) (TermVT src ss '[]) Source #
Close a ReadTerm
context.
Type CtxTy
Type Error_Term
data Error_Term src Source #
Error_Term_unknown NameTe | |
Error_Term_polymorphic (TypeVT src) | |
Error_Term_qualified (TypeVT src) | |
Error_Term_proofless (TypeVT src) | |
Error_Term_Type (Error_Type src) | |
Error_Term_Beta (Error_Beta src) |
(Eq src, Source src) => Eq (Error_Term src) Source # | |
(Show src, Source src) => Show (Error_Term src) Source # | |
ErrorInj (Con_Kind src) (Error_Term src) Source # | |
ErrorInj (Error_Type src) (Error_Term src) Source # | |
ErrorInj (Error_Beta src) (Error_Term src) Source # | |
Type SrcTe
SrcTe_Less | |
SrcTe_Input (Span inp) | |
SrcTe_AST_Term (AST_Term (SrcTe inp ss) ss) | |
SrcTe_AST_Type (AST_Type (SrcTe inp ss)) | |
SrcTe_Kind (KindK (SrcTe inp ss)) | |
SrcTe_Type (TypeVT (SrcTe inp ss)) | |
SrcTe_Term |
SourceInj (Span inp) (SrcTe inp ss) Source # | |
SourceInj (KindK (SrcTe inp ss)) (SrcTe inp ss) Source # | |
SourceInj (TypeVT (SrcTe inp ss)) (SrcTe inp ss) Source # | |
SourceInj (AST_Type (SrcTe inp ss)) (SrcTe inp ss) Source # | |
Eq inp => Eq (SrcTe inp ss) Source # | |
Show inp => Show (SrcTe inp ss) Source # | |
Source (SrcTe inp ss) Source # | |
SourceInj (AST_Term (SrcTe inp ss) ss) (SrcTe inp ss) Source # | |
type Source_Input (SrcTe inp ss) Source # | |