{-# LANGUAGE ViewPatterns #-} module U.Codebase.Reflog where import Data.Bifoldable import Data.Bifunctor import Data.Bitraversable import Data.Time (UTCTime) data Entry causal text = Entry { forall causal text. Entry causal text -> UTCTime time :: UTCTime, forall causal text. Entry causal text -> causal fromRootCausalHash :: causal, forall causal text. Entry causal text -> causal toRootCausalHash :: causal, forall causal text. Entry causal text -> text reason :: text } deriving ((forall a b. (a -> b) -> Entry causal a -> Entry causal b) -> (forall a b. a -> Entry causal b -> Entry causal a) -> Functor (Entry causal) forall a b. a -> Entry causal b -> Entry causal a forall a b. (a -> b) -> Entry causal a -> Entry causal b forall causal a b. a -> Entry causal b -> Entry causal a forall causal a b. (a -> b) -> Entry causal a -> Entry causal b forall (f :: * -> *). (forall a b. (a -> b) -> f a -> f b) -> (forall a b. a -> f b -> f a) -> Functor f $cfmap :: forall causal a b. (a -> b) -> Entry causal a -> Entry causal b fmap :: forall a b. (a -> b) -> Entry causal a -> Entry causal b $c<$ :: forall causal a b. a -> Entry causal b -> Entry causal a <$ :: forall a b. a -> Entry causal b -> Entry causal a Functor) instance Bifunctor Entry where bimap :: forall a b c d. (a -> b) -> (c -> d) -> Entry a c -> Entry b d bimap = (a -> b) -> (c -> d) -> Entry a c -> Entry b d forall (t :: * -> * -> *) a b c d. Bitraversable t => (a -> b) -> (c -> d) -> t a c -> t b d bimapDefault instance Bifoldable Entry where bifoldMap :: forall m a b. Monoid m => (a -> m) -> (b -> m) -> Entry a b -> m bifoldMap = (a -> m) -> (b -> m) -> Entry a b -> m forall (t :: * -> * -> *) m a b. (Bitraversable t, Monoid m) => (a -> m) -> (b -> m) -> t a b -> m bifoldMapDefault instance Bitraversable Entry where bitraverse :: forall (f :: * -> *) a c b d. Applicative f => (a -> f c) -> (b -> f d) -> Entry a b -> f (Entry c d) bitraverse a -> f c f b -> f d g (Entry UTCTime time a fch a tch b reason) = UTCTime -> c -> c -> d -> Entry c d forall causal text. UTCTime -> causal -> causal -> text -> Entry causal text Entry UTCTime time (c -> c -> d -> Entry c d) -> f c -> f (c -> d -> Entry c d) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> a -> f c f a fch f (c -> d -> Entry c d) -> f c -> f (d -> Entry c d) forall a b. f (a -> b) -> f a -> f b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> a -> f c f a tch f (d -> Entry c d) -> f d -> f (Entry c d) forall a b. f (a -> b) -> f a -> f b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> b -> f d g b reason