ghc-8.4.4: The GHC API

Safe HaskellNone




classifyTyCons Source #


:: UniqFM Bool

type constructor vectorisation status

-> NameSet

tycons involving parallel arrays

-> [TyCon]

type constructors that need to be classified

-> ([TyCon], [TyCon], [TyCon], [TyCon]) 

From a list of type constructors, extract those that can be vectorised, returning them in two sets, where the first result list must be vectorised and the second result list need not be vectorised. The third result list are those type constructors that we cannot convert (either because they use language extensions or because they dependent on type constructors for which no vectorised version is available).

NB: In order to be able to vectorise a type constructor, we require members of the depending set (i.e., those type constructors that the current one depends on) to be vectorised only if they are also parallel (i.e., appear in the second argument to the function).

The first argument determines the conversion status of external type constructors as follows:

  • tycons which have converted versions are mapped to True
  • tycons which are not changed by vectorisation are mapped to False
  • tycons which haven't been converted (because they can't or weren't vectorised) are not elements of the map