M Farkas-Dyck
2017-12-14 03:48:10 UTC
I propose to add the following methods to `Bits` and `FiniteBits` classes:
class Bits a where
...
bitSizeMaybe' :: Proxy a -> Maybe Int
class FiniteBits b where
...
finiteBitSize' :: Proxy b -> Int
Rationale: working with an arbitrary `Bits a => a`, one may not have a value of type `a` as argument to `bitSizeMaybe` or `finiteBitSize`, and writing `undefined` makes me feel dirty.
class Bits a where
...
bitSizeMaybe' :: Proxy a -> Maybe Int
class FiniteBits b where
...
finiteBitSize' :: Proxy b -> Int
Rationale: working with an arbitrary `Bits a => a`, one may not have a value of type `a` as argument to `bitSizeMaybe` or `finiteBitSize`, and writing `undefined` makes me feel dirty.