Massive reorganizing: subprojects

This commit is contained in:
Alexander Granin 2020-05-09 01:35:20 +07:00
parent e775f48b1b
commit bda8db6a4f
171 changed files with 826 additions and 123 deletions

42
.gitignore vendored
View File

@ -9,3 +9,45 @@ log.txt
*.cabal *.cabal
.vscode .vscode
stack.yaml.lock stack.yaml.lock
out
result
dist
dist-*
cabal-dev
*.o
*.hi
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
dist-newstyle
.stack-work
stack.yaml.lock
*.cabal
.ghci
.ghcid
.idea/
*.iml
*.diff
*.patch
tags
.vscode/
.nvimrc

View File

@ -0,0 +1,147 @@
name: MeteorCounter
version: 1.0.0.0
github: "graninas/Hydra"
license: BSD3
author: "Alexander Granin"
maintainer: "graninas@gmail.com"
copyright: "Granin A.S. 2020"
description:
MeteorCounter app
default-extensions:
- NoImplicitPrelude
- GADTs
- RankNTypes
- DeriveFunctor
- DeriveGeneric
- OverloadedStrings
- LambdaCase
- MultiParamTypeClasses
- ExplicitNamespaces
- TypeApplications
- ScopedTypeVariables
- TypeOperators
- TypeFamilies
- DataKinds
- FlexibleContexts
- FlexibleInstances
- PatternSynonyms
- PolyKinds
- DefaultSignatures
- ConstraintKinds
- NamedFieldPuns
- TupleSections
- ViewPatterns
- MultiWayIf
- RecordWildCards
dependencies:
- base >= 4.7 && < 5
- bytestring
- time-units
- network
- aeson
- aeson-pretty
- cereal
- mtl
- cryptonite
- base16-bytestring
- base58-bytestring
- base64-bytestring
- arithmoi
- directory
- filepath
- process
- extra
- time
- clock
- vector
- scientific
- containers
- random
- free
- iproute
- memory
- transformers
- template-haskell
- async
- text
- haskeline
- cryptohash-sha256
- bytestring-conversion
- newtype-generics
- lens
- universum
- fmt
- stm
- hslogger
- lens-aeson
- th-abstraction
- MonadRandom
- entropy
- validation
- silently
- uuid
- resourcet
- triplesec
- yaml
- newtype-generics
- regex-posix
- safe-exceptions
- unliftio
- unliftio-core
- rocksdb-haskell
- hedis
- beam-core
- beam-postgres
- beam-sqlite
- beam-migrate
- sqlite-simple
- resource-pool
- servant
- servant-server
- servant-client
- servant-swagger
- servant-docs
- wai
- warp
- http-client
- http-client-tls
- data-default
- generic-lens
- Hydra
library:
source-dirs:
- src
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -fhide-source-paths
executables:
MeteorCounter:
main: Main.hs
source-dirs: src/
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
# - -O2
#
# tests:
# functional-tests:
# main: Spec.hs
# source-dirs:
# - test/spec
# ghc-options:
# - -threaded
# - -rtsopts
# - -with-rtsopts=-N
# dependencies:
# - Hydra

View File

@ -0,0 +1,146 @@
name: PerfTestApp
version: 1.0.0.0
github: "graninas/Hydra"
license: BSD3
author: "Alexander Granin"
maintainer: "graninas@gmail.com"
copyright: "Granin A.S. 2020"
description:
PerfTestApp
default-extensions:
- NoImplicitPrelude
- GADTs
- RankNTypes
- DeriveFunctor
- DeriveGeneric
- OverloadedStrings
- LambdaCase
- MultiParamTypeClasses
- ExplicitNamespaces
- TypeApplications
- ScopedTypeVariables
- TypeOperators
- TypeFamilies
- DataKinds
- FlexibleContexts
- FlexibleInstances
- PatternSynonyms
- PolyKinds
- DefaultSignatures
- ConstraintKinds
- NamedFieldPuns
- TupleSections
- ViewPatterns
- MultiWayIf
- RecordWildCards
dependencies:
- base >= 4.7 && < 5
- bytestring
- time-units
- network
- aeson
- aeson-pretty
- cereal
- mtl
- cryptonite
- base16-bytestring
- base58-bytestring
- base64-bytestring
- arithmoi
- directory
- filepath
- process
- extra
- time
- clock
- vector
- scientific
- containers
- random
- free
- iproute
- memory
- transformers
- template-haskell
- async
- text
- haskeline
- cryptohash-sha256
- bytestring-conversion
- newtype-generics
- lens
- universum
- fmt
- stm
- hslogger
- lens-aeson
- th-abstraction
- MonadRandom
- entropy
- validation
- silently
- uuid
- resourcet
- triplesec
- yaml
- newtype-generics
- regex-posix
- safe-exceptions
- unliftio
- unliftio-core
- rocksdb-haskell
- hedis
- beam-core
- beam-postgres
- beam-sqlite
- beam-migrate
- sqlite-simple
- resource-pool
- servant
- servant-server
- servant-client
- servant-swagger
- servant-docs
- wai
- warp
- http-client
- http-client-tls
- data-default
- generic-lens
- Hydra
library:
source-dirs:
- src
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -fhide-source-paths
executables:
PerfTestApp:
main: Main.hs
source-dirs: src/
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
# - -O2
#
# tests:
# functional-tests:
# main: Spec.hs
# source-dirs:
# - test/spec
# ghc-options:
# - -threaded
# - -rtsopts
# - -with-rtsopts=-N
# dependencies:
# - Hydra

