Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Generic.Data.Internal.Utils
Description
Utilities.
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
- gcoerce :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => a -> b
- gcoerceBinop :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => (a -> a -> a) -> b -> b -> b
- coerce' :: forall {k} f (x :: k) g. Coercible (f x) (g x) => f x -> g x
- coerce1 :: forall {k} f g (x :: k). Coercible f g => f x -> g x
- absurd1 :: forall {k} (x :: k) a. V1 x -> a
- from' :: Generic a => a -> Rep a ()
- to' :: Generic a => Rep a () -> a
- liftG2 :: forall {k} f (a :: k) (b :: k) (c :: k). Generic1 f => (Rep1 f a -> Rep1 f b -> Rep1 f c) -> f a -> f b -> f c
- isSymDataCon :: String -> Bool
- isSymVar :: String -> Bool
Documentation
gcoerce :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => a -> b Source #
Convert between types with representationally equivalent generic representations.
gcoerceBinop :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => (a -> a -> a) -> b -> b -> b Source #
Compose gcoerce
with a binary operation.
coerce' :: forall {k} f (x :: k) g. Coercible (f x) (g x) => f x -> g x Source #
Coerce while preserving the type index.
liftG2 :: forall {k} f (a :: k) (b :: k) (c :: k). Generic1 f => (Rep1 f a -> Rep1 f b -> Rep1 f c) -> f a -> f b -> f c Source #
Lift binary combinators generically.
isSymDataCon :: String -> Bool Source #