packages feed

columbia 0.1.0.1 → 0.1.0.2

raw patch · 7 files changed

+30/−27 lines, 7 filesdep −QuickCheckdep ~directorydep ~transformers

Dependencies removed: QuickCheck

Dependency ranges changed: directory, transformers

Files

ChangeLog.md view
@@ -3,3 +3,7 @@ ## 0.1.0.0  -- YYYY-mm-dd
 
 * First version. Released on an unsuspecting world.
+
+## 0.1.0.2
+
+* Some changes to fix installs on the Hackage server.
columbia.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                columbia
-version:             0.1.0.1
+version:             0.1.0.2
 synopsis:            Enhanced serialization for media that support seeking.
 description:         Libraries such as binary and cereal support sequential reading and writing but do not rely on any further operations. Many media support seeking in files as well. This library implements a file format that supports random access to data entities by seeking.
 	.
@@ -21,7 +21,7 @@   exposed-modules:     Data.Columbia, Data.Columbia.CompoundData, Data.Columbia.SeekableStream, Data.Columbia.SeekableWriter, Data.Columbia.Utils, Data.Columbia.Gc, Data.Columbia.Integral, Data.Columbia.CycleDetection, Data.Columbia.FRecord, Data.Columbia.WithAddress, Data.Columbia.Orphans, Data.Columbia.DualLock
   other-modules:       Data.Columbia.Headers, Data.Columbia.Coercion, Data.Columbia.RWInstances, Data.Columbia.Mapper, Data.Columbia.MyEndianness
   -- other-extensions:    
-  build-depends:       base >=4.6 && <=5, filelock ==0.1.0.1, contravariant ==1.4, bytestring >=0.10 && <0.11, monad-loops ==0.4.3, mtl ==2.2.1, directory ==1.2.2.0, syb-with-class ==0.6.1.7, array >=0.5.1 && <0.5.2, invariant ==0.4.2, containers ==0.5.8.1, pointless-haskell ==0.0.9, mmorph ==1.0.9, parallel ==3.2.1.1, QuickCheck ==2.10, transformers ==0.4.2.0, mmap ==0.5.9, data-endian ==0.1
+  build-depends:       base >=4.6 && <=5, filelock ==0.1.0.1, contravariant ==1.4, bytestring >=0.10 && <0.11, monad-loops ==0.4.3, mtl ==2.2.1, directory >=1.2.2.0 && <=1.3.0.0, syb-with-class ==0.6.1.7, array >=0.5.1 && <0.5.2, invariant ==0.4.2, containers ==0.5.8.1, pointless-haskell ==0.0.9, mmorph ==1.0.9, parallel ==3.2.1.1, transformers >=0.4.2.0 && <=0.5.0.0, mmap ==0.5.9, data-endian ==0.1
   if os(mingw32)
     cpp-options: -DWIN32
   hs-source-dirs:      src
src/Data/Columbia.hs view
@@ -25,19 +25,19 @@ 
 -- | Most common idiom of using 'readOneLayer'; reads an entire data structure.
 readCompoundData :: forall m d. (Monad m, Data(PairCtx RWCtx NoCtx) d) => ReaderT(SeekableStream m Word8) m d
