chore(users/Profpatsch): move utils to my-prelude
I want to use these in multiple projects. Change-Id: I5dfdad8614bc5835e59df06f724de78acae78d42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8971 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
6ecc7a2ee4
commit
57bab040ed
12 changed files with 114 additions and 64 deletions
|
@ -6,34 +6,43 @@ pkgs.haskellPackages.mkDerivation {
|
||||||
|
|
||||||
src = depot.users.Profpatsch.exactSource ./. [
|
src = depot.users.Profpatsch.exactSource ./. [
|
||||||
./my-prelude.cabal
|
./my-prelude.cabal
|
||||||
./MyPrelude.hs
|
./src/Aeson.hs
|
||||||
./Pretty.hs
|
./src/MyPrelude.hs
|
||||||
./Aeson.hs
|
./src/Pretty.hs
|
||||||
./RunCommand.hs
|
./src/RunCommand.hs
|
||||||
./Test.hs
|
./src/Test.hs
|
||||||
|
./src/Tool.hs
|
||||||
|
./src/ValidationParseT.hs
|
||||||
|
./src/Postgres/Decoder.hs
|
||||||
|
./src/Postgres/MonadPostgres.hs
|
||||||
];
|
];
|
||||||
|
|
||||||
isLibrary = true;
|
isLibrary = true;
|
||||||
|
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
|
pkgs.haskellPackages.pa-prelude
|
||||||
pkgs.haskellPackages.pa-label
|
pkgs.haskellPackages.pa-label
|
||||||
pkgs.haskellPackages.pa-error-tree
|
pkgs.haskellPackages.pa-error-tree
|
||||||
pkgs.haskellPackages.aeson
|
pkgs.haskellPackages.pa-json
|
||||||
pkgs.haskellPackages.aeson-better-errors
|
pkgs.haskellPackages.aeson-better-errors
|
||||||
pkgs.haskellPackages.PyF
|
pkgs.haskellPackages.ansi-terminal
|
||||||
pkgs.haskellPackages.errors
|
|
||||||
pkgs.haskellPackages.profunctors
|
|
||||||
pkgs.haskellPackages.semigroupoids
|
|
||||||
pkgs.haskellPackages.these
|
|
||||||
pkgs.haskellPackages.validation-selective
|
|
||||||
pkgs.haskellPackages.error
|
pkgs.haskellPackages.error
|
||||||
|
pkgs.haskellPackages.hscolour
|
||||||
pkgs.haskellPackages.hspec
|
pkgs.haskellPackages.hspec
|
||||||
pkgs.haskellPackages.hspec-expectations-pretty-diff
|
pkgs.haskellPackages.hspec-expectations-pretty-diff
|
||||||
pkgs.haskellPackages.hscolour
|
pkgs.haskellPackages.monad-logger
|
||||||
pkgs.haskellPackages.nicify-lib
|
pkgs.haskellPackages.nicify-lib
|
||||||
|
pkgs.haskellPackages.postgresql-simple
|
||||||
|
pkgs.haskellPackages.profunctors
|
||||||
|
pkgs.haskellPackages.PyF
|
||||||
|
pkgs.haskellPackages.semigroupoids
|
||||||
|
pkgs.haskellPackages.these
|
||||||
pkgs.haskellPackages.typed-process
|
pkgs.haskellPackages.typed-process
|
||||||
pkgs.haskellPackages.ansi-terminal
|
pkgs.haskellPackages.unliftio
|
||||||
|
pkgs.haskellPackages.validation-selective
|
||||||
pkgs.haskellPackages.vector
|
pkgs.haskellPackages.vector
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
license = lib.licenses.mit;
|
license = lib.licenses.mit;
|
||||||
|
|
|
@ -4,13 +4,66 @@ version: 0.0.1.0
|
||||||
author: Profpatsch
|
author: Profpatsch
|
||||||
maintainer: mail@profpatsch.de
|
maintainer: mail@profpatsch.de
|
||||||
|
|
||||||
|
common common-options
|
||||||
|
ghc-options:
|
||||||
|
-Wall
|
||||||
|
-Wno-type-defaults
|
||||||
|
-Wunused-packages
|
||||||
|
-Wredundant-constraints
|
||||||
|
-fwarn-missing-deriving-strategies
|
||||||
|
|
||||||
|
-- See https://downloads.haskell.org/ghc/latest/docs/users_guide/exts.html
|
||||||
|
-- for a description of all these extensions
|
||||||
|
default-extensions:
|
||||||
|
-- Infer Applicative instead of Monad where possible
|
||||||
|
ApplicativeDo
|
||||||
|
|
||||||
|
-- Allow literal strings to be Text
|
||||||
|
OverloadedStrings
|
||||||
|
|
||||||
|
-- Syntactic sugar improvements
|
||||||
|
LambdaCase
|
||||||
|
MultiWayIf
|
||||||
|
|
||||||
|
-- Makes the (deprecated) usage of * instead of Data.Kind.Type an error
|
||||||
|
NoStarIsType
|
||||||
|
|
||||||
|
-- Convenient and crucial to deal with ambiguous field names, commonly
|
||||||
|
-- known as RecordDotSyntax
|
||||||
|
OverloadedRecordDot
|
||||||
|
|
||||||
|
-- does not export record fields as functions, use OverloadedRecordDot to access instead
|
||||||
|
NoFieldSelectors
|
||||||
|
|
||||||
|
-- Record punning
|
||||||
|
RecordWildCards
|
||||||
|
|
||||||
|
-- Improved Deriving
|
||||||
|
DerivingStrategies
|
||||||
|
DerivingVia
|
||||||
|
|
||||||
|
-- Type-level strings
|
||||||
|
DataKinds
|
||||||
|
|
||||||
|
-- to enable the `type` keyword in import lists (ormolu uses this automatically)
|
||||||
|
ExplicitNamespaces
|
||||||
|
|
||||||
|
default-language: GHC2021
|
||||||
|
|
||||||
|
|
||||||
library
|
library
|
||||||
|
import: common-options
|
||||||
|
hs-source-dirs: src
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
MyPrelude
|
MyPrelude
|
||||||
Pretty
|
Pretty
|
||||||
Aeson
|
Aeson
|
||||||
RunCommand
|
RunCommand
|
||||||
Test
|
Test
|
||||||
|
Postgres.Decoder
|
||||||
|
Postgres.MonadPostgres
|
||||||
|
ValidationParseT
|
||||||
|
Tool
|
||||||
|
|
||||||
-- Modules included in this executable, other than Main.
|
-- Modules included in this executable, other than Main.
|
||||||
-- other-modules:
|
-- other-modules:
|
||||||
|
@ -19,26 +72,33 @@ library
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.15 && <5
|
base >=4.15 && <5
|
||||||
|
, pa-prelude
|
||||||
, pa-label
|
, pa-label
|
||||||
, pa-error-tree
|
, pa-error-tree
|
||||||
|
, pa-json
|
||||||
, aeson
|
, aeson
|
||||||
, aeson-better-errors
|
, aeson-better-errors
|
||||||
, PyF
|
, ansi-terminal
|
||||||
, validation-selective
|
, bytestring
|
||||||
, these
|
|
||||||
, text
|
|
||||||
, semigroupoids
|
|
||||||
, profunctors
|
|
||||||
, containers
|
, containers
|
||||||
, error
|
, error
|
||||||
, exceptions
|
, exceptions
|
||||||
, bytestring
|
, filepath
|
||||||
, mtl
|
, hscolour
|
||||||
, hspec
|
, hspec
|
||||||
, hspec-expectations-pretty-diff
|
, hspec-expectations-pretty-diff
|
||||||
, hscolour
|
, monad-logger
|
||||||
|
, mtl
|
||||||
, nicify-lib
|
, nicify-lib
|
||||||
|
, postgresql-simple
|
||||||
|
, profunctors
|
||||||
|
, PyF
|
||||||
|
, semigroupoids
|
||||||
|
, selective
|
||||||
|
, text
|
||||||
|
, these
|
||||||
, typed-process
|
, typed-process
|
||||||
, ansi-terminal
|
, unix
|
||||||
|
, unliftio
|
||||||
|
, validation-selective
|
||||||
, vector
|
, vector
|
||||||
default-language: GHC2021
|
|
||||||
|
|
|
@ -10,26 +10,14 @@
|
||||||
|
|
||||||
module Aeson where
|
module Aeson where
|
||||||
|
|
||||||
import Data.Aeson (Encoding, FromJSON (parseJSON), GFromJSON, GToEncoding, GToJSON, Options (fieldLabelModifier), ToJSON (toEncoding, toJSON), Value (..), Zero, defaultOptions, genericParseJSON, genericToEncoding, genericToJSON, withObject)
|
import Data.Aeson (Value (..))
|
||||||
import Data.Aeson.BetterErrors qualified as Json
|
import Data.Aeson.BetterErrors qualified as Json
|
||||||
import Data.Aeson.Encoding qualified as Enc
|
|
||||||
import Data.Aeson.Key qualified as Key
|
|
||||||
import Data.Aeson.KeyMap qualified as KeyMap
|
import Data.Aeson.KeyMap qualified as KeyMap
|
||||||
import Data.Char qualified
|
|
||||||
import Data.Error.Tree
|
import Data.Error.Tree
|
||||||
import Data.Foldable qualified as Foldable
|
|
||||||
import Data.Int (Int64)
|
|
||||||
import Data.List (isPrefixOf)
|
|
||||||
import Data.List qualified as List
|
|
||||||
import Data.Map.Strict qualified as Map
|
|
||||||
import Data.Maybe (catMaybes)
|
import Data.Maybe (catMaybes)
|
||||||
import Data.String (IsString (fromString))
|
|
||||||
import Data.Text.Lazy qualified as Lazy
|
|
||||||
import Data.Vector qualified as Vector
|
import Data.Vector qualified as Vector
|
||||||
import GHC.Generics (Generic (Rep))
|
|
||||||
import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)
|
|
||||||
import Label
|
import Label
|
||||||
import MyPrelude
|
import PossehlAnalyticsPrelude
|
||||||
import Test.Hspec (describe, it, shouldBe)
|
import Test.Hspec (describe, it, shouldBe)
|
||||||
import Test.Hspec qualified as Hspec
|
import Test.Hspec qualified as Hspec
|
||||||
|
|
|
@ -58,44 +58,37 @@ library
|
||||||
|
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
WhatcdResolver
|
WhatcdResolver
|
||||||
Postgres.Decoder
|
|
||||||
Postgres.MonadPostgres
|
|
||||||
Tool
|
|
||||||
ValidationParseT
|
|
||||||
Multipart2
|
Multipart2
|
||||||
|
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.15 && <5,
|
base >=4.15 && <5,
|
||||||
text,
|
text,
|
||||||
|
my-prelude,
|
||||||
pa-prelude,
|
pa-prelude,
|
||||||
pa-error-tree,
|
pa-error-tree,
|
||||||
pa-label,
|
pa-label,
|
||||||
pa-json,
|
pa-json,
|
||||||
pa-field-parser,
|
pa-field-parser,
|
||||||
pa-run-command,
|
|
||||||
containers,
|
|
||||||
pa-pretty,
|
|
||||||
tmp-postgres,
|
|
||||||
directory,
|
|
||||||
filepath,
|
|
||||||
aeson,
|
|
||||||
aeson-better-errors,
|
aeson-better-errors,
|
||||||
postgresql-simple,
|
aeson,
|
||||||
resource-pool,
|
|
||||||
http-conduit,
|
|
||||||
http-types,
|
|
||||||
mtl,
|
|
||||||
transformers,
|
|
||||||
unliftio,
|
|
||||||
monad-logger,
|
|
||||||
unix,
|
|
||||||
warp,
|
|
||||||
wai,
|
|
||||||
wai-extra,
|
|
||||||
ihp-hsx,
|
|
||||||
blaze-html,
|
blaze-html,
|
||||||
bytestring,
|
bytestring,
|
||||||
|
containers,
|
||||||
|
directory,
|
||||||
dlist,
|
dlist,
|
||||||
|
filepath,
|
||||||
|
http-conduit,
|
||||||
|
http-types,
|
||||||
|
ihp-hsx,
|
||||||
|
monad-logger,
|
||||||
|
mtl,
|
||||||
|
resource-pool,
|
||||||
|
postgresql-simple,
|
||||||
scientific,
|
scientific,
|
||||||
selective
|
selective,
|
||||||
|
tmp-postgres,
|
||||||
|
unliftio,
|
||||||
|
wai-extra,
|
||||||
|
wai,
|
||||||
|
warp,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue