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

Modulesqlite-simple-0.4.19.0Haskell2010

Database.SQLite.Simple.Ok

The Ok type is a simple error handler, basically equivalent to Either [SomeException].

One of the primary reasons why this type was introduced is that Either SomeException had not been provided an instance for Alternative, and it would have been a bad idea to provide an orphaned instance for a commonly-used type and typeclass included in base.

Extending the failure case to a list of SomeExceptions enables a more sensible Alternative instance definitions: <|> concatenates the list of exceptions when both cases fail, and empty is defined as 'Errors []'. Though <|> one could pick one of two exceptions, and throw away the other, and have empty provide a generic exception, this avoids cases where empty overrides a more informative exception and allows you to see all the different ways your computation has failed.

  • 2 types
datadata Ok a
#

Constructors

Instances9Monad, Functor, MonadFail, Applicative, Alternative, MonadPlus, …
  • Monad OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • Functor OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • MonadFail OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • Applicative OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • Alternative OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • MonadPlus OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • MonadThrow OkDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok
  • Eq a => Eq (Ok a)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok

    Two Errors cases are considered equal, regardless of what the list of exceptions looks like.

  • Show a => Show (Ok a)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Ok