Safe Haskell | None |
---|---|
Language | Haskell2010 |
Frontend AST
Synopsis
- data ConsAnn a = ConsAnn {}
- data Atom c b
- data BuiltinFn
- data KempeDecl a c b
- data Pattern c b
- = PatternInt b Integer
- | PatternCons {
- patternKind :: c
- patternName :: TyName c
- | PatternWildcard b
- | PatternBool b Bool
- type Declarations a c b = [KempeDecl a c b]
- data Module a c b = Module {
- importFps :: [ByteString]
- body :: [KempeDecl a c b]
- data ABI
- data BuiltinTy
- data KempeTy a
- data StackType b = StackType {}
- type MonoStackType = ([KempeTy ()], [KempeTy ()])
- prettyMonoStackType :: MonoStackType -> Doc a
- freeVars :: [KempeTy a] -> Set (Name a)
- prettyTyped :: Atom (StackType ()) (StackType ()) -> Doc ann
- prettyTypedModule :: Declarations () (StackType ()) (StackType ()) -> Doc ann
- prettyFancyModule :: Declarations () (ConsAnn (StackType ())) (StackType ()) -> Doc ann
- prettyModule :: Module a c b -> Doc ann
- flipStackType :: StackType () -> StackType ()
- voidStackType :: StackType a -> StackType ()
Documentation
Annotation carried on constructors to keep size information through the IR generation phase.
Instances
AtName b (Name b) | |
Case b (NonEmpty (Pattern c b, [Atom c b])) | |
If b [Atom c b] [Atom c b] | |
Dip b [Atom c b] | |
IntLit b Integer | |
WordLit b Natural | |
Int8Lit b Int8 | |
BoolLit b Bool | |
AtBuiltin b BuiltinFn | |
AtCons c (TyName c) |
Instances
Bifunctor Atom Source # | |
Functor (Atom c) Source # | |
Foldable (Atom c) Source # | |
Defined in Kempe.AST fold :: Monoid m => Atom c m -> m # foldMap :: Monoid m => (a -> m) -> Atom c a -> m # foldMap' :: Monoid m => (a -> m) -> Atom c a -> m # foldr :: (a -> b -> b) -> b -> Atom c a -> b # foldr' :: (a -> b -> b) -> b -> Atom c a -> b # foldl :: (b -> a -> b) -> b -> Atom c a -> b # foldl' :: (b -> a -> b) -> b -> Atom c a -> b # foldr1 :: (a -> a -> a) -> Atom c a -> a # foldl1 :: (a -> a -> a) -> Atom c a -> a # elem :: Eq a => a -> Atom c a -> Bool # maximum :: Ord a => Atom c a -> a # minimum :: Ord a => Atom c a -> a # | |
Traversable (Atom c) Source # | |
(Eq b, Eq c) => Eq (Atom c b) Source # | |
(Ord b, Ord c) => Ord (Atom c b) Source # | |
Generic (Atom c b) Source # | |
(NFData b, NFData c) => NFData (Atom c b) Source # | |
Pretty (Atom c a) Source # | |
type Rep (Atom c b) Source # | |
Instances
TyDecl a (TyName a) [Name a] [(TyName b, [KempeTy a])] | |
FunDecl b (Name b) [KempeTy a] [KempeTy a] [Atom c b] | |
ExtFnDecl b (Name b) [KempeTy a] [KempeTy a] ByteString | |
Export b ABI (Name b) |
Instances
Bifunctor (KempeDecl a) Source # | |
Functor (KempeDecl a c) Source # | |
Foldable (KempeDecl a c) Source # | |
Defined in Kempe.AST fold :: Monoid m => KempeDecl a c m -> m # foldMap :: Monoid m => (a0 -> m) -> KempeDecl a c a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> KempeDecl a c a0 -> m # foldr :: (a0 -> b -> b) -> b -> KempeDecl a c a0 -> b # foldr' :: (a0 -> b -> b) -> b -> KempeDecl a c a0 -> b # foldl :: (b -> a0 -> b) -> b -> KempeDecl a c a0 -> b # foldl' :: (b -> a0 -> b) -> b -> KempeDecl a c a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> KempeDecl a c a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> KempeDecl a c a0 -> a0 # toList :: KempeDecl a c a0 -> [a0] # null :: KempeDecl a c a0 -> Bool # length :: KempeDecl a c a0 -> Int # elem :: Eq a0 => a0 -> KempeDecl a c a0 -> Bool # maximum :: Ord a0 => KempeDecl a c a0 -> a0 # minimum :: Ord a0 => KempeDecl a c a0 -> a0 # | |
Traversable (KempeDecl a c) Source # | |
Defined in Kempe.AST traverse :: Applicative f => (a0 -> f b) -> KempeDecl a c a0 -> f (KempeDecl a c b) # sequenceA :: Applicative f => KempeDecl a c (f a0) -> f (KempeDecl a c a0) # mapM :: Monad m => (a0 -> m b) -> KempeDecl a c a0 -> m (KempeDecl a c b) # sequence :: Monad m => KempeDecl a c (m a0) -> m (KempeDecl a c a0) # | |
(Eq a, Eq b, Eq c) => Eq (KempeDecl a c b) Source # | |
(Ord a, Ord b, Ord c) => Ord (KempeDecl a c b) Source # | |
Defined in Kempe.AST compare :: KempeDecl a c b -> KempeDecl a c b -> Ordering # (<) :: KempeDecl a c b -> KempeDecl a c b -> Bool # (<=) :: KempeDecl a c b -> KempeDecl a c b -> Bool # (>) :: KempeDecl a c b -> KempeDecl a c b -> Bool # (>=) :: KempeDecl a c b -> KempeDecl a c b -> Bool # max :: KempeDecl a c b -> KempeDecl a c b -> KempeDecl a c b # min :: KempeDecl a c b -> KempeDecl a c b -> KempeDecl a c b # | |
Generic (KempeDecl a c b) Source # | |
(NFData a, NFData b, NFData c) => NFData (KempeDecl a c b) Source # | |
Pretty (KempeDecl a b c) Source # | |
type Rep (KempeDecl a c b) Source # | |
PatternInt b Integer | |
PatternCons | |
| |
PatternWildcard b | |
PatternBool b Bool |
Instances
Bifunctor Pattern Source # | |
Functor (Pattern c) Source # | |
Foldable (Pattern c) Source # | |
Defined in Kempe.AST fold :: Monoid m => Pattern c m -> m # foldMap :: Monoid m => (a -> m) -> Pattern c a -> m # foldMap' :: Monoid m => (a -> m) -> Pattern c a -> m # foldr :: (a -> b -> b) -> b -> Pattern c a -> b # foldr' :: (a -> b -> b) -> b -> Pattern c a -> b # foldl :: (b -> a -> b) -> b -> Pattern c a -> b # foldl' :: (b -> a -> b) -> b -> Pattern c a -> b # foldr1 :: (a -> a -> a) -> Pattern c a -> a # foldl1 :: (a -> a -> a) -> Pattern c a -> a # toList :: Pattern c a -> [a] # length :: Pattern c a -> Int # elem :: Eq a => a -> Pattern c a -> Bool # maximum :: Ord a => Pattern c a -> a # minimum :: Ord a => Pattern c a -> a # | |
Traversable (Pattern c) Source # | |
(Eq b, Eq c) => Eq (Pattern c b) Source # | |
(Ord b, Ord c) => Ord (Pattern c b) Source # | |
Generic (Pattern c b) Source # | |
(NFData b, NFData c) => NFData (Pattern c b) Source # | |
Pretty (Pattern c a) Source # | |
type Rep (Pattern c b) Source # | |
type Declarations a c b = [KempeDecl a c b] Source #
Module | |
|
Instances
Generic (Module a c b) Source # | |
(NFData a, NFData b, NFData c) => NFData (Module a c b) Source # | |
type Rep (Module a c b) Source # | |
Defined in Kempe.AST type Rep (Module a c b) = D1 ('MetaData "Module" "Kempe.AST" "kempe-0.1.1.1-EFnLFVNjuQo99bQNXiXMKL-kempe-modules" 'False) (C1 ('MetaCons "Module" 'PrefixI 'True) (S1 ('MetaSel ('Just "importFps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ByteString]) :*: S1 ('MetaSel ('Just "body") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [KempeDecl a c b]))) |
Instances
Eq BuiltinTy Source # | |
Ord BuiltinTy Source # | |
Defined in Kempe.AST.Size | |
Generic BuiltinTy Source # | |
NFData BuiltinTy Source # | |
Defined in Kempe.AST.Size | |
Pretty BuiltinTy Source # | |
Defined in Kempe.AST.Size | |
type Rep BuiltinTy Source # | |
Defined in Kempe.AST.Size type Rep BuiltinTy = D1 ('MetaData "BuiltinTy" "Kempe.AST.Size" "kempe-0.1.1.1-EFnLFVNjuQo99bQNXiXMKL-kempe-modules" 'False) ((C1 ('MetaCons "TyInt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TyBool" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TyInt8" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TyWord" 'PrefixI 'False) (U1 :: Type -> Type))) |
Instances
Functor KempeTy Source # | |
Eq a => Eq (KempeTy a) Source # | |
Ord a => Ord (KempeTy a) Source # | |
Defined in Kempe.AST.Size | |
Generic (KempeTy a) Source # | |
NFData a => NFData (KempeTy a) Source # | |
Defined in Kempe.AST.Size | |
Pretty (KempeTy a) Source # | |
Defined in Kempe.AST.Size | |
type Rep (KempeTy a) Source # | |
Defined in Kempe.AST.Size |
Instances
Eq b => Eq (StackType b) Source # | |
Ord b => Ord (StackType b) Source # | |
Defined in Kempe.AST.Size | |
Generic (StackType b) Source # | |
NFData b => NFData (StackType b) Source # | |
Defined in Kempe.AST.Size | |
Pretty (StackType a) Source # | |
Defined in Kempe.AST.Size | |
type Rep (StackType b) Source # | |
Defined in Kempe.AST.Size |
type MonoStackType = ([KempeTy ()], [KempeTy ()]) Source #
prettyMonoStackType :: MonoStackType -> Doc a Source #
prettyTypedModule :: Declarations () (StackType ()) (StackType ()) -> Doc ann Source #
prettyFancyModule :: Declarations () (ConsAnn (StackType ())) (StackType ()) -> Doc ann Source #
prettyModule :: Module a c b -> Doc ann Source #
flipStackType :: StackType () -> StackType () Source #
Used in Kempe.Monomorphize for patterns
I resent this...
voidStackType :: StackType a -> StackType () Source #