haskell-http-client.ModelLens.mustache Maven / Gradle / Ivy
{{>partial_header}}
{-|
Module : {{baseModule}}.Lens
-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
module {{baseModule}}.ModelLens where
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy as BL
import qualified Data.Data as P (Data, Typeable)
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Time as TI
import Data.Text (Text)
import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
import qualified Prelude as P
import {{baseModule}}.Model
import {{baseModule}}.Core
{{#models}}
{{#model}}
-- * {{classname}}
{{#vars}}
-- | '{{name}}' Lens
{{name}}L :: Lens_' {{classname}} ({{^required}}Maybe {{/required}}{{{vendorExtensions.x-data-type}}})
{{name}}L f {{classname}}{..} = (\{{name}} -> {{classname}} { {{name}}, ..} ) <$> f {{name}}
{-# INLINE {{name}}L #-}
{{/vars}}
{{/model}}
{{/models}}