Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
gargantext
haskell-gargantext
Commits
873d4038
Commit
873d4038
authored
Dec 09, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] remove PatchMap to Map for History of patches
parent
08a0f6ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
History.hs
src/Gargantext/Core/Text/List/Social/History.hs
+20
-20
No files found.
src/Gargantext/Core/Text/List/Social/History.hs
View file @
873d4038
...
...
@@ -22,25 +22,6 @@ import qualified Data.Map.Strict as Map
import
qualified
Data.List
as
List
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
toMap
::
Ord
a
=>
PatchMap
a
b
->
Map
a
b
toMap
=
Map
.
fromList
.
PatchMap
.
toList
toMap'
::
(
Ord
a
,
Ord
b
)
=>
PatchMap
a
(
PatchMap
b
c
)
->
Map
a
(
Map
b
c
)
toMap'
=
(
Map
.
map
toMap
)
.
toMap
-- type NgramsRepo = Repo NgramsState NgramsStatePatch
-- type NgramsState = Map TableNgrams.NgramsType (Map NodeId NgramsTableMap)
-- type NgramsStatePatch = PatchMap TableNgrams.NgramsType (PatchMap NodeId NgramsTablePatch)
-- type NgramsTablePatch = Map NgramsTerm NgramsPatch
toMap''
::
NgramsStatePatch
->
Map
NgramsType
(
Map
ListId
(
Map
NgramsTerm
NgramsPatch
)
)
toMap''
=
undefined
history
::
Foldable
t
...
...
@@ -53,7 +34,26 @@ history nt lists = Map.unionsWith (<>)
.
map
(
Map
.
filterWithKey
(
\
k
_
->
List
.
elem
k
lists
))
.
catMaybes
.
map
(
Map
.
lookup
nt
)
.
map
toMap
''
.
map
toMap
.
view
r_history
where
cons
a
=
a
:
[]
toMap
::
PatchMap
NgramsType
(
PatchMap
NodeId
(
NgramsTablePatch
)
)
->
Map
NgramsType
(
Map
ListId
(
Map
NgramsTerm
NgramsPatch
)
)
toMap
=
Map
.
map
(
Map
.
map
unNgramsTablePatch
)
.
(
Map
.
map
toMap'
)
.
toMap'
where
toMap'
::
Ord
a
=>
PatchMap
a
b
->
Map
a
b
toMap'
=
Map
.
fromList
.
PatchMap
.
toList
unNgramsTablePatch
::
NgramsTablePatch
->
Map
NgramsTerm
NgramsPatch
unNgramsTablePatch
(
NgramsTablePatch
p
)
=
toMap'
p
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