Skip to content

Commit 801df70

Browse files
authored
Add instance Pretty MultiOr (#2652)
1 parent a6bf9b7 commit 801df70

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kore/src/Kore/Internal/MultiOr.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ import Kore.Syntax.Application (
5353
import Kore.TopBottom (
5454
TopBottom (..),
5555
)
56+
import Kore.Unparser (
57+
unparseAssoc',
58+
)
5659
import Logic (
5760
Logic,
5861
LogicT,
@@ -63,6 +66,9 @@ import Prelude.Kore hiding (
6366
map,
6467
traverse,
6568
)
69+
import Pretty (
70+
Pretty (..),
71+
)
6672

6773
-- | 'MultiOr' is a Matching logic or of its children
6874
newtype MultiOr child = MultiOr {getMultiOr :: [child]}
@@ -77,6 +83,10 @@ instance Debug child => Debug (MultiOr child)
7783

7884
instance (Debug child, Diff child) => Diff (MultiOr child)
7985

86+
instance Pretty child => Pretty (MultiOr child) where
87+
pretty = unparseAssoc' "\\or{_}" "\\bottom{_}()" . (<$>) pretty . getMultiOr
88+
{-# INLINE pretty #-}
89+
8090
instance (Ord child, TopBottom child) => Semigroup (MultiOr child) where
8191
(MultiOr []) <> b = b
8292
a <> (MultiOr []) = a

0 commit comments

Comments
 (0)