serokell / o-clock

:hourglass: Type-safe time units in Haskell
Mozilla Public License 2.0
49 stars 6 forks source link

Remove `Num` instance? #106

Closed vrom911 closed 6 years ago

vrom911 commented 6 years ago

We already have had the conversation about Num instance for Time (#14 – issue, #13 – discussion in comments). Time multiplication doesn't make any sense so we agreed on having error on illegal actions from Num class just to have fromInteger that we needed for convenience. And, based on feedback, people don't agree that error is acceptable way, so it's better to get rid of any distrustful code we have. I would like to ask you @ChShersh @int-index if you're also voting for removing these instances?

chshersh commented 6 years ago

I agree with @vrom911 here. Recently I started to value type-safety more than convenience. It's such a pity that we don't have FromInteger type class with only single method. But probably after Compiletime literals are implemented somehow in GHC, we could make interface of o-clock more convenient.

int-index commented 6 years ago

I was against this instance in the first place.