A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/liberal_type_synonyms.html below:

Website Navigation


6.4.5. Liberalised type synonyms — Glasgow Haskell Compiler 9.12.2 User's Guide

6.4.5. Liberalised type synonyms¶
LiberalTypeSynonyms¶
Implies:

ExplicitForAll

Since:

6.8.1

Relax many of the Haskell 98 rules on type synonym definitions.

Type synonyms are like macros at the type level, but Haskell 98 imposes many rules on individual synonym declarations. With the LiberalTypeSynonyms extension, GHC does validity checking on types only after expanding type synonyms. That means that GHC can be very much more liberal about type synonyms than Haskell 98.

GHC does kind checking before expanding synonyms.

After expanding type synonyms, GHC does validity checking on types, looking for the following malformedness which isn’t detected simply by kind checking:

So, for example, this will be rejected:

type Pr = forall a. a

h :: [Pr]
h = ...

because GHC does not allow type constructors applied to for-all types.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4