sutori-0.2.4: Sutori language compiler

Safe HaskellSafe
LanguageHaskell2010

Sutori.Types.Graph

Description

 

Synopsis

Documentation

data TypeGraph Source #

The type graph must be a biderectional map (as there's a bijection between type and its ID)

initialTypeGraph :: TypeGraph Source #

The initial value for the graph. That is, the primitives added

initialNextTypeID :: Int Source #

The initial value for the "next type ID"

insertType :: (SutType, SutTypeID) -> TypeGraph -> TypeGraph Source #

Inserts a type mapping into the map

lookupTypeID :: SutType -> TypeGraph -> Maybe (SutTypeID, Int) Source #

Maybe the SutTypeID of the given type

lookupType :: SutTypeID -> TypeGraph -> Maybe (SutType, Int) Source #

Maybe the type of the given SutTypeID

orderedGraph :: TypeGraph -> [(SutTypeID, (SutType, Int))] Source #

The graph as a list sorted by ID (first appearance?)

memberOffset :: SutType -> String -> Int Source #

Lookup and check a machine/thing member's offset