generic-data-1.1.0.2: Deriving instances with GHC.Generics and related utilities

Safe Haskell | None
Language | Haskell2010

Generic.Data.Internal.Generically

Contents

- Orphan instances

Description

Newtypes with instances implemented using generic combinators.

### Warning

This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.

If something here seems useful, please report it or create a pull request to export it from an external module.

Synopsis

- newtype Generically a = Generically a
- newtype Generically1 (f :: k -> Type) (a :: k) where
  - Generically1 :: forall {k} (f :: k -> Type) (a :: k). f a -> Generically1 f a
- newtype FiniteEnumeration a = FiniteEnumeration a
- newtype GenericProduct a = GenericProduct a

# Documentation

newtype Generically a Source #

A datatype whose instances are defined generically, using the `Generic` representation. `Generically1` is a higher-kinded version of `Generically` that uses `Generic1`.

Generic instances can be derived via ``Generically` A` using `-XDerivingVia`.

    {-# LANGUAGE DeriveGeneric      #-}
    {-# LANGUAGE DerivingStrategies #-}
    {-# LANGUAGE DerivingVia        #-}

    import GHC.Generics (Generic)

    data V4 a = V4 a a a a
      deriving stock Generic

      deriving (Semigroup, Monoid)
      via Generically (V4 a)

This corresponds to `Semigroup` and `Monoid` instances defined by pointwise lifting:

    instance Semigroup a => Semigroup (V4 a) where
      (<>) :: V4 a -> V4 a -> V4 a
      V4 a1 b1 c1 d1 <> V4 a2 b2 c2 d2 =
        V4 (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2)

    instance Monoid a => Monoid (V4 a) where
      mempty :: V4 a
      mempty = V4 mempty mempty mempty mempty

Historically this required modifying the type class to include generic method definitions (`-XDefaultSignatures`) and deriving it with the `anyclass` strategy (`-XDeriveAnyClass`). Having a /via type/ like `Generically` decouples the instance from the type class.

Since: base-4.17.0.0

Constructors

Generically a |

#### Instances

Instances details

(Generic a, Monoid (Rep a ())) => Monoid (Generically a) | Since: base-4.17.0.0
Instance details Defined in GHC.Internal.Generics Methods mempty :: Generically a Source # mappend :: Generically a -> Generically a -> Generically a Source # mconcat :: [Generically a] -> Generically a Source #
(Generic a, Semigroup (Rep a ())) => Semigroup (Generically a) | Since: base-4.17.0.0
Instance details Defined in GHC.Internal.Generics Methods (<>) :: Generically a -> Generically a -> Generically a Source # sconcat :: NonEmpty (Generically a) -> Generically a Source # stimes :: Integral b => b -> Generically a -> Generically a Source #
(Generic a, GBounded (Rep a)) => Bounded (Generically a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods minBound :: Generically a Source # maxBound :: Generically a Source #
(Generic a, GEnum StandardEnum (Rep a)) => Enum (Generically a) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

succ :: Generically a -> Generically a Source #

pred :: Generically a -> Generically a Source #

toEnum :: Int -> Generically a Source #

fromEnum :: Generically a -> Int Source #

enumFrom :: Generically a -> [Generically a] Source #

enumFromThen :: Generically a -> Generically a -> [Generically a] Source #

enumFromTo :: Generically a -> Generically a -> [Generically a] Source #

enumFromThenTo :: Generically a -> Generically a -> Generically a -> [Generically a] Source #

Generic a => Generic (Generically a) Source # | This is a hack to implicitly wrap/unwrap in the instances of `Generically`.

Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (Generically a) |
Instance details Defined in Generic.Data.Internal.Generically type Rep (Generically a) = Rep a

Methods

from :: Generically a -> Rep (Generically a) x Source #

to :: Rep (Generically a) x -> Generically a Source #

(Generic a, Ord (Rep a ()), GIx (Rep a)) => Ix (Generically a) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

range :: (Generically a, Generically a) -> [Generically a] Source #

index :: (Generically a, Generically a) -> Generically a -> Int Source #

unsafeIndex :: (Generically a, Generically a) -> Generically a -> Int Source #

inRange :: (Generically a, Generically a) -> Generically a -> Bool Source #

rangeSize :: (Generically a, Generically a) -> Int Source #

unsafeRangeSize :: (Generically a, Generically a) -> Int Source #

(Generic a, GRead0 (Rep a)) => Read (Generically a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods readsPrec :: Int -> ReadS (Generically a) Source # readList :: ReadS [Generically a] Source # readPrec :: ReadPrec (Generically a) Source # readListPrec :: ReadPrec [Generically a] Source #
(Generic a, GShow0 (Rep a)) => Show (Generically a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods showsPrec :: Int -> Generically a -> ShowS Source # show :: Generically a -> String Source # showList :: [Generically a] -> ShowS Source #
(Generic a, Eq (Rep a ())) => Eq (Generically a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods (==) :: Generically a -> Generically a -> Bool Source # (/=) :: Generically a -> Generically a -> Bool Source #
(Generic a, Ord (Rep a ())) => Ord (Generically a) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

compare :: Generically a -> Generically a -> Ordering Source #

(<) :: Generically a -> Generically a -> Bool Source #

(<=) :: Generically a -> Generically a -> Bool Source #

(>) :: Generically a -> Generically a -> Bool Source #

(>=) :: Generically a -> Generically a -> Bool Source #

max :: Generically a -> Generically a -> Generically a Source #

min :: Generically a -> Generically a -> Generically a Source #

type Rep (Generically a) Source # |
Instance details Defined in Generic.Data.Internal.Generically type Rep (Generically a) = Rep a

newtype Generically1 (f :: k -> Type) (a :: k) where Source #

A type whose instances are defined generically, using the `Generic1` representation. `Generically1` is a higher-kinded version of `Generically` that uses `Generic`.

Generic instances can be derived for type constructors via ``Generically1` F` using `-XDerivingVia`.

    {-# LANGUAGE DeriveGeneric      #-}
    {-# LANGUAGE DerivingStrategies #-}
    {-# LANGUAGE DerivingVia        #-}

    import GHC.Generics (Generic)

    data V4 a = V4 a a a a
      deriving stock (Functor, Generic1)

      deriving Applicative
      via Generically1 V4

This corresponds to `Applicative` instances defined by pointwise lifting:

    instance Applicative V4 where
      pure :: a -> V4 a
      pure a = V4 a a a a

      liftA2 :: (a -> b -> c) -> (V4 a -> V4 b -> V4 c)
      liftA2 (·) (V4 a1 b1 c1 d1) (V4 a2 b2 c2 d2) =
        V4 (a1 · a2) (b1 · b2) (c1 · c2) (d1 · d2)

Historically this required modifying the type class to include generic method definitions (`-XDefaultSignatures`) and deriving it with the `anyclass` strategy (`-XDeriveAnyClass`). Having a /via type/ like `Generically1` decouples the instance from the type class.

Since: base-4.17.0.0

Constructors

Generically1 :: forall {k} (f :: k -> Type) (a :: k). f a -> Generically1 f a |

#### Instances

Instances details

Generic1 f => Generic1 (Generically1 f :: Type -> Type) Source # | This is a hack to implicitly wrap/unwrap in the instances of `Generically1`.

Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep1 (Generically1 f :: Type -> Type) |
Instance details Defined in Generic.Data.Internal.Generically type Rep1 (Generically1 f :: Type -> Type) = Rep1 f

Methods

from1 :: Generically1 f a -> Rep1 (Generically1 f) a Source #

to1 :: Rep1 (Generically1 f) a -> Generically1 f a Source #

(Generic1 f, Eq1 (Rep1 f)) => Eq1 (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Generically1 f a -> Generically1 f b -> Bool Source #
(Generic1 f, Ord1 (Rep1 f)) => Ord1 (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Generically1 f a -> Generically1 f b -> Ordering Source #
(Generic1 f, GRead1 (Rep1 f)) => Read1 (Generically1 f) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Generically1 f a) Source #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Generically1 f a] Source #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Generically1 f a) Source #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Generically1 f a] Source #

(Generic1 f, GShow1 (Rep1 f)) => Show1 (Generically1 f) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Generically1 f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Generically1 f a] -> ShowS Source #
(Generic1 f, Alternative (Rep1 f)) => Alternative (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: Generically1 f a Source # (<|>) :: Generically1 f a -> Generically1 f a -> Generically1 f a Source # some :: Generically1 f a -> Generically1 f [a] Source # many :: Generically1 f a -> Generically1 f [a] Source #
(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) | Since: base-4.17.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

pure :: a -> Generically1 f a Source #

(<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b Source #

liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c Source #

(*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b Source #

(<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a Source #

(Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in GHC.Internal.Generics Methods fmap :: (a -> b) -> Generically1 f a -> Generically1 f b Source # (<$) :: a -> Generically1 f b -> Generically1 f a Source #
(Generic1 f, GFoldable (Rep1 f)) => Foldable (Generically1 f) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

fold :: Monoid m => Generically1 f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Generically1 f a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Generically1 f a -> m Source #

foldr :: (a -> b -> b) -> b -> Generically1 f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Generically1 f a -> b Source #

foldl :: (b -> a -> b) -> b -> Generically1 f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Generically1 f a -> b Source #

foldr1 :: (a -> a -> a) -> Generically1 f a -> a Source #

foldl1 :: (a -> a -> a) -> Generically1 f a -> a Source #

toList :: Generically1 f a -> [a] Source #

null :: Generically1 f a -> Bool Source #

length :: Generically1 f a -> Int Source #

elem :: Eq a => a -> Generically1 f a -> Bool Source #

maximum :: Ord a => Generically1 f a -> a Source #

minimum :: Ord a => Generically1 f a -> a Source #

sum :: Num a => Generically1 f a -> a Source #

product :: Num a => Generically1 f a -> a Source #

(Generic1 f, Functor (Rep1 f), GFoldable (Rep1 f), GTraversable (Rep1 f)) => Traversable (Generically1 f) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Generically1 f a -> f0 (Generically1 f b) Source #

sequenceA :: Applicative f0 => Generically1 f (f0 a) -> f0 (Generically1 f a) Source #

mapM :: Monad m => (a -> m b) -> Generically1 f a -> m (Generically1 f b) Source #

sequence :: Monad m => Generically1 f (m a) -> m (Generically1 f a) Source #

Generic (f a) => Generic (Generically1 f a) Source # | This is a hack to implicitly wrap/unwrap in the instances of `Generically1`.

Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (Generically1 f a) |
Instance details Defined in Generic.Data.Internal.Generically type Rep (Generically1 f a) = Rep (f a)

Methods

from :: Generically1 f a -> Rep (Generically1 f a) x Source #

to :: Rep (Generically1 f a) x -> Generically1 f a Source #

(Generic1 f, GRead1 (Rep1 f), Read a) => Read (Generically1 f a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods readsPrec :: Int -> ReadS (Generically1 f a) Source # readList :: ReadS [Generically1 f a] Source # readPrec :: ReadPrec (Generically1 f a) Source # readListPrec :: ReadPrec [Generically1 f a] Source #
(Generic1 f, GShow1 (Rep1 f), Show a) => Show (Generically1 f a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods showsPrec :: Int -> Generically1 f a -> ShowS Source # show :: Generically1 f a -> String Source # showList :: [Generically1 f a] -> ShowS Source #
(Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a) | Since: base-4.18.0.0
Instance details Defined in GHC.Internal.Generics Methods (==) :: Generically1 f a -> Generically1 f a -> Bool Source # (/=) :: Generically1 f a -> Generically1 f a -> Bool Source #
(Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a) | Since: base-4.18.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

compare :: Generically1 f a -> Generically1 f a -> Ordering Source #

(<) :: Generically1 f a -> Generically1 f a -> Bool Source #

(<=) :: Generically1 f a -> Generically1 f a -> Bool Source #

(>) :: Generically1 f a -> Generically1 f a -> Bool Source #

(>=) :: Generically1 f a -> Generically1 f a -> Bool Source #

max :: Generically1 f a -> Generically1 f a -> Generically1 f a Source #

min :: Generically1 f a -> Generically1 f a -> Generically1 f a Source #

type Rep1 (Generically1 f :: Type -> Type) Source # |
Instance details Defined in Generic.Data.Internal.Generically type Rep1 (Generically1 f :: Type -> Type) = Rep1 f
type Rep (Generically1 f a) Source # |
Instance details Defined in Generic.Data.Internal.Generically type Rep (Generically1 f a) = Rep (f a)

newtype FiniteEnumeration a Source #

Type with `Enum` instance derived via `Generic` with `FiniteEnum` option. This allows deriving `Enum` for types whose constructors have fields.

Some caution is advised; see details in `FiniteEnum`.

### Example

Expand

    >>> :{
    data Booool = Booool Bool Bool
      deriving Generic
      deriving (Enum, Bounded) via (FiniteEnumeration Booool)
    :}

Constructors

FiniteEnumeration a |

#### Instances

Instances details

(Generic a, GBounded (Rep a)) => Bounded (FiniteEnumeration a) Source # | The same instance as `Generically`, for convenience.
Instance details Defined in Generic.Data.Internal.Generically Methods minBound :: FiniteEnumeration a Source # maxBound :: FiniteEnumeration a Source #
(Generic a, GEnum FiniteEnum (Rep a)) => Enum (FiniteEnumeration a) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Methods

succ :: FiniteEnumeration a -> FiniteEnumeration a Source #

pred :: FiniteEnumeration a -> FiniteEnumeration a Source #

toEnum :: Int -> FiniteEnumeration a Source #

fromEnum :: FiniteEnumeration a -> Int Source #

enumFrom :: FiniteEnumeration a -> [FiniteEnumeration a] Source #

enumFromThen :: FiniteEnumeration a -> FiniteEnumeration a -> [FiniteEnumeration a] Source #

enumFromTo :: FiniteEnumeration a -> FiniteEnumeration a -> [FiniteEnumeration a] Source #

enumFromThenTo :: FiniteEnumeration a -> FiniteEnumeration a -> FiniteEnumeration a -> [FiniteEnumeration a] Source #

Generic a => Generic (FiniteEnumeration a) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (FiniteEnumeration a) |
Instance details Defined in Generic.Data.Internal.Generically type Rep (FiniteEnumeration a) = Rep a

Methods

from :: FiniteEnumeration a -> Rep (FiniteEnumeration a) x Source #

to :: Rep (FiniteEnumeration a) x -> FiniteEnumeration a Source #

type Rep (FiniteEnumeration a) Source # |
Instance details Defined in Generic.Data.Internal.Generically type Rep (FiniteEnumeration a) = Rep a

newtype GenericProduct a Source #

Product type with generic instances of `Semigroup` and `Monoid`.

This is similar to `Generically` in most cases, but `GenericProduct` also works for types `T` with deriving `via `GenericProduct` U`, where `U` is a generic product type coercible to, but distinct from `T`. In particular, `U` may not have an instance of `Semigroup`, which `Generically` requires.

### Example

Expand

    >>> import Data.Monoid (Sum(..))
    >>> data Point a = Point a a deriving Generic
    >>> :{
      newtype Vector a = Vector (Point a)
        deriving (Semigroup, Monoid)
          via GenericProduct (Point (Sum a))
    :}

If it were `via `Generically` (Point (Sum a))` instead, then `Vector`'s `mappend` (the `Monoid` method) would be defined as `Point`'s `(`<>`)` (the `Semigroup` method), which might not exist, or might not be equivalent to `Vector`'s generic `Semigroup` instance, which would be unlawful.

Constructors

GenericProduct a |

#### Instances

Instances details

(AssertNoSum Semigroup a, Generic a, Monoid (Rep a ())) => Monoid (GenericProduct a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods mempty :: GenericProduct a Source # mappend :: GenericProduct a -> GenericProduct a -> GenericProduct a Source # mconcat :: [GenericProduct a] -> GenericProduct a Source #
(AssertNoSum Semigroup a, Generic a, Semigroup (Rep a ())) => Semigroup (GenericProduct a) Source # |
Instance details Defined in Generic.Data.Internal.Generically Methods (<>) :: GenericProduct a -> GenericProduct a -> GenericProduct a Source # sconcat :: NonEmpty (GenericProduct a) -> GenericProduct a Source # stimes :: Integral b => b -> GenericProduct a -> GenericProduct a Source #
Generic a => Generic (GenericProduct a) Source # |

Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (GenericProduct a) |
Instance details Defined in Generic.Data.Internal.Generically type Rep (GenericProduct a) = Rep a

Methods

from :: GenericProduct a -> Rep (GenericProduct a) x Source #

to :: Rep (GenericProduct a) x -> GenericProduct a Source #

type Rep (GenericProduct a) Source # |
Instance details Defined in Generic.Data.Internal.Generically type Rep (GenericProduct a) = Rep a

# Orphan instances

Generic1 f => Generic1 (Generically1 f :: Type -> Type) Source # | This is a hack to implicitly wrap/unwrap in the instances of `Generically1`.

Instance details

Associated Types

type Rep1 (Generically1 f :: Type -> Type) |
Instance details Defined in Generic.Data.Internal.Generically type Rep1 (Generically1 f :: Type -> Type) = Rep1 f

Methods

from1 :: Generically1 f a -> Rep1 (Generically1 f) a Source #

to1 :: Rep1 (Generically1 f) a -> Generically1 f a Source #

(Generic a, GBounded (Rep a)) => Bounded (Generically a) Source # |
Instance details Methods minBound :: Generically a Source # maxBound :: Generically a Source #
(Generic a, GEnum StandardEnum (Rep a)) => Enum (Generically a) Source # |

Instance details

Methods

succ :: Generically a -> Generically a Source #

pred :: Generically a -> Generically a Source #

toEnum :: Int -> Generically a Source #

fromEnum :: Generically a -> Int Source #

enumFrom :: Generically a -> [Generically a] Source #

enumFromThen :: Generically a -> Generically a -> [Generically a] Source #

enumFromTo :: Generically a -> Generically a -> [Generically a] Source #

enumFromThenTo :: Generically a -> Generically a -> Generically a -> [Generically a] Source #

Generic a => Generic (Generically a) Source # | This is a hack to implicitly wrap/unwrap in the instances of `Generically`.

Instance details

Associated Types

type Rep (Generically a) |
Instance details Defined in Generic.Data.Internal.Generically type Rep (Generically a) = Rep a

Methods

from :: Generically a -> Rep (Generically a) x Source #

to :: Rep (Generically a) x -> Generically a Source #

(Generic a, Ord (Rep a ()), GIx (Rep a)) => Ix (Generically a) Source # |

Instance details

Methods

range :: (Generically a, Generically a) -> [Generically a] Source #

index :: (Generically a, Generically a) -> Generically a -> Int Source #

unsafeIndex :: (Generically a, Generically a) -> Generically a -> Int Source #

inRange :: (Generically a, Generically a) -> Generically a -> Bool Source #

rangeSize :: (Generically a, Generically a) -> Int Source #

unsafeRangeSize :: (Generically a, Generically a) -> Int Source #

(Generic a, GRead0 (Rep a)) => Read (Generically a) Source # |
Instance details Methods readsPrec :: Int -> ReadS (Generically a) Source # readList :: ReadS [Generically a] Source # readPrec :: ReadPrec (Generically a) Source # readListPrec :: ReadPrec [Generically a] Source #
(Generic a, GShow0 (Rep a)) => Show (Generically a) Source # |
Instance details Methods showsPrec :: Int -> Generically a -> ShowS Source # show :: Generically a -> String Source # showList :: [Generically a] -> ShowS Source #
(Generic a, Eq (Rep a ())) => Eq (Generically a) Source # |
Instance details Methods (==) :: Generically a -> Generically a -> Bool Source # (/=) :: Generically a -> Generically a -> Bool Source #
(Generic a, Ord (Rep a ())) => Ord (Generically a) Source # |

Instance details

Methods

compare :: Generically a -> Generically a -> Ordering Source #

(<) :: Generically a -> Generically a -> Bool Source #

(<=) :: Generically a -> Generically a -> Bool Source #

(>) :: Generically a -> Generically a -> Bool Source #

(>=) :: Generically a -> Generically a -> Bool Source #

max :: Generically a -> Generically a -> Generically a Source #

min :: Generically a -> Generically a -> Generically a Source #

(Generic1 f, GRead1 (Rep1 f)) => Read1 (Generically1 f) Source # |
Instance details Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Generically1 f a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Generically1 f a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Generically1 f a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Generically1 f a] Source #
(Generic1 f, GShow1 (Rep1 f)) => Show1 (Generically1 f) Source # |
Instance details Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Generically1 f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Generically1 f a] -> ShowS Source #
(Generic1 f, GFoldable (Rep1 f)) => Foldable (Generically1 f) Source # |

Instance details

Methods

fold :: Monoid m => Generically1 f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Generically1 f a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Generically1 f a -> m Source #

foldr :: (a -> b -> b) -> b -> Generically1 f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Generically1 f a -> b Source #

foldl :: (b -> a -> b) -> b -> Generically1 f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Generically1 f a -> b Source #

foldr1 :: (a -> a -> a) -> Generically1 f a -> a Source #

foldl1 :: (a -> a -> a) -> Generically1 f a -> a Source #

toList :: Generically1 f a -> [a] Source #

null :: Generically1 f a -> Bool Source #

length :: Generically1 f a -> Int Source #

elem :: Eq a => a -> Generically1 f a -> Bool Source #

maximum :: Ord a => Generically1 f a -> a Source #

minimum :: Ord a => Generically1 f a -> a Source #

sum :: Num a => Generically1 f a -> a Source #

product :: Num a => Generically1 f a -> a Source #

(Generic1 f, Functor (Rep1 f), GFoldable (Rep1 f), GTraversable (Rep1 f)) => Traversable (Generically1 f) Source # |
Instance details Methods traverse :: Applicative f0 => (a -> f0 b) -> Generically1 f a -> f0 (Generically1 f b) Source # sequenceA :: Applicative f0 => Generically1 f (f0 a) -> f0 (Generically1 f a) Source # mapM :: Monad m => (a -> m b) -> Generically1 f a -> m (Generically1 f b) Source # sequence :: Monad m => Generically1 f (m a) -> m (Generically1 f a) Source #
Generic (f a) => Generic (Generically1 f a) Source # | This is a hack to implicitly wrap/unwrap in the instances of `Generically1`.

Instance details

Associated Types

type Rep (Generically1 f a) |
Instance details Defined in Generic.Data.Internal.Generically type Rep (Generically1 f a) = Rep (f a)

Methods

from :: Generically1 f a -> Rep (Generically1 f a) x Source #

to :: Rep (Generically1 f a) x -> Generically1 f a Source #

(Generic1 f, GRead1 (Rep1 f), Read a) => Read (Generically1 f a) Source # |
Instance details Methods readsPrec :: Int -> ReadS (Generically1 f a) Source # readList :: ReadS [Generically1 f a] Source # readPrec :: ReadPrec (Generically1 f a) Source # readListPrec :: ReadPrec [Generically1 f a] Source #
(Generic1 f, GShow1 (Rep1 f), Show a) => Show (Generically1 f a) Source # |
Instance details Methods showsPrec :: Int -> Generically1 f a -> ShowS Source # show :: Generically1 f a -> String Source # showList :: [Generically1 f a] -> ShowS Source #