Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove data-default-class #386

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Web/Scotty/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
import Control.Monad.IO.Class (MonadIO(..))
import UnliftIO (MonadUnliftIO(..))
import Control.Monad.Reader (MonadReader(..), ReaderT, asks, mapReaderT)
import Control.Monad.State.Strict (State, StateT(..))

Check warning on line 25 in Web/Scotty/Internal/Types.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.4

The import of ‘StateT’

Check warning on line 25 in Web/Scotty/Internal/Types.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.2

The import of ‘StateT’

Check warning on line 25 in Web/Scotty/Internal/Types.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

The import of ‘StateT’

Check warning on line 25 in Web/Scotty/Internal/Types.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

The import of ‘StateT’

Check warning on line 25 in Web/Scotty/Internal/Types.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7

The import of ‘StateT’

Check warning on line 25 in Web/Scotty/Internal/Types.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.6

The import of ‘StateT’
import Control.Monad.Trans.Class (MonadTrans(..))
import Control.Monad.Trans.Control (MonadBaseControl, MonadTransControl)
import qualified Control.Monad.Trans.Resource as RT (InternalState, InvalidAccess)

import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy.Char8 as LBS8 (ByteString)
import Data.Default.Class (Default, def)
import Data.String (IsString(..))
import qualified Data.Text as T (Text, pack)
import Data.Typeable (Typeable)
Expand Down Expand Up @@ -58,18 +57,12 @@
-- servers using `setFdCacheDuration`.
}

instance Default Options where
def = defaultOptions

defaultOptions :: Options
defaultOptions = Options 1 W.defaultSettings

newtype RouteOptions = RouteOptions { maxRequestBodySize :: Maybe Kilobytes -- max allowed request size in KB
}

instance Default RouteOptions where
def = defaultRouteOptions

defaultRouteOptions :: RouteOptions
defaultRouteOptions = RouteOptions Nothing

Expand Down Expand Up @@ -100,9 +93,6 @@
, routeOptions :: RouteOptions
}

-- instance Default (ScottyState m) where
-- def = defaultScottyState

defaultScottyState :: ScottyState m
defaultScottyState = ScottyState [] [] Nothing defaultRouteOptions

Expand Down Expand Up @@ -231,8 +221,6 @@
setStatus :: Status -> ScottyResponse -> ScottyResponse
setStatus s sr = sr { srStatus = s }

instance Default ScottyResponse where
def = defaultScottyResponse

-- | The default response has code 200 OK and empty body
defaultScottyResponse :: ScottyResponse
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## next [????.??.??]


### Breaking changes
* Remove dependency on data-default class (#386). We have been exporting constants for default config values since 0.20, and this dependency was simply unnecessary.



## 0.22 [2024.03.09]

### New
Expand Down
1 change: 0 additions & 1 deletion scotty.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Library
bytestring >= 0.10.0.2 ,
case-insensitive >= 1.0.0.1 && < 1.3,
cookie >= 0.4,
data-default-class >= 0.1,
exceptions >= 0.7 && < 0.11,
http-types >= 0.9.1 && < 0.13,
monad-control >= 1.0.0.3 && < 1.1,
Expand Down
Loading