Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
796b0501
Unverified
Commit
796b0501
authored
Feb 18, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NGRAMS-REPO] fix putListNgrams (no need for addListNgrams)
parent
0638f3db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+3
-3
Flow.hs
src/Gargantext/Database/Flow.hs
+2
-2
No files found.
src/Gargantext/API/Ngrams.hs
View file @
796b0501
...
...
@@ -54,7 +54,7 @@ import Data.Map.Strict (Map)
--import qualified Data.Set as Set
import
Control.Category
((
>>>
))
import
Control.Concurrent
import
Control.Lens
(
makeLenses
,
makePrisms
,
Getter
,
Prism
'
,
prism'
,
Iso
'
,
iso
,
from
,
(
^..
),
(
.~
),
(
#
),
to
,
{-withIndex, folded, ifolded,-}
view
,
(
^.
),
(
+~
),
(
<>~
),
(
%~
),
at
,
_Just
,
Each
(
..
),
itraverse_
,
(
.=
),
both
,
mapped
)
import
Control.Lens
(
makeLenses
,
makePrisms
,
Getter
,
Prism
'
,
prism'
,
Iso
'
,
iso
,
from
,
(
^..
),
(
.~
),
(
#
),
to
,
{-withIndex, folded, ifolded,-}
view
,
(
^.
),
(
+~
),
(
%~
),
at
,
_Just
,
Each
(
..
),
itraverse_
,
(
.=
),
both
,
mapped
)
import
Control.Monad
(
guard
)
import
Control.Monad.Error.Class
(
MonadError
,
throwError
)
import
Control.Monad.Reader
...
...
@@ -677,7 +677,6 @@ copyListNgrams srcListId dstListId ngramsType = do
where
f :: Map NodeId NgramsTableMap -> Map NodeId NgramsTableMap
f m = m & at dstListId %~ insertNewOnly (m ^. at srcListId)
-}
-- TODO refactor with putListNgrams
-- The list must be non-empty!
...
...
@@ -692,6 +691,7 @@ addListNgrams listId ngramsType nes = do
saveRepo
where
m = Map.fromList $ (\n -> (n ^. ne_ngrams, n)) <$> nes
-}
putListNgrams
::
RepoCmdM
env
err
m
=>
NodeId
->
NgramsType
...
...
@@ -699,7 +699,7 @@ putListNgrams :: RepoCmdM env err m
putListNgrams
listId
ngramsType
nes
=
do
var
<-
view
repoVar
liftIO
$
modifyMVar_
var
$
pure
.
(
r_state
.
at
ngramsType
%~
(
Just
.
(
at
listId
%~
insertNewOnly
(
Just
m
))
.
something
))
pure
.
(
r_state
.
at
ngramsType
%~
(
Just
.
(
at
listId
%~
(
Just
.
(
m
<>
)
.
something
))
.
something
))
saveRepo
where
m
=
Map
.
fromList
$
(
\
n
->
(
n
^.
ne_ngrams
,
n
))
<$>
nes
...
...
src/Gargantext/Database/Flow.hs
View file @
796b0501
...
...
@@ -59,7 +59,7 @@ import Gargantext.Text.Parsers (parseDocs, FileFormat)
import
System.FilePath
(
FilePath
)
import
Gargantext.API.Ngrams
(
HasRepoVar
)
import
Servant
(
ServantErr
)
import
Gargantext.API.Ngrams
(
NgramsElement
(
..
),
putListNgrams
,
addListNgrams
,
RepoCmdM
)
import
Gargantext.API.Ngrams
(
NgramsElement
(
..
),
putListNgrams
,
RepoCmdM
)
--import Gargantext.Database.Schema.User (insertUsers, simpleUser, gargantuaUser)
import
qualified
Data.Map
as
DM
...
...
@@ -274,7 +274,7 @@ flowListUser uId cId ngsM n = do
<$>
getTficf
userMaster
cId
lId
NgramsTerms
flowListBase
lId
ngsM
add
ListNgrams
lId
NgramsTerms
$
put
ListNgrams
lId
NgramsTerms
$
[
NgramsElement
(
tficf_ngramsTerms
ng
)
GraphList
1
Nothing
mempty
|
ng
<-
ngs
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment