Skip to content

Commit dbef11b

Browse files
ethulgaryb
authored andcommitted
Adding Generic instance for HugeInt (#8)
* Adding Generic instance for HugeInt * Opting for derive instead of derive newtype
1 parent 161fdd9 commit dbef11b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Data/HugeInt.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Data.HugeInt
1919
import Prelude
2020

2121
import Data.String (length, drop, takeWhile)
22+
import Data.Generic (class Generic)
2223
import Data.Int (toNumber)
2324
import Data.Int (round) as Int
2425
import Data.Maybe (Maybe(..))
@@ -27,6 +28,8 @@ import Data.HugeNum as HN
2728

2829
newtype HugeInt = HugeInt HugeNum
2930

31+
derive instance genericHugeInt :: Generic HugeInt
32+
3033
instance eqHugeInt :: Eq HugeInt where
3134
eq (HugeInt h1) (HugeInt h2) = h1 == h2
3235

0 commit comments

Comments
 (0)