[ngrams] foldr -> foldl

parent 40744dc3
Pipeline #4146 failed with stage
in 0 seconds
...@@ -14,7 +14,6 @@ module Gargantext.Components.Annotation.Field where ...@@ -14,7 +14,6 @@ module Gargantext.Components.Annotation.Field where
import Gargantext.Prelude import Gargantext.Prelude
import Data.Array as A import Data.Array as A
import Data.FoldableWithIndex (foldlWithIndex, foldrWithIndex)
import Data.List (List(..), (:)) import Data.List (List(..), (:))
import Data.Map (Map) import Data.Map (Map)
import Data.Maybe (Maybe(..), maybe) import Data.Maybe (Maybe(..), maybe)
......
...@@ -155,7 +155,7 @@ computeCache ngrams contextNgrams = { contextNgrams, pm, pats } ...@@ -155,7 +155,7 @@ computeCache ngrams contextNgrams = { contextNgrams, pm, pats }
pats :: Array NgramsTerm pats :: Array NgramsTerm
pats = A.fromFoldable $ pats = A.fromFoldable $
foldrWithIndex (\term (NgramsRepoElement nre) acc -> Set.union acc $ Set.insert term nre.children) Set.empty contextRepoElements foldlWithIndex (\term acc (NgramsRepoElement nre) -> Set.union acc $ Set.insert term nre.children) Set.empty contextRepoElements
-- pats = A.fromFoldable $ -- pats = A.fromFoldable $
-- foldrWithIndex (\term (NgramsRepoElement nre) acc -> Set.union acc $ Set.insert term nre.children) Set.empty ngrams_repo_elements -- foldrWithIndex (\term (NgramsRepoElement nre) acc -> Set.union acc $ Set.insert term nre.children) Set.empty ngrams_repo_elements
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment