You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
even and odd are defined generically as combinators rather than as typeclass methods.
even :: (P.Eq a, Integral a) => a -> P.Bool
even n = n `rem` (one + one) P.== zero
However, for most hardware-backed Integral types Int, Int64 etc there will be a likely much more efficient implementation by bit testing the lowest bit in the register.
If these were overridable on the Integral class, it might permit this specialization.
The text was updated successfully, but these errors were encountered:
Just something to consider..
even
andodd
are defined generically as combinators rather than as typeclass methods.However, for most hardware-backed Integral types
Int
,Int64
etc there will be a likely much more efficient implementation by bit testing the lowest bit in the register.If these were overridable on the Integral class, it might permit this specialization.
The text was updated successfully, but these errors were encountered: