Copyright | (C) 2015 Edward Kmett |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Stability | experimental |

Portability | non-portable |

Safe Haskell | Safe |

Language | Haskell2010 |

The idea for this trick comes from Dimitrios Vytiniotis.

- data UnsatisfiedConstraint = UnsatisfiedConstraint String
- class Deferrable p where
- defer :: forall proxy p r. Deferrable p => proxy p -> (p => r) -> r
- deferred :: forall p. Deferrable p :- p

# Documentation

data UnsatisfiedConstraint Source #

class Deferrable p where Source #

Allow an attempt at resolution of a constraint at a later time

deferEither :: proxy p -> (p => r) -> Either String r Source #

Resolve a `Deferrable`

constraint with observable failure.

(Deferrable a, Deferrable b) => Deferrable (a, b) Source # | |

(Typeable * a, Typeable * b) => Deferrable ((~) * a b) Source # | |

(Deferrable a, Deferrable b, Deferrable c) => Deferrable (a, b, c) Source # | |

defer :: forall proxy p r. Deferrable p => proxy p -> (p => r) -> r Source #

Defer a constraint for later resolution in a context where we want to upgrade failure into an error

deferred :: forall p. Deferrable p :- p Source #