A typeclass for byte operations?
dons at galois.com
Thu Feb 19 19:12:01 EST 2009
> On Thu, 19 Feb 2009, Don Stewart wrote:
>>> In contrast to Data.Bits it should use the proper parameter order, e.g.
>>> rotateBytes :: Int -> a -> a
>> Proper in the Okasaki sense?
> Unfortunately I don't know what Okasaki's sense is, but I refered to this
You made me go and dig through the archives!
In response to questions about why the convention of putting the
data structure as the last argument...
This style supports multiple operations nicely, especially with
combined with the $ operator. For example, to insert 3 elements
into a set, you can say
insert 1 $ insert 2 $ insert 3 $ someSet
(the last $ is optional). With the other argument ordering, you
insert (insert (insert someSet 3) 2) 1
See the entire thread:
More information about the Libraries