Commit c624d176 authored by mzheng's avatar mzheng

formating addGroup

parent 96a23581
...@@ -131,23 +131,26 @@ toGroupedTreeInstitutes'' m notEmpty institutesTree ...@@ -131,23 +131,26 @@ toGroupedTreeInstitutes'' m notEmpty institutesTree
-> Parent -> Parent
-> GroupedTreeScores score -> GroupedTreeScores score
-> GroupedTreeScores score -> GroupedTreeScores score
addGroup institutesTree' m' k v = addGroup institutesTree' dict' key val =
over gts'_children ( toGroupedTree'' m' over gts'_children
. case HashMap.lookup (unNgramsTerm k) institutesTree' of ( toGroupedTree'' dict'
. case HashMap.lookup (unNgramsTerm key) institutesTree' of
Nothing -> HashMap.union ( fromMaybe mempty Nothing -> HashMap.union ( fromMaybe mempty
$ HashMap.lookup (Just k) m' $ HashMap.lookup (Just key) dict'
) )
Just children -> HashMap.union (foldl (\acc child -> HashMap.union acc $ Just children
HashMap.singleton -> HashMap.union
(NgramsTerm child) (foldl (\acc child
GroupedTreeScores -> HashMap.union acc
{ _gts'_score= _gts'_score v $ HashMap.singleton (NgramsTerm child) GroupedTreeScores
, _gts'_listType= _gts'_listType v { _gts'_score= _gts'_score val
, _gts'_listType= _gts'_listType val
, _gts'_children= HashMap.empty , _gts'_children= HashMap.empty
}) HashMap.empty children }
) HashMap.empty children
) )
. HashMap.union ( fromMaybe mempty . HashMap.union ( fromMaybe mempty
$ HashMap.lookup (Just k) m' $ HashMap.lookup (Just key) dict'
) )
) )
v val
\ No newline at end of file \ No newline at end of file
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