From f8cd9da92a04254a234eafce88849e687f34fccd Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Thu, 19 Oct 2023 04:46:27 +0300 Subject: [PATCH] qblf to hbs2-qblf library --- examples/refchan-qblf/app/RefChanQBLFMain.hs | 2 +- examples/refchan-qblf/refchan-qblf.cabal | 55 +----------- .../refchan-qblf/test/RefChanQBLFProtoTest.hs | 2 +- hbs2-qblf/CHANGELOG.md | 5 ++ hbs2-qblf/LICENSE | 30 +++++++ hbs2-qblf/hbs2-qblf.cabal | 83 +++++++++++++++++++ .../lib/HBS2/Net/Proto/QBLF.hs | 2 +- 7 files changed, 124 insertions(+), 55 deletions(-) create mode 100644 hbs2-qblf/CHANGELOG.md create mode 100644 hbs2-qblf/LICENSE create mode 100644 hbs2-qblf/hbs2-qblf.cabal rename examples/refchan-qblf/lib/QBLF/Proto.hs => hbs2-qblf/lib/HBS2/Net/Proto/QBLF.hs (99%) diff --git a/examples/refchan-qblf/app/RefChanQBLFMain.hs b/examples/refchan-qblf/app/RefChanQBLFMain.hs index b3dfa051..ac6277da 100644 --- a/examples/refchan-qblf/app/RefChanQBLFMain.hs +++ b/examples/refchan-qblf/app/RefChanQBLFMain.hs @@ -26,7 +26,7 @@ import HBS2.Storage.Simple import HBS2.System.Logger.Simple -import QBLF.Proto +import HBS2.Net.Proto.QBLF import Demo.QBLF.Transactions import Data.Config.Suckless diff --git a/examples/refchan-qblf/refchan-qblf.cabal b/examples/refchan-qblf/refchan-qblf.cabal index bed8ea85..bfe83452 100644 --- a/examples/refchan-qblf/refchan-qblf.cabal +++ b/examples/refchan-qblf/refchan-qblf.cabal @@ -18,7 +18,7 @@ common warnings common common-deps build-depends: - base, hbs2-core, hbs2-storage-simple + base, hbs2-core, hbs2-storage-simple, hbs2-qblf , aeson , async , bytestring @@ -100,55 +100,6 @@ common shared-properties , TypeApplications , TypeFamilies -library refchan-qblf-core - import: shared-properties - import: common-deps - default-language: Haskell2010 - - exposed-modules: QBLF.Proto - - ghc-options: - -- -prof - -- -fprof-auto - - -- other-extensions: - - -- type: exitcode-stdio-1.0 - hs-source-dirs: lib - - build-depends: - base, hbs2-core - , async - , attoparsec - , bytestring - , cache - , clock - , containers - , data-default - , directory - , hashable - , microlens-platform - , mtl - , mwc-random - , network - , network-ip - , optparse-applicative - , prettyprinter - , QuickCheck - , random - , safe - , serialise - , stm - , streaming - , tasty - , tasty-hunit - , text - , time - , transformers - , uniplate - , vector - , unliftio - executable refchan-qblf import: shared-properties import: common-deps @@ -168,7 +119,7 @@ executable refchan-qblf main-is: RefChanQBLFMain.hs build-depends: - base, refchan-qblf-core, hbs2-core, hbs2-storage-simple + base, hbs2-core, hbs2-qblf, hbs2-storage-simple , async , attoparsec , bytestring @@ -213,7 +164,7 @@ test-suite refchan-qblf-proto-test main-is: RefChanQBLFProtoTest.hs build-depends: - base, refchan-qblf-core, hbs2-core + base, refchan-qblf-core, hbs2-core, hbs2-qblf , async , bytestring , cache diff --git a/examples/refchan-qblf/test/RefChanQBLFProtoTest.hs b/examples/refchan-qblf/test/RefChanQBLFProtoTest.hs index d34417a4..3c1c8e90 100644 --- a/examples/refchan-qblf/test/RefChanQBLFProtoTest.hs +++ b/examples/refchan-qblf/test/RefChanQBLFProtoTest.hs @@ -7,7 +7,7 @@ import HBS2.Clock import HBS2.Hash import HBS2.Base58 -import QBLF.Proto +import HBS2.Net.Proto.QBLF import Data.Ord import Data.Functor diff --git a/hbs2-qblf/CHANGELOG.md b/hbs2-qblf/CHANGELOG.md new file mode 100644 index 00000000..5428402c --- /dev/null +++ b/hbs2-qblf/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for hbs2-qblf + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/hbs2-qblf/LICENSE b/hbs2-qblf/LICENSE new file mode 100644 index 00000000..3086ee5d --- /dev/null +++ b/hbs2-qblf/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2023, Dmitry Zuikov + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Dmitry Zuikov nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hbs2-qblf/hbs2-qblf.cabal b/hbs2-qblf/hbs2-qblf.cabal new file mode 100644 index 00000000..70b179ac --- /dev/null +++ b/hbs2-qblf/hbs2-qblf.cabal @@ -0,0 +1,83 @@ +cabal-version: 3.0 +name: hbs2-qblf +version: 0.1.0.0 +-- synopsis: +-- description: +license: BSD-3-Clause +license-file: LICENSE +author: Dmitry Zuikov +maintainer: dzuikov@gmail.com +-- copyright: +category: Network +build-type: Simple +extra-doc-files: CHANGELOG.md +-- extra-source-files: + +common shared-properties + ghc-options: + -Wall + -- -fno-warn-unused-matches + -- -fno-warn-unused-do-bind + -- -Werror=missing-methods + -- -Werror=incomplete-patterns + -- -fno-warn-unused-binds + -- -threaded + -- -rtsopts + -- "-with-rtsopts=-N4 -A64m -AL256m -I0" + + default-language: Haskell2010 + + default-extensions: + ApplicativeDo + , BangPatterns + , BlockArguments + , ConstraintKinds + , DataKinds + , DeriveDataTypeable + , DeriveGeneric + , DerivingStrategies + , DerivingVia + , ExtendedDefaultRules + , FlexibleContexts + , FlexibleInstances + , GADTs + , GeneralizedNewtypeDeriving + , ImportQualifiedPost + , LambdaCase + , MultiParamTypeClasses + , OverloadedStrings + , QuasiQuotes + , ScopedTypeVariables + , StandaloneDeriving + , TupleSections + , TypeApplications + , TypeOperators + , TypeFamilies + + +library + import: shared-properties + + exposed-modules: HBS2.Net.Proto.QBLF + + -- other-modules: + -- other-extensions: + build-depends: base >=4.17.2.0, hbs2-core + , async + , bytestring + , containers + , microlens-platform + , mtl + , prettyprinter + , random + , serialise + , stm + , time + , transformers + , uniplate + , unordered-containers + , unliftio + + hs-source-dirs: lib + + default-language: GHC2021 diff --git a/examples/refchan-qblf/lib/QBLF/Proto.hs b/hbs2-qblf/lib/HBS2/Net/Proto/QBLF.hs similarity index 99% rename from examples/refchan-qblf/lib/QBLF/Proto.hs rename to hbs2-qblf/lib/HBS2/Net/Proto/QBLF.hs index 6c70d5d4..92bf9ffd 100644 --- a/examples/refchan-qblf/lib/QBLF/Proto.hs +++ b/hbs2-qblf/lib/HBS2/Net/Proto/QBLF.hs @@ -2,7 +2,7 @@ {-# Language AllowAmbiguousTypes #-} {-# Language UndecidableInstances #-} {-# Language MultiWayIf #-} -module QBLF.Proto where +module HBS2.Net.Proto.QBLF where import HBS2.Prelude.Plated import HBS2.System.Logger.Simple