Copyright | (c) L. S. Leary 2025 |
---|---|
Safe Haskell | None |
Language | GHC2021 |
Data.Hetero.Some
Contents
Description
An (almost) drop-in replacement for Data.Some.
Differences
Synopsis
- data Some (f :: k -> Type) where
- mkSome :: forall {k} f (x :: k). f x -> Some f
- withSome :: Some f -> (forall (x :: k). f x -> r) -> r
- withSomeM :: forall {k} m f r. Monad m => m (Some f) -> (forall (x :: k). f x -> m r) -> m r
- mapSome :: (forall (x :: k). f x -> g x) -> Some f -> Some g
- foldSome :: (forall (x :: k). f x -> b) -> Some f -> b
- traverseSome :: forall {k} h f g. Applicative h => (forall (x :: k). f x -> h (g x)) -> Some f -> h (Some g)
Some
data Some (f :: k -> Type) where Source #
Existentials sans indirection.
Instances
(forall (x :: k). NFData (f x)) => NFData (Some f) Source # | |
Defined in Data.Hetero.Some | |
Applicative f => Monoid (Some f) Source # | |
Applicative f => Semigroup (Some f) Source # | |
(forall (x :: k). Show (f x)) => Show (Some f) Source # | |
HetEq f => Eq (Some f) Source # | |
HetOrd f => Ord (Some f) Source # | |
(forall (x :: k). Hashable (f x), HetEq f) => Hashable (Some f) Source # | |
Defined in Data.Hetero.Some |
withSomeM :: forall {k} m f r. Monad m => m (Some f) -> (forall (x :: k). f x -> m r) -> m r Source #
traverseSome :: forall {k} h f g. Applicative h => (forall (x :: k). f x -> h (g x)) -> Some f -> h (Some g) Source #