prelate 0.5.1.0 → 0.9.0.2
raw patch · 3 files changed
Files
- lib/Prelate/App.hs +21/−8
- prelate.cabal +30/−49
- readme.md +5/−0
lib/Prelate/App.hs view
@@ -1,4 +1,4 @@-{-# language NoImplicitPrelude #-}+{-# language NoImplicitPrelude, CPP #-} {-# options_haddock prune #-} module Prelate.App (@@ -11,13 +11,20 @@ ExitErrorMessage (exitErrorMessage), ) where -import Conc (ConcStack, Critical, interpretCritical, interpretInterrupt)+import Conc (ConcStack, Critical, interpretCritical) import qualified Data.Text.IO as Text import Incipit import Log (Severity (Info), interpretLogStderrLevelConc) import Polysemy.Chronos (ChronosTime, interpretTimeChronos)+import System.Exit (exitFailure) import System.IO (stderr) +#if MIN_VERSION_polysemy_conc(0,14,0)+import Polysemy.Process (Interrupt, interpretInterrupt)+#else+import Conc (interpretInterrupt)+#endif+ -- | The default stack for a Prelate app. type AppStack = [@@ -32,6 +39,11 @@ printError msg = Text.hPutStrLn stderr ("Error: " <> msg) +exitError :: Text -> IO a+exitError msg = do+ printError msg+ exitFailure+ -- | Run the default 'AppStack' with the specified log level and return a potential error as 'Left'. runAppLevelE :: Severity ->@@ -45,16 +57,17 @@ interpretLogStderrLevelConc (Just level) . interpretTimeChronos --- | Run the default 'AppStack' with the specified log level and print an potential error to stderr.+-- | Run the default 'AppStack' with the specified log level and print a potential error to stderr, exiting with failure+-- code. runAppLevel :: Severity ->- Sem AppStack () ->- IO ()+ Sem AppStack a ->+ IO a runAppLevel level =- leftA printError <=< runAppLevelE level+ leftA exitError <=< runAppLevelE level --- | Run the default 'AppStack' and print an potential error to stderr.-runApp :: Sem AppStack () -> IO ()+-- | Run the default 'AppStack' and print an potential error to stderr, exiting with failure code.+runApp :: Sem AppStack a -> IO a runApp = runAppLevel Info
prelate.cabal view
@@ -1,11 +1,11 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.35.0.+-- This file has been generated from package.yaml by hpack version 0.38.3. -- -- see: https://github.com/sol/hpack name: prelate-version: 0.5.1.0+version: 0.9.0.2 synopsis: A Prelude description: See https://hackage.haskell.org/package/prelate/docs/Prelate.html category: Prelude@@ -13,10 +13,12 @@ bug-reports: https://github.com/tek/prelate/issues author: Torsten Schmits maintainer: hackage@tryp.io-copyright: 2022 Torsten Schmits+copyright: 2025 Torsten Schmits license: BSD-2-Clause-Patent license-file: LICENSE build-type: Simple+extra-source-files:+ readme.md source-repository head type: git@@ -34,6 +36,10 @@ Prelate.Json Prelate.Prelude Process+ other-modules:+ Paths_prelate+ autogen-modules:+ Paths_prelate reexported-modules: Control.Concurrent.STM , Control.Concurrent.STM.TArray@@ -75,6 +81,7 @@ , Polysemy.Resume , Polysemy.Time , Conc+ , Gate , Log , Queue , Sync@@ -84,80 +91,54 @@ default-extensions: AllowAmbiguousTypes ApplicativeDo- BangPatterns- BinaryLiterals BlockArguments- ConstraintKinds DataKinds DefaultSignatures DeriveAnyClass- DeriveDataTypeable- DeriveFoldable- DeriveFunctor- DeriveGeneric- DeriveLift- DeriveTraversable DerivingStrategies DerivingVia DisambiguateRecordFields- DoAndIfThenElse DuplicateRecordFields- EmptyCase- EmptyDataDecls- ExistentialQuantification- FlexibleContexts- FlexibleInstances FunctionalDependencies GADTs- GeneralizedNewtypeDeriving- InstanceSigs- KindSignatures LambdaCase LiberalTypeSynonyms- MultiParamTypeClasses+ MonadComprehensions MultiWayIf- NamedFieldPuns+ NoFieldSelectors OverloadedLabels OverloadedLists+ OverloadedRecordDot OverloadedStrings PackageImports PartialTypeSignatures- PatternGuards PatternSynonyms- PolyKinds QuantifiedConstraints QuasiQuotes- RankNTypes RecordWildCards RecursiveDo RoleAnnotations- ScopedTypeVariables- StandaloneDeriving TemplateHaskell- TupleSections- TypeApplications TypeFamilies TypeFamilyDependencies- TypeOperators- TypeSynonymInstances UndecidableInstances UnicodeSyntax ViewPatterns- ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages+ ghc-options: -Wall -Widentities -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wredundant-constraints -Wunused-type-patterns -Wunused-packages build-depends:- aeson >=2.0- , base >=4.13 && <4.18- , exon ==1.4.*- , extra >=1.7.10 && <1.8- , generic-lens >=2.2- , incipit ==0.7.*- , microlens ==0.4.*- , microlens-ghc ==0.4.*- , polysemy-chronos ==0.6.*- , polysemy-conc ==0.12.*- , polysemy-log ==0.9.*- , polysemy-process ==0.12.*- , polysemy-resume ==0.7.*- , polysemy-time ==0.6.*- , template-haskell- default-language: Haskell2010+ aeson >=2.1.0.0 && <2.3+ , base >=4.17.2.1 && <4.22+ , exon >=1.4.0.0 && <1.8+ , extra >=1.7.9 && <1.9+ , generic-lens >=2.2.1.0 && <2.4+ , incipit >=0.8.0.0 && <0.12+ , microlens >=0.4.13.0 && <0.6+ , microlens-ghc >=0.4.14.1 && <0.5+ , polysemy-chronos >=0.5.0.0 && <0.8+ , polysemy-conc >=0.12.1.0 && <0.16+ , polysemy-log >=0.9.0.0 && <0.12+ , polysemy-process >=0.12.0.0 && <0.16+ , polysemy-resume >=0.7.0.0 && <0.10+ , polysemy-time >=0.6.0.0 && <0.8+ , template-haskell >=2.19.0.0 && <2.24+ default-language: GHC2021
+ readme.md view
@@ -0,0 +1,5 @@+# About++A `Prelude` based on [incipit].++[incipit]: https://hackage.haskell.org/package/incipit