kempe-0.1.0.0: Kempe compiler
Safe HaskellNone
LanguageHaskell2010

Kempe.Monomorphize

Contents

Description

This module is kind of half-assed. I don't have any references and it fails under various corner cases.

Synopsis

Documentation

closedModule :: Module () (StackType ()) (StackType ()) -> MonoM (Module () (StackType ()) (StackType ())) Source #

Filter so that only the KempeDecls necessary for exports are there, and fan out top-level functions into all necessary specializations.

This will throw an exception on ill-typed programs.

The Module returned will have to be renamed.

type MonoM = StateT RenameEnv (Either (Error ())) Source #

runMonoM :: Int -> MonoM a -> Either (Error ()) (a, Int) Source #

flattenModule :: Module () (StackType ()) (StackType ()) -> MonoM (Module () (ConsAnn (StackType ())) (StackType ())) Source #

Call closedModule and perform any necessary renamings

tryMono :: MonadError (Error ()) m => StackType () -> m MonoStackType Source #

data ConsAnn a Source #

Annotation carried on constructors to keep size information through the IR generation phase.

Constructors

ConsAnn 

Fields

Instances

Instances details
Functor ConsAnn Source # 
Instance details

Defined in Kempe.AST

Methods

fmap :: (a -> b) -> ConsAnn a -> ConsAnn b #

(<$) :: a -> ConsAnn b -> ConsAnn a #

Foldable ConsAnn Source # 
Instance details

Defined in Kempe.AST

Methods

fold :: Monoid m => ConsAnn m -> m #

foldMap :: Monoid m => (a -> m) -> ConsAnn a -> m #

foldMap' :: Monoid m => (a -> m) -> ConsAnn a -> m #

foldr :: (a -> b -> b) -> b -> ConsAnn a -> b #

foldr' :: (a -> b -> b) -> b -> ConsAnn a -> b #

foldl :: (b -> a -> b) -> b -> ConsAnn a -> b #

foldl' :: (b -> a -> b) -> b -> ConsAnn a -> b #

foldr1 :: (a -> a -> a) -> ConsAnn a -> a #

foldl1 :: (a -> a -> a) -> ConsAnn a -> a #

toList :: ConsAnn a -> [a] #

null :: ConsAnn a -> Bool #

length :: ConsAnn a -> Int #

elem :: Eq a => a -> ConsAnn a -> Bool #

maximum :: Ord a => ConsAnn a -> a #

minimum :: Ord a => ConsAnn a -> a #

sum :: Num a => ConsAnn a -> a #

product :: Num a => ConsAnn a -> a #

Traversable ConsAnn Source # 
Instance details

Defined in Kempe.AST

Methods

traverse :: Applicative f => (a -> f b) -> ConsAnn a -> f (ConsAnn b) #

sequenceA :: Applicative f => ConsAnn (f a) -> f (ConsAnn a) #

mapM :: Monad m => (a -> m b) -> ConsAnn a -> m (ConsAnn b) #

sequence :: Monad m => ConsAnn (m a) -> m (ConsAnn a) #

Generic (ConsAnn a) Source # 
Instance details

Defined in Kempe.AST

Associated Types

type Rep (ConsAnn a) :: Type -> Type #

Methods

from :: ConsAnn a -> Rep (ConsAnn a) x #

to :: Rep (ConsAnn a) x -> ConsAnn a #

NFData a => NFData (ConsAnn a) Source # 
Instance details

Defined in Kempe.AST

Methods

rnf :: ConsAnn a -> () #

Pretty a => Pretty (ConsAnn a) Source # 
Instance details

Defined in Kempe.AST

Methods

pretty :: ConsAnn a -> Doc ann #

prettyList :: [ConsAnn a] -> Doc ann #

type Rep (ConsAnn a) Source # 
Instance details

Defined in Kempe.AST

type Rep (ConsAnn a) = D1 ('MetaData "ConsAnn" "Kempe.AST" "kempe-0.1.0.0-37UN4MutUBa1oYJTH0xWlz-kempe-modules" 'False) (C1 ('MetaCons "ConsAnn" 'PrefixI 'True) (S1 ('MetaSel ('Just "tySz") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64) :*: (S1 ('MetaSel ('Just "tag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8) :*: S1 ('MetaSel ('Just "consTy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))))

Benchmark

closure :: Ord b => (Module a b b, ModuleMap a b b) -> Set (Name b, b) Source #

mkModuleMap :: Module a c b -> ModuleMap a c b Source #