Module

HTTPure.Lookup

Package
purescript-httpure
Repository
cprussin/purescript-httpure

#Lookup Source

class Lookup a v k  where

Types that implement the Lookup class can be looked up by some key to retrieve some value. For instance, you could have an implementation for String (Maybe String) Int where lookup string index returns Just the character in string at index, or Nothing if index is out of bounds.

Members

Instances

  • (Monoid m) => Lookup (Array m) m Int

    A default instance of Lookup for an Array of some type of Monoid. Note that this is different from !! defined in Data.Array in that it does not return a Maybe. If the index is out of bounds, the return value is mempty.

  • (Monoid m) => Lookup (StrMap m) m String

    A default instance of Lookup for a StrMap of some type of Monoid. If the key does not exist in the StrMap, then the return value is mempty.

#(!!) Source

Operator alias for HTTPure.Lookup.lookup (left-associative / precedence 8)

!! can be used as an infix operator instead of using the lookup function.