Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to spago@next #148

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
30 changes: 9 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,29 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purescript: "latest"
purs-tidy: "latest"
spago: "unstable"

- name: Cache PureScript dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }}
path: |
.spago
output

- name: Install dependencies
run: spago install

- name: Build source
run: spago build --no-install --purs-args '--censor-lib --strict'
run: spago build --censor-stats --strict --ensure-ranges --pedantic-packages

- name: Run tests
run: spago test --no-install

- name: Check formatting
run: purs-tidy check src test examples
run: spago test --offline --censor-stats --strict --pedantic-packages

- name: Verify Bower & Pulp
run: |
npm install bower [email protected]
npx bower install
npx pulp build
if [ -d "test" ]; then
npx pulp test
fi
- name: Verify formatting
run: purs-tidy check src test examples/src
41 changes: 0 additions & 41 deletions bower.json

This file was deleted.

13 changes: 0 additions & 13 deletions examples.dhall

This file was deleted.

2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Examples

* [Using Prisms with Sum Types](src/PrismsForSumTypes.purs)
- [Using Prisms with Sum Types](src/PrismsForSumTypes.purs)

## Conventions and the "why" behind them

Expand Down
8 changes: 8 additions & 0 deletions examples/spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package:
name: profunctor-lenses-examples
dependencies:
- colors
- either
- maybe
- prelude
- profunctor-lenses
32 changes: 12 additions & 20 deletions examples/src/PrismsForSumTypes.purs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import Color (Color)
import Color as Color
import Data.Either (Either(..))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq as GEq
import Data.Generic.Rep.Show as GShow
import Data.Show.Generic (genericShow)
import Data.Lens (Prism', is, isn't, nearly, only, preview, prism, prism', review)
import Data.Maybe (Maybe(..), maybe)

Expand Down Expand Up @@ -72,7 +71,7 @@ solidFocus = prism' constructor focus
constructor = Solid
focus fill = case fill of
Solid color -> Just color
otherCases -> Nothing
_ -> Nothing

-- In real life, you might abbreviate the above to this:

Expand Down Expand Up @@ -239,26 +238,19 @@ n5 = review brightSolidFocus unit

-- ... although Eq is only required for `only`.

derive instance genericPercent :: Generic Percent _
derive instance Generic Percent _
derive instance Eq Percent

instance eqPercent :: Eq Percent where
eq = GEq.genericEq

instance showPercent :: Show Percent where
instance Show Percent where
show (Percent f) = "(" <> show f <> "%)"

derive instance genericPoint :: Generic Point _

instance eqPoint :: Eq Point where
eq = GEq.genericEq
derive instance Generic Point _
derive instance Eq Point

instance showPoint :: Show Point where
instance Show Point where
show (Point x y) = "(" <> show x <> ", " <> show y <> ")"

derive instance genericFill :: Generic Fill _

instance eqFill :: Eq Fill where
eq = GEq.genericEq

instance showFill :: Show Fill where
show x = GShow.genericShow x
derive instance Generic Fill _
derive instance Eq Fill
instance Show Fill where
show = genericShow
4 changes: 0 additions & 4 deletions packages.dhall

This file was deleted.

30 changes: 0 additions & 30 deletions spago.dhall

This file was deleted.

Loading