Functional Dependency issue in refactoring
the function groupWithStem_Double should be polymorphic (a instead of Double) as written in the code here: https://gitlab.iscpif.fr/gargantext/haskell-gargantext/blob/dev-social-list/src/Gargantext/Core/Text/List/Group/WithStem.hs#L60
But I got the error:
src/Gargantext/Core/Text/List/Group/WithStem.hs:146:32: error: • Couldn't match type ‘a2’ with ‘a’ arising from a functional dependency between: constraint ‘Control.Monad.Reader.Class.MonadReader (FlowCont Text (GroupedTreeScores a2)) ((->) (FlowCont Text (GroupedTreeScores a)))’ arising from a use of ‘view’ instance ‘Control.Monad.Reader.Class.MonadReader r ((->) r)’ at ‘a2’ is a rigid type variable bound by the type signature for: cont' :: forall a2. [(Text, GroupedTreeScores a2)] at src/Gargantext/Core/Text/List/Group/WithStem.hs:145:9-46 ‘a’ is a rigid type variable bound by the type signature for: mergeWith_a :: forall a. (Text -> Text) -> FlowCont Text (GroupedTreeScores a) -> FlowCont Text (GroupedTreeScores a) at src/Gargantext/Core/Text/List/Group/WithStem.hs:(135,1)-(137,48) • In the second argument of ‘($)’, namely ‘view flc_cont flc’ In the expression: Map.toList $ view flc_cont flc In an equation for ‘cont'’: cont' = Map.toList $ view flc_cont flc • Relevant bindings include cont' :: [(Text, GroupedTreeScores a2)] (bound at src/Gargantext/Core/Text/List/Group/WithStem.hs:146:9) flc :: FlowCont Text (GroupedTreeScores a) (bound at src/Gargantext/Core/Text/List/Group/WithStem.hs:138:17) mergeWith_a :: (Text -> Text) -> FlowCont Text (GroupedTreeScores a) -> FlowCont Text (GroupedTreeScores a) (bound at src/Gargantext/Core/Text/List/Group/WithStem.hs:138:1) | 146 | cont' = Map.toList $ view flc_cont flc