Skip to content

Commit 0d42885

Browse files
committed
generic default instances: left bias in sum types
1 parent 8d60331 commit 0d42885

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Data/Default.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ instance (Default a) => GDefault (K1 i a) where
8282
instance (GDefault a, GDefault b) => GDefault (a :*: b) where
8383
gdef = gdef :*: gdef
8484

85+
instance (GDefault a) => GDefault (a :+: b) where
86+
gdef = L1 gdef
87+
8588
instance (GDefault a) => GDefault (M1 i c a) where
8689
gdef = M1 gdef
8790

0 commit comments

Comments
 (0)