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
Erlang numbers do not admit NaN or infinity values, and division by zero raises an error. The types in the EuclidianRing instance div :: Number -> Number -> Number is thus a lie.
Options:
Remove the EuclidianRing instance (and maybe provide a div that is in Effect or returns a Maybe)
Represent Number as something like number() | nan | infinity | minusinfinity with corresponding code on all operations
I suspect that really both make sense and the question is which gets to be called Number here.
The text was updated successfully, but these errors were encountered:
I have an untested but carefully written implementation of f64 math in erlang, adding +inf, -inf and NaN. If anyone wants it as a baseline for implementing this, I'd be happy to send it. I'm in the purescript discord, @ me in the #purerl channel. I'm not entirely convinced it wouldn't move the problem elsewhere, though; any other erlang code that thinks it's getting a float might now get an atom.
Erlang numbers do not admit
NaN
orinfinity
values, and division by zero raises an error. The types in theEuclidianRing
instancediv :: Number -> Number -> Number
is thus a lie.Options:
EuclidianRing
instance (and maybe provide adiv
that is inEffect
or returns aMaybe
)Number
as something likenumber() | nan | infinity | minusinfinity
with corresponding code on all operationsI suspect that really both make sense and the question is which gets to be called
Number
here.The text was updated successfully, but these errors were encountered: