Safe Haskell | None |
---|---|
Language | Haskell2010 |
Frontend AST
Synopsis
- data BuiltinTy
- data KempeTy a
- data StackType b = StackType {}
- data ConsAnn a = ConsAnn {}
- data Atom c b
- data BuiltinFn
- data KempeDecl a c b
- data Pattern c b
- = PatternInt b Integer
- | PatternCons c (TyName c)
- | PatternWildcard b
- | PatternBool b Bool
- data ABI
- type Module a c b = [KempeDecl a c b]
- freeVars :: [KempeTy a] -> Set (Name a)
- type MonoStackType = ([KempeTy ()], [KempeTy ()])
- size :: KempeTy a -> Int64
- sizeStack :: [KempeTy a] -> Int64
- prettyMonoStackType :: MonoStackType -> Doc a
- prettyTyped :: Atom (StackType ()) (StackType ()) -> Doc ann
- prettyTypedModule :: Module () (StackType ()) (StackType ()) -> Doc ann
- prettyFancyModule :: Module () (ConsAnn (StackType ())) (StackType ()) -> Doc ann
- prettyModule :: Module a c b -> Doc ann
- flipStackType :: StackType () -> StackType ()
- voidStackType :: StackType a -> StackType ()
Documentation
Instances
Eq BuiltinTy Source # | |
Ord BuiltinTy Source # | |
Defined in Kempe.AST | |
Generic BuiltinTy Source # | |
NFData BuiltinTy Source # | |
Pretty BuiltinTy Source # | |
type Rep BuiltinTy Source # | |
Defined in Kempe.AST type Rep BuiltinTy = D1 ('MetaData "BuiltinTy" "Kempe.AST" "kempe-0.1.0.0-37UN4MutUBa1oYJTH0xWlz-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
Eq b => Eq (StackType b) Source # | |
Ord b => Ord (StackType b) Source # | |
Generic (StackType b) Source # | |
NFData b => NFData (StackType b) Source # | |
Pretty (StackType a) Source # | |
type Rep (StackType b) Source # | |
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
Bitraversable Atom Source # | |
Defined in Kempe.AST bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Atom a b -> f (Atom c d) # | |
Bifoldable Atom Source # | |
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 # | |
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
Bitraversable (KempeDecl a) Source # | |
Defined in Kempe.AST bitraverse :: Applicative f => (a0 -> f c) -> (b -> f d) -> KempeDecl a a0 b -> f (KempeDecl a c d) # | |
Bifoldable (KempeDecl a) Source # | |
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 # | |
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 c (TyName c) | |
PatternWildcard b | |
PatternBool b Bool |
Instances
Bitraversable Pattern Source # | |
Defined in Kempe.AST bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Pattern a b -> f (Pattern c d) # | |
Bifoldable Pattern Source # | |
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 # | |
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 MonoStackType = ([KempeTy ()], [KempeTy ()]) Source #
prettyMonoStackType :: MonoStackType -> Doc a 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 #