Created
June 3, 2016 23:19
-
-
Save joaomilho/b5070a3eabddd8561db6b45864f31d13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fn = cond([ | |
[equals(0), always('water freezes at 0°C')], | |
[equals(100), always('water boils at 100°C')], | |
[T, (temp) => `nothing special happens at ${temp}°C`] | |
]) | |
fn(0) //=> 'water freezes at 0°C' | |
fn(50) //=> 'nothing special happens at 50°C' | |
fn(100) //=> 'water boils at 100°C' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment