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


-- | Generate PureScript accessor functions for you servant API
--   
--   Please see README.md
@package servant-purescript
@version 0.8.0.0

module Servant.PureScript.Internal

-- | Our language type is Paramized, so you can choose a custom
--   <tt>TypeBridge</tt> for your translation, by providing your own data
--   type and implementing <a>HasBridge</a> for it.
--   
--   <pre>
--   data MyBridge
--   
--   myBridge :: TypeBridge
--   myBridge = defaultBridge &lt;|&gt; customBridge1 &lt;|&gt; customBridge2
--   
--   instance HasBridge MyBridge where
--     languageBridge _ = myBridge
--   </pre>
data PureScript bridgeSelector
class HasBridge a
languageBridge :: HasBridge a => Proxy a -> FullBridge

-- | Use <a>PureScript</a> <a>DefaultBridge</a> if <a>defaultBridge</a>
--   suffices for your needs.
data DefaultBridge

-- | <a>languageBridge</a> for <a>DefaultBridge</a> evaluates to
--   <a>buildBridge</a> <a>defaultBridge</a> - no surprise there.

-- | A proxy for <a>DefaultBridge</a>
defaultBridgeProxy :: Proxy DefaultBridge
type ParamName = Text
data Param f
Param :: ParamName -> f -> Param f
[_pName] :: Param f -> ParamName
[_pType] :: Param f -> f
type PSParam = Param PSType
pType :: forall f_aeuO f_ajLU. Lens (Param f_aeuO) (Param f_ajLU) f_aeuO f_ajLU
pName :: forall f_aeuO. Lens' (Param f_aeuO) ParamName
data Settings
Settings :: Text -> Set ParamName -> ImportLines -> Bool -> Settings
[_apiModuleName] :: Settings -> Text

-- | This function parameters should instead be put in a Reader monad.
--   
--   <tt>baseUrl</tt> will be put there by default, you can add additional
--   parameters.
--   
--   If your API uses a given parameter name multiple times with different
--   types, only the ones matching the type of the first occurrence will be
--   put in the Reader monad, all others will still be passed as function
--   parameter.
[_readerParams] :: Settings -> Set ParamName
[_standardImports] :: Settings -> ImportLines

-- | If you want codegen for servant-subscriber, set this to True. See the
--   central-counter example for a simple usage case.
[_generateSubscriberAPI] :: Settings -> Bool
standardImports :: Lens' Settings ImportLines
readerParams :: Lens' Settings (Set ParamName)
generateSubscriberAPI :: Lens' Settings Bool
apiModuleName :: Lens' Settings Text
defaultSettings :: Settings

-- | Add a parameter name to be us put in the Reader monad instead of being
--   passed to the generated functions.
addReaderParam :: ParamName -> Settings -> Settings
baseURLId :: ParamName
baseURLParam :: PSParam
subscriberToUserId :: ParamName
makeTypedToUserParam :: PSType -> PSParam
apiToList :: forall bridgeSelector api. (HasForeign (PureScript bridgeSelector) PSType api, GenerateList PSType (Foreign PSType api), HasBridge bridgeSelector) => Proxy api -> Proxy bridgeSelector -> [Req PSType]

-- | Transform a given identifer to be a valid PureScript variable name
--   (hopefully).
toPSVarName :: Text -> Text
psTypedToUser :: PSType -> PSType
psSubscriptions :: PSType
psTypeParameterA :: PSType
instance GHC.Show.Show f => GHC.Show.Show (Servant.PureScript.Internal.Param f)
instance GHC.Classes.Ord f => GHC.Classes.Ord (Servant.PureScript.Internal.Param f)
instance GHC.Classes.Eq f => GHC.Classes.Eq (Servant.PureScript.Internal.Param f)
instance (Data.Typeable.Internal.Typeable a, Servant.PureScript.Internal.HasBridge bridgeSelector) => Servant.Foreign.Internal.HasForeignType (Servant.PureScript.Internal.PureScript bridgeSelector) Language.PureScript.Bridge.TypeInfo.PSType a
instance Servant.PureScript.Internal.HasBridge Servant.PureScript.Internal.DefaultBridge

