Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply functor instantiation map to types
If a functor contains both a newtype and a type synonym referring to the newtype, then during instantiation we must apply the instantiation map to the types in the functor, so that the type synonym now refers to the instantiated newtype instead. Previously, we only applied type substitutions to the types in the functor, which would replace type variables with concrete types defined in the functor arguments, but would not replace any actual names. (Confusingly, the code refers to the instantiation map as "value substitutions" even though it can contain names in the type namespace. The "type substitutions" and "value substitutions" are better thought of as "TVar -> Type mappings" and "Name -> Name mappings".) Fixes #1590.
- Loading branch information