Safe Haskell | Safe |
---|---|
Language | Haskell98 |
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
- data Option a
- fromOption :: Option a -> Maybe a
- toOption :: Maybe a -> Option a
- data Option2 a b
- fromOption2 :: Option2 a b -> Maybe (a, b)
- toOption2 :: Maybe (a, b) -> Option2 a b
- data Option3 a b c
- fromOption3 :: Option3 a b c -> Maybe (a, b, c)
- toOption3 :: Maybe (a, b, c) -> Option3 a b c
- data Option4 a b c d
- fromOption4 :: Option4 a b c d -> Maybe (a, b, c, d)
- toOption4 :: Maybe (a, b, c, d) -> Option4 a b c d
Single component
A strict Maybe
type.
Two components
A strict Maybe
type, with two parameters.
Instances
Functor (Option2 a) Source # | |
(Eq a, Eq b) => Eq (Option2 a b) Source # | |
(Ord a, Ord b) => Ord (Option2 a b) Source # | |
Defined in Data.Repa.Scalar.Option | |
(Show a, Show b) => Show (Option2 a b) Source # | |
Three components
A strict Maybe
type with three parameters.
Instances
Functor (Option3 a b) Source # | |
(Eq a, Eq b, Eq c) => Eq (Option3 a b c) Source # | |
(Ord a, Ord b, Ord c) => Ord (Option3 a b c) Source # | |
Defined in Data.Repa.Scalar.Option 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 # | |
(Show a, Show b, Show c) => Show (Option3 a b c) Source # | |
Four components
A strict Maybe
type with four parameters.
Instances
Functor (Option4 a b c) Source # | |
(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 # | |
Defined in Data.Repa.Scalar.Option 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 # | |
(Show a, Show b, Show c, Show d) => Show (Option4 a b c d) Source # | |