module Servant.PureScript.CodeGen
genModule :: Settings -> [Req PSType] -> Doc
genModuleHeader :: Text -> ImportLines -> Doc
getReaderParams :: Settings -> [PSParam] -> [PSParam]
genParamSettings :: [PSParam] -> Doc
genFunction :: [PSParam] -> Req PSType -> Doc
genGetReaderParams :: [PSParam] -> Doc
genSignature :: Text -> [PSType] -> Maybe PSType -> Doc
genSignatureBuilder :: Doc -> Text -> [PSType] -> Maybe PSType -> Doc
genFnHead :: Text -> [Text] -> Doc
genFnBody :: [PSParam] -> Req PSType -> Doc
genBuildURL :: Url PSType -> Doc
genBuildPath :: Path PSType -> Doc
genBuildSegment :: SegmentType PSType -> Doc
genBuildQuery :: [QueryArg PSType] -> Doc
genBuildQueryArg :: QueryArg PSType -> Doc
genBuildHeaders :: [HeaderArg PSType] -> Doc
genBuildHeader :: HeaderArg PSType -> Doc
reqsToImportLines :: [Req PSType] -> ImportLines
reqToPSTypes :: Req PSType -> [PSType]

-- | Extract all function parameters from a given Req.
reqToParams :: Req PSType -> [Param PSType]
urlToParams :: Url f -> [Param f]
segmentToParam :: SegmentType f -> Maybe (Param f)
queryArgToParam :: QueryArg f -> Param f
headerArgToParam :: HeaderArg f -> Param f
reqBodyToParam :: Maybe f -> Maybe (Param f)
docIntercalate :: Doc -> [Doc] -> Doc
textURLEncode :: Bool -> Text -> Text

-- | Little helper for generating valid variable names
psVar :: Text -> Doc

module Servant.PureScript.MakeRequests
subscriberImportLines :: Map Text ImportLine
genModule :: Settings -> [Req PSType] -> Doc
genFunction :: [PSParam] -> Req PSType -> Doc
genSignature :: Text -> [PSType] -> Maybe PSType -> Doc
genFnBody :: [PSParam] -> Req PSType -> Doc
genBuildPath :: Path PSType -> Doc
genBuildSegment :: SegmentType PSType -> Doc
genBuildQuery :: [QueryArg PSType] -> Doc
genBuildQueryArg :: QueryArg PSType -> Doc
genBuildHeaders :: [HeaderArg PSType] -> Doc
genBuildHeader :: HeaderArg PSType -> Doc
psHttpRequest :: PSType

module Servant.PureScript.Subscriber
genModule :: Settings -> [Req PSType] -> Doc
genFunction :: [PSParam] -> Req PSType -> Doc
genSignature :: Text -> [PSType] -> Maybe PSType -> Doc
genFnBody :: Text -> [Text] -> Doc
genFnCall :: Text -> [Text] -> Doc

module Servant.PureScript
class HasBridge a
languageBridge :: HasBridge a => Proxy a -> FullBridge
languageBridge :: HasBridge a => Proxy a -> FullBridge

-- | Default bridge for mapping primitive/common types: You can append your
--   own bridges like this:
--   
--   <pre>
--   defaultBridge &lt;|&gt; myBridge1 &lt;|&gt; myBridge2
--   </pre>
--   
--   Find examples for bridge definitions in
--   <a>Language.PureScript.Bridge.Primitives</a> and
--   <a>Language.PureScript.Bridge.Tuple</a>.
defaultBridge :: BridgePart

-- | A proxy for <a>DefaultBridge</a>
defaultBridgeProxy :: Proxy DefaultBridge

-- | Use <a>PureScript</a> <a>DefaultBridge</a> if <a>defaultBridge</a>
--   suffices for your needs.
data DefaultBridge

