git.iko.soy/haskell-servant/servant-elm
on master help sign in
Update docs
commit54754b6a3e96ec4daded11bf84d5b9bc1f7b9052 authorSander <hey@sandydoo.me> dateFri 12 Jan 2024, 20:59 (3 years ago) parent5faec7e
1 file changed+8−2
src/Servant/Elm/Internal/Generate.hs+8−2
src/Servant/Elm/Internal/Generate.hs+8−2
@@ -53,19 +53,22 @@ data ElmOptions = ElmOptions
5353 argument.
5454 -}
5555 urlPrefix :: UrlPrefix
56− , elmTypeAlterations :: (EType -> EType)
56+ , elmTypeAlterations :: (EType -> EType)
5757 -- ^ Alterations to perform on ETypes before code generation.
5858 , elmAlterations :: (ETypeDef -> ETypeDef)
5959 -- ^ Alterations to perform on ETypeDefs before code generation.
60− , elmToString :: (EType -> Text)
60+ , elmToString :: (EType -> Text)
6161 -- ^ Elm functions creating a string from a given type.
6262 , emptyResponseElmTypes :: [EType]
6363 -- ^ Types that represent an empty Http response.
6464 , stringElmTypes :: [EType]
6565 -- ^ Types that represent a String.
6666 , expectJsonMethod :: Text
67+ -- ^ The function to use for JSON responses.
6768 , expectStringMethod :: Text
69+ -- ^ The function to use for string responses.
6870 , httpErrorType :: Text
71+ -- ^ The type to use for Http errors.
6972 }
7073
7174
@@ -89,6 +92,9 @@ The default options are:
8992> , stringElmTypes =
9093> [ getType (Proxy :: Proxy String)
9194> , getType (Proxy :: Proxy T.Text) ]
95+> , expectJsonMethod = "Http.expectJson"
96+> , expectStringMethod = "Http.expectString"
97+> , httpErrorType = "Http.Error"
9298> }
9399-}
94100defElmOptions :: ElmOptions