Skip to content

Commit c466d33

Browse files
authored
Merge pull request #8 from cocreature/multipart-instance-example
Fix haddock examples for custom FromMultipart instances
2 parents d2dd0bb + 064f000 commit c466d33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Servant/Multipart.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ import qualified Data.ByteString.Lazy as LBS
107107
-- instance FromMultipart Tmp User where
108108
-- fromMultipart multipartData =
109109
-- User \<$\> lookupInput "username" multipartData
110-
-- \<*\> fmap fileContent (lookupFile "pic" multipartData)
110+
-- \<*\> fmap fdPayload (lookupFile "pic" multipartData)
111111
--
112112
-- type API = MultipartForm Tmp User :> Post '[PlainText] String
113113
--
@@ -218,10 +218,10 @@ lookupInput iname = fmap iValue . find ((==iname) . iName) . inputs
218218
-- @
219219
-- data User = User { username :: Text, pic :: FilePath }
220220
--
221-
-- instance FromMultipart User where
221+
-- instance FromMultipart Tmp User where
222222
-- fromMultipart form =
223223
-- User \<$\> lookupInput "username" (inputs form)
224-
-- \<*\> fmap fdFilePath (lookupFile "pic" $ files form)
224+
-- \<*\> fmap fdPayload (lookupFile "pic" $ files form)
225225
-- @
226226
class FromMultipart tag a where
227227
-- | Given a value of type 'MultipartData', which consists

0 commit comments

Comments
 (0)