-- | Standard entry point - just create a purescript module with default
--   settings for accessing the servant API.
writeAPIModule :: forall bridgeSelector api. (HasForeign (PureScript bridgeSelector) PSType api, GenerateList PSType (Foreign PSType api), HasBridge bridgeSelector) => FilePath -> Proxy bridgeSelector -> Proxy api -> IO ()
writeAPIModuleWithSettings :: forall bridgeSelector api. (HasForeign (PureScript bridgeSelector) PSType api, GenerateList PSType (Foreign PSType api), HasBridge bridgeSelector) => Settings -> FilePath -> Proxy bridgeSelector -> Proxy api -> IO ()
data Settings
Settings :: Text -> Set ParamName -> ImportLines -> Bool -> Settings
[_apiModuleName] :: Settings -> Text

-- | This function parameters should instead be put in a Reader monad.
--   
--   <tt>baseUrl</tt> will be put there by default, you can add additional
--   parameters.
--   
--   If your API uses a given parameter name multiple times with different
--   types, only the ones matching the type of the first occurrence will be
--   put in the Reader monad, all others will still be passed as function
--   parameter.
[_readerParams] :: Settings -> Set ParamName
[_standardImports] :: Settings -> ImportLines

-- | If you want codegen for servant-subscriber, set this to True. See the
--   central-counter example for a simple usage case.
[_generateSubscriberAPI] :: Settings -> Bool
apiModuleName :: Lens' Settings Text
readerParams :: Lens' Settings (Set ParamName)
standardImports :: Lens' Settings ImportLines
defaultSettings :: Settings

-- | Add a parameter name to be us put in the Reader monad instead of being
--   passed to the generated functions.
addReaderParam :: ParamName -> Settings -> Settings

-- | Use this function for implementing <a>parseUrlPiece</a> in your
--   FromHttpApiData instances in order to be compatible with the generated
--   PS code.
--   
--   <pre>
--    
--   instance ToHttpApiData MyDataType where
--     toUrlPiece = jsonToUrlPiece
--     toHeader   = jsonToHeader
--   
--   instance FromHttpApiData MyDataType where
--     parseUrlPiece = jsonParseUrlPiece
--     parseHeader   = jsonParseHeader
--   </pre>
jsonParseUrlPiece :: FromJSON a => Text -> Either Text a

-- | Use this function for implementing <a>toUrlPiece</a> in your
--   ToHttpApiData instances in order to be compatible with the generated
--   PS code.
jsonToUrlPiece :: ToJSON a => a -> Text

-- | Use this function for implementing <a>parseHeader</a> in your
--   FromHttpApiData instances in order to be compatible with the generated
--   PS code.
jsonParseHeader :: FromJSON a => ByteString -> Either Text a

-- | Use this function for implementing <a>toHeader</a> in your
--   ToHttpApiData instances in order to be compatible with the generated
--   PS code.
jsonToHeader :: ToJSON a => a -> ByteString


-- | A header which gets sent by the browser and is thus of no concern for
--   the client consumer of the API.
module Servant.API.BrowserHeader
data BrowserHeader (sym :: Symbol) a
instance Servant.Utils.Links.HasLink sub => Servant.Utils.Links.HasLink (Servant.API.BrowserHeader.BrowserHeader sym a Servant.API.Sub.:> sub)
instance (GHC.TypeLits.KnownSymbol sym, Web.Internal.HttpApiData.FromHttpApiData a, Servant.Server.Internal.HasServer sublayout context) => Servant.Server.Internal.HasServer (Servant.API.BrowserHeader.BrowserHeader sym a Servant.API.Sub.:> sublayout) context
instance (GHC.TypeLits.KnownSymbol sym, Servant.Foreign.Internal.HasForeign lang ftype sublayout) => Servant.Foreign.Internal.HasForeign lang ftype (Servant.API.BrowserHeader.BrowserHeader sym a Servant.API.Sub.:> sublayout)
