Safe Haskell | Safe-Inferred |
---|

Defines a classes to store and read info for GraphHammer edges and vertices information.

Also defines instances of those classes for unit (). It is meant as a safe way to say no useful information. Its use as an info should not incur any cost.

- class Info a where
- type EncodingType a
- encodeInfo :: a -> EncodingType a
- decodeInfo :: EncodingType a -> a

- class (Num i, Ix i, Info a) => InfoArray i a where
- type EncodedInfoArray i a
- newEncodedInfoArray :: Monad m => a -> i -> m (EncodedInfoArray i a)
- readEncodedInfo :: Monad m => EncodedInfoArray i a -> i -> m a
- storeEncodedInfo :: Monad m => EncodedInfoArray i a -> i -> a -> m ()

# Documentation

A class to store information.

type EncodingType a Source

A type we encode our values to.

encodeInfo :: a -> EncodingType aSource

A method to encode value.

decodeInfo :: EncodingType a -> aSource

Decoding process.

Info () |

class (Num i, Ix i, Info a) => InfoArray i a whereSource

A class that defines array interface for GraphHammer information.

type EncodedInfoArray i a Source

A type for arrays with specified index.

newEncodedInfoArray :: Monad m => a -> i -> m (EncodedInfoArray i a)Source

Create an array. First parameter is a length of array.

readEncodedInfo :: Monad m => EncodedInfoArray i a -> i -> m aSource

Get a value from array.

storeEncodedInfo :: Monad m => EncodedInfoArray i a -> i -> a -> m ()Source

Store an encoded value.