purescript-prelude
purescript-prelude copied to clipboard
The PureScript Prelude
Could a function like this be added? https://hackage.haskell.org/package/base-4.19.0.0/docs/Data-Functor-Classes.html#v:liftCompare In which module should such function go?
**Description of the change** Fixes #309 by batching the arguments passed to `Array.prototype.push` by `Function.prototype.apply`. I chose 10,000 for the batch size because it's definitely in the safe range for...
In short, ``` > import Data.Array > [1] >>= \_ -> replicate 200000 0 file:///tmp/p/.psci_modules/Control.Bind/foreign.js:5 Array.prototype.push.apply(result, f(arr[i])); ^ RangeError: Maximum call stack size exceeded at file:///tmp/p/.psci_modules/Control.Bind/foreign.js:5:28 at file:///tmp/p/.psci_modules/$PSCI/index.js:5:74 at ModuleJob.run...
I have following code snippet: ``` post :: forall m a. DecodeJson a => Monad m => String -> m a deleteFoo = do void $ post "http://localhost/delete" ``` type...
Currently, `boolConj`, `boolDisj`, and `boolNot` are foreign, but could these be implemented in PureScript with pattern matching?
`purs` compiles the following: ``` (1.0 < nan) == false ``` to ``` 1.0 < nan === false ``` but if we instead go through the `Ord` API we can...
From @mikesol in Discord: > Would it make sense to revamp `Semiring` so that it had only the operators `add` and `mul` and then use `Dioid` for `zero` and `one`?...
The type ```purescript type AlmostEff = Unit -> Unit ``` causes code that uses it to be removed when compiling using the backend-optimizer. This is problematic when implementing a new...
PR #299 seems to contain a [breaking change](https://github.com/purescript/purescript-prelude/pull/299/files#diff-dd43a1d5c0d3cfc085d97d7d2f780b9aef9600e37e27959b9acf28d0ad2dede5L59) CC @ajnsit For instance it breaks [this code](https://github.com/ntwilson/purescript-option/blob/main/src/Option.purs#L439-L440): ```purescript requiredFields :: Array String requiredFields = Data.Show.showRecordFields requiredProxy (required record') ``` and returns...
**Description of the change** While working on [purescript-json-codecs](https://github.com/JordanMartinez/purescript-json-codecs), I realized that all these proxy args used to guide type inference could be replaced with newtypes now that we have polykinds...