Skip to content

Commit

Permalink
upgrade to purescript 15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chtenb committed Jun 12, 2022
1 parent ef0c5c6 commit d8f6b87
Show file tree
Hide file tree
Showing 17 changed files with 711 additions and 297 deletions.
446 changes: 237 additions & 209 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"description": "",
"devDependencies": {
"parcel": "2.0.0-beta.3.1",
"purescript": "^0.14.5",
"purescript": "^0.15.2",
"purs-tidy": "^0.7.0",
"spago": "^0.20.3"
},
Expand Down
23 changes: 8 additions & 15 deletions packages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,12 @@ in upstream
-------------------------------
-}
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.14.5-20220224/packages.dhall sha256:67cc3d4f0e8fb72bb1413ba94ddd72a3ceb0783eb725e3b22ad7568b3b581163
https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220611/packages.dhall sha256:ea8cb7344562258469327872f4a955d7eb96f69eec07ad00df00f2de6f64048d

in upstream
with string-parsers.version = "v7.0.0"
with errors =
{ dependencies =
[ "effect"
, "control"
, "either"
, "maybe"
, "transformers"
]
, repo =
"https://github.com/passy/purescript-errors"
, version =
"v4.1.0" -- branch, tag, or commit hash
}
-- with string-parsers.version = "v7.0.0"
-- with errors =
-- { dependencies = [ "effect", "control", "either", "maybe", "transformers" ]
-- , repo = "https://github.com/passy/purescript-errors"
-- , version = "v4.1.0"
-- }
9 changes: 7 additions & 2 deletions spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,46 @@ to generate this file without the comments in this block.
, dependencies =
[ "aff"
, "affjax"
, "affjax-web"
, "argonaut-core"
, "arrays"
, "assert"
, "barlow-lens"
, "bifunctors"
, "console"
, "control"
, "debug"
, "effect"
, "either"
, "enums"
, "errors"
, "exceptions"
, "filterable"
, "foldable-traversable"
, "foreign"
, "foreign-object"
, "halogen"
, "http-methods"
, "identity"
, "integers"
, "js-timers"
, "js-uri"
, "lists"
, "maybe"
, "newtype"
, "nullable"
, "numbers"
, "partial"
, "prelude"
, "profunctor-lenses"
, "psci-support"
, "quickcheck"
, "simple-json"
, "record"
, "string-parsers"
, "strings"
, "stringutils"
, "transformers"
, "tuples"
, "variant"
, "web-dom"
, "web-dom-parser"
, "web-html"
Expand Down
4 changes: 3 additions & 1 deletion src/Clipboard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

exports.copyToClipboard = function (text) {
function copyToClipboard(text) {
return function () {
window.prompt("Copy the following link:", text);
}
}

export { copyToClipboard }
2 changes: 1 addition & 1 deletion src/CorsProxy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module CorsProxy where

import Prelude

import Affjax as AX
import Affjax.Web as AX
import Affjax.ResponseFormat as ResponseFormat
import AppState (Url)
import Control.Monad.Maybe.Trans (MaybeT(..))
Expand Down
2 changes: 1 addition & 1 deletion src/CuttlyUrlShortener.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Effect.Console as Console
import JSURI (encodeURIComponent)
import LZString (compressToEncodedURIComponent)
import LocationString (getLocationBaseString)
import Simple.JSON (readJSON)
import SimpleJSON (readJSON) -- TODO switch to argonaut

type RequestBodyRecord = { url :: String }
type ResponseRecord = { url :: { status :: Int } }
Expand Down
4 changes: 3 additions & 1 deletion src/HalogenUtils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

exports.scrollBy = function (x) {
function scrollBy(x) {
return function (y) {
return function (elt) {
return function () {
Expand All @@ -13,3 +13,5 @@ exports.scrollBy = function (x) {
};
};
};

export { scrollBy }
6 changes: 4 additions & 2 deletions src/LZString.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"use strict";
const LZString = require('lz-string');

exports.unsafeCompressToEncodedURIComponent = function (value) {
function unsafeCompressToEncodedURIComponent(value) {
return LZString.compressToEncodedURIComponent(value);
};

exports.unsafeDecompressFromEncodedURIComponent = function (value) {
function unsafeDecompressFromEncodedURIComponent(value) {
return LZString.decompressFromEncodedURIComponent(value);
};

export { unsafeCompressToEncodedURIComponent, unsafeDecompressFromEncodedURIComponent }
6 changes: 4 additions & 2 deletions src/LocalStorage.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
'use strict';

exports.setLocalStorage = function (key) {
function setLocalStorage(key) {
return function (value) {
return function () {
window.localStorage.setItem(key, value);
}
}
}

exports.getLocalStorage = function (key) {
function getLocalStorage(key) {
return function () {
return window.localStorage.getItem(key);
}
}

export { setLocalStorage, getLocalStorage }
19 changes: 11 additions & 8 deletions src/LocationString.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";

exports.getLocationString = function () {
function getLocationString() {
return window.location.href;
};

exports.getLocationBaseString = function () {
function getLocationBaseString() {
return window.location.origin + window.location.pathname;
};

exports.setLocationString = function (value) {
function setLocationString(value) {
return function () {
_setLocationString(value);
}
Expand All @@ -21,14 +21,14 @@ var _setLocationString = function (value) {
};


exports.getFragmentString = function () {
function getFragmentString() {
var result = window.location.hash;
if (result.startsWith("#"))
return result.substring(1);
return "";
};

exports.setFragmentString = function (value) {
function setFragmentString(value) {
return function () {
_setFragmentString(value);
}
Expand All @@ -45,14 +45,14 @@ var _setFragmentString = function (value) {
};


exports.getQueryString = function () {
function getQueryString() {
var result = window.location.search;
if (result.startsWith("?"))
return result.substring(1);
return "";
};

exports.setQueryString = function (value) {
function setQueryString(value) {
return function () {
_setQueryString(value);
}
Expand All @@ -65,9 +65,12 @@ var _setQueryString = function (value) {
window.history.pushState({}, '', newurl);
};

exports._getQueryParam = function (paramName) {
function _getQueryParam(paramName) {
return function () {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(paramName);
}
}


export { setQueryString, getQueryString, setFragmentString, getFragmentString, getLocationBaseString, getLocationString, setLocationString, _getQueryParam }
4 changes: 3 additions & 1 deletion src/Main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

exports.executeJavascriptHacks = function () {
function executeJavascriptHacks() {
// The popstate event of the Window interface is fired when the active history entry changes while the user navigates the session history.
// Hack for making sure hashchanges trigger a reload when nagivating history
// TODO: handle this event properly without a reload by executing the Initialize action on this event
Expand All @@ -26,3 +26,5 @@ exports.executeJavascriptHacks = function () {
m.content = bgColor;
document.head.appendChild(m);
};

export { executeJavascriptHacks }
51 changes: 0 additions & 51 deletions src/Shortlink1UrlShortener.purs

This file was deleted.

5 changes: 5 additions & 0 deletions src/SimpleJSON.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const _parseJSON = JSON.parse;

export const _undefined = undefined;

export const _unsafeStringify = JSON.stringify;
Loading

0 comments on commit d8f6b87

Please sign in to comment.