Compare commits
No commits in common. "480073894bb67843abb76a1d51adad53468b73eb" and "2a92e3e8b0fda4cca47cb3a8b83352e0dc322f62" have entirely different histories.
480073894b
...
2a92e3e8b0
@ -20,7 +20,7 @@ description: Please see the README at <https://git.fiskhamn.se/steffenom
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- base >= 4.7 && < 5
|
- base >= 4.7 && < 5
|
||||||
- text == 2.*
|
- text == 1.2.*
|
||||||
- effectful-core >= 2.2.2.0 && < 3
|
- effectful-core >= 2.2.2.0 && < 3
|
||||||
- effectful >= 2.2.2.0 && < 3
|
- effectful >= 2.2.2.0 && < 3
|
||||||
- effectful-th == 1.*
|
- effectful-th == 1.*
|
||||||
@ -28,7 +28,6 @@ dependencies:
|
|||||||
- torsor == 0.1
|
- torsor == 0.1
|
||||||
- unliftio == 0.2.*
|
- unliftio == 0.2.*
|
||||||
- co-log-core == 0.3.*
|
- co-log-core == 0.3.*
|
||||||
- bytestring == 0.11.*
|
|
||||||
|
|
||||||
ghc-options:
|
ghc-options:
|
||||||
- -Wall
|
- -Wall
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
cabal-version: 1.12
|
cabal-version: 1.12
|
||||||
|
|
||||||
-- This file has been generated from package.yaml by hpack version 0.36.0.
|
-- This file has been generated from package.yaml by hpack version 0.35.1.
|
||||||
--
|
--
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
@ -56,13 +56,12 @@ library
|
|||||||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
|
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
, bytestring ==0.11.*
|
|
||||||
, chronos >=1.1.5 && <2
|
, chronos >=1.1.5 && <2
|
||||||
, co-log-core ==0.3.*
|
, co-log-core ==0.3.*
|
||||||
, effectful >=2.2.2.0 && <3
|
, effectful >=2.2.2.0 && <3
|
||||||
, effectful-core >=2.2.2.0 && <3
|
, effectful-core >=2.2.2.0 && <3
|
||||||
, effectful-th ==1.*
|
, effectful-th ==1.*
|
||||||
, text ==2.*
|
, text ==1.2.*
|
||||||
, torsor ==0.1
|
, torsor ==0.1
|
||||||
, unliftio ==0.2.*
|
, unliftio ==0.2.*
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|||||||
@ -18,9 +18,6 @@ import Data.Text qualified as T
|
|||||||
import Data.Text.IO qualified as T
|
import Data.Text.IO qualified as T
|
||||||
import Data.Text.Lazy qualified as LT
|
import Data.Text.Lazy qualified as LT
|
||||||
import Data.Text.Lazy.Builder qualified as T
|
import Data.Text.Lazy.Builder qualified as T
|
||||||
import Data.Text.Encoding qualified as T
|
|
||||||
import Data.Text.Lazy.Encoding qualified as LT
|
|
||||||
import Data.Text.Encoding.Error qualified as T
|
|
||||||
import Effectful
|
import Effectful
|
||||||
import Effectful.Concurrent.QSem
|
import Effectful.Concurrent.QSem
|
||||||
import Effectful.Dispatch.Dynamic
|
import Effectful.Dispatch.Dynamic
|
||||||
@ -30,12 +27,10 @@ import Effects.Time
|
|||||||
import UnliftIO.Exception (bracket_)
|
import UnliftIO.Exception (bracket_)
|
||||||
import UnliftIO.IO (stderr)
|
import UnliftIO.IO (stderr)
|
||||||
import Prelude hiding (log)
|
import Prelude hiding (log)
|
||||||
import qualified Data.ByteString as B
|
|
||||||
import qualified Data.ByteString.Lazy as LB
|
|
||||||
|
|
||||||
import Terminal
|
import Terminal
|
||||||
|
|
||||||
class LogData a where
|
class Monoid a => LogData a where
|
||||||
toLog :: a -> T.Builder
|
toLog :: a -> T.Builder
|
||||||
|
|
||||||
instance LogData T.Builder where
|
instance LogData T.Builder where
|
||||||
@ -44,20 +39,11 @@ instance LogData T.Builder where
|
|||||||
instance LogData Text where
|
instance LogData Text where
|
||||||
toLog = T.fromText
|
toLog = T.fromText
|
||||||
|
|
||||||
instance LogData LT.Text where
|
|
||||||
toLog = T.fromLazyText
|
|
||||||
|
|
||||||
instance LogData String where
|
instance LogData String where
|
||||||
toLog = T.fromString
|
toLog = T.fromString
|
||||||
|
|
||||||
instance LogData B.ByteString where
|
|
||||||
toLog = toLog . T.decodeUtf8With T.lenientDecode
|
|
||||||
|
|
||||||
instance LogData LB.ByteString where
|
|
||||||
toLog = toLog . LT.decodeUtf8With T.lenientDecode
|
|
||||||
|
|
||||||
data Log :: Effect where
|
data Log :: Effect where
|
||||||
Log :: (LogData a) => Severity -> a -> Log m ()
|
Log :: Severity -> T.Builder -> Log m ()
|
||||||
|
|
||||||
makeEffect ''Log
|
makeEffect ''Log
|
||||||
|
|
||||||
@ -84,10 +70,11 @@ runLogWithQsem lock logger e = do
|
|||||||
lock' <- ask
|
lock' <- ask
|
||||||
bracket_ (waitQSem lock') (signalQSem lock') $ do
|
bracket_ (waitQSem lock') (signalQSem lock') $ do
|
||||||
t <- currentTimeB
|
t <- currentTimeB
|
||||||
liftIO $ cmap (addTime t . fmtMessage) logger <& toLog msg `WithSeverity` sev
|
liftIO $ cmap (addTime t . fmtMessage) logger <& msg `WithSeverity` sev
|
||||||
)
|
)
|
||||||
e
|
e
|
||||||
|
|
||||||
|
|
||||||
stderrLogger ::
|
stderrLogger ::
|
||||||
(MonadIO m) =>
|
(MonadIO m) =>
|
||||||
LogAction m T.Builder
|
LogAction m T.Builder
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
# resolver: ./custom-snapshot.yaml
|
# resolver: ./custom-snapshot.yaml
|
||||||
# resolver: https://example.com/snapshots/2018-01-01.yaml
|
# resolver: https://example.com/snapshots/2018-01-01.yaml
|
||||||
resolver: lts-21.25
|
resolver: lts-20.16
|
||||||
|
|
||||||
|
|
||||||
# User packages to be built.
|
# User packages to be built.
|
||||||
@ -36,6 +36,7 @@ packages:
|
|||||||
# forks / in-progress versions pinned to a git hash. For example:
|
# forks / in-progress versions pinned to a git hash. For example:
|
||||||
#
|
#
|
||||||
extra-deps:
|
extra-deps:
|
||||||
|
- chronos-1.1.5
|
||||||
# - acme-missiles-0.3
|
# - acme-missiles-0.3
|
||||||
# - git: https://github.com/commercialhaskell/stack.git
|
# - git: https://github.com/commercialhaskell/stack.git
|
||||||
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
||||||
|
|||||||
@ -3,10 +3,17 @@
|
|||||||
# For more information, please see the documentation at:
|
# For more information, please see the documentation at:
|
||||||
# https://docs.haskellstack.org/en/stable/lock_files
|
# https://docs.haskellstack.org/en/stable/lock_files
|
||||||
|
|
||||||
packages: []
|
packages:
|
||||||
|
- completed:
|
||||||
|
hackage: chronos-1.1.5@sha256:ca35be5fdbbb384414226b4467c6d1c8b44defe59a9c8a3af32c1c5fb250c781,3830
|
||||||
|
pantry-tree:
|
||||||
|
sha256: 329bf39a05362a9c1f507a4a529725c757208843b562c55e0b7c88538dc3160f
|
||||||
|
size: 581
|
||||||
|
original:
|
||||||
|
hackage: chronos-1.1.5
|
||||||
snapshots:
|
snapshots:
|
||||||
- completed:
|
- completed:
|
||||||
sha256: a81fb3877c4f9031e1325eb3935122e608d80715dc16b586eb11ddbff8671ecd
|
sha256: dad15e2ec0c09280a5c2e07190fb18710fc54472f029f34f861f686540824d81
|
||||||
size: 640086
|
size: 649592
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/25.yaml
|
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/16.yaml
|
||||||
original: lts-21.25
|
original: lts-20.16
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user