incremental-0: incremental update library

Safe HaskellNone
LanguageHaskell2010

Data.Incremental

Documentation

class Incremental a where Source #

Minimal complete definition

patch, diff

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 # 

Associated Types

type Delta Bool :: * Source #

Incremental Char Source # 

Associated Types

type Delta Char :: * Source #

Incremental Double Source # 

Associated Types

type Delta Double :: * Source #

Incremental Float Source # 

Associated Types

type Delta Float :: * Source #

Incremental Int Source # 

Associated Types

type Delta Int :: * Source #

Methods

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

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

Incremental Int8 Source # 

Associated Types

type Delta Int8 :: * Source #

Incremental Int16 Source # 

Associated Types

type Delta Int16 :: * Source #

Incremental Int32 Source # 

Associated Types

type Delta Int32 :: * Source #

Incremental Int64 Source # 

Associated Types

type Delta Int64 :: * Source #

Incremental Integer Source # 

Associated Types

type Delta Integer :: * Source #

Incremental Natural Source # 

Associated Types

type Delta Natural :: * Source #

Incremental Ordering Source # 
Incremental Word Source # 

Associated Types

type Delta Word :: * Source #

Incremental Word8 Source # 

Associated Types

type Delta Word8 :: * Source #

Incremental Word16 Source # 

Associated Types

type Delta Word16 :: * Source #

Incremental Word32 Source # 

Associated Types

type Delta Word32 :: * Source #

Incremental Word64 Source # 

Associated Types

type Delta Word64 :: * Source #

Incremental () Source # 

Associated Types

type Delta () :: * Source #

Methods

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

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

Incremental Void Source # 

Associated Types

type Delta Void :: * Source #

Incremental a => Incremental (Maybe a) Source # 

Associated Types

type Delta (Maybe a) :: * 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 # 

Associated Types

type Delta (Fixed a) :: * 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 # 

Associated Types

type Delta (Identity a) :: * Source #

Num a => Incremental (Sum a) Source # 

Associated Types

type Delta (Sum a) :: * 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 # 

Associated Types

type Delta (IntMap a) :: * 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 # 

Associated Types

type Delta (Set a) :: * 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

Associated Types

type Delta (Fresh a) :: * 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

Associated Types

type Delta (Hetero a) :: * 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 # 

Associated Types

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

Methods

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

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

Incremental (Proxy * a) Source # 

Associated Types

type Delta (Proxy * a) :: * Source #

Methods

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

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

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

Associated Types

type Delta (Map k a) :: * 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 a, Incremental b, Incremental c) => Incremental (a, b, c) Source # 

Associated Types

type Delta (a, b, c) :: * 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 # 

Associated Types

type Delta (Const * a b) :: * 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 Source #

Constructors

Insert a 
Update (Delta a) 
Delete 
Upsert a (Delta a) 

Instances

(Show a, Show (Delta a)) => Show (Alter a) Source # 

Methods

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

show :: Alter a -> String #

showList :: [Alter a] -> ShowS #

Generic (Alter a) Source # 

Associated Types

type Rep (Alter a) :: * -> * #

Methods

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

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

(Incremental a, Semigroup (Delta a)) => Semigroup (Alter a) Source # 

Methods

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

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

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

(Incremental a, Semigroup (Delta a), Monoid (Delta a)) => Monoid (Alter a) Source # 

Methods

mempty :: Alter a #

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

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

(NFData a, NFData (Delta a)) => NFData (Alter a) Source # 

Methods

rnf :: Alter a -> () #

type Rep (Alter a) Source # 

newtype Hetero a Source #

Constructors

Hetero 

Fields

Instances

Bounded a => Bounded (Hetero a) Source # 

Methods

minBound :: Hetero a #

maxBound :: Hetero a #

Enum a => Enum (Hetero a) Source # 

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 # 

Methods

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

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

Floating a => Floating (Hetero a) Source # 

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 # 

Methods

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

recip :: Hetero a -> Hetero a #

fromRational :: Rational -> Hetero a #

Integral a => Integral (Hetero a) Source # 

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 # 

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 # 

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 # 

Methods

toRational :: Hetero a -> Rational #

RealFloat a => RealFloat (Hetero a) Source # 
RealFrac a => RealFrac (Hetero a) Source # 

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 # 

Associated Types

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

Methods

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

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

Semigroup a => Semigroup (Hetero a) Source # 

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 # 

Methods

mempty :: Hetero a #

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

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

NFData a => NFData (Hetero a) Source # 

Methods

rnf :: Hetero a -> () #

Eq a => Incremental (Hetero a) Source #

diff checks equality

Associated Types

type Delta (Hetero a) :: * 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 # 
type Rep (Hetero a) = D1 * (MetaData "Hetero" "Data.Incremental" "incremental-0-9B8t7JiTrwqLYdhnWqXCmt" True) (C1 * (MetaCons "Hetero" PrefixI True) (S1 * (MetaSel (Just Symbol "getHetero") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a)))
type Delta (Hetero a) Source # 
type Delta (Hetero a) = a

newtype Fresh a Source #

Constructors

Fresh 

Fields

Instances

Bounded a => Bounded (Fresh a) Source # 

Methods

minBound :: Fresh a #

maxBound :: Fresh a #

Enum a => Enum (Fresh a) Source # 

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 # 

Methods

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

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

Floating a => Floating (Fresh a) Source # 

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 # 

Methods

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

recip :: Fresh a -> Fresh a #

fromRational :: Rational -> Fresh a #

Integral a => Integral (Fresh a) Source # 

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 # 

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 # 

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 # 

Methods

toRational :: Fresh a -> Rational #

RealFloat a => RealFloat (Fresh a) Source # 
RealFrac a => RealFrac (Fresh a) Source # 

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 # 

Associated Types

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

Methods

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

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

Semigroup a => Semigroup (Fresh a) Source # 

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 # 

Methods

mempty :: Fresh a #

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

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

NFData a => NFData (Fresh a) Source # 

Methods

rnf :: Fresh a -> () #

Incremental (Fresh a) Source #

Always updated

Associated Types

type Delta (Fresh a) :: * 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 # 
type Rep (Fresh a) = D1 * (MetaData "Fresh" "Data.Incremental" "incremental-0-9B8t7JiTrwqLYdhnWqXCmt" True) (C1 * (MetaCons "Fresh" PrefixI True) (S1 * (MetaSel (Just Symbol "getFresh") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a)))
type Delta (Fresh a) Source # 
type Delta (Fresh a) = a