Skip to content

Commit 3154b24

Browse files
committed
Merge pull request purescript#2169 from purescript/0.9
Merge 0.9 branch into master
2 parents 9572706 + 8fd0638 commit 3154b24

582 files changed

Lines changed: 7511 additions & 8707 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 66 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,80 @@
11
language: c
2-
dist: trusty
2+
dist: trusty # because of perf issues
33
sudo: required
44
matrix:
55
include:
6-
- env: GHCVER=7.10.3 CABALVER=1.22 STACKAGE=lts-5.4 RUNSDISTTESTS=YES
7-
compiler: ": #GHC 7.10.3 lts-5.4"
8-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
9-
- env: GHCVER=7.10.3 CABALVER=1.22 STACKAGE=nightly-2016-02-25
10-
compiler: ": #GHC 7.10.3 nightly-2016-02-25"
11-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
12-
- env: GHCVER=7.10.3 CABALVER=1.22 DEPLOY=yes
13-
compiler: ": #GHC 7.10.3"
14-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
15-
before_install:
16-
- unset CC
17-
- export PATH="/opt/ghc/$GHCVER/bin:$PATH"
18-
- export PATH="/opt/cabal/$CABALVER/bin:$PATH"
19-
- export PATH="$HOME/.cabal/bin:$PATH"
20-
- export PATH="/opt/happy/1.19.5/bin:/$PATH"
21-
- export PATH="/opt/alex/3.1.4/bin:/$PATH"
22-
- export PATH="$HOME/build/purescript/purescript/dist/build/psc:/$PATH"
23-
- export PATH="$HOME/build/purescript/purescript/dist/build/psc-ide-server:/$PATH"
24-
- export PATH="$HOME/build/purescript/purescript/dist/build/psc-ide-client:/$PATH"
6+
# The 'compiler' key is a hack to get Travis to use different caches for
7+
# each job in a build, in order to avoid the separate jobs stomping on each
8+
# other's caches. See https://github.com/travis-ci/travis-ci/issues/4393
9+
#
10+
# We use trusty boxes because they seem to be a bit faster.
11+
- compiler: cc-linux-lts-normal
12+
os: linux
13+
dist: trusty
14+
sudo: required
15+
env: BUILD_TYPE=normal COVERAGE=true DEPLOY=true
16+
17+
# - compiler: cc-linux-nightly-normal
18+
# os: linux
19+
# dist: trusty
20+
# sudo: required
21+
# env: BUILD_TYPE=normal STACKAGE_NIGHTLY=true
22+
# allow_failures: true
23+
24+
- compiler: cc-linux-lts-sdist
25+
os: linux
26+
dist: trusty
27+
sudo: required
28+
env: BUILD_TYPE=sdist
29+
30+
- compiler: cc-linux-lts-haddock
31+
os: linux
32+
dist: trusty
33+
sudo: required
34+
env: BUILD_TYPE=haddock
35+
36+
- compiler: cc-osx-lts-normal
37+
os: osx
38+
env: BUILD_TYPE=normal DEPLOY=true
39+
40+
- compiler: cc-osx-lts-sdist
41+
os: osx
42+
env: BUILD_TYPE=sdist
43+
addons:
44+
apt:
45+
packages:
46+
- libgmp-dev
47+
cache:
48+
directories:
49+
- $HOME/.local/bin
50+
- $HOME/.stack
2551
install:
26-
- cabal --version
27-
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
28-
- travis_retry cabal update
29-
# Run sequentially
30-
# Travis container infrastructure seems to expose all host CPUs (16?), thus
31-
# cabal and ghc tries to use them all. Which is bad idea on a shared box.
32-
# See also: https://ghc.haskell.org/trac/ghc/ticket/9221
33-
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
34-
# Cache sandboxes in ~/cabal-sandboxes
35-
# Move right sandbox to .cabal-sandbox if exists
36-
- if [ -d ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} ]; then
37-
mv ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} .cabal-sandbox;
38-
fi
39-
- mkdir -p .cabal-sandbox
40-
- cabal sandbox init --sandbox .cabal-sandbox
41-
# Download stackage cabal.config. Filter this package and 'extra deps'
42-
- if [ -n "$STACKAGE" ]; then curl https://www.stackage.org/$STACKAGE/cabal.config | egrep -v 'purescript|language-javascript|bower-json' > cabal.config; fi
43-
- cabal install --only-dependencies --enable-tests
44-
- cabal install hpc-coveralls
45-
# Snapshot state of the sandbox now, so we don't need to make new one for test install
46-
- rm -rf ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none}
47-
- cp -r .cabal-sandbox ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none}
48-
# Install bower globally (for psc-docs/psc-publish tests)
49-
- npm install -g bower
52+
- | # Install stack.
53+
if test ! -f "$HOME/.local/bin/stack"
54+
then
55+
URL="https://www.stackage.org/stack/$TRAVIS_OS_NAME-x86_64"
56+
curl --location "$URL" > stack.tar.gz
57+
gunzip stack.tar.gz
58+
tar -x -f stack.tar --strip-components 1
59+
mkdir -p "$HOME/.local/bin"
60+
mv stack "$HOME/.local/bin/"
61+
fi
62+
- npm install -g bower # for psc-docs / psc-publish tests
63+
# Fix the CC environment variable, because Travis changes it
64+
- export CC=gcc
65+
- export OS_NAME=$(./travis/convert-os-name.sh)
5066
script:
51-
- ./travis/configure.sh
52-
- cabal build --ghc-options="-Werror"
53-
- cabal test
54-
- ./travis/test-install.sh
55-
after_script:
56-
- ./travis/after.sh
57-
notifications:
58-
email: true
59-
before_deploy: "./bundle/build.sh linux64"
67+
- travis/build.sh
68+
before_deploy:
69+
- ./bundle/build.sh $OS_NAME
6070
deploy:
6171
provider: releases
6272
api_key: $RELEASE_KEY
6373
file:
64-
- bundle/linux64.tar.gz
65-
- bundle/linux64.sha
74+
- bundle/$OS_NAME.tar.gz
75+
- bundle/$OS_NAME.sha
6676
skip_cleanup: true
6777
on:
6878
all_branches: true
6979
tags: true
70-
condition: "$DEPLOY = yes"
71-
cache:
72-
directories:
73-
- ~/cabal-sandboxes
80+
condition: "$DEPLOY = true"

