flocc-pffb

Stabilityexperimental
Maintainerdeveloper@flocc.net
Safe HaskellSafe-Inferred

Compiler.Front.Indices

Description

For more information please see http://www.flocc.net/

Synopsis

Documentation

type Idx = Int

type IdxSet = [Int]

type IdxMonad m = StateT IdxSet m

getnid :: Int -> IdxSet -> (Idx, IdxSet)

Gets the next id for a column in the idx set, and |returns that id, and the updated list.

newid :: Int -> State IdxSet Idx

Creates a new id (for the list of ids specified by the first paramter)

newid' :: Int -> Idx -> StateT [(Idx, Idx)] (State IdxSet) Idx

Returns the id in the map list if it exists. if it does not, creates a new one |adds it to the map

newid'' :: Monad m => Int -> StateT IdxSet m Idx

Creates a new id (for the list of ids specified by the first parameter) using |a state transformer, rather than a state monad.

getid' :: Idx -> StateT [(Idx, Idx)] (State IdxSet) Idx

Looks up the id in the list, and returns the replacement if it exists |or the original if it doesnt

getidST :: Monad m => Idx -> StateT [(Idx, Idx)] (StateT IdxSet m) Idx

Looks up the id in the list, and returns the replacement if it exists |or the original if it doesnt

newidST :: Monad m => Int -> StateT IdxSet m Idx

newidST' :: Monad m => Int -> Idx -> StateT [(Idx, Idx)] (StateT IdxSet m) Idx

Returns the id in the map list if it exists. if it does not, creates a new one |adds it to the map, using a state transformer.