Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 0 additions & 106 deletions .cirrus.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# FreeBSD CI
#
# FreeBSD is not a native GitHub Actions runner, so this workflow runs
# the build inside a VM via vmactions/freebsd-vm. It is kept separate
# from haskell.yml because the cache/restore step model in that
# workflow (hackage index, ghcup, deps caches) does not apply inside
# the VM.

name: FREEBSD

on:
workflow_dispatch:
pull_request:
push:
branches:
- master

jobs:
build:
name: >-
freebsd-${{ matrix.release }}
${{ matrix.command }}
${{ matrix.ghc_version }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.ignore_error }}
strategy:
fail-fast: false
matrix:
include:
- release: "14.3"
command: cabal
ghc_version: 9.14.1
ignore_error: true

steps:
- uses: actions/checkout@v4

- name: Build on FreeBSD
uses: vmactions/freebsd-vm@v1
env:
PACKCHECK_COMMAND: ${{ matrix.command }}
GHCVER: ${{ matrix.ghc_version }}
# For updating see: https://downloads.haskell.org/~ghcup/
GHCUP_VERSION: 0.1.50.2
LC_ALL: C.UTF-8
CABAL_REINIT_CONFIG: y
CABAL_CHECK_RELAX: y
CABAL_PROJECT: cabal.project
DISABLE_BENCH: "y"
DISABLE_DOCS: "y"
DISABLE_SDIST_BUILD: "y"
DISABLE_DIST_CHECKS: "y"
PACKCHECK: "./packcheck.sh"
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
PACKCHECK_GITHUB_COMMIT: "b3743510c7c26f83254ffd9ef91bcd71560cff05"
with:
release: ${{ matrix.release }}
usesh: true
copyback: false
envs: >-
PACKCHECK_COMMAND GHCVER GHCUP_VERSION LC_ALL
CABAL_REINIT_CONFIG CABAL_CHECK_RELAX CABAL_PROJECT
DISABLE_BENCH DISABLE_DOCS DISABLE_SDIST_BUILD DISABLE_DIST_CHECKS
PACKCHECK PACKCHECK_GITHUB_URL PACKCHECK_GITHUB_COMMIT
prepare: |
pkg update
pkg install -y gmake
pkg install -y bash
pkg install -y git
pkg install -y gmp
run: |
if test ! -e "$PACKCHECK"
then
if test -z "$PACKCHECK_GITHUB_COMMIT"
then
echo "PACKCHECK_GITHUB_COMMIT is not specified." >&2
exit 1
fi
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
chmod +x $PACKCHECK
elif test ! -x "$PACKCHECK"
then
chmod +x $PACKCHECK
fi
# Use "bash -c" instead of invoking directly to preserve quoted
# arguments in PACKCHECK_COMMAND e.g. DOCSPEC_OPTIONS="--timeout 60".
# Direct invocation would word-split on spaces inside quoted values.
bash -c "$PACKCHECK $PACKCHECK_COMMAND"
1 change: 1 addition & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
[ --cpp-include=src
, --cpp-include=src/Streamly/Internal/Data/Stream
, --cpp-include=core/src/Streamly/Internal/Data/Array
, --cpp-include=core/src/doctest
, --cpp-include=test
, --cpp-define=CABAL_OS_LINUX
, --cpp-define=linux_HOST_OS
Expand Down
4 changes: 2 additions & 2 deletions benchmark/streamly-benchmarks.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ benchmark Data.Array.Generic
buildable: False
else
buildable: True
if flag(limit-build-mem) && !flag(fusion-plugin)
ghc-options: +RTS -M500M -RTS
if flag(limit-build-mem)
ghc-options: +RTS -M600M -RTS

benchmark Data.Array.Stream
import: bench-options
Expand Down
20 changes: 20 additions & 0 deletions core/docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

### Breaking

* Breaking: In `FileSystem.Path` module the default for `eqPath` changed
on Windows to case-sensitive comparison.
* Breaking: A leading "." component (e.g. "." or "./x") is no longer
Expand All @@ -12,7 +14,25 @@
default. Literally identical relative paths (e.g. `./x` and `./x`, or
`c:` and `c:` on Windows) now compare equal. Pass
`allowRelativeEquality False` to restore the previous strict behaviour.

### Enhancements

* `Streamly.Data.Stream.unfold` no longer requires an `Applicative` constraint
and produces a smaller fused loop (one fewer state constructor and Skip on
the first pull) for unfolds with a pure inject.

### Bug Fixes

* Bug fix: Fixed `followSymlinks` option not working correctly on macOS.
* `Streamly.Internal.Data.Unfold.before` previously did not actually run the
supplied action due to the wrong `>>` instance being resolved; it now runs
as documented.

### Internal

* Unfold constructor's inject changed from monadic to pure. Public APIs
unaffected. Direct users of the `Unfold` constructor with a monadic
inject should switch to `mkUnfoldM` in `Streamly.Internal.Data.Unfold.Type`.

## 0.3.0

Expand Down
9 changes: 6 additions & 3 deletions core/src/Streamly/Data/Unfold.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ module Streamly.Data.Unfold
-- ** Mapping on Input
, lmap
, lmapM
, first
, second
, carry
, supplyFirst
, supplySecond
, carryInput

-- ** Mapping on Output
, mapM
Expand All @@ -93,6 +93,9 @@ module Streamly.Data.Unfold

-- * Deprecated
, many
, first
, second
, carry

)
where
Expand Down
2 changes: 1 addition & 1 deletion core/src/Streamly/Internal/Data/Array/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ unsafeReader = Unfold step inject
where

