We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 24f9cd2 + f9bef52 commit 96a0c16Copy full SHA for 96a0c16
src/Data/These.purs
@@ -20,6 +20,8 @@ import Prelude
20
, Functor
21
, Monad
22
, Semigroup
23
+ , Show
24
+ , show
25
, pure
26
, id )
27
@@ -94,6 +96,11 @@ instance bindThese :: (Semigroup a) => Bind (These a) where
94
96
95
97
instance monadThese :: (Semigroup a) => Monad (These a)
98
99
+instance showThese :: (Show a, Show b) => Show (These a b) where
100
+ show (This x) = "This (" <> show x <> ")"
101
+ show (That y) = "That (" <> show y <> ")"
102
+ show (Both x y) = "Both (" <> show x <> ") (" <> show y <> ")"
103
+
104
these :: forall a b c. (a -> c) -> (b -> c) -> (a -> b -> c) -> These a b -> c
105
these l _ _ (This a) = l a
106
these _ r _ (That x) = r x
0 commit comments