cereal-data-dword (empty) → 0.1
raw patch · 7 files changed
+186/−0 lines, 7 filesdep +basedep +cerealdep +data-dwordsetup-changed
Dependencies added: base, cereal, data-dword
Files
- LICENSE +22/−0
- Setup.hs +2/−0
- cereal-data-dword.cabal +42/−0
- library/Cereal/DataDWord/Get.hs +11/−0
- library/Cereal/DataDWord/Prelude.hs +80/−0
- library/Cereal/DataDWord/Put.hs +11/−0
- library/Cereal/DataDWord/Serialize.hs +18/−0
+ LICENSE view
@@ -0,0 +1,22 @@+Copyright (c) 2018, Metrix.AI++Permission is hereby granted, free of charge, to any person+obtaining a copy of this software and associated documentation+files (the "Software"), to deal in the Software without+restriction, including without limitation the rights to use,+copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the+Software is furnished to do so, subject to the following+conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR+OTHER DEALINGS IN THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ cereal-data-dword.cabal view
@@ -0,0 +1,42 @@+name:+ cereal-data-dword+version:+ 0.1+synopsis:+ Integration of "cereal" and "data-dword"+homepage:+ https://github.com/metrix-ai/cereal-data-dword +bug-reports:+ https://github.com/metrix-ai/cereal-data-dword/issues +author:+ Nikita Volkov <nikita.y.volkov@mail.ru>+maintainer:+ Metrix.AI Ninjas <ninjas@metrix.ai>+copyright:+ (c) 2018, Metrix.AI+license:+ MIT+license-file:+ LICENSE+build-type:+ Simple+cabal-version:+ >=1.10++library+ hs-source-dirs:+ library+ default-extensions:+ Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ default-language:+ Haskell2010+ exposed-modules:+ Cereal.DataDWord.Serialize+ Cereal.DataDWord.Put+ Cereal.DataDWord.Get+ other-modules:+ Cereal.DataDWord.Prelude+ build-depends:+ base <5,+ cereal >=0.5.5 && <0.6,+ data-dword >=0.3.1 && <0.4
+ library/Cereal/DataDWord/Get.hs view
@@ -0,0 +1,11 @@+module Cereal.DataDWord.Get+where++import Cereal.DataDWord.Prelude+++word96 :: Get Word32 -> Get Word64 -> Get Word96+word96 word32 word64 = Word96 <$> word32 <*> word64++word128 :: Get Word64 -> Get Word128+word128 word64 = Word128 <$> word64 <*> word64
+ library/Cereal/DataDWord/Prelude.hs view
@@ -0,0 +1,80 @@+module Cereal.DataDWord.Prelude+(+ module Exports,+)+where+++-- base+-------------------------+import Control.Applicative as Exports+import Control.Arrow as Exports+import Control.Category as Exports+import Control.Concurrent as Exports+import Control.Exception as Exports+import Control.Monad as Exports hiding (mapM_, sequence_, forM_, msum, mapM, sequence, forM)+import Control.Monad.IO.Class as Exports+import Control.Monad.Fix as Exports hiding (fix)+import Control.Monad.ST as Exports+import Data.Bits as Exports+import Data.Bool as Exports+import Data.Char as Exports+import Data.Coerce as Exports+import Data.Complex as Exports+import Data.Data as Exports+import Data.Dynamic as Exports+import Data.Either as Exports+import Data.Fixed as Exports+import Data.Foldable as Exports+import Data.Function as Exports hiding (id, (.))+import Data.Functor as Exports+import Data.Functor.Identity as Exports+import Data.Int as Exports+import Data.IORef as Exports+import Data.Ix as Exports+import Data.List as Exports hiding (sortOn, isSubsequenceOf, uncons, concat, foldr, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, find, maximumBy, minimumBy, mapAccumL, mapAccumR, foldl')+import Data.Maybe as Exports+import Data.Monoid as Exports hiding (Last(..), First(..), (<>))+import Data.Ord as Exports+import Data.Proxy as Exports+import Data.Ratio as Exports+import Data.Semigroup as Exports+import Data.STRef as Exports+import Data.String as Exports+import Data.Traversable as Exports+import Data.Tuple as Exports+import Data.Unique as Exports+import Data.Version as Exports+import Data.Word as Exports+import Debug.Trace as Exports+import Foreign.ForeignPtr as Exports+import Foreign.Ptr as Exports+import Foreign.StablePtr as Exports+import Foreign.Storable as Exports hiding (sizeOf, alignment)+import GHC.Conc as Exports hiding (withMVar, threadWaitWriteSTM, threadWaitWrite, threadWaitReadSTM, threadWaitRead)+import GHC.Exts as Exports (lazy, inline, sortWith, groupWith)+import GHC.Generics as Exports (Generic)+import GHC.IO.Exception as Exports+import Numeric as Exports+import Prelude as Exports hiding (concat, foldr, mapM_, sequence_, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, mapM, sequence, id, (.))+import System.Environment as Exports+import System.Exit as Exports+import System.IO as Exports+import System.IO.Error as Exports+import System.IO.Unsafe as Exports+import System.Mem as Exports+import System.Mem.StableName as Exports+import System.Timeout as Exports+import Text.ParserCombinators.ReadP as Exports (ReadP, ReadS, readP_to_S, readS_to_P)+import Text.ParserCombinators.ReadPrec as Exports (ReadPrec, readPrec_to_P, readP_to_Prec, readPrec_to_S, readS_to_Prec)+import Text.Printf as Exports (printf, hPrintf)+import Text.Read as Exports (Read(..), readMaybe, readEither)+import Unsafe.Coerce as Exports++-- cereal+-------------------------+import Data.Serialize as Exports++-- uuid+-------------------------+import Data.DoubleWord as Exports
+ library/Cereal/DataDWord/Put.hs view
@@ -0,0 +1,11 @@+module Cereal.DataDWord.Put+where++import Cereal.DataDWord.Prelude+++word96 :: Putter Word32 -> Putter Word64 -> Putter Word96+word96 word32 word64 (Word96 a b) = word32 a <> word64 b++word128 :: Putter Word64 -> Putter Word128+word128 word64 (Word128 a b) = word64 a <> word64 b
+ library/Cereal/DataDWord/Serialize.hs view
@@ -0,0 +1,18 @@+{-|+Orphan instances of "Serialize".+-}+module Cereal.DataDWord.Serialize+where++import Cereal.DataDWord.Prelude+import qualified Cereal.DataDWord.Put as Put+import qualified Cereal.DataDWord.Get as Get+++instance Serialize Word96 where+ put = Put.word96 put put+ get = Get.word96 get get++instance Serialize Word128 where+ put = Put.word128 put+ get = Get.word128 get