Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- buildMap :: Demarc -> Map String Demarc
- getNames :: Demarc -> [String]
- grafting' :: Map String Demarc -> Demarc -> Demarc
- grafting :: [Demarc] -> Demarc -> Demarc
- checkUniqNames :: [Demarc] -> [String]
- countGrafting :: [Demarc] -> Int
- enumBytes :: [FlagID] -> Int
- delta_prim :: Primitive -> Int
- pow :: Int -> Int -> Int
- delta_lit :: LitArith -> Int
- delta :: SizeArith -> Int
- delta_bits :: SizeArith -> Int
- bits2bytesUP :: (Num t, Num p, Ord t) => t -> p
- delta_bytes :: SizeArith -> Int
- fresh :: Demarc -> FormalID
- compile :: Demarc -> BaseExp
Documentation
buildMap :: Demarc -> Map String Demarc Source #
Build the dictionary / map of layer (and field) identifiers to their inner Demarc.
Todo: warning when multiple layers have the same name (which one union
picks is undefined behavior)
checkUniqNames :: [Demarc] -> [String] Source #
This can be done before or after grafting phase. It checks that every Layer
and Field
has a globally unique name, reporting an error when the name is not unique.
countGrafting :: [Demarc] -> Int Source #
enumBytes :: [FlagID] -> Int Source #
How many bytes are required for an Enum containing the given fields. This computes ceiling(log_2(length(flags)) / 8).
delta_prim :: Primitive -> Int Source #
TODO: parametrized delta_prim for architecture-dependent types
delta_bits :: SizeArith -> Int Source #
delta_bytes :: SizeArith -> Int Source #
Rounds up SizeArith
to the nearest whole byte.