appveyor.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ version: '{build}'
33
environment:
44
# Keep the path as short as possible, just in case.
55
STACK_ROOT: c:\s
6-
# Appveyor does not seem to be able to cope with the symbolic link
7-
# stack.yaml, so this is a workaround.
8-
STACK_YAML: stack-lts-5.yaml
96
RELEASE_USER: purescript
107
RELEASE_REPO: purescript
118
cache:
12-
- c:\s
9+
- c:\s -> appveyor/cache-buster.txt
1310
install:
1411
- git submodule update --init
1512
- ps: Install-Product node 5
@@ -31,9 +28,6 @@ build_script:
3128
test_script:
3229
- stack -j1 --no-terminal test --pedantic
3330
on_success:
34-
# this seems to be necessary; if omitted, the bash script fails to find the
35-
# tool 'strip'.
36-
- copy C:\MinGW\bin\strip.exe C:\tools\strip.exe
3731
- ps: |
3832
function UploadFile
3933
{
@@ -42,7 +36,7 @@ on_success:
4236
4337
if ($env:APPVEYOR_REPO_TAG_NAME)
4438
{
45-
bash ./bundle/build-stack.sh win64
39+
bash ./bundle/build.sh win64
4640
4741
(New-Object Net.WebClient).DownloadFile('https://github.com/aktau/github-release/releases/download/v0.6.2/windows-amd64-github-release.zip', 'c:\tools\github-release.zip')
4842
pushd c:\tools

appveyor/cache-buster.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This file acts as a cache buster for the AppVeyor (Windows CI) build
2+
cache. In order to invalidate the AppVeyor build cache, simply make a
3+
change to the number at the end of this file and commit.
4+
5+
See http://www.appveyor.com/docs/build-cache#cache-dependencies for more
6+
information.
7+
8+
Increment me to invalidate the cache: 0
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ mkdir -p bundle/build/purescript
2929
for BIN in psc psci psc-docs psc-publish psc-bundle psc-ide-server psc-ide-client
3030
do
3131
FULL_BIN="$LOCAL_INSTALL_ROOT/bin/${BIN}${BIN_EXT}"
32-
strip "$FULL_BIN" || true # not the end of the world if this fails, and
33-
# AppVeyor can't seem to handle it for some reason
32+
if [ "$OS" != "win64" ]
33+
then
34+
strip "$FULL_BIN"
35+
fi
3436
cp "$FULL_BIN" bundle/build/purescript
3537
done
3638

core-tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
core-docs.md
12
bower_components/
23
output/

core-tests/bower.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "core-tests",
3+
"homepage": "https://github.com/purescript/purescript",
4+
"authors": [
5+
"Phil Freeman <paf31@cantab.net>"
6+
],
7+
"ignore": [
8+
"**/.*",
9+
"node_modules",
10+
"bower_components",
11+
"test",
12+
"tests"
13+
],
14+
"dependencies": {
15+
"purescript-arrays": "#8c9ada5762",
16+
"purescript-bifunctors": "#9e3b2864ce",
17+
"purescript-console": "#db29da9aca",
18+
"purescript-const": "#cf538a65d8",
19+
"purescript-contravariant": "#9ae6d7c99c",
20+
"purescript-control": "#97096c7e26",
21+
"purescript-distributive": "#ba81c64ffd",
22+
"purescript-eff": "#dbd6c4a415",
23+
"purescript-either": "#54f4efd423",
24+
"purescript-enums": "#9332412e52",
25+
"purescript-exceptions": "#522a0cea50",
26+
"purescript-exists": "#e828c8341e",
27+
"purescript-foldable-traversable": "#df37787855",
28+
"purescript-foreign": "#64890cbbdb",
29+
"purescript-free": "#f8ab7c5f05",
30+
"purescript-functions": "#e417541936",
31+
"purescript-functor-coproducts": "#7654d9dea4",
32+
"purescript-generics": "#d09cb16ca3",
33+
"purescript-globals": "#113ee398be",
34+
"purescript-graphs": "#0b7089afa2",
35+
"purescript-identity": "#204ac5f46a",
36+
"purescript-inject": "#3ae4880bad",
37+
"purescript-integers": "#58d7605dd5",
38+
"purescript-lazy": "#bf4b34d673",
39+
"purescript-maps": "#d9e4c6599a",
40+
"purescript-math": "#99797b6494",
41+
"purescript-maybe": "#1b60a07038",
42+
"purescript-monoid": "#a8c8bb9d73",
43+
"purescript-parallel": "#c7296ab008",
44+
"purescript-prelude": "#318ee857bd",
45+
"purescript-profunctor": "#a649126cea",
46+
"purescript-proxy": "#c494b11bd7",
47+
"purescript-quickcheck": "#4a15c93f12",
48+
"purescript-random": "#68314c21e2",
49+
"purescript-refs": "#f47e1059a3",
50+
"purescript-semirings": "#c40efda15f",
51+
"purescript-sets": "#1eaabf177f",
52+
"purescript-st": "#077d9a2d7e",
53+
"purescript-strings": "#87dd5f1694",
54+
"purescript-tailrec": "#3c11db00ba",
55+
"purescript-transformers": "#2d0a471ce4",
56+
"purescript-tuples": "#4fe689ef93",
57+
"purescript-unfoldable": "#e2382f30d8",
58+
"purescript-validation": "#f43ff0fbdd"
59+
}
60+
}

core-tests/test-everything.sh

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,62 +18,16 @@ if [ "$force_reinstall" = "true" ] && [ -d "bower_components" ]; then
1818
rm -r bower_components
1919
fi
2020

21-
bower i \
22-
purescript-prelude \
23-
purescript-eff \
24-
purescript-st \
25-
purescript-integers \
26-
purescript-functions \
27-
purescript-console \
28-
purescript-profunctor \
29-
purescript-contravariant \
30-
purescript-parallel \
31-
purescript-control \
32-
purescript-tailrec \
33-
purescript-maps \
34-
purescript-free \
35-
purescript-transformers \
36-
purescript-exists \
37-
purescript-monoid \
38-
purescript-either \
39-
purescript-maybe \
40-
purescript-inject \
41-
purescript-graphs \
42-
purescript-enums \
43-
purescript-unfoldable \
44-
purescript-coproducts \
45-
purescript-lazy \
46-
purescript-distributive \
47-
purescript-identity \
48-
purescript-bifunctors \
49-
purescript-const \
50-
purescript-sets \
51-
purescript-quickcheck \
52-
purescript-foreign \
53-
purescript-foldable-traversable \
54-
purescript-tuples \
55-
purescript-strings \
56-
purescript-arrays \
57-
purescript-random \
58-
purescript-refs \
59-
purescript-globals \
60-
purescript-exceptions \
61-
purescript-validation \
62-
purescript-parallel \
63-
purescript-proxy \
64-
purescript-semirings \
65-
purescript-math \
66-
purescript-generics
21+
# todo : fix this once core libraries reach 1.0
22+
yes 1 | bower i
6723

6824
if [ "$force_recompile" = "true" ] && [ -d "output" ]; then
6925
echo "Recompiling..."
7026
rm -r output
7127
fi
7228

73-
../dist/build/psc/psc tests/*/*.purs \
74-
'bower_components/purescript-*/src/**/*.purs' \
75-
--ffi 'bower_components/purescript-*/src/**/*.js'
29+
stack exec psc 'tests/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'
7630

77-
../dist/build/psc-docs/psc-docs tests/*/*.purs \
78-
'bower_components/purescript-*/src/**/*.purs' \
79-
> full-core-docs.md
31+
stack exec psc-docs 'bower_components/purescript-*/src/**/*.purs' > core-docs.md
32+
33+
NODE_PATH=output node -e "require('Test.Main').main()"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module Test.GenericDeriving where
2+
3+
import Prelude
4+
5+
import Control.Monad.Eff (Eff)
6+
import Control.Monad.Eff.Console (CONSOLE, log, logShow)
7+
import Data.Generic (class Generic, gShow, gEq)
8+
import Partial.Unsafe (unsafePartial)
9+
10+
data Empty
11+
12+
derive instance genericEmpty :: Partial => Generic Empty
13+
14+
data A a
15+
= A Number String
16+
| B Int
17+
| C (Array (A a))
18+
| D { "asgård" :: a }
19+
| E Empty
20+
21+
derive instance genericA :: (Partial, Generic b) => Generic (A b)
22+
23+
newtype X b = X b
24+
25+
derive instance genericX :: Generic (X String)
26+
27+
main :: forall eff. Eff (console :: CONSOLE | eff) Unit
28+
main = unsafePartial do
29+
log $ gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] })
30+
logShow $ gEq (C [B 0]) (C [B 0] :: A Empty)

core-tests/tests/Main.purs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Test.Main where
2+
3+
import Prelude
4+
import Control.Monad.Eff (Eff)
5+
import Control.Monad.Eff.Console (CONSOLE)
6+
import Test.GenericDeriving as GenericDeriving
7+
8+
main :: forall eff. Eff (console :: CONSOLE | eff) Unit
9+
main = GenericDeriving.main

0 commit comments

Comments
 (0)