@@ -64,6 +64,7 @@ data ElmOptions = ElmOptions
6464 , stringElmTypes :: [EType]
6565 -- ^ Types that represent a String.
6666 , expectJsonMethod :: Text
67+ , expectStringMethod :: Text
6768 , httpErrorType :: Text
6869 }
6970
@@ -104,6 +105,7 @@ defElmOptions = ElmOptions
104105 , toElmType (Proxy :: Proxy T.Text)
105106 ]
106107 , expectJsonMethod = "Http.expectJson"
108+ , expectStringMethod = "Http.expectString"
107109 , httpErrorType = "Http.Error"
108110 }
109111
@@ -313,7 +315,7 @@ mkTypeSignature opts request =
313315 toMsgType :: Maybe Doc
314316 toMsgType = do
315317 result <- fmap elmTypeRef $ request ^. F.reqReturnType
316− Just ("(Result" <+> stext (httpErrorType opts) <+> parens result <+> " -> msg)")
318+ Just ("(Result" <+> stext (httpErrorType opts) <+> parens result <+> "-> msg)")
317319
318320 returnType :: Maybe Doc
319321 returnType = do
@@ -505,11 +507,11 @@ mkRequest opts request =
505507 | isEmptyType opts $ (elmTypeAlterations opts) elmTypeExpr
506508 -- let elmConstructor = T.pack (renderElm elmTypeExpr)
507509 ->
508− "Http.expectString " <> line <+> indent i "(\\x -> case x of" <> line <+>
510+ stext (expectStringMethod opts) <> line <+> indent i "(\\x -> case x of" <> line <+>
509511 indent i "Err e -> toMsg (Err e)" <> line <+>
510512 indent i "Ok _ -> toMsg (Ok ()))"
511513 Just elmTypeExpr ->
512− stext (expectJsonMethod opts) <+> " toMsg" <+> renderDecoderName ((elmTypeAlterations opts) elmTypeExpr)
514+ stext (expectJsonMethod opts) <+> "toMsg" <+> renderDecoderName ((elmTypeAlterations opts) elmTypeExpr)
513515 Nothing -> error "mkHttpRequest: no reqReturnType?"
514516 -- case request ^. F.reqReturnType of
515517 -- Just elmTypeExpr | isEmptyType opts elmTypeExpr ->