% package:configuration-tools

This operator is an alternative for $ with a higher precedence. It is suitable for usage within applicative style code without the need to add parenthesis.
An operator for applying a setter to an option parser that yields a modification function. Example usage:
data HttpURL = HttpURL
{ _auth ∷ !Auth
, _domain ∷ !String
}

auth ∷ Functor f ⇒ (Auth → f Auth) → HttpURL → f HttpURL
auth f s = (\u → s { _auth = u }) <$> f (_auth s)

domain ∷ Functor f ⇒ (String → f String) → HttpURL → f HttpURL
domain f s = (\u → s { _domain = u }) <$> f (_domain s)

path ∷ Functor f ⇒ (String → f String) → HttpURL → f HttpURL
path f s = (\u → s { _path = u }) <$> f (_path s)

-- or with lenses and TemplateHaskell just:
-- $(makeLenses ''HttpURL)

pHttpURL ∷ MParser HttpURL
pHttpURL = id
<$< auth %:: pAuth
<*< domain .:: strOption
% long "domain"
⊕ short 'd'
⊕ help "HTTP domain"
A variant of updateProperty that uses the FromJSON instance for the update function. It mimics the aeson operator .:. It creates a parser that modifies a setter with a parsed function.
data HttpURL = HttpURL
{ _auth ∷ !Auth
, _domain ∷ !String
}

auth ∷ Functor f ⇒ (Auth → f Auth) → HttpURL → f HttpURL
auth f s = (\u → s { _auth = u }) <$> f (_auth s)

domain ∷ Functor f ⇒ (String → f String) → HttpURL → f HttpURL
domain f s = (\u → s { _domain = u }) <$> f (_domain s)

path ∷ Functor f ⇒ (String → f String) → HttpURL → f HttpURL
path f s = (\u → s { _path = u }) <$> f (_path s)

-- or with lenses and TemplateHaskell just:
-- $(makeLenses ''HttpURL)

instance FromJSON (HttpURL → HttpURL) where
parseJSON = withObject "HttpURL" $ \o → id
<$< auth %.: "auth" % o
<*< domain ..: "domain" % o