gargantext-0.0.7.1.5.3: Search, map, share
Copyright(c) CNRS 2017-Present
LicenseAGPL + CECILL v3
Maintainerteam@gargantext.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gargantext.Core.NodeStory.Types

Description

 
Synopsis

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 #

Minimal complete definition

hasNodeStory

Instances

Instances details
HasNodeStoryEnv DevEnv # 
Instance details

Defined in Gargantext.API.Admin.EnvTypes

HasNodeStoryEnv Env # 
Instance details

Defined in Gargantext.API.Admin.EnvTypes

newtype NodeStory s p #

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

Constructors

NodeStory 

Fields

Instances

Instances details
(FromJSON s, FromJSON p) => FromJSON (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

(ToJSON s, ToJSON p) => ToJSON (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Generic (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Associated Types

type Rep (NodeStory s p) :: Type -> Type #

Methods

from :: NodeStory s p -> Rep (NodeStory s p) x #

to :: Rep (NodeStory s p) x -> NodeStory s p #

(Show s, Show p) => Show (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Methods

showsPrec :: Int -> NodeStory s p -> ShowS #

show :: NodeStory s p -> String #

showList :: [NodeStory s p] -> ShowS #

(Eq s, Eq p) => Eq (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Methods

(==) :: NodeStory s p -> NodeStory s p -> Bool #

(/=) :: NodeStory s p -> NodeStory s p -> Bool #

(Serialise s, Serialise p) => Serialise (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

type Rep (NodeStory s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

type Rep (NodeStory s p) = D1 ('MetaData "NodeStory" "Gargantext.Core.NodeStory.Types" "gargantext-0.0.7.1.5.3-inplace" 'True) (C1 ('MetaCons "NodeStory" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unNodeStory") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map NodeId (Archive s p)))))

data NodeStoryEnv #

Instances

Instances details
Generic NodeStoryEnv # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Associated Types

type Rep NodeStoryEnv :: Type -> Type #

type Rep NodeStoryEnv # 
Instance details

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_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)) #

data Archive s p #

Constructors

Archive 

Fields

Instances

Instances details
DefaultFromField SqlJsonb (Archive NgramsState' NgramsStatePatch') # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

(FromJSON s, FromJSON p) => FromJSON (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

(ToJSON s, ToJSON p) => ToJSON (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Generic (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Associated Types

type Rep (Archive s p) :: Type -> Type #

Methods

from :: Archive s p -> Rep (Archive s p) x #

to :: Rep (Archive s p) x -> Archive s p #

(Show s, Show p) => Show (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Methods

showsPrec :: Int -> Archive s p -> ShowS #

show :: Archive s p -> String #

showList :: [Archive s p] -> ShowS #

(Eq s, Eq p) => Eq (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Methods

(==) :: Archive s p -> Archive s p -> Bool #

(/=) :: Archive s p -> Archive s p -> Bool #

FromField (Archive NgramsState' NgramsStatePatch') # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

(Serialise s, Serialise p) => Serialise (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

Methods

encode :: Archive s p -> Encoding #

decode :: Decoder s0 (Archive s p) #

encodeList :: [Archive s p] -> Encoding #

decodeList :: Decoder s0 [Archive s p] #

type Rep (Archive s p) # 
Instance details

Defined in Gargantext.Core.NodeStory.Types

type Rep (Archive s p) = D1 ('MetaData "Archive" "Gargantext.Core.NodeStory.Types" "gargantext-0.0.7.1.5.3-inplace" 'False) (C1 ('MetaCons "Archive" 'PrefixI 'True) (S1 ('MetaSel ('Just "_a_version") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Version) :*: (S1 ('MetaSel ('Just "_a_state") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 s) :*: S1 ('MetaSel ('Just "_a_history") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [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.

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' #

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)