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
152
Issues
152
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
9ba4f597
Commit
9ba4f597
authored
Feb 07, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN]
parent
b36a041b
Pipeline
#1403
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
32 deletions
+0
-32
Prelude.hs
src/Gargantext/Core/Text/List/Group/Prelude.hs
+0
-32
No files found.
src/Gargantext/Core/Text/List/Group/Prelude.hs
View file @
9ba4f597
...
...
@@ -89,7 +89,6 @@ instance SetListType (HashMap NgramsTerm (GroupedTreeScores a)) where
setListType
lt
=
HashMap
.
map
(
set
gts'_listType
lt
)
------
class
HasSize
a
where
hasSize
::
a
->
Integer
...
...
@@ -102,38 +101,11 @@ instance HasSize (Set a) where
instance
(
HasSize
a
,
Semigroup
a
)
=>
ViewScore
(
GroupedTreeScores
a
)
Integer
where
viewScore
=
hasSize
.
viewScores
{-
-- TODO clean this instances
instance ViewScore (GroupedTreeScores Double) Double where
viewScore = viewScores
instance ViewScores (GroupedTreeScores Double) Double where
viewScores g = sum $ parent : children
where
parent = view gts'_score g
children = map viewScores $ HashMap.elems $ view gts'_children g
instance ViewScore (GroupedTreeScores (Set NodeId)) Int where
viewScore = Set.size . viewScores
instance ViewScore (GroupedTreeScores (Scored NgramsTerm)) Double where
viewScore = view (gts'_score . scored_genInc)
instance ViewScores (GroupedTreeScores (Set NodeId)) (Set NodeId) where
viewScores g = Set.unions $ parent : children
where
parent = view gts'_score g
children = map viewScores $ HashMap.elems $ view gts'_children g
-}
instance
Semigroup
a
=>
ViewScores
(
GroupedTreeScores
a
)
a
where
viewScores
g
=
foldl1
(
<>
)
$
parent
:
children
where
parent
=
view
gts'_score
g
children
=
map
viewScores
$
HashMap
.
elems
$
view
gts'_children
g
------
instance
HasTerms
(
HashMap
NgramsTerm
(
GroupedTreeScores
a
))
where
hasTerms
=
Set
.
unions
.
(
map
hasTerms
)
.
HashMap
.
toList
...
...
@@ -147,11 +119,9 @@ instance HasTerms (NgramsTerm, GroupedTreeScores a) where
$
view
gts'_children
g
------
instance
ToNgramsElement
(
HashMap
NgramsTerm
(
GroupedTreeScores
a
))
where
toNgramsElement
=
List
.
concat
.
(
map
toNgramsElement
)
.
HashMap
.
toList
instance
ToNgramsElement
(
NgramsTerm
,
GroupedTreeScores
a
)
where
toNgramsElement
(
t
,
gts
)
=
parent
:
children
where
...
...
@@ -178,5 +148,3 @@ instance ToNgramsElement (NgramsTerm, GroupedTreeScores a) where
$
map
(
childrenWith
root
t'
)
$
HashMap
.
toList
$
view
gts'_children
gts'
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