Copyright | (c) CNRS 2017-Present |
---|---|
License | AGPL + CECILL v3 |
Maintainer | team@gargantext.org |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type HasNodeStory env err m = (DbCmd' env err m, MonadReader env m, MonadError err m, HasNodeStoryEnv env, HasNodeError err)
- class HasNodeStoryImmediateSaver env => HasNodeStoryEnv env
- hasNodeStory :: HasNodeStoryEnv env => Getter env NodeStoryEnv
- class HasNodeStoryImmediateSaver env
- hasNodeStoryImmediateSaver :: HasNodeStoryImmediateSaver env => Getter env (NodeId -> ArchiveList -> IO ())
- class HasNodeArchiveStoryImmediateSaver env
- hasNodeArchiveStoryImmediateSaver :: HasNodeArchiveStoryImmediateSaver env => Getter env (NodeId -> ArchiveList -> IO ArchiveList)
- newtype NodeStory s p = NodeStory {
- _unNodeStory :: Map NodeId (Archive s p)
- type NgramsState' = Map NgramsType NgramsTableMap
- type NgramsStatePatch' = PatchMap NgramsType NgramsTablePatch
- type NodeListStory = NodeStory NgramsState' NgramsStatePatch'
- type ArchiveList = Archive NgramsState' NgramsStatePatch'
- initNodeListStoryMock :: NodeListStory
- data NodeStoryEnv = NodeStoryEnv {
- _nse_saver_immediate :: !(NodeId -> ArchiveList -> IO ())
- _nse_archive_saver_immediate :: !(NodeId -> ArchiveList -> IO ArchiveList)
- _nse_getter :: !(NodeId -> IO ArchiveList)
- _nse_getter_multi :: !([NodeId] -> IO NodeListStory)
- initNodeStory :: (Monoid s, Semigroup p) => NodeId -> NodeStory s p
- nse_getter :: Lens' NodeStoryEnv (NodeId -> IO ArchiveList)
- nse_getter_multi :: Lens' NodeStoryEnv ([NodeId] -> IO NodeListStory)
- nse_saver_immediate :: Lens' NodeStoryEnv (NodeId -> ArchiveList -> IO ())
- nse_archive_saver_immediate :: Lens' NodeStoryEnv (NodeId -> ArchiveList -> IO ArchiveList)
- unNodeStory :: forall s p s p. Iso (NodeStory s p) (NodeStory s p) (Map NodeId (Archive s p)) (Map NodeId (Archive s p))
- data Archive s p = Archive {
- _a_version :: !Version
- _a_state :: !s
- _a_history :: ![p]
- initArchive :: (Monoid s, Semigroup p) => Archive s p
- archiveAdvance :: (Semigroup s, Semigroup p) => Archive s p -> Archive s p -> Archive s p
- unionArchives :: (Semigroup s, Semigroup p) => Archive s p -> Archive s p -> Archive s p
- a_history :: forall s p p. Lens (Archive s p) (Archive s p) [p] [p]
- a_state :: forall s p s. Lens (Archive s p) (Archive s p) s s
- a_version :: forall s p. Lens' (Archive s p) Version
- combineState :: NgramsState' -> NgramsState' -> NgramsState'
- type ArchiveStateSet = Set (NgramsType, NgramsTerm)
- type ArchiveStateList = [(NgramsType, NgramsTerm, NgramsRepoElement)]
Documentation
type HasNodeStory env err m = (DbCmd' env err m, MonadReader env m, MonadError err m, HasNodeStoryEnv env, HasNodeError err) #
class HasNodeStoryImmediateSaver env => HasNodeStoryEnv env #
Instances
HasNodeStoryEnv DevEnv # | |
Defined in Gargantext.API.Admin.EnvTypes | |
HasNodeStoryEnv Env # | |
Defined in Gargantext.API.Admin.EnvTypes |
hasNodeStory :: HasNodeStoryEnv env => Getter env NodeStoryEnv #
class HasNodeStoryImmediateSaver env #
Instances
HasNodeStoryImmediateSaver DevEnv # | |
Defined in Gargantext.API.Admin.EnvTypes hasNodeStoryImmediateSaver :: Getter DevEnv (NodeId -> ArchiveList -> IO ()) # | |
HasNodeStoryImmediateSaver Env # | |
Defined in Gargantext.API.Admin.EnvTypes hasNodeStoryImmediateSaver :: Getter Env (NodeId -> ArchiveList -> IO ()) # |
hasNodeStoryImmediateSaver :: HasNodeStoryImmediateSaver env => Getter env (NodeId -> ArchiveList -> IO ()) #
class HasNodeArchiveStoryImmediateSaver env #
Instances
hasNodeArchiveStoryImmediateSaver :: HasNodeArchiveStoryImmediateSaver env => Getter env (NodeId -> ArchiveList -> IO ArchiveList) #
Node Story for each NodeType where the Key of the Map is NodeId TODO : generalize for any NodeType, let's start with NodeList which is implemented already
NodeStory | |
|
Instances
(FromJSON s, FromJSON p) => FromJSON (NodeStory s p) # | |
(ToJSON s, ToJSON p) => ToJSON (NodeStory s p) # | |
Defined in Gargantext.Core.NodeStory.Types | |
Generic (NodeStory s p) # | |
(Show s, Show p) => Show (NodeStory s p) # | |
(Eq s, Eq p) => Eq (NodeStory s p) # | |
(Serialise s, Serialise p) => Serialise (NodeStory s p) # | |
type Rep (NodeStory s p) # | |
Defined in Gargantext.Core.NodeStory.Types |
type NgramsState' = Map NgramsType NgramsTableMap #
data NodeStoryEnv #
NodeStoryEnv | |
|
Instances
Generic NodeStoryEnv # | |
Defined in Gargantext.Core.NodeStory.Types type Rep NodeStoryEnv :: Type -> Type # from :: NodeStoryEnv -> Rep NodeStoryEnv x # to :: Rep NodeStoryEnv x -> NodeStoryEnv # | |
type Rep NodeStoryEnv # | |
Defined in Gargantext.Core.NodeStory.Types type Rep NodeStoryEnv = D1 ('MetaData "NodeStoryEnv" "Gargantext.Core.NodeStory.Types" "gargantext-0.0.7.1.5.3-inplace" 'False) (C1 ('MetaCons "NodeStoryEnv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_nse_saver_immediate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NodeId -> ArchiveList -> IO ())) :*: S1 ('MetaSel ('Just "_nse_archive_saver_immediate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NodeId -> ArchiveList -> IO ArchiveList))) :*: (S1 ('MetaSel ('Just "_nse_getter") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NodeId -> IO ArchiveList)) :*: S1 ('MetaSel ('Just "_nse_getter_multi") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ([NodeId] -> IO NodeListStory))))) |
nse_getter :: Lens' NodeStoryEnv (NodeId -> IO ArchiveList) #
nse_getter_multi :: Lens' NodeStoryEnv ([NodeId] -> IO NodeListStory) #
nse_saver_immediate :: Lens' NodeStoryEnv (NodeId -> ArchiveList -> IO ()) #
Lenses at the bottom of the file because Template Haskell would reorder order of execution in others cases
unNodeStory :: forall s p s p. Iso (NodeStory s p) (NodeStory s p) (Map NodeId (Archive s p)) (Map NodeId (Archive s p)) #
Archive | |
|
Instances
initArchive :: (Monoid s, Semigroup p) => Archive s p #
archiveAdvance :: (Semigroup s, Semigroup p) => Archive s p -> Archive s p -> Archive s p #
This is the normal way to update archive state, bumping the version and history. Resulting state is taken directly from new archive, omitting old archive completely.
unionArchives :: (Semigroup s, Semigroup p) => Archive s p -> Archive s p -> Archive s p #
This is to merge archive states.
combineState :: NgramsState' -> NgramsState' -> NgramsState' #
Combine NgramsState'
. This is because the structure is (Map
NgramsType (Map ...)) and the default (<>)
operator is
left-biased
(https:/hackage.haskell.orgpackagecontainers-0.6.6docs/Data-Map-Internal.html#v:union)
type ArchiveStateSet = Set (NgramsType, NgramsTerm) #
type ArchiveStateList = [(NgramsType, NgramsTerm, NgramsRepoElement)] #