Proposal: add `Proxy`fied versions of `bitSizeMaybe` and `finiteBitSize`

David Feuer david.feuer at gmail.com
Thu Dec 14 04:19:47 UTC 2017


+1, but we should also do this for sizeOf and alignment in Foreign.Storable.

On Dec 13, 2017 10:53 PM, "M Farkas-Dyck" <strake888 at gmail.com> wrote:

> 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.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20171213/0282553c/attachment.html>


More information about the Libraries mailing list