HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleAgda-2.7.0.1Haskell2010

Agda.Utils.Maybe.Strict

A strict version of the Maybe type.

Import qualified, as in import qualified Agda.Utils.Maybe.Strict as Strict

  • 1 type
  • 1 class
  • 20 values
  • PackageAgda-2.7.0.1
  • Exports22
  • LanguageHaskell2010
  • LicenceMIT
  • SourceStrict.hs
datadata Maybe a
#

The type of strict optional values.

Constructors

Instances64Functor, Applicative, Foldable, Traversable, Eq1, Ord1, …
valuefromMaybe :: a -> Maybe a -> a
#

Given a default value and a Maybe, yield the default value if the Maybe argument is Nothing and extract the value out of the Just otherwise.

valuemaybe :: b -> (a -> b) -> Maybe a -> b
#

Given a default value, a function and a Maybe value, yields the default value if the Maybe value is Nothing and applies the function to the value stored in the Just otherwise.

classclass Strict lazy strict | lazy -> strict, strict -> lazy where
#

Ad hoc conversion between "strict" and "lazy" versions of a structure.

Unfortunately all externally defined instances are doomed to be orphans: https://gitlab.haskell.org/ghc/ghc/-/issues/11999 See also https://qfpl.io/posts/orphans-and-fundeps/index.html for

Methods

Instances10Strict, …
valuecaseMaybe :: Maybe a -> b -> (a -> b) -> b
#

Version of maybe with different argument ordering. Often, we want to case on a Maybe, do something interesting in the Just case, but only a default action in the Nothing case. Then, the argument ordering of caseMaybe is preferable.

caseMaybe m err f = flip (maybe err) m f

Orphan instances

2 instances