gdp-0.0.0.2: Reason about invariants and preconditions with ghosts of departed proofs.

Copyright(c) Matt Noonan 2018
LicenseBSD-style
Maintainermatt.noonan@gmail.com
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.The

Description

 

Synopsis

Documentation

class The d a | d -> a where Source #

A class for extracing "the" underlying value. the should ideally be a coercion from some newtype wrap of a back to a.

For this common use case, in the module where newtype New a = New a is defined, an instance of The can be created with an empty definition:

newtype New a = New a
instance The (New a) a

Methods

the :: d -> a Source #

the :: Coercible d a => d -> a Source #

Instances

The (Named name a) a Source # 

Methods

the :: Named name a -> a Source #

The (Satisfies p a) a Source # 

Methods

the :: Satisfies p a -> a Source #

The a' a => The ((:::) a' p) a Source # 

Methods

the :: (a' ::: p) -> a Source #

pattern The :: The d a => a -> d Source #

A view pattern for discarding the wrapper around a value.

f (The x) = expression x

is equivalent to

f x = let x' = the x in expression x'