
15 Oct
2021
15 Oct
'21
4:22 p.m.
On Thu, Oct 14, 2021 at 08:05:42PM +0000, Keith wrote:
As currently defined, `shift x minBound` calls `shiftR` with a negative displacement.
This would avoid that: ``` shift x n | n >= 0 = shiftL x n | n == minBound = shiftR (shiftR x maxBound) 1 | otherwise = shiftR x (-n) ```
That would require `Bits` to be a subclass of both `Ord` and `Bounded`; currently it is only a subclass of `Eq`, and I’d want to be very cautious about changing that. Regards, Seph -- Seph Shewell Brockway, BSc MSc (Glas.) Pronouns: she/her