- All countries
_
- Countries where life expectancy reached 75
<join _ <cons [_ ?(gt? $ 75)] _>>
- Countries where life expectancy was under 40
<join _ <cons [_ ?(lt? $ 40)] _>>
- Countries where life expectancy decreased more than 5 years
<join _ <cons [_ $x] <join _ <cons [_ ?(lt? $ (- x 5))] _>>>>
- Countries where life expectancy increased 1.5 times from 1960 to 2005
<join _ <cons [,1960 $x] <join _ <cons [,2005 ?(gt? $ (* x 1.5))] _>>>
What is the Point?
The point is we filters countries with a single pattern that represents a shape of a line.
We do not need to write algorithms for each filtering.
Mechanism
The target data are as follow. The following are data of Japanese life expectancy.
We pattern-match against these time-series data as (list [integer float])
, i.e. a list of tuples of an integer and float.