sample
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,3 +25,5 @@ cabal.project.local~
|
||||
.ghc.environment.*
|
||||
|
||||
example-project.cabal
|
||||
|
||||
.direnv
|
||||
|
||||
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1763421233,
|
||||
"narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
22
flake.nix
Normal file
22
flake.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
description = "Zako Flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "hs";
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
zlib
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
164
hq-sample.cabal
Normal file
164
hq-sample.cabal
Normal file
@@ -0,0 +1,164 @@
|
||||
cabal-version: 1.12
|
||||
|
||||
-- This file has been generated from package.yaml by hpack version 0.37.0.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
|
||||
name: hq-sample
|
||||
version: 0.1.0.0
|
||||
author: mincomk
|
||||
maintainer: mail@drchi.co.kr
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
build-type: Simple
|
||||
extra-source-files:
|
||||
README.md
|
||||
|
||||
library
|
||||
exposed-modules:
|
||||
Data.Track
|
||||
Env.Cache
|
||||
Lib
|
||||
other-modules:
|
||||
Paths_hq_sample
|
||||
hs-source-dirs:
|
||||
src
|
||||
default-extensions:
|
||||
OverloadedStrings
|
||||
LambdaCase
|
||||
DeriveGeneric
|
||||
TypeApplications
|
||||
DataKinds
|
||||
TypeOperators
|
||||
FlexibleContexts
|
||||
DerivingStrategies
|
||||
GeneralizedNewtypeDeriving
|
||||
build-depends:
|
||||
aeson
|
||||
, async
|
||||
, base
|
||||
, bytestring
|
||||
, conferer
|
||||
, containers
|
||||
, directory
|
||||
, generic-optics
|
||||
, hedis
|
||||
, katip
|
||||
, mtl
|
||||
, optics
|
||||
, persistent
|
||||
, servant
|
||||
, servant-client
|
||||
, servant-quickcheck
|
||||
, servant-server
|
||||
, servant-swagger
|
||||
, stm
|
||||
, text
|
||||
, time
|
||||
, transformers
|
||||
, unordered-containers
|
||||
, wai
|
||||
, wai-websockets
|
||||
, warp
|
||||
, websockets
|
||||
default-language: Haskell2010
|
||||
|
||||
executable hq-sample
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
Paths_hq_sample
|
||||
hs-source-dirs:
|
||||
app
|
||||
default-extensions:
|
||||
OverloadedStrings
|
||||
LambdaCase
|
||||
DeriveGeneric
|
||||
TypeApplications
|
||||
DataKinds
|
||||
TypeOperators
|
||||
FlexibleContexts
|
||||
DerivingStrategies
|
||||
GeneralizedNewtypeDeriving
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
build-depends:
|
||||
aeson
|
||||
, async
|
||||
, base
|
||||
, bytestring
|
||||
, conferer
|
||||
, containers
|
||||
, directory
|
||||
, generic-optics
|
||||
, hedis
|
||||
, hq-sample
|
||||
, katip
|
||||
, mtl
|
||||
, optics
|
||||
, persistent
|
||||
, servant
|
||||
, servant-client
|
||||
, servant-quickcheck
|
||||
, servant-server
|
||||
, servant-swagger
|
||||
, stm
|
||||
, text
|
||||
, time
|
||||
, transformers
|
||||
, unordered-containers
|
||||
, wai
|
||||
, wai-websockets
|
||||
, warp
|
||||
, websockets
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite hq-sample-test
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
Paths_hq_sample
|
||||
hs-source-dirs:
|
||||
test
|
||||
default-extensions:
|
||||
OverloadedStrings
|
||||
LambdaCase
|
||||
DeriveGeneric
|
||||
TypeApplications
|
||||
DataKinds
|
||||
TypeOperators
|
||||
FlexibleContexts
|
||||
DerivingStrategies
|
||||
GeneralizedNewtypeDeriving
|
||||
build-depends:
|
||||
QuickCheck
|
||||
, aeson
|
||||
, async
|
||||
, base
|
||||
, bytestring
|
||||
, conferer
|
||||
, containers
|
||||
, directory
|
||||
, generic-optics
|
||||
, hedis
|
||||
, hq-sample
|
||||
, katip
|
||||
, mtl
|
||||
, optics
|
||||
, persistent
|
||||
, servant
|
||||
, servant-client
|
||||
, servant-quickcheck
|
||||
, servant-server
|
||||
, servant-swagger
|
||||
, stm
|
||||
, tasty
|
||||
, tasty-hunit
|
||||
, tasty-quickcheck
|
||||
, text
|
||||
, time
|
||||
, transformers
|
||||
, unordered-containers
|
||||
, wai
|
||||
, wai-websockets
|
||||
, warp
|
||||
, websockets
|
||||
default-language: Haskell2010
|
||||
43
package.yaml
43
package.yaml
@@ -1,4 +1,4 @@
|
||||
name: example-project
|
||||
name: hq-sample
|
||||
version: 0.1.0.0
|
||||
license: MIT
|
||||
author: "mincomk"
|
||||
@@ -6,6 +6,17 @@ maintainer: "mail@drchi.co.kr"
|
||||
extra-source-files:
|
||||
- README.md
|
||||
|
||||
default-extensions:
|
||||
- OverloadedStrings
|
||||
- LambdaCase
|
||||
- DeriveGeneric
|
||||
- TypeApplications
|
||||
- DataKinds
|
||||
- TypeOperators
|
||||
- FlexibleContexts
|
||||
- DerivingStrategies
|
||||
- GeneralizedNewtypeDeriving
|
||||
|
||||
dependencies:
|
||||
- base
|
||||
|
||||
@@ -17,29 +28,51 @@ dependencies:
|
||||
- unordered-containers
|
||||
- optics
|
||||
|
||||
- directory
|
||||
- time
|
||||
|
||||
- servant-swagger
|
||||
- servant-server
|
||||
- servant-client
|
||||
- servant-quickcheck
|
||||
|
||||
- persistent
|
||||
- hedis
|
||||
- katip
|
||||
- conferer
|
||||
- warp
|
||||
- wai
|
||||
- aeson
|
||||
- servant
|
||||
- wai-websockets
|
||||
- websockets
|
||||
- stm
|
||||
- async
|
||||
- generic-optics
|
||||
|
||||
library:
|
||||
source-dirs: src
|
||||
dependencies:
|
||||
- base
|
||||
|
||||
executables:
|
||||
example-project:
|
||||
hq-sample:
|
||||
main: Main.hs
|
||||
source-dirs: app
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
dependencies:
|
||||
- base
|
||||
|
||||
- example-project
|
||||
- hq-sample
|
||||
|
||||
tests:
|
||||
example-project-test:
|
||||
hq-sample-test:
|
||||
main: Main.hs
|
||||
source-dirs: test
|
||||
dependencies:
|
||||
- base
|
||||
|
||||
- example-project
|
||||
- hq-sample
|
||||
|
||||
- tasty
|
||||
- tasty-hunit
|
||||
|
||||
11
src/Data/Track.hs
Normal file
11
src/Data/Track.hs
Normal file
@@ -0,0 +1,11 @@
|
||||
module Data.Track where
|
||||
|
||||
import Data.Aeson (FromJSON, ToJSON)
|
||||
import Data.Word (Word64)
|
||||
import GHC.Generics (Generic)
|
||||
|
||||
newtype TrackId = TrackId Word64
|
||||
deriving stock (Show, Eq, Ord, Generic)
|
||||
deriving newtype (ToJSON, FromJSON)
|
||||
|
||||
data Track = Track {trackId :: TrackId}
|
||||
4
src/Env/Cache.hs
Normal file
4
src/Env/Cache.hs
Normal file
@@ -0,0 +1,4 @@
|
||||
module Env.Cache where
|
||||
|
||||
class (Monad m) => MonadCache m where
|
||||
writeCache :: String -> String -> m ()
|
||||
@@ -2,3 +2,4 @@ module Lib (someFunc) where
|
||||
|
||||
someFunc :: IO ()
|
||||
someFunc = putStrLn "someFunc"
|
||||
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
|
||||
module Main (main) where
|
||||
|
||||
import Data.Aeson.Key qualified as K
|
||||
import Data.Aeson.KeyMap qualified as KM
|
||||
import Data.List (isInfixOf)
|
||||
import Data.List qualified as L
|
||||
import Data.Text qualified as T
|
||||
import Data.Yaml hiding (Parser)
|
||||
import Test.Tasty
|
||||
import Test.Tasty.HUnit
|
||||
import Test.Tasty.QuickCheck as QC
|
||||
|
||||
Reference in New Issue
Block a user