storable-tuple-0.1/0000755000175000001440000000000014375117603015332 5ustar00thielemausers00000000000000storable-tuple-0.1/Setup.lhs0000644000175000001440000000011514375117603017137 0ustar00thielemausers00000000000000#! /usr/bin/env runhaskell > import Distribution.Simple > main = defaultMain storable-tuple-0.1/storable-tuple.cabal0000644000175000001440000000411314375117603021257 0ustar00thielemausers00000000000000Cabal-Version: 2.2 Name: storable-tuple Version: 0.1 Category: Data, Foreign Synopsis: Storable instance for pairs and triples Description: Provides a Storable instance for pair and triple which should be binary compatible with C99 and C++. The only purpose of this package is to provide a standard location for this instance so that other packages needing this instance can play nicely together. Note however, that the original purpose of the @Storable@ class was the transfer of primitive types between Haskell and foreign code. This purpose was already extended by HSC, which creates @Storable@ instances for records from C header files. Nonetheless, @Storable@ instances for tuples were omitted from @base@ by intention. Instead of using the orphan instances from this package, you may instead use the custom class or the wrapper type from the module @Foreign.Storable.Record.Tuple@ from the package @storable-record@. License: BSD-3-Clause License-file: LICENSE Author: Henning Thielemann Maintainer: Henning Thielemann Homepage: http://code.haskell.org/~thielema/storable-tuple/ Stability: Experimental Build-Type: Simple Tested-With: GHC==6.8.2, GHC==8.0.1 Extra-Source-Files: Changes.md Source-Repository head Type: darcs Location: http://code.haskell.org/~thielema/storable-tuple/ Source-Repository this Type: darcs Location: http://code.haskell.org/~thielema/storable-tuple/ Tag: 0.1 Flag splitBase Description: Choose the new smaller, split-up base package. Library Build-Depends: storable-record >=0.0.5 && <0.1, utility-ht >=0.0.1 && <0.1, base-orphans >= 0.5 && <1 If flag(splitBase) Build-Depends: base >=3 && <5 Else Build-Depends: special-functors >= 1.0 && <1.1, base >= 1.0 && < 2 Default-Language: Haskell98 GHC-Options: -Wall -fno-warn-orphans Hs-Source-Dirs: src Exposed-Modules: Foreign.Storable.Tuple storable-tuple-0.1/Changes.md0000644000175000001440000000015314375117603017223 0ustar00thielemausers00000000000000# Change log for the `storable-tuple` package ## 0.1 * `Tuple`: implement instances using `Record.Tuple` storable-tuple-0.1/LICENSE0000644000175000001440000000270314375117603016341 0ustar00thielemausers00000000000000Copyright (c) Henning Thielemann 2009 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. Neither the name of the author nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 AUTHORS 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. storable-tuple-0.1/src/0000755000175000001440000000000014375117603016121 5ustar00thielemausers00000000000000storable-tuple-0.1/src/Foreign/0000755000175000001440000000000014375117603017512 5ustar00thielemausers00000000000000storable-tuple-0.1/src/Foreign/Storable/0000755000175000001440000000000014375117603021265 5ustar00thielemausers00000000000000storable-tuple-0.1/src/Foreign/Storable/Tuple.hs0000644000175000001440000000233114375117603022711 0ustar00thielemausers00000000000000module Foreign.Storable.Tuple where import qualified Foreign.Storable.Newtype as Newtype import Foreign.Storable.Record.Tuple (Tuple(Tuple, getTuple)) import Foreign.Storable (Storable, sizeOf, alignment, peek, poke) import Data.Orphans () instance (Storable a, Storable b) => Storable (a,b) where {-# INLINABLE sizeOf #-} sizeOf = Newtype.sizeOf Tuple {-# INLINABLE alignment #-} alignment = Newtype.alignment Tuple {-# INLINABLE peek #-} peek = Newtype.peek getTuple {-# INLINABLE poke #-} poke = Newtype.poke Tuple instance (Storable a, Storable b, Storable c) => Storable (a,b,c) where {-# INLINABLE sizeOf #-} sizeOf = Newtype.sizeOf Tuple {-# INLINABLE alignment #-} alignment = Newtype.alignment Tuple {-# INLINABLE peek #-} peek = Newtype.peek getTuple {-# INLINABLE poke #-} poke = Newtype.poke Tuple instance (Storable a, Storable b, Storable c, Storable d) => Storable (a,b,c,d) where {-# INLINABLE sizeOf #-} sizeOf = Newtype.sizeOf Tuple {-# INLINABLE alignment #-} alignment = Newtype.alignment Tuple {-# INLINABLE peek #-} peek = Newtype.peek getTuple {-# INLINABLE poke #-} poke = Newtype.poke Tuple