-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Generate lens-family style lenses
--   
--   (see README.md)
@package lens-family-th
@version 0.5.0.2


-- | The shared functionality behind Lens.Family.TH and Lens.Family2.TH.
module Lens.Family.THCore

-- | By default, if the field name begins with an underscore, then the
--   underscore will simply be removed (and the new first character
--   lowercased if necessary).
defaultNameTransform :: String -> Maybe String

-- | Information about the larger type the lens will operate on.
type LensTypeInfo = (Name, [TyVarBndr])

-- | Information about the smaller type the lens will operate on.
type ConstructorFieldInfo = (Name, Strict, Type)

-- | The true workhorse of lens derivation. This macro is parameterized by
--   a macro that derives signatures, as well as a function that filters
--   and transforms names. Producing Nothing means that a lens should not
--   be generated for the provided name.
deriveLenses :: (Name -> LensTypeInfo -> ConstructorFieldInfo -> Q [Dec]) -> (String -> Maybe String) -> Name -> Q [Dec]

-- | Derive traversals for each constructor in a data or newtype
--   declaration, Traversals will be named by prefixing the constructor
--   name with an underscore.
--   
--   Example usage:
--   
--   <pre>
--   $(makeTraversals ''Foo)
--   </pre>
makeTraversals :: Name -> Q [Dec]


-- | Derive lenses for <a>Lens.Family</a>.
--   
--   Example usage:
--   
--   <pre>
--   {-# LANGUAGE TemplateHaskell #-}
--   
--   import Lens.Family
--   import Lens.Family.TH
--   
--   data Foo a = Foo { _bar :: Int, _baz :: a }
--              deriving (Show, Read, Eq, Ord)
--   $(makeLenses ''Foo)
--   </pre>
module Lens.Family.TH

-- | Derive lenses for the record selectors in a single-constructor data
--   declaration, or for the record selector in a newtype declaration.
--   Lenses will only be generated for record fields which are prefixed
--   with an underscore.
--   
--   Example usage:
--   
--   <pre>
--   $(makeLenses ''Foo)
--   </pre>
makeLenses :: Name -> Q [Dec]

-- | Derive lenses with the provided name transformation and filtering
--   function. Produce <tt>Just lensName</tt> to generate a lens of the
--   resultant name, or <tt>Nothing</tt> to not generate a lens for the
--   input record name.
--   
--   Example usage:
--   
--   <pre>
--   $(makeLensesBy (\n -&gt; Just (n ++ "L")) ''Foo)
--   </pre>
makeLensesBy :: (String -> Maybe String) -> Name -> Q [Dec]

-- | Derive lenses, specifying explicit pairings of <tt>(fieldName,
--   lensName)</tt>.
--   
--   Example usage:
--   
--   <pre>
--   $(makeLensesFor [("_foo", "fooLens"), ("bar", "lbar")] ''Foo)
--   </pre>
makeLensesFor :: [(String, String)] -> Name -> Q [Dec]

-- | Derive traversals for each constructor in a data or newtype
--   declaration, Traversals will be named by prefixing the constructor
--   name with an underscore.
--   
--   Example usage:
--   
--   <pre>
--   $(makeTraversals ''Foo)
--   </pre>
makeTraversals :: Name -> Q [Dec]

-- | <i>Deprecated: Use makeLenses instead.</i>
mkLenses :: Name -> Q [Dec]

-- | <i>Deprecated: Use makeLensesBy instead.</i>
mkLensesBy :: (String -> Maybe String) -> Name -> Q [Dec]

-- | <i>Deprecated: Use makeLensesFor instead.</i>
mkLensesFor :: [(String, String)] -> Name -> Q [Dec]


-- | Derive lenses for <a>Lens.Family2</a>.
--   
--   Example usage:
--   
--   <pre>
--   {-# LANGUAGE TemplateHaskell, Rank2Types #-}
--   
--   import Lens.Family2
--   import Lens.Family2.TH
--   
--   data Foo a = Foo { _bar :: Int, _baz :: a }
--              deriving (Show, Read, Eq, Ord)
--   $(makeLenses ''Foo)
--   </pre>
module Lens.Family2.TH

-- | Derive lenses for the record selectors in a single-constructor data
--   declaration, or for the record selector in a newtype declaration.
--   Lenses will only be generated for record fields which are prefixed
--   with an underscore.
--   
--   Example usage:
--   
--   <pre>
--   $(makeLenses ''Foo)
--   </pre>
makeLenses :: Name -> Q [Dec]

-- | Derive lenses with the provided name transformation and filtering
--   function. Produce <tt>Just lensName</tt> to generate a lens of the
--   resultant name, or <tt>Nothing</tt> to not generate a lens for the
--   input record name.
--   
--   Example usage:
--   
--   <pre>
--   $(makeLensesBy (\n -&gt; Just (n ++ "L")) ''Foo)
--   </pre>
makeLensesBy :: (String -> Maybe String) -> Name -> Q [Dec]

-- | Derive lenses, specifying explicit pairings of <tt>(fieldName,
--   lensName)</tt>.
--   
--   Example usage:
--   
--   <pre>
--   $(makeLensesFor [("_foo", "fooLens"), ("bar", "lbar")] ''Foo)
--   </pre>
makeLensesFor :: [(String, String)] -> Name -> Q [Dec]

-- | Derive traversals for each constructor in a data or newtype
--   declaration, Traversals will be named by prefixing the constructor
--   name with an underscore.
--   
--   Example usage:
--   
--   <pre>
--   $(makeTraversals ''Foo)
--   </pre>
makeTraversals :: Name -> Q [Dec]

-- | <i>Deprecated: Use makeLenses instead.</i>
mkLenses :: Name -> Q [Dec]

-- | <i>Deprecated: Use makeLensesBy instead.</i>
mkLensesBy :: (String -> Maybe String) -> Name -> Q [Dec]

-- | <i>Deprecated: Use makeLensesFor instead.</i>
mkLensesFor :: [(String, String)] -> Name -> Q [Dec]
