Skip to content

Commit

Permalink
Separate build into its own step. add BL instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Aug 1, 2021
1 parent 3e46f98 commit 3393918
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ jobs:
run: |
set -ex
curl -sSL https://get.haskellstack.org/ | sh -s - -f
- name: Build
run: |
set -ex
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
cd massiv-serialise
stack $STACK_ARGS test --no-run-tests --bench --no-run-benchmarks --haddock --no-haddock-deps
cd ../massiv-persist
stack $STACK_ARGS test --no-run-tests --bench --no-run-benchmarks --haddock --no-haddock-deps
- name: Tests
run: |
set -ex
Expand Down
6 changes: 5 additions & 1 deletion massiv-persist/src/Massiv/Persist.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ instance (Index ix, Persist e) => Persist (Array B ix e) where
put = putArray
get = getArray

instance (Index ix, NFData e, Persist e) => Persist (Array N ix e) where
instance (Index ix, Persist e) => Persist (Array BL ix e) where
put = putArray
get = getArray

instance (Index ix, NFData e, Persist e) => Persist (Array BN ix e) where
put = putArray
get = getArray

Expand Down
18 changes: 12 additions & 6 deletions massiv-persist/tests/Test/Massiv/PersistSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,15 @@ spec = do
roundtripArraySpec @B @Ix3 @Integer
roundtripArraySpec @B @Ix4 @Integer
roundtripArraySpec @B @Ix5 @Integer
describe "N" $ do
roundtripArraySpec @N @Ix1 @Integer
roundtripArraySpec @N @Ix2 @Integer
roundtripArraySpec @N @Ix3 @Integer
roundtripArraySpec @N @Ix4 @Integer
roundtripArraySpec @N @Ix5 @Integer
describe "BN" $ do
roundtripArraySpec @BN @Ix1 @Integer
roundtripArraySpec @BN @Ix2 @Integer
roundtripArraySpec @BN @Ix3 @Integer
roundtripArraySpec @BN @Ix4 @Integer
roundtripArraySpec @BN @Ix5 @Integer
describe "BL" $ do
roundtripArraySpec @BL @Ix1 @Integer
roundtripArraySpec @BL @Ix2 @Integer
roundtripArraySpec @BL @Ix3 @Integer
roundtripArraySpec @BL @Ix4 @Integer
roundtripArraySpec @BL @Ix5 @Integer
2 changes: 1 addition & 1 deletion massiv-serialise/src/Massiv/Serialise.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ instance (Index ix, Serialise e) => Serialise (Array BL ix e) where
encode = encodeArray @V.Vector
decode = decodeArray @V.Vector

instance (Index ix, NFData e, Serialise e) => Serialise (Array B ix e) where
instance (Index ix, Serialise e) => Serialise (Array B ix e) where
encode = encode . toLazyArray
decode = evalLazyArray <$> decode

Expand Down

0 comments on commit 3393918

Please sign in to comment.