diff --git a/servant-multipart.cabal b/servant-multipart.cabal index 66d0f88..769896c 100644 --- a/servant-multipart.cabal +++ b/servant-multipart.cabal @@ -22,7 +22,7 @@ tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.3 library default-language: Haskell2010 hs-source-dirs: src - exposed-modules: Servant.Multipart + exposed-modules: Servant.Multipart, Servant.Multipart.Internal -- ghc boot libs build-depends: diff --git a/src/Servant/Multipart.hs b/src/Servant/Multipart.hs index 5ae5e1b..3cda3d2 100644 --- a/src/Servant/Multipart.hs +++ b/src/Servant/Multipart.hs @@ -1,23 +1,3 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE InstanceSigs #-} -{-# LANGUAGE TypeOperators #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeSynonymInstances #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE UndecidableInstances #-} -{-# LANGUAGE TypeApplications #-} --- | @multipart/form-data@ support for servant. --- --- This is mostly useful for adding file upload support to --- an API. See haddocks of 'MultipartForm' for an introduction. module Servant.Multipart ( MultipartForm , MultipartForm' @@ -42,658 +22,4 @@ module Servant.Multipart , ToMultipartSample(..) ) where -import Control.Lens ((<>~), (&), view, (.~)) -import Control.Monad (replicateM) -import Control.Monad.IO.Class -import Control.Monad.Trans.Resource -import Data.Array (listArray, (!)) -import Data.List (find, foldl') -import Data.Maybe -import Data.Monoid -import Data.String.Conversions (cs) -import Data.Text (Text, unpack) -import Data.Text.Encoding (decodeUtf8, encodeUtf8) -import Data.Typeable -import Network.HTTP.Media.MediaType ((//), (/:)) -import Network.Wai -import Network.Wai.Parse -import Servant hiding (contentType) -import Servant.API.Modifiers (FoldLenient) -import Servant.Client.Core (HasClient(..), RequestBody(RequestBodySource), setRequestBody) -import Servant.Docs hiding (samples) -import Servant.Foreign hiding (contentType) -import Servant.Server.Internal -import Servant.Types.SourceT (SourceT(..), source, StepT(..), fromActionStep) -import System.Directory -import System.IO (IOMode(ReadMode), withFile) -import System.Random (getStdRandom, Random(randomR)) - -import qualified Data.ByteString as SBS -import qualified Data.ByteString.Lazy as LBS - --- | Combinator for specifying a @multipart/form-data@ request --- body, typically (but not always) issued from an HTML @\