Skip to content
Cinch
← Data.Result API referenceSAMPLE LISTING
cinch-base / 0.1.0Data/Result.cinch

Declaration source.

This sample listing contains the declarations shown in the API reference. Package implementations will appear here when real package data is connected.

module Data.Result where
3-- A successful value or a recoverable error.
4data Result e a
5-- Err :: e -> Result e a
6-- Ok :: a -> Result e a
7
8-- Transform a successful result, preserving an error.
9map :: forall e a b. (a -> b) -> Result e a -> Result e b
11-- Transform the error while leaving successful values alone.
12map-error :: forall e f a. (e -> f) -> Result e a -> Result f a