-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple observable sharing -- -- Simple observable sharing inspired by the paper "Observable Sharing -- for Functional Circuit Description". @package observable-sharing @version 0.2.1.2 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 -- | Shorthand type Name = StableName -- | Construct an empty map. empty :: Map f -- | Construct a map with a single element. singleton :: Name 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 name is present in the map, False -- otherwise. member :: Name a -> Map f -> Bool -- | Finds the value associated with the name, or Nothing if the -- name has no value associated to it. lookup :: Name 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 debug :: Map f -> (forall a. f a -> String) -> IO ()