nickel icon indicating copy to clipboard operation
nickel copied to clipboard

Standard library stabilization

Open yannham opened this issue 4 years ago • 2 comments

#254 describes the next batch of functions to add to the standard library to have a minimum viable one. While it's currently not yet closed, the implementation should end soon. This issue tracks the second phase of tasks to achieve with respect to the standard library.

  • [ ] Write tests
  • [x] Write documentation
  • [ ] Stabilize naming, make it consistent
  • [ ] Stabilize types, make them consistent
  • [ ] Stabilize provided contracts, make their names and implementation consistent

yannham avatar Mar 10 '21 14:03 yannham

Now that we have |>, it feels like strings.join should be flipped to Str -> List Str -> Str

silverraven691 avatar Nov 19 '21 11:11 silverraven691

Hopefully, this is not off-topic, here's a bunch of functions I ended up re-implementing while writing some Nickel, and more that I think I may end up wanting:

nums.clamp : Num -> Num -> Num -> Num
functions.flip : forall a b c. (a -> b -> c) -> b -> a -> c // Although I don't suppose I'll use it as much after my PR
lists.optional : Bool -> List -> List
records.optional : Bool -> { _: Dyn } -> { _: Dyn }
records.filter : (Str -> Dyn -> Bool) -> { _: Dyn } -> { _: Dyn }
records.toList : { _: Dyn } -> List { key: Str, value: Dyn } // or: records.entriesOf
records.fromList : List { key: Str, value: Dyn } -> { _: Dyn } // or: records.fromEntries

E: base64 en/decode would be great too

silverraven691 avatar Nov 30 '21 17:11 silverraven691

This issue is superseded by #935

yannham avatar Dec 16 '22 16:12 yannham