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
val eqlNull : 'a -> box:'a Js.null -> bool
val eqOpt : 'a -> box:'a option -> bool
note null =~ null should return true
polymorphic comparison warning should emitted when it can not be specalized
Use cases:
eqNull ~null:(Array.getNull a 0) 3
otherwise, we have to check nullable and compare it later which is too verbose.
Do we need make use of nullary constructor?
eqOpt A ~box:v
eqNull A ~box:v
Note the option specialize is tricky:
when the left operand value is A, it can not be specialized A = None
when the left operand type is enum(not maybe_pointer), it still can not be specialized.
it can be only specialized based on the type of first argument, given the complexity introduced, we won't do it
The text was updated successfully, but these errors were encountered:
note
null =~ null
should return truepolymorphic comparison warning should emitted when it can not be specalized
Use cases:
otherwise, we have to check nullable and compare it later which is too verbose.
Do we need make use of
nullary constructor
?Note the option specialize is tricky:
A
, it can not be specializedA = None
enum
(not maybe_pointer), it still can not be specialized.it can be only specialized based on the type of first argument, given the complexity introduced, we won't do it
The text was updated successfully, but these errors were encountered: