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
The length function from Universum.Container.Class module returns Int, and we can return Natural there and make it type-safe because it is obvious that the size of the container is always non-negative. It will avoid unnecessary fromIntegral @Int @Natural conversions that seem unsafe at first glance.
If there are functions with a similar invariant that also return Int, they should also be changed.
The text was updated successfully, but these errors were encountered:
DK318
added a commit
to DK318/universum
that referenced
this issue
Nov 3, 2021
The
length
function fromUniversum.Container.Class
module returnsInt
, and we can returnNatural
there and make it type-safe because it is obvious that the size of the container is always non-negative. It will avoid unnecessaryfromIntegral @Int @Natural
conversions that seem unsafe at first glance.If there are functions with a similar invariant that also return
Int
, they should also be changed.The text was updated successfully, but these errors were encountered: