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
5d8b0446
Commit
5d8b0446
authored
Feb 23, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[STACK] upgrading servant and LTS.
parent
feb9c078
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
Count.hs
src/Gargantext/Ngrams/Count.hs
+2
-1
Prelude.hs
src/Gargantext/Prelude.hs
+2
-1
stack.yaml
stack.yaml
+8
-7
No files found.
src/Gargantext/Ngrams/Count.hs
View file @
5d8b0446
...
...
@@ -7,6 +7,7 @@ import Gargantext.Prelude
import
Data.Foldable
as
F
import
Data.Map.Strict
(
insertWith
)
import
Data.Map
(
Map
)
import
qualified
Data.Map
as
M
...
...
@@ -31,7 +32,7 @@ letters'' = DTL.foldr (\ch xs -> DTL.singleton ch : xs) []
-- number of punctuation
occurrences
::
Ord
a
=>
[
a
]
->
Map
a
Int
occurrences
xs
=
foldl'
(
\
x
y
->
M
.
insertWith'
(
+
)
y
1
x
)
M
.
empty
xs
occurrences
xs
=
foldl'
(
\
x
y
->
insertWith
(
+
)
y
1
x
)
M
.
empty
xs
-- for optimization :
--occurrences' :: Ord a => [a] -> Map a Integer
...
...
src/Gargantext/Prelude.hs
View file @
5d8b0446
...
...
@@ -34,6 +34,7 @@ import Protolude ( Bool(True, False), Int, Double, Integer
import
qualified
Data.List
as
L
hiding
(
head
,
sum
)
import
qualified
Control.Monad
as
M
import
qualified
Data.Map
as
Map
import
Data.Map.Strict
(
insertWith
)
import
qualified
Data.Vector
as
V
import
Safe
(
headMay
)
import
Text.Show
(
Show
(),
show
)
...
...
@@ -149,7 +150,7 @@ count2map xs = Map.map (/ (fromIntegral (length xs))) (count2map' xs)
-- | insert in a dict
count2map'
::
(
Ord
k
,
Foldable
t
)
=>
t
k
->
Map
.
Map
k
Double
count2map'
xs
=
L
.
foldl'
(
\
x
y
->
Map
.
insertWith'
(
+
)
y
1
x
)
Map
.
empty
xs
count2map'
xs
=
L
.
foldl'
(
\
x
y
->
insertWith
(
+
)
y
1
x
)
Map
.
empty
xs
trunc
::
(
RealFrac
a
,
Integral
c
,
Integral
b
)
=>
b
->
a
->
c
...
...
stack.yaml
View file @
5d8b0446
...
...
@@ -2,21 +2,22 @@ flags: {}
extra-package-dbs
:
[]
packages
:
-
.
allow-newer
:
true
extra-deps
:
-
aeson-
1.0.2.1
-
a
ttoparsec-0.13.2.2
-
aeson-
0.11.3.0
-
a
eson-lens-0.5.0.0
-
duckling-0.1.3.0
-
http-media-0.7.1.2
-
h
ttp-types-0.11
-
mmorph-1.1.0
-
extra-1.5.3
-
h
askell-src-exts-1.18.2
-
http-types-0.12.1
-
protolude-0.2
-
servant-0.12.1
-
servant-auth-0.3.0.1
-
servant-client-0.12.0.1
-
servant-client-core-0.12
-
servant-docs-0.11.1
-
servant-mock-0.8.3
-
servant-multipart-0.11.1
-
servant-server-0.12
-
text-1.2.3.0
resolver
:
lts-9.2
-
text-show-3.6.2
resolver
:
lts-10.6
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