View File

@ -0,0 +1,146 @@
name: PerfTestApp2
version: 1.0.0.0
github: "graninas/Hydra"
license: BSD3
author: "Alexander Granin"
maintainer: "graninas@gmail.com"
copyright: "Granin A.S. 2020"
description:
PerfTestApp2
default-extensions:
- NoImplicitPrelude
- GADTs
- RankNTypes
- DeriveFunctor
- DeriveGeneric
- OverloadedStrings
- LambdaCase
- MultiParamTypeClasses
- ExplicitNamespaces
- TypeApplications
- ScopedTypeVariables
- TypeOperators
- TypeFamilies
- DataKinds
- FlexibleContexts
- FlexibleInstances
- PatternSynonyms
- PolyKinds
- DefaultSignatures
- ConstraintKinds
- NamedFieldPuns
- TupleSections
- ViewPatterns
- MultiWayIf
- RecordWildCards
dependencies:
- base >= 4.7 && < 5
- bytestring
- time-units
- network
- aeson
- aeson-pretty
- cereal
- mtl
- cryptonite
- base16-bytestring
- base58-bytestring
- base64-bytestring
- arithmoi
- directory
- filepath
- process
- extra
- time
- clock
- vector
- scientific
- containers
- random
- free
- iproute
- memory
- transformers
- template-haskell
- async
- text
- haskeline
- cryptohash-sha256
- bytestring-conversion
- newtype-generics
- lens
- universum
- fmt
- stm
- hslogger
- lens-aeson
- th-abstraction
- MonadRandom
- entropy
- validation
- silently
- uuid
- resourcet
- triplesec
- yaml
- newtype-generics
- regex-posix
- safe-exceptions
- unliftio
- unliftio-core
- rocksdb-haskell
- hedis
- beam-core
- beam-postgres
- beam-sqlite
- beam-migrate
- sqlite-simple
- resource-pool
- servant
- servant-server
- servant-client
- servant-swagger
- servant-docs
- wai
- warp
- http-client
- http-client-tls
- data-default
- generic-lens
- Hydra
library:
source-dirs:
- src
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -fhide-source-paths
executables:
PerfTestApp2:
main: Main.hs
source-dirs: src/
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
# - -O2
#
# tests:
# functional-tests:
# main: Spec.hs
# source-dirs:
# - test/spec
# ghc-options:
# - -threaded
# - -rtsopts
# - -with-rtsopts=-N
# dependencies:
# - Hydra

View File

