packages feed

impure-containers-0.2: impure-containers.cabal

name:                impure-containers
version:             0.2
synopsis:            Mutable containers in haskell
description:         Please see README.md
homepage:            https://github.com/andrewthad/impure-containers#readme
license:             BSD3
license-file:        LICENSE
author:              Andrew Martin
maintainer:          andrew.thaddeus@gmail.com
copyright:           2016 Andrew Martin
category:            web
build-type:          Simple
cabal-version:       >=1.10
extra-source-files:
    cbits/Makefile
  , cbits/check.c
  , cbits/defs.h
  , cbits/sse-42-check.c

library
  hs-source-dirs:      src
  exposed-modules:
    Data.HashMap.Mutable.Basic
    -- Data.Heap.Mutable.ModelA
    -- Data.Heap.Mutable.ModelB
    Data.Heap.Mutable.ModelC
    Data.Heap.Mutable.ModelD
    -- Data.Vector.Unique
    Data.Graph.Immutable
    Data.Graph.Mutable
    Data.ArrayList.Generic
    Data.Graph.Types
  other-modules:
    Data.HashMap.Mutable.Internal.Array
    Data.HashMap.Mutable.Internal.CacheLine
    Data.HashMap.Mutable.Internal.CheapPseudoRandomBitStream
    Data.HashMap.Mutable.Internal.IntArray
    Data.HashMap.Mutable.Internal.Linear.Bucket
    Data.HashMap.Mutable.Internal.UnsafeTricks
    Data.HashMap.Mutable.Internal.Utils
  build-depends:
      base >= 4.7 && < 5
    , hashable
    , primitive
    , vector
    , containers
    , ghc-prim
  default-language:    Haskell2010

  if flag(sse42) && !flag(portable)
    cc-options:  -DUSE_SSE_4_2 -msse4.2
    cpp-options: -DUSE_SSE_4_2
    C-sources:   cbits/sse-42.c

  if !flag(portable) && !flag(sse42)
    C-sources:       cbits/default.c

  if !flag(portable)
    C-sources:       cbits/common.c

  if flag(portable)
    cpp-options: -DNO_C_SEARCH -DPORTABLE

  if !flag(portable) && flag(unsafe-tricks) && impl(ghc)
    build-depends: ghc-prim
    cpp-options: -DUNSAFETRICKS

  if flag(debug)
    cpp-options: -DDEBUG

  if flag(bounds-checking)
    cpp-options: -DBOUNDS_CHECKING

  -- ghc-prof-options: -prof -auto-all

  if impl(ghc >= 6.12.0)
    ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
                 -fno-warn-unused-do-bind
  else
    ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2

Flag unsafe-tricks
  Description: turn on unsafe GHC tricks
  Default:   True

Flag bounds-checking
  Description: if on, use bounds-checking array accesses
  Default: False

Flag debug
  Description: if on, spew debugging output to stdout
  Default: False

Flag sse42
  Description: if on, use SSE 4.2 extensions to search cache lines very
               efficiently. The portable flag forces this off.
  Default: False

Flag portable
  Description: if on, use only pure Haskell code and no GHC extensions.
  Default: False

test-suite impure-containers-test
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  build-depends:
      base
    , impure-containers
    , containers
    , test-framework
    , test-framework-quickcheck2
    , QuickCheck
    , HUnit
    , test-framework-hunit
    , vector
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/andrewthad/impure-containers