serialize-instances (empty) → 0.1.0.0
raw patch · 4 files changed
+138/−0 lines, 4 filesdep +basedep +cerealdep +hashablesetup-changed
Dependencies added: base, cereal, hashable, semigroups, unordered-containers
Files
- Data/Serialize/Instances.hs +40/−0
- LICENSE +20/−0
- Setup.hs +2/−0
- serialize-instances.cabal +76/−0
+ Data/Serialize/Instances.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE StandaloneDeriving,DeriveGeneric #-}+module Data.Serialize.Instances where++import Data.Hashable+import Data.HashMap.Lazy as Lazy+import Data.List.NonEmpty+import Data.Serialize+import Data.Typeable+import Data.Typeable.Internal++import GHC.Generics++class Serialize1 f where+ put1 :: Serialize a => Putter (f a)+ default put1 :: Serialize (f a) => Putter (f a)+ put1 = put+ get1 :: Serialize a => Get (f a)+ default get1 :: Serialize (f a) => Get (f a)+ get1 = get++deriving instance Generic Fingerprint+deriving instance Generic TypeRep++instance Serialize Fingerprint where+instance Serialize TyCon where+ get = mkTyCon3 <$> get <*> get <*> get+ put x = do+ put $ tyConPackage x+ put $ tyConModule x+ put $ tyConName x+instance Serialize TypeRep where++instance Serialize1 NonEmpty where++instance Serialize a => Serialize (NonEmpty a) where++instance (Eq k,Hashable k,Serialize k,Serialize a) => Serialize (Lazy.HashMap k a) where+ get = Lazy.fromList <$> get+ put = put . Lazy.toList+
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2016 Simon Hudon++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
+ serialize-instances.cabal view
@@ -0,0 +1,76 @@+-- Initial generic-instances.cabal generated by cabal init. For further +-- documentation, see http://haskell.org/cabal/users-guide/++-- The name of the package.+name: serialize-instances++-- The package version. See the Haskell package versioning policy (PVP) +-- for standards guiding when and how versions should be incremented.+-- http://www.haskell.org/haskellwiki/Package_versioning_policy+-- PVP summary: +-+------- breaking API changes+-- | | +----- non-breaking API additions+-- | | | +--- code changes with no API change+version: 0.1.0.0++-- A short (one-line) description of the package.+synopsis: Instances for Serialize of cereal++-- A longer description of the package.+description: Instances for Serialize of cereal, especially for TypeRep and NonEmpty++-- The license under which the package is released.+license: MIT++-- The file containing the license text.+license-file: LICENSE++-- The package author(s).+author: Simon Hudon++-- An email address to which users can send suggestions, bug reports, and +-- patches.+maintainer: simon@cse.yorku.ca++-- A copyright notice.+-- copyright: ++category: GHC++build-type: Simple++-- Extra files to be distributed with the package, such as examples or a +-- README.+-- extra-source-files: ++-- Constraint on the version of Cabal needed to build this package.+cabal-version: >=1.10++source-repository head+ type: git+ location: https://github.com/literate-unitb/serialize-instances++library+ -- Modules exported by the library.+ exposed-modules: Data.Serialize.Instances+ + -- Modules included in this library but not exported.+ -- other-modules: + + -- LANGUAGE extensions used by modules in this package.+ default-extensions: TemplateHaskell, QuasiQuotes, DefaultSignatures, MultiParamTypeClasses, RankNTypes, FlexibleInstances, FlexibleContexts+ + -- Other library packages from which modules are imported.+ build-depends: base >=4.7 && <5, semigroups >=0.16 && <0.19, cereal >=0.4 && <0.6, unordered-containers, hashable+ + ghc-options: -W -fwarn-missing-signatures + -fwarn-incomplete-uni-patterns+ -fwarn-missing-methods+ -fno-ignore-asserts+ -fwarn-tabs+ -j8++ -- Directories containing source files.+ hs-source-dirs: .+ + -- Base language which the package is written in.+ default-language: Haskell2010