Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data TypeGraph = TypeGraph (Map SutType (SutTypeID, Int)) (Map SutTypeID (SutType, Int))
- initialTypeGraph :: TypeGraph
- initialNextTypeID :: Int
- insertType :: (SutType, SutTypeID) -> TypeGraph -> TypeGraph
- lookupTypeID :: SutType -> TypeGraph -> Maybe (SutTypeID, Int)
- lookupType :: SutTypeID -> TypeGraph -> Maybe (SutType, Int)
- orderedGraph :: TypeGraph -> [(SutTypeID, (SutType, Int))]
- memberOffset :: SutType -> String -> Int
Documentation
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