Skip to content

Commit 1037ee1

Browse files
better Show for MaybeEmpty lol
1 parent 7356dfd commit 1037ee1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Data/Unfoldable/MaybeEmpty.purs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ newtype MaybeEmpty :: forall k. (k -> Type) -> k -> Type
4040
newtype MaybeEmpty f a = MaybeEmpty (Maybe (f a))
4141

4242
derive instance Newtype (MaybeEmpty f a) _
43-
derive newtype instance Show (f a) => Show (MaybeEmpty f a)
4443
derive newtype instance Arbitrary (f a) => Arbitrary (MaybeEmpty f a)
4544
derive newtype instance Coarbitrary (f a) => Coarbitrary (MaybeEmpty f a)
4645
derive newtype instance Semigroup (f a) => Semigroup (MaybeEmpty f a)
@@ -51,6 +50,9 @@ derive instance Generic (MaybeEmpty f a) _
5150
derive instance Eq1 f => Eq1 (MaybeEmpty f)
5251
derive instance Ord1 f => Ord1 (MaybeEmpty f)
5352

53+
instance maybeEmptyShow :: (Show (f a)) => Show (MaybeEmpty f a) where
54+
show (MaybeEmpty m) = "(MaybeEmpty " <> show m <> ")"
55+
5456
instance (Eq1 f, Eq a) => Eq (MaybeEmpty f a) where
5557
eq (MaybeEmpty Nothing) (MaybeEmpty Nothing) = true
5658
eq (MaybeEmpty x) (MaybeEmpty y) = (eq1 <$> x <*> y) == Just true

0 commit comments

Comments
 (0)