{-# LANGUAGE FlexibleInstances #-}
module Foundation.Collection.Keyed
( KeyedCollection(..)
) where
import Basement.Compat.Base
import qualified Data.List
class KeyedCollection c where
type Key c
type Value c
lookup :: Key c -> c -> Maybe (Value c)
instance Eq k => KeyedCollection [(k, v)] where
type Key [(k,v)] = k
type Value [(k,v)] = v
lookup :: Key [(k, v)] -> [(k, v)] -> Maybe (Value [(k, v)])
lookup = Key [(k, v)] -> [(k, v)] -> Maybe (Value [(k, v)])
forall a b. Eq a => a -> [(a, b)] -> Maybe b
Data.List.lookup