Agda
Safe HaskellNone
LanguageHaskell2010

Agda.Utils.IndexMap

Description

Maps from de Bruijn indices, implemented using IntMaps from de Bruijn levels.

Synopsis

Documentation

data IndexMap a Source #

Maps from de Bruijn indices.

Instances

Instances details
Eq a => Eq (IndexMap a) Source # 
Instance details

Defined in Agda.Utils.IndexMap

Methods

(==) :: IndexMap a -> IndexMap a -> Bool #

(/=) :: IndexMap a -> IndexMap a -> Bool #

Show a => Show (IndexMap a) Source # 
Instance details

Defined in Agda.Utils.IndexMap

Methods

showsPrec :: Int -> IndexMap a -> ShowS #

show :: IndexMap a -> String #

showList :: [IndexMap a] -> ShowS #

invariant :: IndexMap a -> Bool Source #

The IndexMap invariant.

nil :: IndexMap a Source #

An empty map.

snoc :: IndexMap a -> a -> IndexMap a Source #

Inserts a new binding, which will have de Bruijn index 0, and shifts other bindings one step.

append :: IndexMap a -> [a] -> IndexMap a Source #

Inserts a number of new bindings. The last element in the list will have de Bruijn index 0.

fromList :: [a] -> IndexMap a Source #

Converts a list to an IndexMap. The last element in the list will have de Bruijn index 0.

update :: Int -> a -> IndexMap a -> IndexMap a Source #

index :: Int -> IndexMap a -> a Source #