repa-scalar-4.2.4.0: Scalar data types and conversions.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Repa.Scalar.Option

Description

Option types are similar to Maybe a, Maybe (a, b) and so on, except they are directly unpacked into the constructor and are strict in each component.

Synopsis

Single component

data Option a Source #

A strict Maybe type.

Constructors

Some !a 
None 

Instances

Instances details
Functor Option Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

fmap :: (a -> b) -> Option a -> Option b #

(<$) :: a -> Option b -> Option a #

Show a => Show (Option a) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

showsPrec :: Int -> Option a -> ShowS #

show :: Option a -> String #

showList :: [Option a] -> ShowS #

Eq a => Eq (Option a) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

(==) :: Option a -> Option a -> Bool #

(/=) :: Option a -> Option a -> Bool #

Ord a => Ord (Option a) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

compare :: Option a -> Option a -> Ordering #

(<) :: Option a -> Option a -> Bool #

(<=) :: Option a -> Option a -> Bool #

(>) :: Option a -> Option a -> Bool #

(>=) :: Option a -> Option a -> Bool #

max :: Option a -> Option a -> Option a #

min :: Option a -> Option a -> Option a #

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

Instances details
Functor (Option2 a) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

fmap :: (a0 -> b) -> Option2 a a0 -> Option2 a b #

(<$) :: a0 -> Option2 a b -> Option2 a a0 #

(Show a, Show b) => Show (Option2 a b) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

showsPrec :: Int -> Option2 a b -> ShowS #

show :: Option2 a b -> String #

showList :: [Option2 a b] -> ShowS #

(Eq a, Eq b) => Eq (Option2 a b) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

(==) :: Option2 a b -> Option2 a b -> Bool #

(/=) :: Option2 a b -> Option2 a b -> Bool #

(Ord a, Ord b) => Ord (Option2 a b) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

compare :: Option2 a b -> Option2 a b -> Ordering #

(<) :: Option2 a b -> Option2 a b -> Bool #

(<=) :: Option2 a b -> Option2 a b -> Bool #

(>) :: Option2 a b -> Option2 a b -> Bool #

(>=) :: Option2 a b -> Option2 a b -> Bool #

max :: Option2 a b -> Option2 a b -> Option2 a b #

min :: Option2 a b -> Option2 a b -> Option2 a b #

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

Instances details
Functor (Option3 a b) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

fmap :: (a0 -> b0) -> Option3 a b a0 -> Option3 a b b0 #

(<$) :: a0 -> Option3 a b b0 -> Option3 a b a0 #

(Show a, Show b, Show c) => Show (Option3 a b c) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

showsPrec :: Int -> Option3 a b c -> ShowS #

show :: Option3 a b c -> String #

showList :: [Option3 a b c] -> ShowS #

(Eq a, Eq b, Eq c) => Eq (Option3 a b c) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

(==) :: Option3 a b c -> Option3 a b c -> Bool #

(/=) :: Option3 a b c -> Option3 a b c -> Bool #

(Ord a, Ord b, Ord c) => Ord (Option3 a b c) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

compare :: Option3 a b c -> Option3 a b c -> Ordering #

(<) :: Option3 a b c -> Option3 a b c -> Bool #

(<=) :: Option3 a b c -> Option3 a b c -> Bool #

(>) :: Option3 a b c -> Option3 a b c -> Bool #

(>=) :: Option3 a b c -> Option3 a b c -> Bool #

max :: Option3 a b c -> Option3 a b c -> Option3 a b c #

min :: Option3 a b c -> Option3 a b c -> Option3 a b c #

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

Instances details
Functor (Option4 a b c) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

fmap :: (a0 -> b0) -> Option4 a b c a0 -> Option4 a b c b0 #

(<$) :: a0 -> Option4 a b c b0 -> Option4 a b c a0 #

(Show a, Show b, Show c, Show d) => Show (Option4 a b c d) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

showsPrec :: Int -> Option4 a b c d -> ShowS #

show :: Option4 a b c d -> String #

showList :: [Option4 a b c d] -> ShowS #

(Eq a, Eq b, Eq c, Eq d) => Eq (Option4 a b c d) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

(==) :: Option4 a b c d -> Option4 a b c d -> Bool #

(/=) :: Option4 a b c d -> Option4 a b c d -> Bool #

(Ord a, Ord b, Ord c, Ord d) => Ord (Option4 a b c d) Source # 
Instance details

Defined in Data.Repa.Scalar.Option

Methods

compare :: Option4 a b c d -> Option4 a b c d -> Ordering #

(<) :: Option4 a b c d -> Option4 a b c d -> Bool #

(<=) :: Option4 a b c d -> Option4 a b c d -> Bool #

(>) :: Option4 a b c d -> Option4 a b c d -> Bool #

(>=) :: Option4 a b c d -> Option4 a b c d -> Bool #

max :: Option4 a b c d -> Option4 a b c d -> Option4 a b c d #

min :: Option4 a b c d -> Option4 a b c d -> Option4 a b c d #

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.