chore: enable GHC NumericUnderscores language extension
The `_` character between numeric literals improve their readablity. Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
@@ -41,6 +41,7 @@ library
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
|
NumericUnderscores
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
exposed-modules: PostgREST.Admin
|
exposed-modules: PostgREST.Admin
|
||||||
PostgREST.App
|
PostgREST.App
|
||||||
@@ -218,6 +219,7 @@ test-suite spec
|
|||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
QuasiQuotes
|
QuasiQuotes
|
||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
|
NumericUnderscores
|
||||||
hs-source-dirs: test/spec
|
hs-source-dirs: test/spec
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
other-modules: Feature.Auth.AsymmetricJwtSpec
|
other-modules: Feature.Auth.AsymmetricJwtSpec
|
||||||
@@ -317,6 +319,7 @@ test-suite observability
|
|||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
QuasiQuotes
|
QuasiQuotes
|
||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
|
NumericUnderscores
|
||||||
hs-source-dirs: test/observability
|
hs-source-dirs: test/observability
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
other-modules: ObsHelper
|
other-modules: ObsHelper
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ retryingSchemaCacheLoad appState@AppState{stateObserver=observer, stateMainThrea
|
|||||||
let delayMicroseconds = 32*oneSecondInUs {-32 seconds-} in
|
let delayMicroseconds = 32*oneSecondInUs {-32 seconds-} in
|
||||||
capDelay delayMicroseconds $ exponentialBackoff oneSecondInUs
|
capDelay delayMicroseconds $ exponentialBackoff oneSecondInUs
|
||||||
|
|
||||||
oneSecondInUs = 1000000 -- one second in microseconds
|
oneSecondInUs = 1_000_000 -- one second in microseconds
|
||||||
|
|
||||||
newSchemaCacheStatus :: IO SchemaCacheStatus
|
newSchemaCacheStatus :: IO SchemaCacheStatus
|
||||||
newSchemaCacheStatus = SchemaCacheStatus <$> newEmptyTMVarIO
|
newSchemaCacheStatus = SchemaCacheStatus <$> newEmptyTMVarIO
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ retryingListen appState nextDelay hasDbListenerBug = do
|
|||||||
where
|
where
|
||||||
observer = AppState.getObserver appState
|
observer = AppState.getObserver appState
|
||||||
mainThreadId = AppState.getMainThreadId appState
|
mainThreadId = AppState.getMainThreadId appState
|
||||||
oneSecondInMicro = 1000000
|
oneSecondInMicro = 1_000_000
|
||||||
maxDelay = 32
|
maxDelay = 32
|
||||||
|
|
||||||
handleNotification channel msg =
|
handleNotification channel msg =
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ data LoggerState = LoggerState
|
|||||||
init :: IO LoggerState
|
init :: IO LoggerState
|
||||||
init = mdo
|
init = mdo
|
||||||
let
|
let
|
||||||
oneSecond = 1000000
|
oneSecond = 1_000_000
|
||||||
loggerState = LoggerState zTime debouncePoolTimeout
|
loggerState = LoggerState zTime debouncePoolTimeout
|
||||||
zTime <- mkAutoUpdate defaultUpdateSettings { updateAction = getZonedTime }
|
zTime <- mkAutoUpdate defaultUpdateSettings { updateAction = getZonedTime }
|
||||||
debouncePoolTimeout <- makeDebouncer $
|
debouncePoolTimeout <- makeDebouncer $
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ waitForObs (ObsChan orig copy) t msg f =
|
|||||||
-- duplicate the provided channel and construct wairFor function binding both channels
|
-- duplicate the provided channel and construct wairFor function binding both channels
|
||||||
-- accumulate effecful computation results into a list for specified time
|
-- accumulate effecful computation results into a list for specified time
|
||||||
takeUntilTimeout t' = fmap reverse . accumulateUntilTimeout t' (flip (:)) []
|
takeUntilTimeout t' = fmap reverse . accumulateUntilTimeout t' (flip (:)) []
|
||||||
decisecond = 100000
|
decisecond = 100_000
|
||||||
|
|
||||||
obsDiagMessage :: Observation -> Text
|
obsDiagMessage :: Observation -> Text
|
||||||
obsDiagMessage = \case
|
obsDiagMessage = \case
|
||||||
|
|||||||
@@ -46,4 +46,4 @@ spec = describe "Server started with metrics enabled" $ do
|
|||||||
waitFor (1 * sec) "SchemaCacheQueriedObs" $ \x -> [ o | o@SchemaCacheQueriedObs{} <- pure x ]
|
waitFor (1 * sec) "SchemaCacheQueriedObs" $ \x -> [ o | o@SchemaCacheQueriedObs{} <- pure x ]
|
||||||
waitFor (1 * sec) "SchemaCacheLoadedObs" $ \x -> [ o | o@SchemaCacheLoadedObs{} <- pure x ]
|
waitFor (1 * sec) "SchemaCacheLoadedObs" $ \x -> [ o | o@SchemaCacheLoadedObs{} <- pure x ]
|
||||||
where
|
where
|
||||||
sec = 1000000
|
sec = 1_000_000
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ planCost :: SResponse -> Float
|
|||||||
planCost resp =
|
planCost resp =
|
||||||
let res = simpleBody resp ^? nth 0 . key "Plan" . key "Total Cost" in
|
let res = simpleBody resp ^? nth 0 . key "Plan" . key "Total Cost" in
|
||||||
-- big value in case parsing fails
|
-- big value in case parsing fails
|
||||||
fromMaybe 1000000000.0 $ unbox =<< res
|
fromMaybe 1_000_000_000.0 $ unbox =<< res
|
||||||
where
|
where
|
||||||
unbox :: JSON.Value -> Maybe Float
|
unbox :: JSON.Value -> Maybe Float
|
||||||
unbox (JSON.Number n) = Just $ toRealFloat n
|
unbox (JSON.Number n) = Just $ toRealFloat n
|
||||||
|
|||||||
Reference in New Issue
Block a user