storable-complex 0.2.2 → 0.2.3.0
raw patch · 5 files changed
+29/−56 lines, 5 filesdep +base-orphansdep ~base
Dependencies added: base-orphans
Dependency ranges changed: base
Files
- README.md +13/−0
- in-base/Foreign/Storable/Complex.hs +0/−1
- out-of-base/Foreign/Storable/Complex.hs +0/−37
- src/Foreign/Storable/Complex.hs +3/−0
- storable-complex.cabal +13/−18
+ README.md view
@@ -0,0 +1,13 @@+# what is storable-complex?++historically, `Complex a` didn't have a storable instance in base,+and thus storable-complex was born!++# when might i use this package?++you're using an older ghc/version of base AND calling out to some C or fortran+codes around complex numbers. You might find yourself needing this then!++# when might i regret using this?+if you're writing your own orphan instances instead of using base-orphans,+you might have a bad day, use base-orphans (and storable-complex) instead!
− in-base/Foreign/Storable/Complex.hs
@@ -1,1 +0,0 @@-module Foreign.Storable.Complex () where
− out-of-base/Foreign/Storable/Complex.hs
@@ -1,37 +0,0 @@--------------------------------------------------------------------------------- |--- Module : Data.Array.CArray.Base--- Copyright : (c) 2008 Jed Brown--- License : BSD-style------ Maintainer : jed@59A2.org--- Stability : provisional--- Portability : portable------ This module provides a Storable instance for Complex which is binary--- compatible with C99, C++ and Fortran complex data types. It's only purpose--- is to provide a standard location for this instance so that other packages--- needing this instance can play nicely together.-----------------------------------------------------------------------------------{-# LANGUAGE ScopedTypeVariables #-}--module Foreign.Storable.Complex () where--import Data.Complex-import Foreign.Storable-import Foreign.Ptr---- This Storable instance for Complex is binary compatible with C99, C++ and--- Fortran complex data types.-instance Storable a => Storable (Complex a) where- sizeOf z = 2 * sizeOf (undefined :: a)- alignment z = alignment (undefined :: a)- peek p = do let q = castPtr p- r <- peek q- i <- peekElemOff q 1- return (r :+ i)- poke p (r :+ i) = do let q = (castPtr p)- poke q r- pokeElemOff q 1 i
+ src/Foreign/Storable/Complex.hs view
@@ -0,0 +1,3 @@+module Foreign.Storable.Complex () where++import Data.Orphans()
storable-complex.cabal view
@@ -1,12 +1,12 @@ name: storable-complex -version: 0.2.2 +version: 0.2.3.0 synopsis: Storable instance for Complex description: Provides a Storable instance for Complex which is binary - compatible with C99, C++ and Fortran complex data types. - . - 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. + compatible with C99, C++ and Fortran complex data types. + . + 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. category: Data license: BSD3 license-file: LICENSE @@ -14,26 +14,21 @@ maintainer: Carter Schonwald <carter.schonwald@gmail.com> homepage: https://github.com/cartazio/storable-complex bug-reports: https://github.com/cartazio/storable-complex/issues -build-type: Simple +build-type: Simple cabal-version: >= 1.6 extra-source-files: - in-base/Foreign/Storable/Complex.hs - out-of-base/Foreign/Storable/Complex.hs .travis.yml + README.md source-repository head type: git location: git@github.com:cartazio/storable-complex.git -flag instanceInBase - description: instance Storable Complex is already in 'base' - default: True + library exposed-modules: Foreign.Storable.Complex - if flag(instanceInBase) - build-depends: base >= 4.8 && < 5 - hs-source-dirs: in-base - else - build-depends: base < 4.8 && >= 4.4 - hs-source-dirs: out-of-base + build-depends: base >= 4 && < 200 + ,base-orphans >= 0.3.2 + + hs-source-dirs: src