Skip to content

Commit

Permalink
Merge pull request #7 from TorNATO-PRO/modernize-rrb-list
Browse files Browse the repository at this point in the history
Modernize rrb list
  • Loading branch information
paldepind authored Oct 16, 2023
2 parents 374d946 + 82e5169 commit eee6b44
Show file tree
Hide file tree
Showing 17 changed files with 1,762 additions and 295 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build-rrb-list
run-name: build-rrb-list
on: [push]
jobs:
build-rrb-list:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup nodeJS
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dev dependencies
run: yarn install

- name: Build RRBList
run: yarn build


test-rrb-list:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup nodeJS
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dev dependencies
run: yarn install

- name: Test RRBList
run: yarn test
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Dependencies
.psci_modules
bower_components
.spago
node_modules

# Generated files
.psci
output
.psc-ide-port
.purs-repl
.psa-stash
output
yarn-error.log
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

35 changes: 0 additions & 35 deletions bower.json

This file was deleted.

13 changes: 0 additions & 13 deletions package-lock.json

This file was deleted.

17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@
"test": "test"
},
"scripts": {
"test": "pulp test",
"build": "pulp build"
"test": "spago -x test.dhall test --purs-args \"--strict --stash\"",
"build": "spago build --purs-args \"--strict --stash\""
},
"author": "Gabe Johnson",
"contributors": [
"Nathan Waltz <[email protected]>"
],
"license": "MIT",
"dependencies": {
"list": "^2.0.x"
"list": "2.0.19"
},
"private": true
"private": true,
"devDependencies": {
"purescript": "0.15.10",
"purescript-psa": "^0.8.2",
"purs-tidy": "^0.10.0",
"spago": "^0.21.0"
}
}
4 changes: 4 additions & 0 deletions packages.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.15.10-20230831/packages.dhall
sha256:427ed74fe90c2ef9651075529e3170fa7c888683d5e0038d91a415e47cc62b85
in upstream
18 changes: 0 additions & 18 deletions psc-package.json

This file was deleted.

16 changes: 16 additions & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ name = "purescript-rrb-list"
, dependencies =
[ "control"
, "foldable-traversable"
, "functions"
, "maybe"
, "nonempty"
, "partial"
, "prelude"
, "tailrec"
, "tuples"
, "unfoldable"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs" ]
}
55 changes: 30 additions & 25 deletions src/RRBList/Types.js → src/Data/RRBList/Internal/Types.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
"use strict";

var L = require("list");

exports._eq = L.equalsWith;
exports._append = L.concat;
exports._mempty = L.empty;
exports._map = L.map;
exports._apply = L.ap;
exports._pure = L.of;
exports._foldl = L.foldl;
exports._foldr = L.foldr;
exports._bind = L.chain;
exports._traverse = function () {
function Cont(fn) {
this.fn = fn;
}
import * as L from "list"

function cons(x) {
return function (xs) {
return L.prepend(x, xs);
};
export const _eq = L.equalsWith;

export const _append = L.concat;

export const _mempty = L.empty;

export const _map = L.map;

export const _apply = L.ap;

export const _pure = L.of;

export const _foldl = L.foldl;

export const _foldr = L.foldr;

export const _bind = L.chain;

export const _traverse = () => {
class Cont {
constructor(fn) {
this.fn = fn;
}
}

const cons = (x) => (xs) => L.prepend(x, xs);

return function (apply, map, pure, f) {
var buildFrom = function (x, ys) {
return apply(map(cons)(f(x)))(ys);
Expand All @@ -47,13 +54,11 @@ exports._traverse = function () {
return result;
};
};
}();
}

exports._show = function (f, xs) {
return "fromFoldable [" + L.join(", ", L.map(f, xs)) + "]";
};
export const _show = (f, xs) => "(RRBList [" + L.join(", ", L.map(f, xs)) + "])";

exports._unfoldr1 = function (isNothing, fromJust, fst, snd, f, b) {
export const _unfoldr1 = (isNothing, fromJust, fst, snd, f, b) => {
var result = L.empty();
var value = b;
while (true) { // eslint-disable-line no-constant-condition
Expand All @@ -68,7 +73,7 @@ exports._unfoldr1 = function (isNothing, fromJust, fst, snd, f, b) {
}
};

exports._unfoldr = function (isNothing, fromJust, fst, snd, f, b) {
export const _unfoldr = (isNothing, fromJust, fst, snd, f, b) => {
var result = L.empty();
var value = b;
while (true) { // eslint-disable-line no-constant-condition
Expand Down
Loading

0 comments on commit eee6b44

Please sign in to comment.