2 Module : Gargantext.Database.Flow.Types
3 Description : Types for Flow
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
14 {-# LANGUAGE ConstraintKinds #-}
15 {-# LANGUAGE RankNTypes #-}
16 {-# LANGUAGE ConstrainedClassMethods #-}
17 {-# LANGUAGE ConstraintKinds #-}
18 {-# LANGUAGE DeriveGeneric #-}
19 {-# LANGUAGE FlexibleContexts #-}
20 {-# LANGUAGE InstanceSigs #-}
21 {-# LANGUAGE NoImplicitPrelude #-}
22 {-# LANGUAGE OverloadedStrings #-}
24 module Gargantext.Database.Flow.Types
28 import Gargantext.Prelude
29 import Gargantext.Core.Flow.Types
30 import Gargantext.API.Ngrams (HasRepoVar, RepoCmdM)
31 import Gargantext.Database.Schema.Ngrams (Ngrams(..), NgramsType(..))
32 import Gargantext.Database.Types.Node (NodeId)
33 import Gargantext.Database.Types.Errors (HasNodeError)
34 import Gargantext.Database.Utils (CmdM)
36 type FlowCmdM env err m =
43 data DocumentIdWithNgrams a = DocumentIdWithNgrams
44 { documentWithId :: !(DocumentWithId a)
45 , document_ngrams :: !(Map Ngrams (Map NgramsType Int))
48 data DocumentWithId a = DocumentWithId
49 { documentId :: !NodeId
53 instance HasText a => HasText (DocumentWithId a)
55 hasText (DocumentWithId _ a) = hasText a