From 42f18e9b4f5566d45ad22f13642b308eb49deae7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 11 Jul 2016 14:03:54 -0400 Subject: [PATCH] Use the getters instead of destructuring. --- src/Term.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Term.hs b/src/Term.hs index 62d281d71..105daceb9 100644 --- a/src/Term.hs +++ b/src/Term.hs @@ -39,6 +39,5 @@ termSize = cata size where alignCofreeWith :: Functor f => (forall a b. f a -> f b -> Maybe (f (These a b))) -> (a -> b -> c) -> These (Cofree f a) (Cofree f b) -> Free (CofreeF f c) (These (Cofree f a) (Cofree f b)) alignCofreeWith contrast combine = go where go terms = fromMaybe (pure terms) $ case terms of - These t1 t2 -> let (a1 :< s1, a2 :< s2) = (runCofree t1, runCofree t2) in - wrap . (combine a1 a2 :<) . fmap go <$> contrast s1 s2 + These t1 t2 -> wrap . (combine (extract t1) (extract t2) :<) . fmap go <$> contrast (unwrap t1) (unwrap t2) _ -> Nothing