Q:

How do we test a `Range` type in Elixir

How do we test for a Range type? What would be the equivalent of is_range?
Erlang/OTP 21 [erts-10.1] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> a = 1..10
1..10
iex(2)> is_list a
false
iex(3)> i a
Term
  1..10
Data type
  Range
Description
  This is a struct. Structs are maps with a __struct__ key.
Reference modules
  Range, Map
Implemented protocols
  IEx.Info, Enumerable, Inspect
iex(4)> 

A:

Why would you need this function in the first place? Range is a struct. We have pattern matching everywhere you might need it. Just pattern match to %Range{} and you are all set.   

