HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

ModuleAgda-2.8.0.2Haskell2010

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
  • 21 values
  • PackageAgda-2.8.0.2
  • Exports23
  • LanguageHaskell2010
  • LicenceMIT
  • SourceStrict.hs
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.

datadata Maybe a
#

The type of strict optional values.

Constructors

Instances66Functor, Applicative, Foldable, Traversable, Eq1, Ord1, …
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