Questions tagged [prelude.ls]

prelude.ls is a functionally oriented utility library; almost all of its functions are curried.

From the prelude.Is home page

prelude.ls is a functionally oriented utility library. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript,

8 questions
2
votes
2 answers

Use prelude-ls with LiveScript

I just need to use prelude-ls library in LiveScript, but no from the REPL. In my little test, I have 4 files: main.htm application.ls application.js require.js I have the latest version of require.js (2.1.15) and in my main.htm I load the…
Marcelo Camargo
  • 2,240
  • 2
  • 22
  • 51
1
vote
2 answers

How to show strings in custom Prelude library Protolude

I read this blog post on how to create a custom Prelude library. The library can be found here. One of the things it does is prohibit String. It also defines a function for automatic string conversions (here). I have enabled OverloadedStrings in the…
OneEyeQuestion
  • 742
  • 7
  • 22
1
vote
1 answer

Get minimum of a object

Firstly, good morning. PreludeLS is able to get the minimum value of an array: [1 2 3 4 5 6 7 8 9 10] |> minimum #=> 1 Now I figure out a way to get the minimum-by a unknown key. Let's suppose I have an object called A and it has 3 properties with…
Marcelo Camargo
  • 2,240
  • 2
  • 22
  • 51
1
vote
1 answer

How to use module prelude-ls in TypeScript

I program in LiveScript and use the external module prelude-ls to do things as chaining, mapping, folding, grep or other functional concepts. In LiveScript, I can do _ = require 'prelude-ls' [1 2 3] |> map (*2) |> filter (> 4) |> fold (+) But if I…
Marcelo Camargo
  • 2,240
  • 2
  • 22
  • 51
1
vote
1 answer

livescript/prelude: repeat is not defined

With prelude.ls in livescript, when I run repeat 4 'a', it gives me repeat is not defined, all other function works fine. Encountering the same problem on livescript.net, I guess I missed something simple, what is it?
muyueh
  • 1,018
  • 13
  • 16
1
vote
1 answer

How to run prelude functions

I downloaded prelude.js and added it in my application. I linked the js file in my html file in the following way: I didn't link any dependent file in my html file. I opened the…
user2873816
  • 179
  • 1
  • 5
  • 16
0
votes
2 answers

Cannot get [{"foo"}, {"bar"}, {}, {}] |> filter empty to work

This works: [1 to 10] |> filter (> 4) |> console.log #[ 5, 6, 7, 8, 9, 10 ] This works: empty {} #true but this doesn't: [{"foo"}, {"bar"}, {}, {}] |> filter empty |> console.log # [ { foo: 'foo' }, { bar: 'bar' }, {}, {} ] [{"foo"}, {"bar"}, {},…
muyueh
  • 1,018
  • 13
  • 16
0
votes
1 answer

prelude.ls |> with multiple argument

Is it possible to use |> with multiple arguments? sum = (a, b)-> a + b 10, 12 |> sum # "Unexpected ','" sum(10,12) # this is fine 10 |> sum 12, _ # this works, but is there a better way?
muyueh
  • 1,018
  • 13
  • 16