This module contains type synonyms to represent type synonyms. A collection of type synonyms can always be ordered, since (mutually) recursive type synonyms are not permitted. The ordering of type synonyms must be determined to find a minimal number of unfold steps to make two types syntactically equivalent.
- type TypeSynonyms = Map String (Int, Tps -> Tp)
- type TypeSynonymOrdering = Map String Int
- type OrderedTypeSynonyms = (TypeSynonymOrdering, TypeSynonyms)
- noOrderedTypeSynonyms :: OrderedTypeSynonyms
- stringAsTypeSynonym :: OrderedTypeSynonyms
- getTypeSynonymOrdering :: TypeSynonyms -> (TypeSynonymOrdering, [[String]])
- isPhantomTypeSynonym :: OrderedTypeSynonyms -> String -> Bool
- expandType :: TypeSynonyms -> Tp -> Tp
- expandTypeConstructor :: TypeSynonyms -> Tp -> Tp
- expandToplevelTC :: OrderedTypeSynonyms -> Tp -> Maybe Tp
- expandTypeConstructorOneStep :: TypeSynonyms -> Tp -> Maybe Tp
- expandOneStepOrdered :: OrderedTypeSynonyms -> (Tp, Tp) -> Maybe (Tp, Tp)
A (unordered) collection of type synonyms is represented by a finite map of strings (the name of the type synonym) to pairs that have an int (the number of arguments of the type synonym) and a function.
An ordering of type synonyms maps a name of a type synonym to a position in the ordering.
An (unordered) collection of type synonyms, together with an ordering.
Order a collection of type synonyms, and return this ordering paired with sets of mutually recursive type synonyms that are detected.
Expansion of a type
Fully expand the top-level type constructor.
Try to expand the top-level type constructor one step.