ghc-source-gen-0.4.3.0: Constructs Haskell syntax trees for the GHC API.
Safe HaskellNone
LanguageHaskell2010

GHC.SourceGen.Type

Description

This module provides combinators for constructing Haskell types.

Synopsis

Documentation

type HsType' = HsType GhcPs Source #

A Haskell type, as it is represented after the parsing step.

Instances:

tyPromotedVar :: RdrNameStr -> HsType' Source #

A promoted name, for example from the DataKinds extension.

(-->) :: HsType' -> HsType' -> HsType' infixr 0 Source #

A function type.

a -> b
=====
var "a" --> var "b"

forall' :: [HsTyVarBndrS'] -> HsType' -> HsType' Source #

A type variable binding.

forall a . T a
=====
forall' [bvar "a"] $ var "T" @@ var "a"

type HsTyVarBndr' = HsTyVarBndr GhcPs Source #

A type variable binding, as it is represented after the parsing step.

Construct with either bVar (for regular type variables) or kindedVar (for kind signatures).

Instances:

(==>) :: [HsType'] -> HsType' -> HsType' infixr 0 Source #

Qualify a type with constraints.

(F x, G x) => x
=====
[var "F" @@ var "x", var "G" @@ var "x"] ==> var "x"

kindedVar :: OccNameStr -> HsType' -> HsTyVarBndr' Source #

A type variable with a kind signature.

x :: A
=====
kindedVar "x" (var "A")