Skip to content

Commit 82afda8

Browse files
committed
add Bool, CBool instances
1 parent b64fabb commit 82afda8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Data/Default/Internal.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class Default a where
9898
default def :: (Generic a, GDefault (Rep a)) => a
9999
def = to gdef
100100

101+
instance Default Bool where def = False
101102
instance Default Int where def = 0
102103
instance Default Int8 where def = 0
103104
instance Default Int16 where def = 0
@@ -115,6 +116,9 @@ instance (Integral a) => Default (Ratio a) where def = 0
115116
instance (Default a, RealFloat a) => Default (Complex a) where def = def :+ def
116117
instance (HasResolution a) => Default (Fixed a) where def = 0
117118

119+
#if MIN_VERSION_base(4, 10, 0)
120+
instance Default CBool where def = 0
121+
#endif
118122
instance Default CShort where def = 0
119123
instance Default CUShort where def = 0
120124
instance Default CInt where def = 0

0 commit comments

Comments
 (0)