@ -1,14 +1,13 @@
name: Hydra name: astro
version: 1.0.0.0 version: 1.0.0.0
github: "graninas/Hydra" github: "graninas/Hydra"
license: BSD3 license: BSD3
author: "Alexander Granin" author: "Alexander Granin"
maintainer: "graninas@gmail.com" maintainer: "graninas@gmail.com"
copyright: "Granin A.S. 2019" copyright: "Granin A.S. 2020"
description: description:
Hydra is the project that allows to build multithreaded concurrent applications. Astro web server and client for astronomers
Hydra is initially based on the Hydra.Framework.
default-extensions: default-extensions:
- NoImplicitPrelude - NoImplicitPrelude
@ -115,83 +114,37 @@ dependencies:
- http-client-tls - http-client-tls
- data-default - data-default
- generic-lens - generic-lens
- Hydra
library: library:
source-dirs: source-dirs:
- src - src
ghc-options: ghc-options:
- -Wall - -Wall
- -Wcompat
- -Widentities
- -fhide-source-paths
executables: executables:
perf-test-app: astro:
main: Main.hs main: Main.hs
source-dirs: app/PerfTestApp source-dirs: src/
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
- -O2
dependencies:
- Hydra
perf-test-app2:
main: Main.hs
source-dirs: app/PerfTestApp2
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
- -O2
dependencies:
- Hydra
meteor-counter-app:
main: Main.hs
source-dirs: app/MeteorCounter
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
- -O2
dependencies:
- Hydra
astro-app:
main: Main.hs
source-dirs: app/astro
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
- -O2
dependencies:
- Hydra
labyrinth:
main: Main.hs
source-dirs: app/labyrinth
ghc-options: ghc-options:
- -threaded - -threaded
- -rtsopts - -rtsopts
- -with-rtsopts=-N - -with-rtsopts=-N
- -Wall - -Wall
# - -O2 # - -O2
dependencies:
- Hydra
#
tests: # tests:
functional-tests: # functional-tests:
main: Spec.hs # main: Spec.hs
source-dirs: # source-dirs:
- test/spec # - test/spec
ghc-options: # ghc-options:
- -threaded # - -threaded
- -rtsopts # - -rtsopts
- -with-rtsopts=-N # - -with-rtsopts=-N
dependencies: # dependencies:
- Hydra # - Hydra

146
app/labyrinth/package.yaml Normal file
View File

@ -0,0 +1,146 @@
name: labyrinth
version: 1.0.0.0
github: "graninas/Hydra"
license: BSD3
author: "Alexander Granin"
maintainer: "graninas@gmail.com"
copyright: "Granin A.S. 2020"
description:
Labyrinth game (aka Terra Incognita)
default-extensions:
- NoImplicitPrelude
- GADTs
- RankNTypes
- DeriveFunctor
- DeriveGeneric
- OverloadedStrings
- LambdaCase
- MultiParamTypeClasses
- ExplicitNamespaces
- TypeApplications
- ScopedTypeVariables
- TypeOperators
- TypeFamilies
- DataKinds
- FlexibleContexts
- FlexibleInstances
- PatternSynonyms
- PolyKinds
- DefaultSignatures
- ConstraintKinds
- NamedFieldPuns
- TupleSections
- ViewPatterns
- MultiWayIf
- RecordWildCards
dependencies:
- base >= 4.7 && < 5
- bytestring
- time-units
- network
- aeson
- aeson-pretty
- cereal
- mtl
- cryptonite
- base16-bytestring
- base58-bytestring
- base64-bytestring
- arithmoi
- directory
- filepath
- process
- extra
- time
- clock
- vector
- scientific
- containers
- random
- free
- iproute
- memory
- transformers
- template-haskell
- async
- text
- haskeline
- cryptohash-sha256
- bytestring-conversion
- newtype-generics
- lens
- universum
- fmt
- stm
- hslogger
- lens-aeson
- th-abstraction
- MonadRandom
- entropy
- validation
- silently
- uuid
- resourcet
- triplesec
- yaml
- newtype-generics
- regex-posix
- safe-exceptions
- unliftio
- unliftio-core
- rocksdb-haskell
- hedis
- beam-core
- beam-postgres
- beam-sqlite
- beam-migrate
- sqlite-simple
- resource-pool
- servant
- servant-server
- servant-client
- servant-swagger
- servant-docs
- wai
- warp
- http-client
- http-client-tls
- data-default
- generic-lens
- Hydra
library:
source-dirs:
- src
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -fhide-source-paths
executables:
labyrinth:
main: Main.hs
source-dirs: src/
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
# - -O2
#
# tests:
# functional-tests:
# main: Spec.hs
# source-dirs:
# - test/spec
# ghc-options:
# - -threaded
# - -rtsopts
# - -with-rtsopts=-N
# dependencies:
# - Hydra

135
lib/Hydra/package.yaml Normal file
View File

