repa-scalar-4.2.0.3: Scalar data types and conversions.

Safe HaskellSafe
LanguageHaskell98

Data.Repa.Scalar.Option

Contents

Description

Option types are synonyms for Maybe a, Maybe (a, b) and so on, which are strict in the components.

Synopsis

Single component

data Option a Source

A strict Maybe type.

Constructors

Some !a 
None 

Instances

Eq a => Eq (Option a) Source 
Ord a => Ord (Option a) Source 
Show a => Show (Option a) Source 

fromOption :: Option a -> Maybe a Source

Convert an Option to a Maybe.

toOption :: Maybe a -> Option a Source

Convert a Maybe to an Option.

Two components

data Option2 a b Source

A strict Maybe type, with two parameters.

Constructors

Some2 !a !b 
None2 

Instances

(Eq a, Eq b) => Eq (Option2 a b) Source 
(Ord a, Ord b) => Ord (Option2 a b) Source 
(Show a, Show b) => Show (Option2 a b) Source 

fromOption2 :: Option2 a b -> Maybe (a, b) Source

Convert an Option2 to a Maybe.

toOption2 :: Maybe (a, b) -> Option2 a b Source

Convert a Maybe to an Option2.

Three components

data Option3 a b c Source

A strict Maybe type with three parameters.

Constructors

Some3 !a !b !c 
None3 

Instances

(Eq a, Eq b, Eq c) => Eq (Option3 a b c) Source 
(Ord a, Ord b, Ord c) => Ord (Option3 a b c) Source 
(Show a, Show b, Show c) => Show (Option3 a b c) Source 

fromOption3 :: Option3 a b c -> Maybe (a, b, c) Source

Convert an Option2 to a Maybe.

toOption3 :: Maybe (a, b, c) -> Option3 a b c Source

Convert a Maybe to an Option3.

Four components

data Option4 a b c d Source

A strict Maybe type with four parameters.

Constructors

Some4 !a !b !c !d 
None4 

Instances

(Eq a, Eq b, Eq c, Eq d) => Eq (Option4 a b c d) Source 
(Ord a, Ord b, Ord c, Ord d) => Ord (Option4 a b c d) Source 
(Show a, Show b, Show c, Show d) => Show (Option4 a b c d) Source 

fromOption4 :: Option4 a b c d -> Maybe (a, b, c, d) Source

Convert an Option2 to a Maybe.

toOption4 :: Maybe (a, b, c, d) -> Option4 a b c d Source

Convert a Maybe to an Option4.