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.

As discussed in #324

Signature

Number -> Number -> Number -> Boolean

Possible Implementation

const inRange = curry((low, high, v) =>
  compose(apply(useWith(both, [flip(gte), flip(lte)])), sort(gt), list)(
    low,
    high
  )(v)
);

Codepen

Does it need to do anything else?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
wojpawlikcommented, Feb 23, 2018

if start is greater than end the params are swapped to support negative ranges

I don’t think this is essential, after all, you can do inRange(__, max).

Ramda actually treats it as an error.

1reaction
Undistractioncommented, Mar 10, 2018

You could look at it like this:

If I’m trying to check if a value is in the range of n to Number.POSITIVE_INFINITY I’m effectively doing R.flip(R.gt(n)) so I should use that instead. However I’m not sure if that is a good enough argument.

Read more comments on GitHub >

github_iconTop Results From Across the Web

inRange.js - Documentation
@func inRange; * @memberOf RA; * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|v2.7.0}; * @category Relation; * @sig Number -> Number -> Number ...
Read more >
Rheumatoid Arthritis Signs and Symptoms
Rheumatoid Arthritis has a number of symptoms that patients should be aware of including inflamed joints, pain, fatigue and over time joint damage....
Read more >
ZLINE 48 in. Range Door in Multiple Finishes (RA-DR-48)
Streamline your kitchen design with our interchangeable colored range doors available for any unrivaled ZLINE range. From bright and brilliant to subtle and ......
Read more >
Rheumatoid Arthritis (RA) Symptoms and Signs: Early Stage ...
Rheumatoid arthritis (RA) is an autoimmune disorder that causes the chronic inflammation of joints. RA tends to begin slowly with minor ...
Read more >
Time in Range | American Diabetes Association
The ADA's Time in Range initiative will provide guidance on treating your patients ... RA, McMahon C. The relationship of hemoglobin A1C to...
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