Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Sutori.Types.Primitives
Description
- data SutPrimitive
- type SutTypeID = Int
- primitives :: [SutPrimitive]
- primitiveSize :: SutPrimitive -> Int
- primitiveID :: SutPrimitive -> SutTypeID
- primitiveIDs :: [(SutPrimitive, SutTypeID)]
- generalizePrimitives :: SutPrimitive -> SutPrimitive -> SutPrimitive
- toTypeLight :: SutPrimitive -> SutPrimitive
- toTypeNum :: SutPrimitive -> SutPrimitive
- toTypeBag :: SutPrimitive -> SutPrimitive
- toTypeWallet :: SutPrimitive -> SutPrimitive
- toTypePhrase :: SutPrimitive -> SutPrimitive
- toTypeSortable :: SutPrimitive -> SutPrimitive
- toTypeEq :: SutPrimitive -> SutPrimitive
Documentation
data SutPrimitive Source #
Sutori primitives
Constructors
SutBag | A bag (Int) |
SutWallet | A wallet (Float) |
SutPhrase | A phrase (String) |
SutLight | A light (Bool) |
SutLetter | A letter (Char) |
SutTypeVoid | A void element (Void) |
SutTypeError | A Type Error (&^%$#) |
Instances
primitives :: [SutPrimitive] Source #
Predefined Sutori types to initialize symtable
primitiveSize :: SutPrimitive -> Int Source #
Defines sizes for each primitive ("in bytes"-ish)
primitiveID :: SutPrimitive -> SutTypeID Source #
Eventual TypeIDs for the type graph
primitiveIDs :: [(SutPrimitive, SutTypeID)] Source #
Zipped primitives with their IDs
generalizePrimitives :: SutPrimitive -> SutPrimitive -> SutPrimitive Source #
Given two types, this is the most general one (LCA) Right now LCA is just always one of them
toTypeLight :: SutPrimitive -> SutPrimitive Source #
Convert primitive to boolean type
toTypeNum :: SutPrimitive -> SutPrimitive Source #
Convert primitive to the most specific numerical type available
toTypeBag :: SutPrimitive -> SutPrimitive Source #
Convert primitive to the most specific numerical type available
toTypeWallet :: SutPrimitive -> SutPrimitive Source #
Convert primitive to the general float type
toTypePhrase :: SutPrimitive -> SutPrimitive Source #
Convert primitive to the most general string (printable) type
toTypeSortable :: SutPrimitive -> SutPrimitive Source #
Convert primitive to a sortable type or error
toTypeEq :: SutPrimitive -> SutPrimitive Source #
Convert primitive to a equalable type or error