Skip to content

Commit

Permalink
Prepare 0.6.4.1 release
Browse files Browse the repository at this point in the history
Reformatted.
Added workflows.
Updated package metadata.
  • Loading branch information
brianjosephmckeon authored Feb 5, 2024
1 parent 8acbf10 commit 0caa736
Show file tree
Hide file tree
Showing 15 changed files with 2,256 additions and 1,636 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@byteverse/l3c
12 changes: 12 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: build
on:
pull_request:
branches:
- "*"

jobs:
call-workflow:
uses: byteverse/.github/.github/workflows/build.yaml@main
secrets: inherit
with:
release: false
12 changes: 12 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: release
on:
push:
tags:
- "*"

jobs:
call-workflow:
uses: byteverse/.github/.github/workflows/build.yaml@main
secrets: inherit
with:
release: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
dist
dist-*
cabal-dev
Expand Down
84 changes: 45 additions & 39 deletions changelog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
0.6.4.0: [2023.06.28]
---------------------
# Revision history for contiguous

## 0.6.4.1 -- 2024-02-05

* Update package metadata.

## 0.6.4.0 -- 2023-06-28

* Make it work with primitive-unlifted-2.1, which drops
support for older primitive-unlifted.
* Add `quintupleton` and `sextupleton`.
* Add `construct(1|2|3|4|5|6)` aliases for constructing arrays with
a small known number of elements.

0.6.3.0: [2022.12.07]
---------------------
* Add strict foldrM
## 0.6.3.0 -- 2022-12-07

* Add strict `foldrM`

## 0.6.2.0 -- 2022-04-13

0.6.2.0: [2022.04.13]
---------------------
* Make benchmarks build
* Add strict ifoldlZipWith and foldlZipWith
* Add strict `ifoldlZipWith` and `foldlZipWith`

## 0.6.1.1 -- 2022-02-16

0.6.1.1: [2022.02.16]
---------------------
* Allow building with GHC 9.2.1.
* Drop support for GHC 8.8 and earlier.

0.6.1.0: [2021.09.01]
---------------------
## 0.6.1.0 -- 2021-09-01

* Add `itraverseP`
* Add `deleteAt` and `ifoldr`

0.6.0: [2021.XX.XX]
-------------------
## 0.6.0 -- 2021-08-28

* Add `Slice`, `MutableSlice`.
* Split `Contiguous` into `ContiguousSlice` and `Contiguous`.
* Add `shrink` and `unsafeShrinkAndFreeze`

0.5.2: [2021.08.11]
-------------------
## 0.5.2 -- 2021-08-11

* Add `ifoldlM'`.
* Add `foldrZipWith` and `ifoldrZipWith`.
* Add `foldlZipWithM'` and `ifoldlZipWithM'`.
* Add `all` and `any`.
* Add `run`. Use it internally to accerelate prevent GHC from
boxing results in `runST`.
boxing results in `runST`.
* Add `quadrupleton`.

0.5.1: [2020.06.30]
-----------------
## 0.5.1 -- 2020-06-30

* Add `izipWith`.
* Compatibility with `primitive-0.7.1.0`.

0.5: [2019.07.23]
-----------------
## 0.5 -- 2019-07-23

* Add `generateM`, `reverseSlice`, `swap`, `catMaybes`,
`zipWith`, `zip`, `lefts`, `rights`, `partitionEithers`, `elem`,
`find`, `maximum`/`minimum`, `maximumBy`/`minimumBy`, `asum`,
Expand All @@ -65,14 +71,14 @@
* Make sure all functions are marked INLINE. Last function not marked
as inline was `imap'`.

0.4.0.1: [2019.05.17]
---------------------
## 0.4.0.1 -- 2019-05-17

* Allow building with `primitive-0.7`. This required depending on the
`primitive-unlifted` package to provide the removed `UnliftedArray`
api.

0.4: [2019.05.16]
----------
## 0.4 -- 2019-05-16

