short-vec 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+56/−39 lines, 4 filesdep ~basedep ~fin-intdep ~semigroupoids
Dependency ranges changed: base, fin-int, semigroupoids
Files
- CHANGELOG.md +6/−1
- README.md +3/−0
- short-vec.cabal +32/−35
- src/Data/Vec/Short/Internal.hs +15/−3
CHANGELOG.md view
@@ -1,3 +1,8 @@-# 0.1.0.0+# 0.1.0.1 (2023-03-12)++* Fix build on GHC 9.2 and above caused by RULES looping infinitely.+* Fix a redundant import warning with base >= 4.18.++# 0.1.0.0 (2021-09-07) Initial version.
+ README.md view
@@ -0,0 +1,3 @@+# short-vec++Provides a length-indexed vector type built on `SmallArray#`.
short-vec.cabal view
@@ -1,34 +1,33 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.35.1. -- -- see: https://github.com/sol/hpack------ hash: d250fd4c14d88f72bb1abb89d02d30c1f6f6cbcbab3b4edfb356e404089e770e name: short-vec-version: 0.1.0.0-synopsis: A length-indexed vector type build on 'SmallArray#'+version: 0.1.0.1+synopsis: Length-indexed vectors using SmallArray# description: This provides performant length-indexed vectors with a suite of rewrite rules implementing fusion of intermediate structures, so that expressions involving many operations can usually be compiled to a single pass of computing and writing each index of the final 'Vec'. category: Data-homepage: https://github.com/google/hs-fin-vec#readme-bug-reports: https://github.com/google/hs-fin-vec/issues-author: Lennart Augustsson <lennart@augustsson.net>, Wren Romano, Andrew Pritchard <awpr@google.com>+homepage: https://github.com/awpr/fin-vec#readme+bug-reports: https://github.com/awpr/fin-vec/issues+author: Lennart Augustsson <lennart@augustsson.net>, Wren Romano <wrengr@google.com>, Andrew Pritchard <awpritchard@gmail.com> -maintainer: Andrew Pritchard <awpr@google.com>-copyright: 2018-2021 Google LLC+maintainer: Andrew Pritchard <awpritchard@gmail.com>+copyright: 2018-2021 Google LLC; 2022-2023 Andrew Pritchard license: Apache-2.0 license-file: LICENSE build-type: Simple extra-source-files: CHANGELOG.md+ README.md source-repository head type: git- location: https://github.com/google/hs-fin-vec+ location: https://github.com/awpr/fin-vec subdir: short-vec library@@ -36,24 +35,22 @@ Data.Vec.Short Data.Vec.Short.Explicit Data.Vec.Short.Internal- other-modules:- Paths_short_vec hs-source-dirs: src build-depends: QuickCheck >=2.5 && <2.15- , adjunctions >=4.4 && <4.5- , base >=4.12 && <4.16+ , adjunctions ==4.4.*+ , base >=4.12 && <4.19 , data-default-class >=0.0 && <0.2 , deepseq >=1.1 && <1.5 , distributive >=0.1 && <0.7- , fin-int >=0.1 && <0.2- , indexed-traversable >=0.1 && <0.2+ , fin-int >=0.1 && <0.3+ , indexed-traversable ==0.1.* , integer-gmp >=0.5 && <1.2- , portray >=0.1 && <0.2- , portray-diff >=0.1 && <0.2- , semigroupoids >=1.0 && <5.4- , sint >=0.1 && <0.2+ , portray >=0.1 && <0.4+ , portray-diff ==0.1.*+ , semigroupoids >=1.0 && <6.1+ , sint >=0.1 && <0.3 default-language: Haskell2010 test-suite Vec-test@@ -64,19 +61,19 @@ build-depends: HUnit , QuickCheck >=2.4.0.1- , adjunctions >=4.4 && <4.5+ , adjunctions ==4.4.* , base , data-default-class >=0.0 && <0.2 , deepseq >=1.1 && <1.5 , distributive >=0.1 && <0.7- , fin-int >=0.1 && <0.2- , indexed-traversable >=0.1 && <0.2+ , fin-int >=0.1 && <0.3+ , indexed-traversable ==0.1.* , integer-gmp >=0.5 && <1.2- , portray >=0.1 && <0.2- , portray-diff >=0.1 && <0.2- , semigroupoids >=1.0 && <5.4+ , portray >=0.1 && <0.4+ , portray-diff ==0.1.*+ , semigroupoids >=1.0 && <6.1 , short-vec- , sint >=0.1 && <0.2+ , sint >=0.1 && <0.3 , test-framework >=0.3.3 , test-framework-hunit , test-framework-quickcheck2@@ -89,18 +86,18 @@ test build-depends: QuickCheck >=2.5 && <2.15- , adjunctions >=4.4 && <4.5- , base >=4.12 && <4.16+ , adjunctions ==4.4.*+ , base >=4.12 && <4.19 , data-default-class >=0.0 && <0.2 , deepseq , distributive >=0.1 && <0.7 , fin-int , gauge- , indexed-traversable >=0.1 && <0.2+ , indexed-traversable ==0.1.* , integer-gmp >=0.5 && <1.2- , portray >=0.1 && <0.2- , portray-diff >=0.1 && <0.2- , semigroupoids >=1.0 && <5.4+ , portray >=0.1 && <0.4+ , portray-diff ==0.1.*+ , semigroupoids >=1.0 && <6.1 , short-vec- , sint >=0.1 && <0.2+ , sint >=0.1 && <0.3 default-language: Haskell2010
src/Data/Vec/Short/Internal.hs view
@@ -1,4 +1,5 @@ -- Copyright 2018-2021 Google LLC+-- Copyright 2022-2023 Andrew Pritchard -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License.@@ -60,7 +61,9 @@ import Prelude hiding ((++), concat, iterate) +#if !MIN_VERSION_base(4, 18, 0) import Control.Applicative (Applicative(..))+#endif import Control.DeepSeq (NFData(rnf)) import Control.Exception (assert) import qualified Data.Data as D@@ -484,15 +487,24 @@ -- Fuses adjacent Vec ops, keeping everything in Accessor form. "access/materialize" forall va. access (materialize va) = va +-- Eliminates no-op copies of a vector.+"materialize/access" forall v. materialize (access v) = v++ #-}++-- This rule seems to fire incorrectly when there's no coerce present on+-- GHC-9.2.2, leading to an infinite loop of applying the same expansion; so,+-- disable it for now. I don't yet know why it started firing.+#if __GLASGOW_HASKELL__ < 902+{-# RULES+ -- Transports coercions out from between access/materialize pairs so they can -- fuse. "access/coerce/materialize" forall v. access (coerce v) = mapVA coerce (access v) --- Eliminates no-op copies of a vector.-"materialize/access" forall v. materialize (access v) = v- #-}+#endif pureVA :: SInt n -> a -> Accessor n a pureVA n x = Accessor n $ \_ -> (# x #)