Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
purescript-gargantext
Commits
1b88dd0f
Commit
1b88dd0f
authored
Dec 02, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] G.D.Maybe -> G.D.Array
parent
3ee4bc3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
22 deletions
+23
-22
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+1
-1
Array.purs
src/Gargantext/Data/Array.purs
+22
-3
Maybe.purs
src/Gargantext/Data/Maybe.purs
+0
-18
No files found.
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
1b88dd0f
...
...
@@ -11,7 +11,7 @@ import Data.Tuple.Nested((/\))
import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Data.
Maybe
(catMaybes)
import Gargantext.Data.
Array
(catMaybes)
import Gargantext.Components.RandomText (words)
import Gargantext.Components.Nodes.Corpus.Graph.Tabs as GT
import Gargantext.Components.Graph as Graph
...
...
src/Gargantext/Data/Array.purs
View file @
1b88dd0f
module Gargantext.Data.Array
where
import Data.Tuple (Tuple(..))
import Data.Array as DA
import Data.Maybe
import Data.Sequence as DS
import Data.Tuple (Tuple(..))
import Prelude (bind, flip, identity, (<<<))
----------------------------------------------------------------------
-- | Split arrays tools
splitEvery :: forall a. Int -> Array a -> Array (Array a)
splitEvery _ [] = []
splitEvery n xs =
...
...
@@ -18,3 +20,20 @@ splitAt n ls = Tuple (DS.toUnfoldable x) (DS.toUnfoldable xs)
where
Tuple x xs = DS.splitAt n (DS.fromFoldable ls)
----------------------------------------------------------------------
-- | Array with Maybe tools
mapMaybe :: forall a b. (a -> Maybe b) -> Array a -> Array b
mapMaybe f = concatMap (maybe [] singleton <<< f)
catMaybes :: forall a. Array (Maybe a) -> Array a
catMaybes = mapMaybe identity
----------------------------------------------------------------------
-- | Array misc tools
concatMap :: forall a b. (a -> Array b) -> Array a -> Array b
concatMap = flip bind
singleton :: forall a. a -> Array a
singleton a = [a]
src/Gargantext/Data/Maybe.purs
deleted
100644 → 0
View file @
3ee4bc3e
module Gargantext.Data.Maybe where
import Prelude (bind, flip, identity, (<<<))
import Data.Maybe
mapMaybe :: forall a b. (a -> Maybe b) -> Array a -> Array b
mapMaybe f = concatMap (maybe [] singleton <<< f)
catMaybes :: forall a. Array (Maybe a) -> Array a
catMaybes = mapMaybe identity
concatMap :: forall a b. (a -> Array b) -> Array a -> Array b
concatMap = flip bind
singleton :: forall a. a -> Array a
singleton a = [a]
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