Skip to content
Cinch
← Data.Option API referenceSAMPLE LISTING
cinch-base / 0.1.0Data/Option.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.Option where
3-- Either a present value or its absence.
4data Option a
5-- None :: Option a
6-- Some :: a -> Option a
7
8-- Apply a function to a present value. None remains None.
9map :: forall a b. (a -> b) -> Option a -> Option b
11-- Extract a present value, or return the supplied default.
12with-default :: forall a. a -> Option a -> a
14-- Report whether a value is present.
15is-some :: forall a. Option a -> Bool