Can we test for a range type?

How would we test for a range type?

Like is_range? or equivalent?

There’s no need for such function as we can pattern match on %Range{} struct in case, function heads etc, and if you still need it, it’s trivial to implement.

2 Likes

As far as I remember we are even able to match on .., such that the following should work:

def range?(_.._) -> true
def range?(_) -> false
9 Likes