Skip to content

Commit 8e9e9ba

Browse files
committed
Fix building Servant.Multipart.Client
1 parent 110784e commit 8e9e9ba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

servant-multipart-client/servant-multipart-client.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ library
3030
build-depends:
3131
array >=0.5.1.1 && <0.6
3232
, base >=4.9 && <5
33+
, base-compat >=0.11.2 && <0.14
3334
, bytestring >=0.10.8.1 && <0.12
3435
, text >=1.2.3.0 && <2.1
3536
, random >=0.1.1 && <1.3

servant-multipart-client/src/Servant/Multipart/Client.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Servant.Multipart.API
2727
import Control.Monad (replicateM)
2828
import Data.Array (listArray, (!))
2929
import Data.List (foldl')
30+
import Data.List.Compat (singleton)
3031
#if !MIN_VERSION_base(4,11,0)
3132
import Data.Monoid ((<>))
3233
#endif
@@ -74,7 +75,7 @@ instance MultipartClient Tmp where
7475
readHandle hdl = fromActionStep LBS.null (LBS.hGet hdl 4096)
7576

7677
instance MultipartClient Mem where
77-
loadFile _ = source . pure
78+
loadFile _ = source . singleton
7879

7980
-- | Generates a boundary to be used to separate parts of the multipart.
8081
-- Requires 'IO' because it is randomized.
@@ -132,7 +133,7 @@ multipartToBody boundary mp = RequestBodySource $ files' <> source ["--", bounda
132133
renderInput input = renderPart (lencode . iName $ input)
133134
"text/plain"
134135
""
135-
(source . pure . lencode . iValue $ input)
136+
(source . singleton . lencode . iValue $ input)
136137
inputs' = foldl' (\acc x -> acc `mappend'` renderInput x) mempty' (inputs mp)
137138
renderFile :: FileData tag -> SourceIO LBS.ByteString
138139
renderFile file = renderPart (lencode . fdInputName $ file)

0 commit comments

Comments
 (0)