Skip to content

Commit

Permalink
Remove base-compat and use TypeApplications
Browse files Browse the repository at this point in the history
  • Loading branch information
marinelli committed Sep 3, 2023
1 parent 8e9e9ba commit a2bf235
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion servant-multipart-client/servant-multipart-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ library
build-depends:
array >=0.5.1.1 && <0.6
, base >=4.9 && <5
, base-compat >=0.11.2 && <0.14
, bytestring >=0.10.8.1 && <0.12
, text >=1.2.3.0 && <2.1
, random >=0.1.1 && <1.3
Expand Down
5 changes: 2 additions & 3 deletions servant-multipart-client/src/Servant/Multipart/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import Servant.Multipart.API
import Control.Monad (replicateM)
import Data.Array (listArray, (!))
import Data.List (foldl')
import Data.List.Compat (singleton)
#if !MIN_VERSION_base(4,11,0)
import Data.Monoid ((<>))
#endif
Expand Down Expand Up @@ -75,7 +74,7 @@ instance MultipartClient Tmp where
readHandle hdl = fromActionStep LBS.null (LBS.hGet hdl 4096)

instance MultipartClient Mem where
loadFile _ = source . singleton
loadFile _ = source . pure @[]

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

0 comments on commit a2bf235

Please sign in to comment.