monad-memo-0.5.4: Memoization monad transformer

Copyright | (c) Eduard Sergeev 2011
License | BSD-style (see the file LICENSE)
Maintainer | eduard.sergeev@gmail.com
Stability | experimental
Portability | non-portable (multi-param classes, functional dependencies)
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.MapLike.Instances

Contents

- Orphan instances

Description

Defines MapLike instances declaration for standard data types

Synopsis

- class MapLike c k v | c -> k, c -> v where
  - lookup :: k -> c -> Maybe v
  - add :: k -> v -> c -> c

# Documentation

class MapLike c k v | c -> k, c -> v where Source #

An abstract interface to the container which can store `v` indexed by `k`

Methods

lookup :: k -> c -> Maybe v Source #

add :: k -> v -> c -> c Source #

#### Instances

Instances details

MapLike (IntMap v) Int v Source # | Data.IntMap is usually more efficient that Data.Map if `k :: Int`
Instance details Defined in Data.MapLike.Instances Methods lookup :: Int -> IntMap v -> Maybe v Source # add :: Int -> v -> IntMap v -> IntMap v Source #
Ord k => MapLike (Map k v) k v Source # | Data.Map is a default implementation (not the fastest but well-known)
Instance details Defined in Data.MapLike.Instances Methods lookup :: k -> Map k v -> Maybe v Source # add :: k -> v -> Map k v -> Map k v Source #

# Orphan instances

MapLike (IntMap v) Int v Source # | Data.IntMap is usually more efficient that Data.Map if `k :: Int`
Instance details Methods lookup :: Int -> IntMap v -> Maybe v Source # add :: Int -> v -> IntMap v -> IntMap v Source #
Ord k => MapLike (Map k v) k v Source # | Data.Map is a default implementation (not the fastest but well-known)
Instance details Methods lookup :: k -> Map k v -> Maybe v Source # add :: k -> v -> Map k v -> Map k v Source #