keyed-0.1.0.0: Generic indexing for many data structures

Copyright(c) William Yager 2015
LicenseBSD
Maintainerwill (dot) yager (at) gmail (dot) com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.MKeyed

Description

This module provides functions for generic indexing of Monadic data structures.

Synopsis

Documentation

class MKeyed d where Source

Data structures that allow monadic lookup of values.

Associated Types

type MKey d Source

The key to look up by.

type MValue d Source

The value that is returned.

type MContainer d :: * -> * Source

The container it is returned in.

Methods

indexM :: d -> MKey d -> MContainer d (MValue d) Source

lookupM :: d -> MKey d -> MContainer d (Maybe (MValue d)) Source

Instances

(!!) :: MKeyed d => d -> MKey d -> MContainer d (MValue d) Source

An inline version of indexM.

(!!?) :: MKeyed d => d -> MKey d -> MContainer d (Maybe (MValue d)) Source

An inline version of lookupM.