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
153
Issues
153
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
4399f066
Unverified
Commit
4399f066
authored
Jul 04, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mapConcurrentlyChunked
parent
6296b828
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
Main.hs
bin/gargantext-cli/Main.hs
+3
-5
No files found.
bin/gargantext-cli/Main.hs
View file @
4399f066
...
...
@@ -63,7 +63,8 @@ mapMP f xs = do
mapConcurrentlyChunked
::
(
a
->
IO
b
)
->
[
a
]
->
IO
[
b
]
mapConcurrentlyChunked
f
ts
=
do
n
<-
getNumCapabilities
caps
<-
getNumCapabilities
let
n
=
caps
`
div
`
length
ts
concat
<$>
mapConcurrently
(
mapM
f
)
(
chunksOf
n
ts
)
filterTermsAndCooc
...
...
@@ -94,11 +95,8 @@ main = do
putStrLn
$
show
$
length
termList
let
years
=
DM
.
keys
corpus
let
patterns
=
WithList
$
buildPatterns
termList
let
corpus'
=
DMaybe
.
catMaybes
$
map
(
\
k
->
DM
.
lookup
k
corpus
)
years
r
<-
mapConcurrentlyChunked
(
filterTermsAndCooc
patterns
)
(
zip
years
corpus'
)
r
<-
mapConcurrentlyChunked
(
filterTermsAndCooc
patterns
)
(
DM
.
toList
corpus
)
putStrLn
$
show
r
--writeFile outputFile cooc
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