-readCompoundData = fixT rwProxy(withAddresses rwProxy #. readOneLayer rwProxy)
+readCompoundData = fixT rwProxy(withAddresses #. readOneLayer)
 
 -- | Convenient idiom; sells targets repeatedly until the entire data structure has been written.
 writeCompoundData :: forall m d. (Monad m, Data(PairCtx RWCtx NoCtx) d)
 	=> d -> ReaderT(SeekableWriter m Word8) m Word32
-writeCompoundData = fixTW rwProxy(writeBackAddresses rwProxy ##. writeOneLayer rwProxy)
+writeCompoundData = fixTW rwProxy(writeBackAddresses ##. writeOneLayer)
 
 rwKeyProxy :: Proxy(PairCtx RWCtx(PairCtx KeyCtx NoCtx))
 rwKeyProxy = undefined
 
 readDataWithCycles :: forall m d. (MonadFix m, StateM m, StateOf m ~ Map Word32 Dynamic, Data(PairCtx RWCtx(PairCtx KeyCtx NoCtx)) d) => ReaderT(SeekableStream m Word8) m d
-readDataWithCycles = fixT rwKeyProxy(withAddresses rwKeyProxy #. cycleDetect rwKeyProxy #. readOneLayer rwKeyProxy)
+readDataWithCycles = fixT rwKeyProxy(withAddresses #. cycleDetect #. readOneLayer)
 
 writeDataWithCycles :: forall m d. (StateM m, StateOf m ~ Map(DynamicWithCtx KeyComparable) Word32, Data(PairCtx RWCtx(PairCtx KeyCtx NoCtx)) d)
 	=> d -> ReaderT(SeekableWriter m Word8) m Word32
-writeDataWithCycles = fixTW rwKeyProxy(writeBackAddresses rwKeyProxy ##. cycleDetectW rwKeyProxy ##. writeOneLayer rwKeyProxy)
+writeDataWithCycles = fixTW rwKeyProxy(writeBackAddresses ##. cycleDetectW ##. writeOneLayer)
src/Data/Columbia/CompoundData.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleContexts, FlexibleInstances, GADTs, ScopedTypeVariables, TypeOperators, Rank2Types, AllowAmbiguousTypes, Trustworthy #-}
+{-# LANGUAGE FlexibleContexts, FlexibleInstances, GADTs, ScopedTypeVariables, TypeOperators, Rank2Types, AllowAmbiguousTypes, ImpredicativeTypes, Trustworthy #-}
 
 -- | Serialization of compound data types (with class!). Also read and write methods' type class contexts
 --   are implemented with heterogeneous list constraints, making them sufficiently abstract. For every
@@ -47,38 +47,37 @@ 	=> PolyTraversal ctx m t
 	-> (forall t2. (Data ctx t2) => PolyTraversal ctx m t2)
 	-> PolyTraversal ctx m t
-(traversal #. traversal2) f = traversal(traversal2 f)
+(traversal #. traversal2) proxy f = traversal proxy(traversal2 proxy f)
 
 (##.) :: (Data ctx t)
 	=> PolyTraversalW ctx m t
 	-> (forall t2. (Data ctx t2) => PolyTraversalW ctx m t2)
 	-> PolyTraversalW ctx m t
-(traversal ##. traversal2) f = traversal(traversal2 f)
+(traversal ##. traversal2) proxy f = traversal proxy(traversal2 proxy f)
 
 fixT :: (Data ctx t)
 	=> Proxy ctx
 	-> (forall t2. (Data ctx t2) => PolyTraversal ctx m t2)
 	-> ReaderT(SeekableStream m Word8) m t
-fixT proxy traversal = traversal(fixT proxy traversal)
+fixT proxy traversal = traversal proxy(fixT proxy traversal)
 
 fixTW :: (Data ctx t)
 	=> Proxy ctx
 	-> (forall t2. (Data ctx t2) => PolyTraversalW ctx m t2)
 	-> t
 	-> ReaderT(SeekableWriter m Word8) m Word32
-fixTW proxy traversal = traversal(fixTW proxy traversal)
+fixTW proxy traversal = traversal proxy(fixTW proxy traversal)
 
 -- | Try to cast from the first traversal; if that fails, use the second traversal.
 typeCoerce :: (Typeable t, Data ctx t2)
-	=> Proxy ctx
-	-> PolyTraversal ctx m t
+	=> PolyTraversal ctx m t
 	-> (forall t3. (Data ctx t3) => PolyTraversal ctx m t3)
 	-> PolyTraversal ctx m t2
-typeCoerce _ traversal traversal2 m = 
+typeCoerce traversal traversal2 proxy m = 
 	maybe
-	(traversal2 m)
+	(traversal2 proxy m)
 	id
-	(gcast(traversal m))
+	(gcast(traversal proxy m))
 
 ------------------------------------
 
@@ -103,14 +102,14 @@ 
 -- | A 'PolyTraversal' is a reader method over a data type, parameterized over a method to read components.
 --   Think: the targets have /wide appeal/, making it /easy to find a buyer/.
-type PolyTraversal ctx m d = (forall a. (Data ctx a) => ReaderT(SeekableStream m Word8) m a)
+type PolyTraversal ctx m d = Proxy ctx
+	-> (forall a. (Data ctx a) => ReaderT(SeekableStream m Word8) m a)
 	-> ReaderT(SeekableStream m Word8) m d
 
 -- | Function returns something 'PolyTraversal'. We can use this to examine the top layer
 --   of a data structure, then seek to and read some of its components.
 readOneLayer :: forall ctx m d. (Monad m, HasField ctx RWCtx, Data ctx d)
-	=> Proxy ctx
-	-> PolyTraversal ctx m d
+	=> PolyTraversal ctx m d
 readOneLayer proxy0 m = do
 	let specimen :: d = error"readOneLayer: specimen"
 	let ty = dataTypeOf proxy0 specimen
@@ -157,11 +156,12 @@ 		writeIntegral x
 	return$error"recursorW: unused"
 
-type PolyTraversalW ctx m d = (forall a. (Data ctx a) => a -> ReaderT(SeekableWriter m Word8) m Word32)
+type PolyTraversalW ctx m d = Proxy ctx
+	-> (forall a. (Data ctx a) => a -> ReaderT(SeekableWriter m Word8) m Word32)
 	-> d -> ReaderT(SeekableWriter m Word8) m Word32
 
 -- | Writes the top layer of a data structure, and sells each of the sub-targets in turn.
-writeOneLayer :: forall ctx m d. (Monad m, HasField ctx RWCtx, Data ctx d) => Proxy ctx -> PolyTraversalW ctx m d
+writeOneLayer :: forall ctx m d. (Monad m, HasField ctx RWCtx, Data ctx d) => PolyTraversalW ctx m d
 writeOneLayer proxy0 f d = do
 	let ty = dataTypeOf proxy0 d
 	m <- getWriterPosition
src/Data/Columbia/CycleDetection.hs view
@@ -74,7 +74,7 @@ type CycleDetectionWIO = ReaderT(IORef(Map(DynamicWithCtx KeyComparable) Word32)) IO
 
 cycleDetect :: forall ctx m t. (MonadFix m, StateM m, StateOf m ~ Map Word32 Dynamic, HasField ctx RWCtx, Data ctx t)
-	=> Proxy ctx -> PolyTraversal ctx m t
+	=> PolyTraversal ctx m t
 cycleDetect proxy m =
 	getPosition>>= \n->
 	lift get'>>=
@@ -89,8 +89,7 @@ 		.lookup n
 
 cycleDetectW :: forall ctx m t. (StateM m, StateOf m ~ Map(DynamicWithCtx KeyComparable) Word32, HasField ctx RWCtx, HasField ctx KeyCtx, Data ctx t)
-	=> Proxy ctx
-	-> PolyTraversalW ctx m t
+	=> PolyTraversalW ctx m t
 cycleDetectW proxy f x =
 	case hasField(dict :: ctx t) :: KeyCtx t of
 		KeyCtx ->
src/Data/Columbia/Orphans.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, UndecidableInstances, StandaloneDeriving, DeriveDataTypeable, Trustworthy #-}
+{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, UndecidableInstances, StandaloneDeriving, DeriveDataTypeable, ImpredicativeTypes, Trustworthy #-}
 
 module Data.Columbia.Orphans (LazyFix(LazyFix)) where
 
src/Data/Columbia/WithAddress.hs view
@@ -67,7 +67,7 @@ -- | The strategy reads term structure from a file and associates file addresses with it.
 --   Bear in mind that the addresses become no good at the moment your reader lock is
 --   relinquished, due to GC'ing (unless you do something heroic with your own locking pattern).
-withAddresses :: forall ctx m d. (Data ctx d, Monad m) => Proxy ctx -> PolyTraversal ctx m d
+withAddresses :: forall ctx m d. (Data ctx d, Monad m) => PolyTraversal ctx m d
 withAddresses proxy m = case dataCast1 proxy(do
 	n <- getPosition
 	if n == 0 then
@@ -83,7 +83,7 @@ --   type 'WithAddress' and that associates an address to the data, and writes that address
 --   in lieu of writing all of the data. The term structure of 'WithAddress' constructor itself
 --   never ends up in the file.
-writeBackAddresses ::  forall ctx m d. (Data ctx d, Monad m) => Proxy ctx -> PolyTraversalW ctx m d
+writeBackAddresses ::  forall ctx m d. (Data ctx d, Monad m) => PolyTraversalW ctx m d
 writeBackAddresses proxy f d = case dataCast1 proxy(Fl$ \d2 -> case d2 of
 		WithAddress n _ -> return n
 		Address n -> return n