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 ./. [
|
||||
./my-prelude.cabal
|
||||
./MyPrelude.hs
|
||||
./Pretty.hs
|
||||
./Aeson.hs
|
||||
./RunCommand.hs
|
||||
./Test.hs
|
||||
./src/Aeson.hs
|
||||
./src/MyPrelude.hs
|
||||
./src/Pretty.hs
|
||||
./src/RunCommand.hs
|
||||
./src/Test.hs
|
||||
./src/Tool.hs
|
||||
./src/ValidationParseT.hs
|
||||
./src/Postgres/Decoder.hs
|
||||
./src/Postgres/MonadPostgres.hs
|
||||
];
|
||||
|
||||
isLibrary = true;
|
||||
|
||||
libraryHaskellDepends = [
|
||||
pkgs.haskellPackages.pa-prelude
|
||||
pkgs.haskellPackages.pa-label
|
||||
pkgs.haskellPackages.pa-error-tree
|
||||
pkgs.haskellPackages.aeson
|
||||
pkgs.haskellPackages.pa-json
|
||||
pkgs.haskellPackages.aeson-better-errors
|
||||
pkgs.haskellPackages.PyF
|
||||
pkgs.haskellPackages.errors
|
||||
pkgs.haskellPackages.profunctors
|
||||
pkgs.haskellPackages.semigroupoids
|
||||
pkgs.haskellPackages.these
|
||||
pkgs.haskellPackages.validation-selective
|
||||
pkgs.haskellPackages.ansi-terminal
|
||||
pkgs.haskellPackages.error
|
||||
pkgs.haskellPackages.hscolour
|
||||
pkgs.haskellPackages.hspec
|
||||
pkgs.haskellPackages.hspec-expectations-pretty-diff
|
||||
pkgs.haskellPackages.hscolour
|
||||
pkgs.haskellPackages.monad-logger
|
||||
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.ansi-terminal
|
||||
pkgs.haskellPackages.unliftio
|
||||
pkgs.haskellPackages.validation-selective
|
||||
pkgs.haskellPackages.vector
|
||||
|
||||
|
||||
];
|
||||
|
||||
license = lib.licenses.mit;
|
||||
|
|
|
@ -4,13 +4,66 @@ version: 0.0.1.0
|
|||
author: Profpatsch
|
||||
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
|
||||
import: common-options
|
||||
hs-source-dirs: src
|
||||
exposed-modules:
|
||||
MyPrelude
|
||||
Pretty
|
||||
Aeson
|
||||
RunCommand
|
||||
Test
|
||||
Postgres.Decoder
|
||||
Postgres.MonadPostgres
|
||||
ValidationParseT
|
||||
Tool
|
||||
|
||||
-- Modules included in this executable, other than Main.
|
||||
-- other-modules:
|
||||
|
@ -19,26 +72,33 @@ library
|
|||
-- other-extensions:
|
||||
build-depends:
|
||||
base >=4.15 && <5
|
||||
, pa-prelude
|
||||
, pa-label
|
||||
, pa-error-tree
|
||||
, pa-json
|
||||
, aeson
|
||||
, aeson-better-errors
|
||||
, PyF
|
||||
, validation-selective
|
||||
, these
|
||||
, text
|
||||
, semigroupoids
|
||||
, profunctors
|
||||
, ansi-terminal
|
||||
, bytestring
|
||||
, containers
|
||||
, error
|
||||
, exceptions
|
||||
, bytestring
|
||||
, mtl
|
||||
, filepath
|
||||
, hscolour
|
||||
, hspec
|
||||
, hspec-expectations-pretty-diff
|
||||
, hscolour
|
||||
, monad-logger
|
||||
, mtl
|
||||
, nicify-lib
|
||||
, postgresql-simple
|
||||
, profunctors
|
||||
, PyF
|
||||
, semigroupoids
|
||||
, selective
|
||||
, text
|
||||
, these
|
||||
, typed-process
|
||||
, ansi-terminal
|
||||
, unix
|
||||
, unliftio
|
||||
, validation-selective
|
||||
, vector
|
||||
default-language: GHC2021
|
||||
|
|
|
@ -10,26 +10,14 @@
|
|||
|
||||
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.Encoding qualified as Enc
|
||||
import Data.Aeson.Key qualified as Key
|
||||
import Data.Aeson.KeyMap qualified as KeyMap
|
||||
import Data.Char qualified
|
||||
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.String (IsString (fromString))
|
||||
import Data.Text.Lazy qualified as Lazy
|
||||
import Data.Vector qualified as Vector
|
||||
import GHC.Generics (Generic (Rep))
|
||||
import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)
|
||||
import Label
|
||||
import MyPrelude
|
||||
import PossehlAnalyticsPrelude
|
||||
import Test.Hspec (describe, it, shouldBe)
|
||||
import Test.Hspec qualified as Hspec
|
||||
|
|
@ -58,44 +58,37 @@ library
|
|||
|
||||
exposed-modules:
|
||||
WhatcdResolver
|
||||
Postgres.Decoder
|
||||
Postgres.MonadPostgres
|
||||
Tool
|
||||
ValidationParseT
|
||||
Multipart2
|
||||
|
||||
build-depends:
|
||||
base >=4.15 && <5,
|
||||
text,
|
||||
my-prelude,
|
||||
pa-prelude,
|
||||
pa-error-tree,
|
||||
pa-label,
|
||||
pa-json,
|
||||
pa-field-parser,
|
||||
pa-run-command,
|
||||
containers,
|
||||
pa-pretty,
|
||||
tmp-postgres,
|
||||
directory,
|
||||
filepath,
|
||||
aeson,
|
||||
aeson-better-errors,
|
||||
postgresql-simple,
|
||||
resource-pool,
|
||||
http-conduit,
|
||||
http-types,
|
||||
mtl,
|
||||
transformers,
|
||||
unliftio,
|
||||
monad-logger,
|
||||
unix,
|
||||
warp,
|
||||
wai,
|
||||
wai-extra,
|
||||
ihp-hsx,
|
||||
aeson,
|
||||
blaze-html,
|
||||
bytestring,
|
||||
containers,
|
||||
directory,
|
||||
dlist,
|
||||
filepath,
|
||||
http-conduit,
|
||||
http-types,
|
||||
ihp-hsx,
|
||||
monad-logger,
|
||||
mtl,
|
||||
resource-pool,
|
||||
postgresql-simple,
|
||||
scientific,
|
||||
selective
|
||||
selective,
|
||||
tmp-postgres,
|
||||
unliftio,
|
||||
wai-extra,
|
||||
wai,
|
||||
warp,
|
||||
|
||||
|
|
Loading…
Reference in a new issue