dictionary-sharing-0.1.0.0: Sharing/memoization of class members

Safe HaskellNone
LanguageHaskell2010

Data.ClassSharing

Synopsis

Documentation

data Shared f a #

newtype Shareable f a #

Constructors

Shareable 

Fields

Instances
Functor f => Functor (Shareable f) # 
Instance details

Defined in Data.ClassSharing

Methods

fmap :: (a -> b) -> Shareable f a -> Shareable f b #

(<$) :: a -> Shareable f b -> Shareable f a #

Applicative f => Applicative (Shareable f) # 
Instance details

Defined in Data.ClassSharing

Methods

pure :: a -> Shareable f a #

(<*>) :: Shareable f (a -> b) -> Shareable f a -> Shareable f b #

liftA2 :: (a -> b -> c) -> Shareable f a -> Shareable f b -> Shareable f c #

(*>) :: Shareable f a -> Shareable f b -> Shareable f b #

(<*) :: Shareable f a -> Shareable f b -> Shareable f a #

Alternative f => Alternative (Shareable f) # 
Instance details

Defined in Data.ClassSharing

Methods

empty :: Shareable f a #

(<|>) :: Shareable f a -> Shareable f a -> Shareable f a #

some :: Shareable f a -> Shareable f [a] #

many :: Shareable f a -> Shareable f [a] #

share :: (Typeable a, Typeable f) => Shareable f a -> Shared f a #

Share/memoize a class member of type f a.

unsafeAccess :: Shared f a -> Shareable f a #

Should only be used to access class members. A safe wrapper should be defined for every shared class member. Direct access can lead to overriding class member definitions.

runShared :: Shared f a -> Ref -> f a #

type Ref = IORef DynMap #

data DynMap #

A dynamic map with type safe insertion and lookup.

Instances
Show DynMap # 
Instance details

Defined in Data.ClassSharing

unsafeNewRef :: () -> Ref #

class Typeable (a :: k) #

The class Typeable allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#