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
When a TypeVariable with typeclass constraints are unified with a TypeOperator, the type system (i.e., unify in hindley_milner.py) does not check to see if the TypeOperator is actually a member of the required typeclasses. As a result of this, some TypeErrors related to typeclass membership will not be raised until function-call time (as opposed to function-compose time).
For example, consider show (of the Show typeclass). When show is composed with id, the typeclass constraints will be unified and the composed function will have the correct constrained type. If you compose show with a function with a concrete (TypeVariable) output type which is not a member of Show, the type inference system will not check the constraint and raise a TypeError until the composed function is actually called.
The text was updated successfully, but these errors were encountered:
BTW you can try to add an option for Arrow in the fresh function since you might encounter the function with sig (int -> int) be copyed into (-> int int), which looks terrible...
Actually not just Arrow entry, you might need to add Tuple and List as well...
p.s. I do appreciate this awesome project, but it seems to be dead for quite a while... I feel sorry about it.
When a
TypeVariable
with typeclass constraints are unified with aTypeOperator
, the type system (i.e.,unify
in hindley_milner.py) does not check to see if theTypeOperator
is actually a member of the required typeclasses. As a result of this, some TypeErrors related to typeclass membership will not be raised until function-call time (as opposed to function-compose time).For example, consider
show
(of theShow
typeclass). Whenshow
is composed withid
, the typeclass constraints will be unified and the composed function will have the correct constrained type. If you composeshow
with a function with a concrete (TypeVariable
) output type which is not a member ofShow
, the type inference system will not check the constraint and raise aTypeError
until the composed function is actually called.The text was updated successfully, but these errors were encountered: