Merge pull request #5 from garganscript/master
Upgrade to purescript 0.14.2
This commit is contained in:
commit
9af22d1533
11 changed files with 65 additions and 142 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use_nix
|
|
@ -15,7 +15,6 @@
|
|||
"purescript-prelude": "^4.1.1",
|
||||
"purescript-unsafe-coerce": "^4.0.0",
|
||||
"purescript-typelevel": "^6.0.0",
|
||||
"purescript-generics-rep": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"purescript-psci-support": "^4.0.0"
|
||||
|
|
13
nix/easy-ps.nix
Normal file
13
nix/easy-ps.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ pkgs ? import ./pinned.nix { } }:
|
||||
|
||||
import
|
||||
(
|
||||
pkgs.fetchFromGitHub {
|
||||
owner = "justinwoo";
|
||||
repo = "easy-purescript-nix";
|
||||
rev = "master";
|
||||
sha256 = "03g9xq451dmrkq8kiz989wnl8k0lmj60ajflz44bhp7cm08hf3bw";
|
||||
}
|
||||
) {
|
||||
inherit pkgs;
|
||||
}
|
6
nix/pinned.nix
Normal file
6
nix/pinned.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
import (
|
||||
builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/21.11.tar.gz";
|
||||
sha256 = "162dywda2dvfj1248afxc45kcrg83appjd0nmdb541hl7rnncf02";
|
||||
}
|
||||
)
|
5
package.json
Normal file
5
package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"spago": "^0.20.9"
|
||||
}
|
||||
}
|
122
packages.dhall
122
packages.dhall
|
@ -1,125 +1,5 @@
|
|||
{-
|
||||
Welcome to your new Dhall package-set!
|
||||
|
||||
Below are instructions for how to edit this file for most use
|
||||
cases, so that you don't need to know Dhall to use it.
|
||||
|
||||
## Warning: Don't Move This Top-Level Comment!
|
||||
|
||||
Due to how `dhall format` currently works, this comment's
|
||||
instructions cannot appear near corresponding sections below
|
||||
because `dhall format` will delete the comment. However,
|
||||
it will not delete a top-level comment like this one.
|
||||
|
||||
## Use Cases
|
||||
|
||||
Most will want to do one or both of these options:
|
||||
1. Override/Patch a package's dependency
|
||||
2. Add a package not already in the default package set
|
||||
|
||||
This file will continue to work whether you use one or both options.
|
||||
Instructions for each option are explained below.
|
||||
|
||||
### Overriding/Patching a package
|
||||
|
||||
Purpose:
|
||||
- Change a package's dependency to a newer/older release than the
|
||||
default package set's release
|
||||
- Use your own modified version of some dependency that may
|
||||
include new API, changed API, removed API by
|
||||
using your custom git repo of the library rather than
|
||||
the package set's repo
|
||||
|
||||
Syntax:
|
||||
Replace the overrides' "{=}" (an empty record) with the following idea
|
||||
The "//" or "⫽" means "merge these two records and
|
||||
when they have the same value, use the one on the right:"
|
||||
-------------------------------
|
||||
let overrides =
|
||||
{ packageName =
|
||||
upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" }
|
||||
, packageName =
|
||||
upstream.packageName // { version = "v4.0.0" }
|
||||
, packageName =
|
||||
upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" }
|
||||
}
|
||||
-------------------------------
|
||||
|
||||
Example:
|
||||
-------------------------------
|
||||
let overrides =
|
||||
{ halogen =
|
||||
upstream.halogen // { version = "master" }
|
||||
, halogen-vdom =
|
||||
upstream.halogen-vdom // { version = "v4.0.0" }
|
||||
}
|
||||
-------------------------------
|
||||
|
||||
### Additions
|
||||
|
||||
Purpose:
|
||||
- Add packages that aren't already included in the default package set
|
||||
|
||||
Syntax:
|
||||
Replace the additions' "{=}" (an empty record) with the following idea:
|
||||
-------------------------------
|
||||
let additions =
|
||||
{ package-name =
|
||||
{ dependencies =
|
||||
[ "dependency1"
|
||||
, "dependency2"
|
||||
]
|
||||
, repo =
|
||||
"https://example.com/path/to/git/repo.git"
|
||||
, version =
|
||||
"tag ('v4.0.0') or branch ('master')"
|
||||
}
|
||||
, package-name =
|
||||
{ dependencies =
|
||||
[ "dependency1"
|
||||
, "dependency2"
|
||||
]
|
||||
, repo =
|
||||
"https://example.com/path/to/git/repo.git"
|
||||
, version =
|
||||
"tag ('v4.0.0') or branch ('master')"
|
||||
}
|
||||
, etc.
|
||||
}
|
||||
-------------------------------
|
||||
|
||||
Example:
|
||||
-------------------------------
|
||||
let additions =
|
||||
{ benchotron =
|
||||
{ dependencies =
|
||||
[ "arrays"
|
||||
, "exists"
|
||||
, "profunctor"
|
||||
, "strings"
|
||||
, "quickcheck"
|
||||
, "lcg"
|
||||
, "transformers"
|
||||
, "foldable-traversable"
|
||||
, "exceptions"
|
||||
, "node-fs"
|
||||
, "node-buffer"
|
||||
, "node-readline"
|
||||
, "datetime"
|
||||
, "now"
|
||||
]
|
||||
, repo =
|
||||
"https://github.com/hdgarrood/purescript-benchotron.git"
|
||||
, version =
|
||||
"v7.0.0"
|
||||
}
|
||||
}
|
||||
-------------------------------
|
||||
-}
|
||||
|
||||
|
||||
let upstream =
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.13.6-20200423/packages.dhall sha256:c180a06bb5444fd950f8cbdd6605c644fd246deb397e62572b8f4a6b9dbcaf22
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.15.4-20220901/packages.dhall sha256:f1531b29c21ac437ffe5666c1b6cc76f0a9c29d3c9d107ff047aa2567744994f
|
||||
|
||||
let overrides = {=}
|
||||
|
||||
|
|
19
shell.nix
Normal file
19
shell.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ pkgs ? import ./nix/pinned.nix { } }:
|
||||
let
|
||||
easy-ps = import ./nix/easy-ps.nix { inherit pkgs; };
|
||||
|
||||
build = pkgs.writeShellScriptBin "build" ''
|
||||
#!/usr/bin/env bash
|
||||
purs compile "src/**/*.purs" "test/**/*.purs"
|
||||
'';
|
||||
in
|
||||
pkgs.mkShell {
|
||||
name = "purescript-reactix-d3";
|
||||
|
||||
buildInputs = [
|
||||
easy-ps.purs-0_15_4
|
||||
easy-ps.psc-package
|
||||
build
|
||||
pkgs.dhall-json
|
||||
];
|
||||
}
|
11
spago.dhall
11
spago.dhall
|
@ -4,12 +4,13 @@ You can edit this file as you like.
|
|||
-}
|
||||
{ name = "tuples-native"
|
||||
, dependencies =
|
||||
[ "generics-rep"
|
||||
, "prelude"
|
||||
, "psci-support"
|
||||
, "typelevel"
|
||||
, "unsafe-coerce"
|
||||
[ "console"
|
||||
, "effect"
|
||||
, "functions"
|
||||
, "prelude"
|
||||
, "tuples"
|
||||
, "typelevel"
|
||||
, "typelevel-prelude"
|
||||
]
|
||||
, packages = ./packages.dhall
|
||||
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
exports.prjImpl = function projImpl1 (n, t) {
|
||||
export function prjImpl(n, t) {
|
||||
return t[n];
|
||||
};
|
||||
|
||||
exports.t2_ = function t21 (a, b) {
|
||||
export function t2_ (a, b) {
|
||||
return [a,b];
|
||||
};
|
||||
|
||||
exports.t3_ = function t31 (a,b,c) {
|
||||
export function t3_ (a,b,c) {
|
||||
return [a,b,c];
|
||||
};
|
||||
|
||||
exports.t4_ = function t41 (a,b,c,d) {
|
||||
export function t4_ (a,b,c,d) {
|
||||
return [a,b,c,d];
|
||||
};
|
||||
|
||||
exports.t5_ = function t51 (a,b,c,d,e) {
|
||||
export function t5_ (a,b,c,d,e) {
|
||||
return [a,b,c,d,e];
|
||||
};
|
||||
|
||||
exports.t6_ = function t61 (a,b,c,d,e,f) {
|
||||
export function t6_ (a,b,c,d,e,f) {
|
||||
return [a,b,c,d,e,f];
|
||||
};
|
||||
|
||||
exports.t7_ = function t71 (a,b,c,d,e,f,g) {
|
||||
export function t7_ (a,b,c,d,e,f,g) {
|
||||
return [a,b,c,d,e,f,g];
|
||||
};
|
||||
|
||||
exports.t8_ = function t81 (a,b,c,d,e,f,g,h) {
|
||||
export function t8_ (a,b,c,d,e,f,g,h) {
|
||||
return [a,b,c,d,e,f,g,h];
|
||||
};
|
||||
|
||||
exports.t9_ = function t91 (a,b,c,d,e,f,g,h,i) {
|
||||
export function t9_ (a,b,c,d,e,f,g,h,i) {
|
||||
return [a,b,c,d,e,f,g,h,i];
|
||||
};
|
||||
|
|
|
@ -18,7 +18,8 @@ import Data.Tuple.Nested as DTN
|
|||
import Data.Typelevel.Num (D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, class Lt, class Nat, toInt, d0, d1, d2, d3, d4, d5, d6, d7, d8)
|
||||
import Prelude (($))
|
||||
import Prim.Row (class Cons)
|
||||
import Type.RowList (Cons, Nil, kind RowList, class ListToRow)
|
||||
import Prim.RowList (RowList)
|
||||
import Type.RowList (Cons, Nil, class ListToRow)
|
||||
|
||||
-- | Safely coerce a `TupleN` pair into a PureScript Tuple
|
||||
xt :: forall a b. T2 a b -> DT.Tuple a b
|
||||
|
@ -65,7 +66,7 @@ prj n t = runFn2 prjImpl (toInt n) t
|
|||
|
||||
|
||||
-- | Represented as a heterogeneous array under the hood
|
||||
foreign import data TupleN :: RowList -> Type
|
||||
foreign import data TupleN :: RowList Type -> Type
|
||||
|
||||
|
||||
type T2 a b =
|
||||
|
@ -112,7 +113,7 @@ foreign import t7_ :: forall a b c d e f g . Fn7 a b c d e f g (T7 a b c d e
|
|||
foreign import t8_ :: forall a b c d e f g h . Fn8 a b c d e f g h (T8 a b c d e f g h)
|
||||
foreign import t9_ :: forall a b c d e f g h i. Fn9 a b c d e f g h i (T9 a b c d e f g h i)
|
||||
|
||||
class TupleSize n (t :: RowList) | t -> n
|
||||
class TupleSize n (t :: RowList Type) | t -> n
|
||||
|
||||
instance tupleSizeT2 :: TupleSize D2 (Cons "0" a (Cons "1" b Nil))
|
||||
instance tupleSizeT3 :: TupleSize D3 (Cons "0" a (Cons "1" b (Cons "2" c Nil)))
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
function lenTuple (string) {
|
||||
export function lenTupleImpl (string) {
|
||||
return [string, string.length]
|
||||
}
|
||||
|
||||
exports.lenTupleImpl = lenTuple
|
||||
|
|
Loading…
Reference in a new issue