Copyright | (C) 2018 QBayLogic B.V. |
---|---|

License | BSD2 (see the file LICENSE) |

Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |

Safe Haskell | Trustworthy |

Language | Haskell2010 |

Hidden arguments

# Documentation

type Hidden (x :: Symbol) a = IP x a Source #

A value reflected to, or *hiding* at, the *Constraint* level

e.g. a function:

f :: Hidden "foo" Int => Bool -> Int f = ...

has a *normal* argument of type `Bool`

, and a *hidden* argument called "foo"
of type `Int`

. In order to apply the `Int`

argument we have to use the
`expose`

function, so that the *hidden* argument becomes a normal argument
again.

### Original implementation

`Hidden`

used to be implemented by:

class Hidden (x :: Symbol) a | x -> a where hidden :: a

which is equivalent to *IP*, except that *IP* has magic inference rules
bestowed by GHC so that there's never any ambiguity. We need these magic
inference rules so we don't end up in type inference absurdity where asking
for the type of an type-annotated value results in a *no-instance-in-scope*
error.