-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simple observable sharing
--
-- Simple observable sharing
@package observable-sharing
@version 0.2.0.0
module Data.Ref
data Ref a
Ref :: StableName a -> a -> Ref a
[label] :: Ref a -> StableName a
[deref] :: Ref a -> a
ref :: a -> Ref a
instance GHC.Classes.Eq (Data.Ref.Ref a)
instance GHC.Show.Show a => GHC.Show.Show (Data.Ref.Ref a)
module Data.Ref.Map
-- | A reference indexed map.
--
-- useful for associating info with a reference.
data Map f
-- | Construct an empty map.
empty :: Map f
-- | Construct a map with a single element.
singleton :: Ref a -> f a -> Map f
-- | Returns True if the map is empty, False otherwise.
null :: Map f -> Bool
-- | Returns the number of elements stored in this map.
size :: Map f -> Int
-- | Returns True if the reference is present in the map,
-- False otherwise.
member :: Ref a -> Map f -> Bool
-- | Returns the value associated with the reference, or Nothing if
-- the reference has no value associated to it.
lookup :: Ref a -> Map f -> Maybe (f a)
-- | Associates a reference with the specified value. If the map already
-- contains a mapping for the reference, the old value is replaced.
insert :: Ref a -> f a -> Map f -> Map f
-- | Removes the associated value of a reference, if any is present in the
-- map.
delete :: Ref a -> Map f -> Map f
-- | Updates the associated value of a reference, if any is present in the
-- map.
adjust :: (f a -> f b) -> Ref a -> Map f -> Map f
-- | Union of two maps (left biased).
union :: Map f -> Map f -> Map f
-- | Difference of two maps.
difference :: Map f -> Map f -> Map f
-- | Intersectino of two maps.
intersection :: Map f -> Map f -> Map f
-- | Transforms a map by applying the given function to each value.
map :: (f a -> f b) -> Map f -> Map f
-- | Filter this map by retaining only elements which values satisfy a
-- predicate.
filter :: (f a -> Bool) -> Map f -> Map f