ddc-source-tetra-0.4.2.1: Disciplined Disciple Compiler source language.

Safe HaskellNone
LanguageHaskell98

DDC.Source.Tetra.Transform.Expand

Description

Look at type signatures and add quantifiers to bind any free type variables. Also add holes for missing type arguments.

Given

   mapS (f : a -> S e b) (xx : List a) : S e (List b)
    = box case xx of
       Nil        -> Nil
       Cons x xs  -> Cons (run f x) (run mapS f xs)

We get:

   mapS [a e b : ?] (f : a -> S e b) (xx : List a) : S e (List b)
    = /(a e b : ?). box case xx of
       Nil        -> Nil
       Cons x xs  -> Cons (run f x) (run mapS [?] [?] [?] f xs)

Synopsis

Documentation

data Config l Source

Expander configuration.

Constructors

Config 

Fields

configMakeTypeHole :: Kind (GName l) -> Type (GName l)

Make a type hole of the given kind.

configDefault :: (GName l ~ Name) => Config l Source

Default expander configuration.

class ExpandLanguage l => Expand c l where Source

Methods

expand :: Ord (GName l) => Config l -> KindEnv (GName l) -> TypeEnv (GName l) -> c l -> c l Source

Add quantifiers to the types of binders. Also add holes for missing type arguments.

Instances

ExpandLanguage l => Expand GGuard l Source 
ExpandLanguage l => Expand GGuardedExp l Source 
ExpandLanguage l => Expand GAlt l Source 
ExpandLanguage l => Expand GExp l Source 
ExpandLanguage l => Expand Top l Source 
ExpandLanguage l => Expand Module l Source