@@ -53,19 +53,22 @@ data ElmOptions = ElmOptions
55 urlPrefix :: UrlPrefix
55 urlPrefix :: UrlPrefix
56− , elmTypeAlterations :: (EType -> EType)
56+ , elmTypeAlterations :: (EType -> EType)
57 -- ^ Alterations to perform on ETypes before code generation.
57 -- ^ Alterations to perform on ETypes before code generation.
58 , elmAlterations :: (ETypeDef -> ETypeDef)
58 , elmAlterations :: (ETypeDef -> ETypeDef)
59 -- ^ Alterations to perform on ETypeDefs before code generation.
59 -- ^ Alterations to perform on ETypeDefs before code generation.
60− , elmToString :: (EType -> Text)
60+ , elmToString :: (EType -> Text)
61 -- ^ Elm functions creating a string from a given type.
61 -- ^ Elm functions creating a string from a given type.
62 , emptyResponseElmTypes :: [EType]
62 , emptyResponseElmTypes :: [EType]
63 -- ^ Types that represent an empty Http response.
63 -- ^ Types that represent an empty Http response.
64 , stringElmTypes :: [EType]
64 , stringElmTypes :: [EType]
65 -- ^ Types that represent a String.
65 -- ^ Types that represent a String.
66 , expectJsonMethod :: Text
66 , expectJsonMethod :: Text
67+ -- ^ The function to use for JSON responses.
67 , expectStringMethod :: Text
68 , expectStringMethod :: Text
69+ -- ^ The function to use for string responses.
68 , httpErrorType :: Text
70 , httpErrorType :: Text
71+ -- ^ The type to use for Http errors.
@@ -89,6 +92,9 @@ The default options are:
89> , stringElmTypes =
92> , stringElmTypes =
90> [ getType (Proxy :: Proxy String)
93> [ getType (Proxy :: Proxy String)
91> , getType (Proxy :: Proxy T.Text) ]
94> , getType (Proxy :: Proxy T.Text) ]
95+> , expectJsonMethod = "Http.expectJson"
96+> , expectStringMethod = "Http.expectString"
97+> , httpErrorType = "Http.Error"
94defElmOptions :: ElmOptions
100defElmOptions :: ElmOptions