sutori-0.2.4: Sutori language compiler

Safe HaskellSafe
LanguageHaskell2010

Sutori.Types.Primitives

Description

 

Synopsis

Documentation

type SutTypeID = Int Source #

A type will be represented by an ID

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