Copyright | (c) Melanie Brown 2023 |
---|---|
License | BSD3 (see the file LICENSE) |
Safe Haskell | None |
Language | GHC2021 |
Intervals over types and their operations.
Synopsis
- data Interval x
- pattern (:<>:) :: forall x. Ord x => x -> x -> Interval x
- pattern (:<|:) :: forall x. Ord x => x -> x -> Interval x
- pattern (:|>:) :: forall x. Ord x => x -> x -> Interval x
- pattern (:||:) :: forall x. Ord x => x -> x -> Interval x
- pattern (:--:) :: forall x. Ord x => x -> x -> Interval x
- pattern (:<->:) :: Ord x => Levitated x -> Levitated x -> Interval x
- pattern (:<-|:) :: Ord x => Levitated x -> Levitated x -> Interval x
- pattern (:|->:) :: Ord x => Levitated x -> Levitated x -> Interval x
- pattern (:|-|:) :: Ord x => Levitated x -> Levitated x -> Interval x
- pattern (:---:) :: forall x. Ord x => Levitated x -> Levitated x -> Interval x
- pattern Whole :: Ord x => Interval x
- (+/-) :: (Ord x, Num x) => x -> x -> Interval x
- (...) :: Ord x => (Levitated x, Extremum) -> (Levitated x, Extremum) -> Interval x
- interval :: Ord x => SomeBound (Levitated x) -> SomeBound (Levitated x) -> Interval x
- point :: Ord x => x -> Interval x
- bounds :: Interval x -> (SomeBound (Levitated x), SomeBound (Levitated x))
- lower :: Ord x => Interval x -> SomeBound (Levitated x)
- lowerBound :: Ord x => Interval x -> (Levitated x, Extremum)
- upper :: Ord x => Interval x -> SomeBound (Levitated x)
- upperBound :: Ord x => Interval x -> (Levitated x, Extremum)
- imin :: Ord x => Interval x -> Maybe (Levitated x)
- iinf :: Ord x => Interval x -> Levitated x
- isup :: Ord x => Interval x -> Levitated x
- imax :: Ord x => Interval x -> Maybe (Levitated x)
- imap :: (Ord x, Ord y) => (x -> y) -> Interval x -> Interval y
- imapLev :: (Ord x, Ord y) => (Levitated x -> Levitated y) -> Interval x -> Interval y
- itraverse :: (Ord x, Ord y, Applicative f) => (x -> f y) -> Interval x -> f (Interval y)
- itraverseLev :: (Ord x, Ord y, Applicative f) => (Levitated x -> f (Levitated y)) -> Interval x -> f (Interval y)
- open :: Ord x => Interval x -> Interval x
- close :: Ord x => Interval x -> Interval x
- openclosed :: Ord x => Interval x -> Interval x
- closedopen :: Ord x => Interval x -> Interval x
- openLower :: Ord x => Interval x -> Interval x
- closedLower :: Ord x => Interval x -> Interval x
- openUpper :: Ord x => Interval x -> Interval x
- closedUpper :: Ord x => Interval x -> Interval x
- setLower :: Ord x => Levitated x -> Interval x -> Interval x
- setUpper :: Ord x => Levitated x -> Interval x -> Interval x
- data Adjacency x
- = Before !(Interval x) !(Interval x)
- | Meets !(Interval x) !(Interval x) !(Interval x)
- | Overlaps !(Interval x) !(Interval x) !(Interval x)
- | Starts !(Interval x) !(Interval x)
- | During !(Interval x) !(Interval x) !(Interval x)
- | Finishes !(Interval x) !(Interval x)
- | Identical !(Interval x)
- | FinishedBy !(Interval x) !(Interval x)
- | Contains !(Interval x) !(Interval x) !(Interval x)
- | StartedBy !(Interval x) !(Interval x)
- | OverlappedBy !(Interval x) !(Interval x) !(Interval x)
- | MetBy !(Interval x) !(Interval x) !(Interval x)
- | After !(Interval x) !(Interval x)
- hull :: Ord x => Interval x -> Interval x -> Interval x
- hulls :: Ord x => NonEmpty (Interval x) -> Interval x
- within :: Ord x => Levitated x -> Interval x -> Bool
- converseAdjacency :: Adjacency x -> Adjacency x
- adjacency :: Ord x => Interval x -> Interval x -> Adjacency x
- intersect :: forall x. Ord x => Interval x -> Interval x -> Maybe (Interval x)
- union :: forall x. Ord x => Interval x -> Interval x -> OneOrTwo (Interval x)
- unions :: forall x. Ord x => [Interval x] -> [Interval x]
- unionsAsc :: forall x. Ord x => [Interval x] -> [Interval x]
- complement :: forall x. Ord x => Interval x -> Maybe (OneOrTwo (Interval x))
- difference :: forall x. Ord x => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x))
- (\\) :: forall x. Ord x => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x))
- symmetricDifference :: forall x. Ord x => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x))
- measure :: forall x. (Ord x, Num x) => Interval x -> Maybe x
- measuring :: forall y x. (Ord x, Num y) => (x -> x -> y) -> Interval x -> Maybe y
- hausdorff :: (Ord x, Num x) => Interval x -> Interval x -> Maybe x
- isSubsetOf :: Ord x => Interval x -> Interval x -> Bool
- data Extremum
- opposite :: Extremum -> Extremum
- data Bound ext x where
- unBound :: Bound ext x -> x
- class Opposite (Opposite ext) ~ ext => Bounding ext where
- compareBounds :: Ord x => Bound ext1 x -> Bound ext2 x -> Ordering
- data SomeBound x = forall ext.(Bounding ext, Bounding (Opposite ext)) => SomeBound !(Bound ext x)
- unSomeBound :: Ord x => SomeBound x -> x
- oppose :: SomeBound x -> SomeBound x
- data OneOrTwo x
The Interval type
Instances
(Ord x, Data x) => Data (Interval x) Source # | |
Defined in Data.Interval gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Interval x -> c (Interval x) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Interval x) # toConstr :: Interval x -> Constr # dataTypeOf :: Interval x -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Interval x)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Interval x)) # gmapT :: (forall b. Data b => b -> b) -> Interval x -> Interval x # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Interval x -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Interval x -> r # gmapQ :: (forall d. Data d => d -> u) -> Interval x -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Interval x -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Interval x -> m (Interval x) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Interval x -> m (Interval x) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Interval x -> m (Interval x) # | |
(Ord x, Generic x) => Generic (Interval x) Source # | |
(Ord x, Show x) => Show (Interval x) Source # | |
(Ord x, NFData x) => NFData (Interval x) Source # | |
Defined in Data.Interval | |
Ord x => Eq (Interval x) Source # | |
Ord x => Ord (Interval x) Source # | |
(Ord x, Hashable x) => Hashable (Interval x) Source # | |
Defined in Data.Interval | |
type Rep (Interval x) Source # | |
Construction
Finite intervals
pattern (:<>:) :: forall x. Ord x => x -> x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching finite open intervals.
pattern (:<|:) :: forall x. Ord x => x -> x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching finite open-closed intervals.
pattern (:|>:) :: forall x. Ord x => x -> x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching finite closed-open intervals.
pattern (:||:) :: forall x. Ord x => x -> x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching finite closed intervals.
pattern (:--:) :: forall x. Ord x => x -> x -> Interval x Source #
A unidirectional pattern synonym matching finite intervals,
that ignores the particular Bound
s.
Possibly-infinite intervals
The first four form a {-# COMPLETE #-}
set of bidirectional patterns,
and the final is a {-# COMPLETE #-}
unidirectional pattern on its own.
pattern (:<->:) :: Ord x => Levitated x -> Levitated x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching open intervals.
pattern (:<-|:) :: Ord x => Levitated x -> Levitated x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching open-closed intervals.
pattern (:|->:) :: Ord x => Levitated x -> Levitated x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching closed-open intervals.
pattern (:|-|:) :: Ord x => Levitated x -> Levitated x -> Interval x infix 5 Source #
A bidirectional pattern synonym matching closed intervals.
pattern (:---:) :: forall x. Ord x => Levitated x -> Levitated x -> Interval x Source #
A unidirectional pattern synonym ignoring the particular Bound
s.
Miscellaneous constructors
(...) :: Ord x => (Levitated x, Extremum) -> (Levitated x, Extremum) -> Interval x Source #
Given limits and Extremum
s, try to make an interval.
interval :: Ord x => SomeBound (Levitated x) -> SomeBound (Levitated x) -> Interval x Source #
Given SomeBound
s, try to make an interval.
Deconstruction
lower :: Ord x => Interval x -> SomeBound (Levitated x) Source #
Get the lower bound of an interval.
lower = fst . bounds
lowerBound :: Ord x => Interval x -> (Levitated x, Extremum) Source #
Get the lower bound of an interval (with the bound expressed at the term level).
upper :: Ord x => Interval x -> SomeBound (Levitated x) Source #
Get the upper bound of an interval.
upper = snd . bounds
upperBound :: Ord x => Interval x -> (Levitated x, Extremum) Source #
Get the upper bound of an interval (with the bound expressed at the term level).
imin :: Ord x => Interval x -> Maybe (Levitated x) Source #
Get the minimum of an interval, if it exists.
iinf :: Ord x => Interval x -> Levitated x Source #
Get the infimum of an interval, weakening if necessary.
isup :: Ord x => Interval x -> Levitated x Source #
Get the supremum of an interval, weakening if necessary.
imax :: Ord x => Interval x -> Maybe (Levitated x) Source #
Get the maximum of an interval, if it exists.
Modification
itraverse :: (Ord x, Ord y, Applicative f) => (x -> f y) -> Interval x -> f (Interval y) Source #
Since the Ord
constraints on the constructors for Interval
prevent it from being Traversable
, this will have to suffice.
itraverseLev :: (Ord x, Ord y, Applicative f) => (Levitated x -> f (Levitated y)) -> Interval x -> f (Interval y) Source #
openclosed :: Ord x => Interval x -> Interval x Source #
Make the interval open-closed, leaving the endpoints unchanged.
closedopen :: Ord x => Interval x -> Interval x Source #
Make the interval closed-open, leaving the endpoints unchanged.
openLower :: Ord x => Interval x -> Interval x Source #
Make the lower bound open, leaving the endpoints unchanged.
closedLower :: Ord x => Interval x -> Interval x Source #
Make the lower bound closed, leaving the endpoints unchanged.
openUpper :: Ord x => Interval x -> Interval x Source #
Make the upper bound open, leaving the endpoints unchanged.
closedUpper :: Ord x => Interval x -> Interval x Source #
Make the upper bound closed, leaving the endpoints unchanged.
Computing with intervals
According to
Allen,
two intervals can be "adjacent" in 13 different ways,
into at most 3 distinct intervals. In this package,
this quality is called the Adjacency
of the intervals.
Before !(Interval x) !(Interval x) | |
Meets !(Interval x) !(Interval x) !(Interval x) | |
Overlaps !(Interval x) !(Interval x) !(Interval x) | |
Starts !(Interval x) !(Interval x) | |
During !(Interval x) !(Interval x) !(Interval x) | |
Finishes !(Interval x) !(Interval x) | |
Identical !(Interval x) | |
FinishedBy !(Interval x) !(Interval x) | |
Contains !(Interval x) !(Interval x) !(Interval x) | |
StartedBy !(Interval x) !(Interval x) | |
OverlappedBy !(Interval x) !(Interval x) !(Interval x) | |
MetBy !(Interval x) !(Interval x) !(Interval x) | |
After !(Interval x) !(Interval x) |
Instances
hull :: Ord x => Interval x -> Interval x -> Interval x Source #
Get the convex hull of two intervals.
>>>
hull (7 :|>: 8) (3 :|>: 4)
(3 :|>: 8)
>>>
hull (Bottom :<-|: Levitate 3) (4 :<>: 5)
(Bottom :<->: Levitate 5)
hulls :: Ord x => NonEmpty (Interval x) -> Interval x Source #
Get the convex hull of a non-empty list of intervals.
within :: Ord x => Levitated x -> Interval x -> Bool Source #
Test whether a point is contained in the interval.
converseAdjacency :: Adjacency x -> Adjacency x Source #
The result of having compared the same two intervals in reverse order.
intersect :: forall x. Ord x => Interval x -> Interval x -> Maybe (Interval x) Source #
Calculate the intersection of two intervals, if it exists.
>>> intersect (2 :<>: 4) (3 :||: 5) Just (3 :|>: 4) >>> intersect (2 :<>: 4) (4 :||: 5) Nothing >>> intersect (1 :<>: 4) (2 :||: 3) Just (2 :||: 3)
union :: forall x. Ord x => Interval x -> Interval x -> OneOrTwo (Interval x) Source #
Get the union of two intervals, as either OneOrTwo
.
>>> union (2 :||: 5) (5 :<>: 7) One (2 :|>: 7) >>> union (2 :||: 4) (5 :<>: 7) Two (2 :||: 4) (5 :<>: 7)
unionsAsc :: forall x. Ord x => [Interval x] -> [Interval x] Source #
O(n). Get the union of a sorted list of intervals.
NOTE: The input condition is not checked. Use with care.
complement :: forall x. Ord x => Interval x -> Maybe (OneOrTwo (Interval x)) Source #
Take the complement of the interval, as possibly OneOrTwo
. See also complement
.
>>> complement (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top))
Note that infinitely-open intervals will include in their result
the points at infinity toward which they are infinite:
>>> complement (Levitate 3 :-: Top)
Just (Two (Bottom :|-|: Levitate 3) (Top :|-|: Top))
difference :: forall x. Ord x => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x)) Source #
Remove all points of the second interval from the first.
>>> difference Whole (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) >>> difference (1 :<>: 4) (2 :||: 5) Just (One (1 :<>: 2)) >>> difference (1 :|>: 4) (0 :||: 1) Just (One (1 :<>: 4)) >>> difference (1 :<>: 4) (0 :||: 1) Just (One (1 :<>: 4))
(\\) :: forall x. Ord x => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x)) Source #
Infix synonym for difference
symmetricDifference :: forall x. Ord x => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x)) Source #
The difference of the union and intersection of two intervals.
>>> symmetricDifference Whole (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) >>> symmetricDifference (1 :<>: 4) (2 :||: 5) Just (Two (1 :<>: 2) (4 :||: 5))
measuring :: forall y x. (Ord x, Num y) => (x -> x -> y) -> Interval x -> Maybe y Source #
Apply a function to the lower, then upper, endpoint of an interval.
>>> measuring const (-1 :<>: 1) Just (-1) >>> measuring (*) (4 :<>: 6) Just 24
measure == measuring subtract
hausdorff :: (Ord x, Num x) => Interval x -> Interval x -> Maybe x Source #
Get the distance between two intervals.
>>> hausdorff (3 :<>: 5) (6 :<>: 7) Just 1 >>> hausdorff (3 :<>: 5) Whole Just 0
Bounds
The kinds of extremum an interval can have.
Instances
Data Extremum Source # | |
Defined in Data.Interval gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Extremum -> c Extremum # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Extremum # toConstr :: Extremum -> Constr # dataTypeOf :: Extremum -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Extremum) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Extremum) # gmapT :: (forall b. Data b => b -> b) -> Extremum -> Extremum # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Extremum -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Extremum -> r # gmapQ :: (forall d. Data d => d -> u) -> Extremum -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Extremum -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Extremum -> m Extremum # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Extremum -> m Extremum # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Extremum -> m Extremum # | |
Bounded Extremum Source # | |
Enum Extremum Source # | |
Generic Extremum Source # | |
Read Extremum Source # | |
Show Extremum Source # | |
Eq Extremum Source # | |
Ord Extremum Source # | |
Defined in Data.Interval | |
type Rep Extremum Source # | |
Defined in Data.Interval type Rep Extremum = D1 ('MetaData "Extremum" "Data.Interval" "interval-patterns-0.8.0-BzcshY5RLEW8SWgNfdCVP3" 'False) ((C1 ('MetaCons "Minimum" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Infimum" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Supremum" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Maximum" 'PrefixI 'False) (U1 :: Type -> Type))) |
opposite :: Extremum -> Extremum Source #
The opposite
of an Extremum
is its complementary analogue:
how the same point would be viewed from the complement of the
interval to which it belongs.
c.f. opposeBound
.
data Bound ext x where Source #
Min :: !x -> Bound Minimum x | |
Inf :: !x -> Bound Infimum x | |
Sup :: !x -> Bound Supremum x | |
Max :: !x -> Bound Maximum x |
Instances
Foldable (Bound ext) Source # | |
Defined in Data.Interval fold :: Monoid m => Bound ext m -> m # foldMap :: Monoid m => (a -> m) -> Bound ext a -> m # foldMap' :: Monoid m => (a -> m) -> Bound ext a -> m # foldr :: (a -> b -> b) -> b -> Bound ext a -> b # foldr' :: (a -> b -> b) -> b -> Bound ext a -> b # foldl :: (b -> a -> b) -> b -> Bound ext a -> b # foldl' :: (b -> a -> b) -> b -> Bound ext a -> b # foldr1 :: (a -> a -> a) -> Bound ext a -> a # foldl1 :: (a -> a -> a) -> Bound ext a -> a # toList :: Bound ext a -> [a] # length :: Bound ext a -> Int # elem :: Eq a => a -> Bound ext a -> Bool # maximum :: Ord a => Bound ext a -> a # minimum :: Ord a => Bound ext a -> a # | |
Traversable (Bound ext) Source # | |
Functor (Bound ext) Source # | |
Eq x => Eq (Bound ext x) Source # | |
Ord x => Ord (Bound ext (Levitated x)) Source # | |
Defined in Data.Interval compare :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Ordering # (<) :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Bool # (<=) :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Bool # (>) :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Bool # (>=) :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Bool # max :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Bound ext (Levitated x) # min :: Bound ext (Levitated x) -> Bound ext (Levitated x) -> Bound ext (Levitated x) # |
class Opposite (Opposite ext) ~ ext => Bounding ext where Source #
A type class for inverting Bound
s.
bound :: x -> Bound ext x Source #
opposeBound :: Bound ext x -> Bound (Opposite ext) x Source #
c.f. opposite
.
compareBounds :: Ord x => Bound ext1 x -> Bound ext2 x -> Ordering Source #
Bound
s have special comparison rules for identical points.
>>>
compareBounds (Min (Levitate 0)) (Max (Levitate 0))
EQ>>>
compareBounds (Inf (Levitate 0)) (Sup (Levitate 0))
GT>>>
compareBounds (Max (Levitate 0)) (Sup (Levitate 0))
GT>>>
compareBounds (Inf (Levitate 0)) (Min (Levitate 0))
GT>>>
compareBounds (Max (Levitate 0)) (Inf (Levitate 0))
LT
Instances
Eq x => Eq (SomeBound (Levitated x)) Source # | |
Ord x => Ord (SomeBound (Levitated x)) Source # | |
Defined in Data.Interval compare :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> Ordering # (<) :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> Bool # (<=) :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> Bool # (>) :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> Bool # (>=) :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> Bool # max :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> SomeBound (Levitated x) # min :: SomeBound (Levitated x) -> SomeBound (Levitated x) -> SomeBound (Levitated x) # |
unSomeBound :: Ord x => SomeBound x -> x Source #
Re-exports
Either one of something, or two of it.
Use oneOrTwo
to deconstruct.
Instances
Foldable OneOrTwo Source # | |
Defined in Data.OneOrTwo fold :: Monoid m => OneOrTwo m -> m # foldMap :: Monoid m => (a -> m) -> OneOrTwo a -> m # foldMap' :: Monoid m => (a -> m) -> OneOrTwo a -> m # foldr :: (a -> b -> b) -> b -> OneOrTwo a -> b # foldr' :: (a -> b -> b) -> b -> OneOrTwo a -> b # foldl :: (b -> a -> b) -> b -> OneOrTwo a -> b # foldl' :: (b -> a -> b) -> b -> OneOrTwo a -> b # foldr1 :: (a -> a -> a) -> OneOrTwo a -> a # foldl1 :: (a -> a -> a) -> OneOrTwo a -> a # elem :: Eq a => a -> OneOrTwo a -> Bool # maximum :: Ord a => OneOrTwo a -> a # minimum :: Ord a => OneOrTwo a -> a # | |
Traversable OneOrTwo Source # | |
Functor OneOrTwo Source # | |
Data x => Data (OneOrTwo x) Source # | |
Defined in Data.OneOrTwo gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OneOrTwo x -> c (OneOrTwo x) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OneOrTwo x) # toConstr :: OneOrTwo x -> Constr # dataTypeOf :: OneOrTwo x -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OneOrTwo x)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OneOrTwo x)) # gmapT :: (forall b. Data b => b -> b) -> OneOrTwo x -> OneOrTwo x # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OneOrTwo x -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OneOrTwo x -> r # gmapQ :: (forall d. Data d => d -> u) -> OneOrTwo x -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OneOrTwo x -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OneOrTwo x -> m (OneOrTwo x) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OneOrTwo x -> m (OneOrTwo x) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OneOrTwo x -> m (OneOrTwo x) # | |
Generic (OneOrTwo x) Source # | |
Read x => Read (OneOrTwo x) Source # | |
Show x => Show (OneOrTwo x) Source # | |
Eq x => Eq (OneOrTwo x) Source # | |
Ord x => Ord (OneOrTwo x) Source # | |
type Rep (OneOrTwo x) Source # | |
Defined in Data.OneOrTwo type Rep (OneOrTwo x) = D1 ('MetaData "OneOrTwo" "Data.OneOrTwo" "interval-patterns-0.8.0-BzcshY5RLEW8SWgNfdCVP3" 'False) (C1 ('MetaCons "One" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 x)) :+: C1 ('MetaCons "Two" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 x) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 x))) |