gdp-0.0.3.0: 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
  • class The d a | d -> a where
  • pattern The :: The d a => a -> d

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

Minimal complete definition

Nothing

Methods

the :: d -> a Source #

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

Instances
The (Satisfies p a) a Source # 
Instance details

Defined in Data.Refined

Methods

the :: Satisfies p a -> a Source #

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

Defined in Data.Refined

Methods

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

The (Named name a) a Source # 
Instance details

Defined in Theory.Named

Methods

the :: Named name a -> 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'