incremental-0.3: incremental update library

Safe HaskellNone
LanguageHaskell2010

Data.Incremental

Documentation

class Incremental a where Source #

Associated Types

type Delta a Source #

the difference type

Methods

patch :: a -> Delta a -> a Source #

maybe a (patch a) (diff b a) ≡ b

diff :: a -> a -> Maybe (Delta a) Source #

returns Nothing when there is no update

Instances
Incremental Bool Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Bool :: Type Source #

Incremental Char Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Char :: Type Source #

Incremental Double Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Double :: Type Source #

Incremental Float Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Float :: Type Source #

Incremental Int Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Int :: Type Source #

Methods

patch :: Int -> Delta Int -> Int Source #

diff :: Int -> Int -> Maybe (Delta Int) Source #

Incremental Int8 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Int8 :: Type Source #

Incremental Int16 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Int16 :: Type Source #

Incremental Int32 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Int32 :: Type Source #

Incremental Int64 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Int64 :: Type Source #

Incremental Integer Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Integer :: Type Source #

Incremental Natural Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Natural :: Type Source #

Incremental Ordering Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Ordering :: Type Source #

Incremental Word Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Word :: Type Source #

Incremental Word8 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Word8 :: Type Source #

Incremental Word16 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Word16 :: Type Source #

Incremental Word32 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Word32 :: Type Source #

Incremental Word64 Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Word64 :: Type Source #

Incremental () Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta () :: Type Source #

Methods

patch :: () -> Delta () -> () Source #

diff :: () -> () -> Maybe (Delta ()) Source #

Incremental ByteString Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta ByteString :: Type Source #

Incremental Text Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Text :: Type Source #

Incremental Void Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta Void :: Type Source #

Eq a => Incremental [a] Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta [a] :: Type Source #

Methods

patch :: [a] -> Delta [a] -> [a] Source #

diff :: [a] -> [a] -> Maybe (Delta [a]) Source #

Incremental a => Incremental (Maybe a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Maybe a) :: Type Source #

Methods

patch :: Maybe a -> Delta (Maybe a) -> Maybe a Source #

diff :: Maybe a -> Maybe a -> Maybe (Delta (Maybe a)) Source #

Incremental (Fixed a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Fixed a) :: Type Source #

Methods

patch :: Fixed a -> Delta (Fixed a) -> Fixed a Source #

diff :: Fixed a -> Fixed a -> Maybe (Delta (Fixed a)) Source #

Incremental a => Incremental (Identity a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Identity a) :: Type Source #

Num a => Incremental (Sum a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Sum a) :: Type Source #

Methods

patch :: Sum a -> Delta (Sum a) -> Sum a Source #

diff :: Sum a -> Sum a -> Maybe (Delta (Sum a)) Source #

