1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Unpack the Map.

This commit is contained in:
Rob Rix 2015-11-17 13:56:40 -08:00
parent 5b837704ee
commit f985212b89

View File

@ -47,7 +47,7 @@ type Algorithm a = Free (Operation a)
cost :: Diff a -> Integer
cost f = iter c $ fmap g f where
c (Leaf _) = 0
c (Keyed xs) = sum $ snd <$> xs
c (Keyed xs) = sum $ snd <$> (toList xs)
c (Indexed xs) = sum xs
c (Fixed xs) = sum xs
g _ = 1