{-# OPTIONS_GHC -Wno-deprecations #-}
module Data.Barbie
{-# DEPRECATED "Use Data.Functor.Barbie or Barbies instead" #-}
(
FunctorB(bmap)
, TraversableB(btraverse)
, btraverse_
, bfoldMap
, bsequence, bsequence'
, ProductB(buniq, bprod)
, CanDeriveProductB
, App.bzip
, App.bunzip
, App.bzipWith
, App.bzipWith3
, App.bzipWith4
, ConstraintsB(AllB, baddDicts)
, AllBF
, bmapC
, btraverseC
, ProductBC(bdicts)
, CanDeriveProductBC
, buniqC
, bmempty
, Barbie(..)
, Trivial.Void
, Trivial.Unit (..)
, Rec(..)
, GProductB(..)
, GProductBC(..)
, (/*/), (/*)
)
where
import Barbies.Internal.ConstraintsB (AllBF, ConstraintsB (..), bmapC, btraverseC, bmempty)
import Barbies.Internal.FunctorB(FunctorB(..))
import Barbies.Internal.Wrappers(Barbie(..))
import qualified Barbies.Internal.ApplicativeB as App
import Data.Barbie.Internal.Product(ProductB(..), CanDeriveProductB, GProductB(..))
import Data.Barbie.Internal.ProductC(ProductBC(..), CanDeriveProductBC, GProductBC(..), buniqC)
import Barbies.Internal.TraversableB
( TraversableB(..)
, bsequence, bsequence'
, bfoldMap, btraverse_
)
import qualified Barbies.Internal.Trivial as Trivial
import Data.Functor.Product (Product(Pair))
import Data.Functor.Prod (Prod(..), oneTuple, prod)
import Data.Generics.GenericN (Rec(..))
{-# DEPRECATED (/*/), (/*) "Use bzipWith2, bzipWith3, etc" #-}
(/*/)
:: ProductB b => b f -> b g -> b (Prod '[f, g])
b f
l /*/ :: b f -> b g -> b (Prod '[f, g])
/*/ b g
r
= (forall a. Product f g a -> Prod '[f, g] a)
-> b (Product f g) -> b (Prod '[f, g])
forall k (b :: (k -> *) -> *) (f :: k -> *) (g :: k -> *).
FunctorB b =>
(forall (a :: k). f a -> g a) -> b f -> b g
bmap (\(Pair f g) -> f a -> Prod '[g] a -> Prod '[f, g] a
forall k (f :: k -> *) (a :: k) (fs :: [k -> *]).
f a -> Prod fs a -> Prod (f : fs) a
Cons f a
f (g a -> Prod '[] a -> Prod '[g] a
forall k (f :: k -> *) (a :: k) (fs :: [k -> *]).
f a -> Prod fs a -> Prod (f : fs) a
Cons g a
g Prod '[] a
forall k (a :: k). Prod '[] a
Unit)) (b f
l b f -> b g -> b (Product f g)
forall k (b :: (k -> *) -> *) (f :: k -> *) (g :: k -> *).
ProductB b =>
b f -> b g -> b (Product f g)
`bprod` b g
r)
infixr 4 /*/
(/*) :: ProductB b => b f -> b (Prod fs) -> b (Prod (f ': fs))
b f
l /* :: b f -> b (Prod fs) -> b (Prod (f : fs))
/* b (Prod fs)
r =
(forall a. Product f (Prod fs) a -> Prod (f : fs) a)
-> b (Product f (Prod fs)) -> b (Prod (f : fs))
forall k (b :: (k -> *) -> *) (f :: k -> *) (g :: k -> *).
FunctorB b =>
(forall (a :: k). f a -> g a) -> b f -> b g
bmap (\(Pair f fs) -> f a -> Prod '[f] a
forall k (f :: k -> *) (a :: k). f a -> Prod '[f] a
oneTuple f a
f Prod '[f] a -> Prod fs a -> Prod ('[f] ++ fs) a
forall k (ls :: [k -> *]) (a :: k) (rs :: [k -> *]).
Prod ls a -> Prod rs a -> Prod (ls ++ rs) a
`prod` Prod fs a
fs) (b f
l b f -> b (Prod fs) -> b (Product f (Prod fs))
forall k (b :: (k -> *) -> *) (f :: k -> *) (g :: k -> *).
ProductB b =>
b f -> b g -> b (Product f g)
`bprod` b (Prod fs)
r)
infixr 4 /*