Incremental a => Incremental (IntMap a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (IntMap a) :: Type Source #

Methods

patch :: IntMap a -> Delta (IntMap a) -> IntMap a Source #

diff :: IntMap a -> IntMap a -> Maybe (Delta (IntMap a)) Source #

Ord a => Incremental (Set a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Set a) :: Type Source #

Methods

patch :: Set a -> Delta (Set a) -> Set a Source #

diff :: Set a -> Set a -> Maybe (Delta (Set a)) Source #

Incremental (Fresh a) Source #

Always updated

Instance details

Defined in Data.Incremental

Associated Types

type Delta (Fresh a) :: Type Source #

Methods

patch :: Fresh a -> Delta (Fresh a) -> Fresh a Source #

diff :: Fresh a -> Fresh a -> Maybe (Delta (Fresh a)) Source #

Eq a => Incremental (Hetero a) Source #

diff checks equality

Instance details

Defined in Data.Incremental

Associated Types

type Delta (Hetero a) :: Type Source #

Methods

patch :: Hetero a -> Delta (Hetero a) -> Hetero a Source #

diff :: Hetero a -> Hetero a -> Maybe (Delta (Hetero a)) Source #

(Incremental a, Incremental b) => Incremental (a, b) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (a, b) :: Type Source #

Methods

patch :: (a, b) -> Delta (a, b) -> (a, b) Source #

diff :: (a, b) -> (a, b) -> Maybe (Delta (a, b)) Source #

(Ord k, Incremental a) => Incremental (Map k a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Map k a) :: Type Source #

Methods

patch :: Map k a -> Delta (Map k a) -> Map k a Source #

diff :: Map k a -> Map k a -> Maybe (Delta (Map k a)) Source #

Incremental (Proxy a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Proxy a) :: Type Source #

Methods

patch :: Proxy a -> Delta (Proxy a) -> Proxy a Source #

diff :: Proxy a -> Proxy a -> Maybe (Delta (Proxy a)) Source #

(Incremental a, Incremental b, Incremental c) => Incremental (a, b, c) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (a, b, c) :: Type Source #

Methods

patch :: (a, b, c) -> Delta (a, b, c) -> (a, b, c) Source #

diff :: (a, b, c) -> (a, b, c) -> Maybe (Delta (a, b, c)) Source #

Incremental a => Incremental (Const a b) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Delta (Const a b) :: Type Source #

Methods

patch :: Const a b -> Delta (Const a b) -> Const a b Source #

diff :: Const a b -> Const a b -> Maybe (Delta (Const a b)) Source #

data Alter a d Source #

Constructors

Insert a 
Update d 
Delete a

last value

Delete_ 
Upsert a d 
Instances
Functor (Alter a) Source # 
Instance details

Defined in Data.Incremental

Methods

fmap :: (a0 -> b) -> Alter a a0 -> Alter a b #

(<$) :: a0 -> Alter a b -> Alter a a0 #

(Show a, Show d) => Show (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Methods

showsPrec :: Int -> Alter a d -> ShowS #

show :: Alter a d -> String #

showList :: [Alter a d] -> ShowS #

Generic (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Rep (Alter a d) :: Type -> Type #

Methods

from :: Alter a d -> Rep (Alter a d) x #

to :: Rep (Alter a d) x -> Alter a d #

(Incremental a, d ~ Delta a, Semigroup d) => Semigroup (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Methods

(<>) :: Alter a d -> Alter a d -> Alter a d #

sconcat :: NonEmpty (Alter a d) -> Alter a d #

stimes :: Integral b => b -> Alter a d -> Alter a d #

(Incremental a, Monoid d, d ~ Delta a) => Monoid (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Methods

mempty :: Alter a d #

mappend :: Alter a d -> Alter a d -> Alter a d #

mconcat :: [Alter a d] -> Alter a d #

(ToJSON a, ToJSON d) => ToJSON (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Methods

toJSON :: Alter a d -> Value #

toEncoding :: Alter a d -> Encoding #

toJSONList :: [Alter a d] -> Value #

toEncodingList :: [Alter a d] -> Encoding #

(FromJSON a, FromJSON d) => FromJSON (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Methods

parseJSON :: Value -> Parser (Alter a d) #

parseJSONList :: Value -> Parser [Alter a d] #

(NFData a, NFData d) => NFData (Alter a d) Source # 
Instance details

Defined in Data.Incremental

Methods

rnf :: Alter a d -> () #

type Rep (Alter a d) Source # 
Instance details

Defined in Data.Incremental

newtype Hetero a Source #

Constructors

Hetero 

Fields

Instances
Bounded a => Bounded (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

minBound :: Hetero a #

maxBound :: Hetero a #

Enum a => Enum (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

succ :: Hetero a -> Hetero a #

pred :: Hetero a -> Hetero a #

toEnum :: Int -> Hetero a #

fromEnum :: Hetero a -> Int #

enumFrom :: Hetero a -> [Hetero a] #

enumFromThen :: Hetero a -> Hetero a -> [Hetero a] #

enumFromTo :: Hetero a -> Hetero a -> [Hetero a] #

enumFromThenTo :: Hetero a -> Hetero a -> Hetero a -> [Hetero a] #

Eq a => Eq (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

(==) :: Hetero a -> Hetero a -> Bool #

(/=) :: Hetero a -> Hetero a -> Bool #

Floating a => Floating (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

pi :: Hetero a #

exp :: Hetero a -> Hetero a #

log :: Hetero a -> Hetero a #

sqrt :: Hetero a -> Hetero a #

(**) :: Hetero a -> Hetero a -> Hetero a #

logBase :: Hetero a -> Hetero a -> Hetero a #

sin :: Hetero a -> Hetero a #

cos :: Hetero a -> Hetero a #

tan :: Hetero a -> Hetero a #

asin :: Hetero a -> Hetero a #

acos :: Hetero a -> Hetero a #

atan :: Hetero a -> Hetero a #

sinh :: Hetero a -> Hetero a #

cosh :: Hetero a -> Hetero a #

tanh :: Hetero a -> Hetero a #

asinh :: Hetero a -> Hetero a #

acosh :: Hetero a -> Hetero a #

atanh :: Hetero a -> Hetero a #

log1p :: Hetero a -> Hetero a #

expm1 :: Hetero a -> Hetero a #

log1pexp :: Hetero a -> Hetero a #

log1mexp :: Hetero a -> Hetero a #

Fractional a => Fractional (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

(/) :: Hetero a -> Hetero a -> Hetero a #

recip :: Hetero a -> Hetero a #

fromRational :: Rational -> Hetero a #

Integral a => Integral (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

quot :: Hetero a -> Hetero a -> Hetero a #

rem :: Hetero a -> Hetero a -> Hetero a #

div :: Hetero a -> Hetero a -> Hetero a #

mod :: Hetero a -> Hetero a -> Hetero a #

quotRem :: Hetero a -> Hetero a -> (Hetero a, Hetero a) #

divMod :: Hetero a -> Hetero a -> (Hetero a, Hetero a) #

toInteger :: Hetero a -> Integer #

Num a => Num (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

(+) :: Hetero a -> Hetero a -> Hetero a #

(-) :: Hetero a -> Hetero a -> Hetero a #

(*) :: Hetero a -> Hetero a -> Hetero a #

negate :: Hetero a -> Hetero a #

abs :: Hetero a -> Hetero a #

signum :: Hetero a -> Hetero a #

fromInteger :: Integer -> Hetero a #

Ord a => Ord (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

compare :: Hetero a -> Hetero a -> Ordering #

(<) :: Hetero a -> Hetero a -> Bool #

(<=) :: Hetero a -> Hetero a -> Bool #

(>) :: Hetero a -> Hetero a -> Bool #

(>=) :: Hetero a -> Hetero a -> Bool #

max :: Hetero a -> Hetero a -> Hetero a #

min :: Hetero a -> Hetero a -> Hetero a #

Real a => Real (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

toRational :: Hetero a -> Rational #

RealFloat a => RealFloat (Hetero a) Source # 
Instance details

Defined in Data.Incremental

RealFrac a => RealFrac (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

properFraction :: Integral b => Hetero a -> (b, Hetero a) #

truncate :: Integral b => Hetero a -> b #

round :: Integral b => Hetero a -> b #

ceiling :: Integral b => Hetero a -> b #

floor :: Integral b => Hetero a -> b #

Generic (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Rep (Hetero a) :: Type -> Type #

Methods

from :: Hetero a -> Rep (Hetero a) x #

to :: Rep (Hetero a) x -> Hetero a #

Semigroup a => Semigroup (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

(<>) :: Hetero a -> Hetero a -> Hetero a #

sconcat :: NonEmpty (Hetero a) -> Hetero a #

stimes :: Integral b => b -> Hetero a -> Hetero a #

Monoid a => Monoid (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

mempty :: Hetero a #

mappend :: Hetero a -> Hetero a -> Hetero a #

mconcat :: [Hetero a] -> Hetero a #

NFData a => NFData (Hetero a) Source # 
Instance details

Defined in Data.Incremental

Methods

rnf :: Hetero a -> () #

Eq a => Incremental (Hetero a) Source #

diff checks equality

Instance details

Defined in Data.Incremental

Associated Types

type Delta (Hetero a) :: Type Source #

Methods

patch :: Hetero a -> Delta (Hetero a) -> Hetero a Source #

diff :: Hetero a -> Hetero a -> Maybe (Delta (Hetero a)) Source #

type Rep (Hetero a) Source # 
Instance details

Defined in Data.Incremental

type Rep (Hetero a) = D1 (MetaData "Hetero" "Data.Incremental" "incremental-0.3-3Fa0uMVHZ8vBBWalvHuxyP" True) (C1 (MetaCons "Hetero" PrefixI True) (S1 (MetaSel (Just "getHetero") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Delta (Hetero a) Source # 
Instance details

Defined in Data.Incremental

type Delta (Hetero a) = a

newtype Fresh a Source #

Constructors

Fresh 

Fields

Instances
Bounded a => Bounded (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

minBound :: Fresh a #

maxBound :: Fresh a #

Enum a => Enum (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

succ :: Fresh a -> Fresh a #

pred :: Fresh a -> Fresh a #

toEnum :: Int -> Fresh a #

fromEnum :: Fresh a -> Int #

enumFrom :: Fresh a -> [Fresh a] #

enumFromThen :: Fresh a -> Fresh a -> [Fresh a] #

enumFromTo :: Fresh a -> Fresh a -> [Fresh a] #

enumFromThenTo :: Fresh a -> Fresh a -> Fresh a -> [Fresh a] #

Eq a => Eq (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

(==) :: Fresh a -> Fresh a -> Bool #

(/=) :: Fresh a -> Fresh a -> Bool #

Floating a => Floating (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

pi :: Fresh a #

exp :: Fresh a -> Fresh a #

log :: Fresh a -> Fresh a #

sqrt :: Fresh a -> Fresh a #

(**) :: Fresh a -> Fresh a -> Fresh a #

logBase :: Fresh a -> Fresh a -> Fresh a #

sin :: Fresh a -> Fresh a #

cos :: Fresh a -> Fresh a #

tan :: Fresh a -> Fresh a #

asin :: Fresh a -> Fresh a #

acos :: Fresh a -> Fresh a #

atan :: Fresh a -> Fresh a #

sinh :: Fresh a -> Fresh a #

cosh :: Fresh a -> Fresh a #

tanh :: Fresh a -> Fresh a #

asinh :: Fresh a -> Fresh a #

acosh :: Fresh a -> Fresh a #

atanh :: Fresh a -> Fresh a #

log1p :: Fresh a -> Fresh a #

expm1 :: Fresh a -> Fresh a #

log1pexp :: Fresh a -> Fresh a #

log1mexp :: Fresh a -> Fresh a #

Fractional a => Fractional (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

(/) :: Fresh a -> Fresh a -> Fresh a #

recip :: Fresh a -> Fresh a #

fromRational :: Rational -> Fresh a #

Integral a => Integral (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

quot :: Fresh a -> Fresh a -> Fresh a #

rem :: Fresh a -> Fresh a -> Fresh a #

div :: Fresh a -> Fresh a -> Fresh a #

mod :: Fresh a -> Fresh a -> Fresh a #

quotRem :: Fresh a -> Fresh a -> (Fresh a, Fresh a) #

divMod :: Fresh a -> Fresh a -> (Fresh a, Fresh a) #

toInteger :: Fresh a -> Integer #

Num a => Num (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

(+) :: Fresh a -> Fresh a -> Fresh a #

(-) :: Fresh a -> Fresh a -> Fresh a #

(*) :: Fresh a -> Fresh a -> Fresh a #

negate :: Fresh a -> Fresh a #

abs :: Fresh a -> Fresh a #

signum :: Fresh a -> Fresh a #

fromInteger :: Integer -> Fresh a #

Ord a => Ord (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

compare :: Fresh a -> Fresh a -> Ordering #

(<) :: Fresh a -> Fresh a -> Bool #

(<=) :: Fresh a -> Fresh a -> Bool #

(>) :: Fresh a -> Fresh a -> Bool #

(>=) :: Fresh a -> Fresh a -> Bool #

max :: Fresh a -> Fresh a -> Fresh a #

min :: Fresh a -> Fresh a -> Fresh a #

Real a => Real (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

toRational :: Fresh a -> Rational #

RealFloat a => RealFloat (Fresh a) Source # 
Instance details

Defined in Data.Incremental

RealFrac a => RealFrac (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

properFraction :: Integral b => Fresh a -> (b, Fresh a) #

truncate :: Integral b => Fresh a -> b #

round :: Integral b => Fresh a -> b #

ceiling :: Integral b => Fresh a -> b #

floor :: Integral b => Fresh a -> b #

Generic (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Associated Types

type Rep (Fresh a) :: Type -> Type #

Methods

from :: Fresh a -> Rep (Fresh a) x #

to :: Rep (Fresh a) x -> Fresh a #

Semigroup a => Semigroup (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

(<>) :: Fresh a -> Fresh a -> Fresh a #

sconcat :: NonEmpty (Fresh a) -> Fresh a #

stimes :: Integral b => b -> Fresh a -> Fresh a #

Monoid a => Monoid (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

mempty :: Fresh a #

mappend :: Fresh a -> Fresh a -> Fresh a #

mconcat :: [Fresh a] -> Fresh a #

NFData a => NFData (Fresh a) Source # 
Instance details

Defined in Data.Incremental

Methods

rnf :: Fresh a -> () #

Incremental (Fresh a) Source #

Always updated

Instance details

Defined in Data.Incremental

Associated Types

type Delta (Fresh a) :: Type Source #

Methods

patch :: Fresh a -> Delta (Fresh a) -> Fresh a Source #

diff :: Fresh a -> Fresh a -> Maybe (Delta (Fresh a)) Source #

type Rep (Fresh a) Source # 
Instance details

Defined in Data.Incremental

type Rep (Fresh a) = D1 (MetaData "Fresh" "Data.Incremental" "incremental-0.3-3Fa0uMVHZ8vBBWalvHuxyP" True) (C1 (MetaCons "Fresh" PrefixI True) (S1 (MetaSel (Just "getFresh") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Delta (Fresh a) Source # 
Instance details

Defined in Data.Incremental

type Delta (Fresh a) = a