1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Use the Foldable instance instead of specifying the constructor.

This commit is contained in:
Rob Rix 2016-06-30 11:27:37 -04:00
parent 27cc162e1c
commit cb71ba3467

View File

@ -38,4 +38,4 @@ spec = parallel $ do
(childrenOf <$> beforeTerm diff, childrenOf <$> afterTerm diff) `shouldBe` (Just (Set.fromList tas), Just (Set.fromList tbs))
childrenOf :: (Ord leaf, Ord annotation) => Term leaf annotation -> Set.Set (Term leaf annotation)
childrenOf term = let Indexed children = unwrap term in Set.fromList children
childrenOf term = Set.fromList (toList (unwrap term))