question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions about common FP functions

See original GitHub issue

Hi @mobily, the library looks really interesting! I’m quite interested in trying it out for future projects. I just have a couple of questions about certain functions, and I hope this is the right place to ask.

  1. How would you do Clojure’s assoc and dissoc with ts-belt? Would it have to be D.merge(m, {k: v}) and D.rejectWithKey(m, (_, key) => key == k)?
  2. I noticed that D.xxxWithKey’s signature is (v, k) instead of the usual (or rather what I would expect to be) (k, v). Is that just a matter of personal preference or rather a convention from another library/language that I’m not familiar with?
  3. On Remeda, the doc says “Due to the lazy evaluation, it’s also unclear how to use some utility functions within the pipeline.” Does this mean that ts-belt does eager evaluation? So something like, say, pipe(m, D.toPairs, A.take(2)) would iterate through all the key-value pairs first before taking the first two elements?

Also, something like Remeda’s mapping doc would be very helpful to newcomers! I’m happy to chip in if you think it’d be useful.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
mobilycommented, Dec 9, 2021

ad 2. it’s been fixed and published in v3.1.1 🚀

1reaction
mobilycommented, Dec 15, 2021

👋 hey again @anthony-khong!

I’m curious to know what you actually do during development!

I did some changes to improve this process, so basically, for development purposes, you can use the following commands:

yarn build dev -n Dict -t set

⬆️ this command will build a single module (in this case Dict) and run set tests

yarn test run -f set -n Dict

⬆️ this command will be useful if you change a single test file (in this case Dict/set.test.ts)

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Functional Programming | Interviewkickstart
In other words, FP is an approach to software construction based on creating pure functions. FP helps in solving problems where many different...
Read more >
Question Everything | alvinalexander.com
FP applications consist of only immutable values and pure functions. Pure function means that (a) a function's output depends only on its input...
Read more >
FP interview - gists · GitHub
These are some questions to give a sense of what you know about FP. ... Nuts and bolts; Reasoning about types; Knowledge of...
Read more >
Software Engineering | Calculation of Function Point (FP)
Function Point (FP) is an element of software development which helps to approximate the cost of development early in the process. It may ......
Read more >
FP in JavaScript, questions about an approach. - Reddit
This is a JavaScript question, but I think it fits FP (and trying to find enlightenment) in general. I've been trying to write...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found