Safe Haskell | None |
---|---|

Language | Haskell2010 |

This module contains the definition of a Type Class that represents a Heap. In the context of QIO, a Heap is the type used to represent a classical basis state. An instance of a Heap is also defined, that makes use of a Map.

# Documentation

class Eq h => Heap h where Source #

The Heap Type Class

define an `initial`

(i.e. empty) Heap

update :: h -> Qbit -> Bool -> h Source #

`update`

the value of a Qubit within the Heap to the given Boolen value

(?) :: h -> Qbit -> Maybe Bool Source #

Lookup the value of the given Qubit in the Heap (if it exists)

forget :: h -> Qbit -> h Source #

remove the given Qubit from the Heap

hswap :: h -> Qbit -> Qbit -> h Source #

Swap the values associated with two Qubits within the Heap