HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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

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