{"library":"prelude-ls","title":"Prelude.ls Functional Utility Library","description":"prelude.ls is a functionally oriented utility library designed to simplify common programming tasks by providing a rich set of curried functions. It is primarily written in LiveScript and serves as the recommended base library for LiveScript projects, although it is fully usable within standard JavaScript environments. The library offers a wide array of utilities for lists, objects, strings, functions, and numbers, emphasizing a functional programming paradigm with functions like `map`, `filter`, and `fold` readily available. The current stable version is 1.2.1. Given its last update approximately six years ago (around April 2020), its release cadence is effectively inactive, indicating it is no longer actively maintained. A key differentiator is its deep integration with and recommendation for the LiveScript ecosystem, providing a Haskell-like prelude module, and its consistent use of currying across most functions. It predates widespread modern JavaScript module systems and exclusively functions via CommonJS modules.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install prelude-ls"],"cli":null},"imports":["const P = require('prelude-ls');","const { map } = require('prelude-ls');","const { Obj } = require('prelude-ls');\nconst objectMap = Obj.map;"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const P = require('prelude-ls');\n\n// Example 1: Basic list mapping with a curried function\nconst addTwo = P.map(x => x + 2);\nconst numbers = [1, 2, 3, 4, 5];\nconst mappedNumbers = addTwo(numbers);\nconsole.log('Mapped numbers:', mappedNumbers); // Expected: [3, 4, 5, 6, 7]\n\n// Example 2: Filtering even numbers, demonstrating currying\nconst isEven = x => x % 2 === 0;\nconst filterEven = P.filter(isEven);\nconst evenNumbers = filterEven(numbers);\nconsole.log('Even numbers:', evenNumbers); // Expected: [2, 4]\n\n// Example 3: Folding (reducing) a list\nconst sum = P.fold((acc, x) => acc + x, 0);\nconst total = sum(numbers);\nconsole.log('Sum of numbers:', total); // Expected: 15\n\n// Example 4: Using an object-specific function\nconst data = { a: 1, b: 2, c: 3 };\nconst objMapValues = P.Obj.map(x => x * 10);\nconst mappedObject = objMapValues(data);\nconsole.log('Mapped object:', mappedObject); // Expected: { a: 10, b: 20, c: 30}\n","lang":"javascript","description":"This quickstart demonstrates how to import `prelude-ls` using CommonJS and utilize its core functional programming utilities, including curried `map`, `filter`, `fold`, and an object-specific `Obj.map` function.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}