inject (Array contents start end) =
return (MA.ArrayUnsafe contents end start)
MA.ArrayUnsafe contents end start

{-# INLINE_LATE step #-}
step (MA.ArrayUnsafe contents end p) = do
Expand Down
2 changes: 1 addition & 1 deletion core/src/Streamly/Internal/Data/Fold/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,7 @@ unfoldMany (Unfold ustep inject) (Fold fstep initial extract final) =
StreamD.Stop -> return $ Partial fs

{-# INLINE_LATE consume #-}
consume s a = inject a >>= produce s
consume s a = produce s (inject a)

-- | Get the bottom most @n@ elements using the supplied comparison function.
--
Expand Down
4 changes: 2 additions & 2 deletions core/src/Streamly/Internal/Data/MutArray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ indexerFromLen from len =
let fromThenTo n = (from, from + len, n - 1)
mkSlice n i = return (i, min len (n - i))
in Unfold.lmap length
$ Unfold.mapM (uncurry mkSlice) . Unfold.carry
$ Unfold.mapM (uncurry mkSlice) . Unfold.carryInput
$ Unfold.lmap fromThenTo Unfold.enumerateFromThenTo
RENAME(sliceIndexerFromLen,indexerFromLen)

Expand All @@ -121,7 +121,7 @@ splitterFromLen, slicerFromLen :: forall m a. (Monad m, Unbox a)
splitterFromLen from len =
let mkSlice arr (i, n) = return $ unsafeSliceOffLen i n arr
in Unfold.mapM (uncurry mkSlice)
$ Unfold.carry (indexerFromLen from len)
$ Unfold.carryInput (indexerFromLen from len)
RENAME(slicerFromLen,splitterFromLen)

{-# DEPRECATED getSlicesFromLen "Please use splitterFromLen instead." #-}
Expand Down
4 changes: 2 additions & 2 deletions core/src/Streamly/Internal/Data/MutArray/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ indexReaderWith liftio (D.Stream stepi sti) = Unfold step inject
where

inject (MutArray contents start end _) =
return $ GetIndicesState contents start end sti
GetIndicesState contents start end sti

{-# INLINE_LATE step #-}
step (GetIndicesState contents start end st) = do
Expand Down Expand Up @@ -2215,7 +2215,7 @@ readerRevWith liftio = Unfold step inject

inject (MutArray contents start end _) =
let p = INDEX_PREV(end,a)
in return $ ArrayUnsafe contents start p
in ArrayUnsafe contents start p

{-# INLINE_LATE step #-}
step (ArrayUnsafe _ start p) | p < start = return D.Stop
Expand Down
6 changes: 3 additions & 3 deletions core/src/Streamly/Internal/Data/Producer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ where
import Streamly.Internal.Data.Stream.Step (Step(..))
import Streamly.Internal.Data.Stream.Type (Stream(..))
import Streamly.Internal.Data.SVar.Type (defState)
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
import Streamly.Internal.Data.Unfold.Type (Unfold, mkUnfoldM)

import Streamly.Internal.Data.Producer.Source
import Streamly.Internal.Data.Producer.Type
Expand All @@ -56,8 +56,8 @@ import Prelude hiding (concat)
--
-- /Pre-release/
{-# INLINE simplify #-}
simplify :: Producer m a b -> Unfold m a b
simplify (Producer step inject _) = Unfold step inject
simplify :: Functor m => Producer m a b -> Unfold m a b
simplify (Producer step inject _) = mkUnfoldM step inject

-------------------------------------------------------------------------------
-- Unfolds
Expand Down
4 changes: 2 additions & 2 deletions core/src/Streamly/Internal/Data/RingArray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ reader = Unfold step inject

where

inject rb = return (rb, ringSize rb)
inject rb = (rb, ringSize rb)

step (rb, n) = do
if n <= 0
Expand All @@ -483,7 +483,7 @@ readerRev = Unfold step inject

where

inject rb = return (moveReverse rb, ringSize rb)
inject rb = (moveReverse rb, ringSize rb)

step (rb, n) = do
if n <= 0
Expand Down
2 changes: 1 addition & 1 deletion core/src/Streamly/Internal/Data/Scanl/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,7 @@ unfoldMany (Unfold ustep inject) (Scanl fstep initial extract final) =
StreamD.Stop -> return $ Partial fs

{-# INLINE_LATE consume #-}
consume s a = inject a >>= produce s
consume s a = produce s (inject a)

-- | Get the bottom most @n@ elements using the supplied comparison function.
--
Expand Down
Loading
Loading