@ -0,0 +1,135 @@
name: Hydra
version: 1.1.0.0
github: "graninas/Hydra"
license: BSD3
author: "Alexander Granin"
maintainer: "graninas@gmail.com"
copyright: "Granin A.S. 2020"
description:
All-in-one framework for writing web backends and cli applications.
default-extensions:
- NoImplicitPrelude
- GADTs
- RankNTypes
- DeriveFunctor
- DeriveGeneric
- OverloadedStrings
- LambdaCase
- MultiParamTypeClasses
- ExplicitNamespaces
- TypeApplications
- ScopedTypeVariables
- TypeOperators
- TypeFamilies
- DataKinds
- FlexibleContexts
- FlexibleInstances
- PatternSynonyms
- PolyKinds
- DefaultSignatures
- ConstraintKinds
- NamedFieldPuns
- TupleSections
- ViewPatterns
- MultiWayIf
- RecordWildCards
dependencies:
- base >= 4.7 && < 5
- bytestring
- time-units
- network
- aeson
- aeson-pretty
- cereal
- mtl
- cryptonite
- base16-bytestring
- base58-bytestring
- base64-bytestring
- arithmoi
- directory
- filepath
- process
- extra
- time
- clock
- vector
- scientific
- containers
- random
- free
- iproute
- memory
- transformers
- template-haskell
- async
- text
- haskeline
- cryptohash-sha256
- bytestring-conversion
- newtype-generics
- lens
- universum
- fmt
- stm
- hslogger
- lens-aeson
- th-abstraction
- MonadRandom
- entropy
- validation
- silently
- uuid
- resourcet
- triplesec
- yaml
- newtype-generics
- regex-posix
- safe-exceptions
- unliftio
- unliftio-core
- rocksdb-haskell
- hedis
- beam-core
- beam-postgres
- beam-sqlite
- beam-migrate
- sqlite-simple
- resource-pool
- servant
- servant-server
- servant-client
- servant-swagger
- servant-docs
- wai
- warp
- http-client
- http-client-tls
- data-default
- generic-lens
library:
source-dirs:
- src
ghc-options:
- -Wall
tests:
functional-tests:
main: Spec.hs
source-dirs:
- test
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- hspec
- HUnit
- QuickCheck
- hspec-contrib
- Hydra

View File

@ -9,13 +9,13 @@ import Hydra.Prelude
import qualified Hydra.Core.Domain.DB as D import qualified Hydra.Core.Domain.DB as D
import qualified Hydra.Core.Domain.KVDB as D import qualified Hydra.Core.Domain.KVDB as D
import Language.Haskell.TH.MakeFunctor (makeFunctorInstance)
data KVDBF next where data KVDBF next where
Save :: D.KVDBKey -> D.KVDBValue -> (D.DBResult () -> next) -> KVDBF next Save :: D.KVDBKey -> D.KVDBValue -> (D.DBResult () -> next) -> KVDBF next
Load :: D.KVDBKey -> (D.DBResult D.KVDBValue -> next) -> KVDBF next Load :: D.KVDBKey -> (D.DBResult D.KVDBValue -> next) -> KVDBF next
makeFunctorInstance ''KVDBF instance Functor KVDBF where
fmap g (Save k v next) = Save k v (g . next)
fmap g (Load k next) = Load k (g . next)
type KVDBL db = Free KVDBF type KVDBL db = Free KVDBF

View File

@ -16,8 +16,6 @@ import qualified Hydra.Core.State.ChurchL as CL
import qualified Hydra.Core.State.Class as C import qualified Hydra.Core.State.Class as C
import qualified Hydra.Core.Lang.Class as C import qualified Hydra.Core.Lang.Class as C
import Language.Haskell.TH.MakeFunctor (makeFunctorInstance)
-- | Core effects container language. -- | Core effects container language.
data LangF next where data LangF next where
-- | Eval stateful action atomically. -- | Eval stateful action atomically.
@ -33,7 +31,12 @@ data LangF next where
-- TODO: KVDB -- TODO: KVDB
makeFunctorInstance ''LangF instance Functor LangF where
fmap f (EvalStateAtomically act next) = EvalStateAtomically act (f . next)
fmap f (EvalLogger act next) = EvalLogger act (f . next)
fmap f (EvalRandom act next) = EvalRandom act (f . next)
fmap f (EvalControlFlow act next) = EvalControlFlow act (f . next)
fmap f (EvalIO act next) = EvalIO act (f . next)
type LangL = F LangF type LangL = F LangF

Some files were not shown because too many files have changed in this diff Show More