* Add `convert`, `filter`, `ifilter`, `itraverse(_)` (#6), `imap'`,
`unsafeFromListN`, `unsafeFromListReverseMutableN`, `ifoldr'`,
`foldl`, `mapMutable`, `imapMutable`, `reverse`, `reverseMutable`,
Expand All @@ -90,26 +96,26 @@
* Change all instances of `return` to `pure`
* Add initial test suite (some unit tests that check implementations
against base/vector versions of the same functions)
* Export `unsafeFreeze`, `copy`, `write`,
* Export `unsafeFreeze`, `copy`, `write`,
* Rename `sameMutable` to `equalsMutable`

0.3.3.0: [2019.03.24]
---------------------
## 0.3.3.0 -- 2019-03-24

* Add `freeze` as a method to `Contiguous`
* Add more folds
* Mark more functions as INLINEABLE

0.3.2.0: [2019.01.02]
---------------------
## 0.3.2.0 -- 2019-01-02

* Add `thaw` as a method to `Contiguous`

0.3.1.0: [2018.10.19]
---------------------
## 0.3.1.0 -- 2018-10-19

* Add `singleton`,`doubleton`,`tripleton` as methods to `Contiguous`
* Add `map'`, `imap`, `mapMutable'`, `imapMutable'`

0.3.0.0: [2018.09.06]
---------------------
## 0.3.0.0 -- 2018-09-06

* Document the need for `Always`
* Generalise API: from `ST s` to `PrimMonad m`
* Add NFData `rnf` function for deeply evaluating
Expand All @@ -121,11 +127,11 @@
* Add `replicate`, `null` as methods to `Contiguous`.
* Add `traverse`, `itraverse`, `traverseP`, `foldMap`

0.2.0.0: [2018.06.07]
---------------------
## 0.2.0.0 -- 2018-06-07

* Add cabal metadata: category, proper synopsis/description
* Use primitive-0.6.4.0

0.1.0.0: [2018.05.31]
---------------------
Initial version. Released on an unsuspecting world.
## 0.1.0.0 -- 2018-05-31

* Initial version.
2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

70 changes: 40 additions & 30 deletions bench/Main.hs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{-# language
BangPatterns
, MagicHash
, ScopedTypeVariables
, TypeApplications
, UnboxedTuples
#-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE UnboxedTuples #-}

module Main (main) where

import Prelude hiding
( null, read, Foldable(..), map
( Foldable (..)
, map
, null
, read
)

import Control.Monad
import Data.Functor.Identity (Identity(..))
import Data.Monoid (Sum(..))
import Data.Functor.Identity (Identity (..))
import Data.Monoid (Sum (..))
import Data.Primitive.Contiguous
import GHC.Exts (RealWorld)
import System.Random
Expand Down Expand Up @@ -301,23 +302,31 @@ main = do
func "primArray100" mapMaybeJ primArray100
func "primArray1000" mapMaybeJ primArray1000

mapMaybeJ :: forall arr. (Contiguous arr, Element arr Int)
=> arr Int
-> ()
mapMaybeJ ::
forall arr.
(Contiguous arr, Element arr Int) =>
arr Int ->
()
mapMaybeJ arr =
let !(arr' :: arr Int) = mapMaybe Just arr
let !(_arr' :: arr Int) = mapMaybe Just arr
in ()

mapPlus1 :: forall arr. (Contiguous arr, Element arr Int)
=> arr Int -> ()
mapPlus1 arr = let !(arr' :: arr Int) = map (+1) arr in ()
mapPlus1 ::
forall arr.
(Contiguous arr, Element arr Int) =>
arr Int ->
()
mapPlus1 arr = let !(_arr' :: arr Int) = map (+ 1) arr in ()

mapPlus1' :: forall arr. (Contiguous arr, Element arr Int)
=> arr Int -> ()
mapPlus1' arr = let !(arr' :: arr Int) = map' (+1) arr in ()
mapPlus1' ::
forall arr.
(Contiguous arr, Element arr Int) =>
arr Int ->
()
mapPlus1' arr = let !(_arr' :: arr Int) = map' (+ 1) arr in ()

plus1 :: Int -> Int
plus1 = (+1)
_plus1 :: Int -> Int
_plus1 = (+ 1)

sum1 :: a -> Sum Int
sum1 = const (Sum 1)
Expand All @@ -335,21 +344,22 @@ index## :: (Contiguous arr, Element arr a) => Int -> arr a -> ()
index## ix arr = case index# arr ix of !(# _x #) -> ()

randomList :: Int -> IO [Int]
randomList sz = replicateM sz (randomRIO (minBound,maxBound))
randomList sz = replicateM sz (randomRIO (minBound, maxBound))

randomC :: (Contiguous arr, Element arr Int)
=> Int
-> IO (arr Int)
randomC ::
(Contiguous arr, Element arr Int) =>
Int ->
IO (arr Int)
randomC sz = do
rList <- randomList sz
rList' <- shuffleM rList
pure (fromListN sz rList')

randomCM :: (Contiguous arr, Element arr Int)
=> Int
-> IO (Mutable arr RealWorld Int)
randomCM ::
(Contiguous arr, Element arr Int) =>
Int ->
IO (Mutable arr RealWorld Int)
randomCM sz = do
rList <- randomList sz
rList' <- shuffleM rList
fromListMutableN sz rList'

2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages: .
tests: True
Loading

0 comments on commit 0caa736

Please sign in to comment.