Skip to content

Commit

Permalink
Test with GHC 9.4.4 (#66)
Browse files Browse the repository at this point in the history
* Test with GHC 9.4

* Try 9.4.4 specifically

* Update changelog

* More pure

* Tweak Cabal file

* Drop ::set-output
  • Loading branch information
snowleopard authored Feb 19, 2023
1 parent 4270092 commit eba02fa
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc: ['9.2', '9.0', '8.10', '8.8', '8.6']
ghc: ['9.4.4', '9.2', '9.0', '8.10', '8.8', '8.6']
include:
- os: windows-latest
- os: macOS-latest
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Get GHC libdir
id: get-ghc-libdir
run: |
echo "::set-output name=libdir::$(ghc --print-libdir)"
echo "name=libdir::$(ghc --print-libdir)" >> $GITHUB_OUTPUT
shell: bash
- run: cabal v2-freeze --enable-tests
- uses: actions/cache@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.6

* Start supporting GHC 9.4. See #66.
* Add `ComposeTraversable`. See #65.
* Make the `Applicative` instance of `ComposeEither` more interesting by relying
on the `Selective f` constraint. See #64.
Expand Down
6 changes: 3 additions & 3 deletions examples/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ item = Parser $ \case
(c:cs) -> [(c,cs)]

sat :: (Char -> Bool) -> Parser Char
sat p = do { c <- item; if p c then return c else zero }
sat p = do { c <- item; if p c then pure c else zero }

char :: Char -> Parser Char
char c = sat (==c)

string :: String -> Parser String
string [] = return ""
string [] = pure ""
string (c:cs) = do
_ <- char c
_ <- string cs
return (c:cs)
pure (c:cs)

bin :: Parser Int
bin = undefined
Expand Down
4 changes: 2 additions & 2 deletions examples/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ getPure (Pure a) = Just a
getPure (Apply f x) = do
pf <- getPure f
px <- getPure x
return (pf px)
pure (pf px)
getPure (Select x y) = do
px <- getPure x
py <- getPure y
return (either py id px)
pure (either py id px)

getEffects :: Query a -> ([Prompt], [FilePath])
getEffects (Terminal p) = ([p], [] )
Expand Down
2 changes: 1 addition & 1 deletion selective.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bug-reports: https://github.com/snowleopard/selective/issues
category: Control
build-type: Simple
cabal-version: 1.18
tested-with: GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6
tested-with: GHC==9.4.4, GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6
description: Selective applicative functors: declare your effects statically,
select which to execute dynamically.
.
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Selective.hs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ matchS (Cases cs _) x f = foldr (\c -> eliminate c (f c)) (Left <$> x) cs
matchM :: Monad m => Cases a -> m a -> (a -> m b) -> m (Either a b)
matchM (Cases _ p) mx f = do
x <- mx
if p x then Right <$> f x else return (Left x)
if p x then Right <$> f x else pure (Left x)

-- TODO: Add a type-safe version based on @KnownNat@.
-- | A restricted version of monadic bind. Fails with an error if the 'Bounded'
Expand Down

0 comments on commit eba02fa

Please sign in to comment.