Commit 04fb96c2 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[ngrams] better output of old != new

parent cdae18ff
...@@ -194,7 +194,7 @@ instance Monoid NgramsPatch where ...@@ -194,7 +194,7 @@ instance Monoid NgramsPatch where
mempty = NgramsPatch { patch_children: mempty, patch_list: mempty } mempty = NgramsPatch { patch_children: mempty, patch_list: mempty }
instance Semigroup NgramsPatch where instance Semigroup NgramsPatch where
append (NgramsReplace p) (NgramsReplace q) append (NgramsReplace p) (NgramsReplace q)
| p.patch_old /= q.patch_new = unsafeThrow "append/NgramsPatch: old != new" | p.patch_old /= q.patch_new = unsafeThrow $ "append/NgramsPatch: old != new: " <> show p.patch_old <> " != " <> show q.patch_new
| otherwise = ngramsReplace q.patch_old p.patch_new | otherwise = ngramsReplace q.patch_old p.patch_new
append (NgramsPatch p) (NgramsPatch q) = NgramsPatch append (NgramsPatch p) (NgramsPatch q) = NgramsPatch
{ patch_children: p.patch_children <> q.patch_children { patch_children: p.patch_children <> q.patch_children
......
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