Skip to content

Commit

Permalink
generic default instances: left bias in sum types
Browse files Browse the repository at this point in the history
  • Loading branch information
mauke committed Oct 21, 2024
1 parent cd9d5cf commit 81e576d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Data/Default.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ instance (Default a) => GDefault (K1 i a) where
instance (GDefault a, GDefault b) => GDefault (a :*: b) where
gdef = gdef :*: gdef

instance (GDefault a) => GDefault (a :+: b) where
gdef = L1 gdef

instance (GDefault a) => GDefault (M1 i c a) where
gdef = M1 gdef

Expand Down

0 comments on commit 81e576d

Please sign in to comment.