harg-0.4.0.0: Haskell program configuration using higher kinded data

Safe HaskellNone
LanguageHaskell2010

Options.Harg.Het.Prod

Synopsis

Documentation

data ((a :: (Type -> Type) -> Type) :* (b :: (Type -> Type) -> Type)) (f :: Type -> Type) infixr 4 Source #

Infix version of Product. Allows to combine higher-kinded types, and keep them partially applied until needed:

  data User = User { name :: String, age :: Int }
    deriving Generic

  type Config = Nested User :* Single Int

  configOpt :: Config Opt
  configOpt = ...

Constructors

(a f) :* (b f) infixr 4 
Instances
(ProductB a, ProductB b) => ProductB (a :* b :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

bprod :: (a :* b) f -> (a :* b) g -> (a :* b) (Product f g) #

buniq :: (forall (a0 :: k). f a0) -> (a :* b) f #

(TraversableB a, TraversableB b) => TraversableB (a :* b :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

btraverse :: Applicative t => (forall (a0 :: k). f a0 -> t (g a0)) -> (a :* b) f -> t ((a :* b) g) #

(FunctorB a, FunctorB b) => FunctorB (a :* b :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

bmap :: (forall (a0 :: k). f a0 -> g a0) -> (a :* b) f -> (a :* b) g #

(GetSource l f, GetSource r f) => GetSource (l :* r) f Source # 
Instance details

Defined in Options.Harg.Sources.Types

Associated Types

type SourceVal (l :* r) :: Type Source #

Methods

getSource :: HargCtx -> (l :* r) f -> IO (SourceVal (l :* r)) Source #

(Show (a Identity), Show (b Identity)) => Show ((a :* b) Identity) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

showsPrec :: Int -> (a :* b) Identity -> ShowS #

show :: (a :* b) Identity -> String #

showList :: [(a :* b) Identity] -> ShowS #

Generic ((a :* b) f) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Associated Types

type Rep ((a :* b) f) :: Type -> Type #

Methods

from :: (a :* b) f -> Rep ((a :* b) f) x #

to :: Rep ((a :* b) f) x -> (a :* b) f #

(FromJSON (a Maybe), FromJSON (b Maybe), ProductB a, ProductB b, KnownSymbol ta, KnownSymbol tb) => FromJSON ((Tagged ta a :* Tagged tb b) Maybe) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

parseJSON :: Value -> Parser ((Tagged ta a :* Tagged tb b) Maybe) #

parseJSONList :: Value -> Parser [(Tagged ta a :* Tagged tb b) Maybe] #

(FromJSON (a Maybe), FromJSON (b' Maybe), ProductB a, ProductB b', KnownSymbol ta, b' ~ (Tagged tb b :* c)) => FromJSON ((Tagged ta a :* (Tagged tb b :* c)) Maybe) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

parseJSON :: Value -> Parser ((Tagged ta a :* (Tagged tb b :* c)) Maybe) #

parseJSONList :: Value -> Parser [(Tagged ta a :* (Tagged tb b :* c)) Maybe] #

type SourceVal (l :* r) Source # 
Instance details

Defined in Options.Harg.Sources.Types

type SourceVal (l :* r) = (SourceVal l, SourceVal r)
type Rep ((a :* b) f) Source # 
Instance details

Defined in Options.Harg.Het.Prod

newtype Tagged (t :: k) (a :: (Type -> Type) -> Type) (f :: Type -> Type) Source #

This type adds a type-level phantom tag to a higher-kinded type. Its JSON instance allows using :* with JSONSource.

Constructors

Tagged 

Fields

Instances
ProductB a => ProductB (Tagged t a :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

bprod :: Tagged t a f -> Tagged t a g -> Tagged t a (Product f g) #

buniq :: (forall (a0 :: k). f a0) -> Tagged t a f #

TraversableB a => TraversableB (Tagged t a :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

btraverse :: Applicative t0 => (forall (a0 :: k). f a0 -> t0 (g a0)) -> Tagged t a f -> t0 (Tagged t a g) #

FunctorB a => FunctorB (Tagged t a :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

bmap :: (forall (a0 :: k). f a0 -> g a0) -> Tagged t a f -> Tagged t a g #

(FromJSON (a Maybe), FromJSON (b Maybe), ProductB a, ProductB b, KnownSymbol ta, KnownSymbol tb) => FromJSON ((Tagged ta a :* Tagged tb b) Maybe) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

parseJSON :: Value -> Parser ((Tagged ta a :* Tagged tb b) Maybe) #

parseJSONList :: Value -> Parser [(Tagged ta a :* Tagged tb b) Maybe] #

(FromJSON (a Maybe), FromJSON (b' Maybe), ProductB a, ProductB b', KnownSymbol ta, b' ~ (Tagged tb b :* c)) => FromJSON ((Tagged ta a :* (Tagged tb b :* c)) Maybe) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

parseJSON :: Value -> Parser ((Tagged ta a :* (Tagged tb b :* c)) Maybe) #

parseJSONList :: Value -> Parser [(Tagged ta a :* (Tagged tb b :* c)) Maybe] #

Generic (Tagged t a f) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Associated Types

type Rep (Tagged t a f) :: Type -> Type #

Methods

from :: Tagged t a f -> Rep (Tagged t a f) x #

to :: Rep (Tagged t a f) x -> Tagged t a f #

FromJSON (a f) => FromJSON (Tagged t a f) Source # 
Instance details

Defined in Options.Harg.Het.Prod

Methods

parseJSON :: Value -> Parser (Tagged t a f) #

parseJSONList :: Value -> Parser [Tagged t a f] #

type Rep (Tagged t a f) Source # 
Instance details

Defined in Options.Harg.Het.Prod

type Rep (Tagged t a f) = D1 (MetaData "Tagged" "Options.Harg.Het.Prod" "harg-0.4.0.0-inplace" True) (C1 (MetaCons "Tagged" PrefixI True) (S1 (MetaSel (Just "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a f))))