Skip to content

Instantly share code, notes, and snippets.

@sebabouche
Created June 22, 2018 20:17
Show Gist options
  • Save sebabouche/43c4ef8448d8fd482a3d27ede9486a24 to your computer and use it in GitHub Desktop.
Save sebabouche/43c4ef8448d8fd482a3d27ede9486a24 to your computer and use it in GitHub Desktop.
ramda: cond, always, T, identity
import { cond, always, lte, gte, T, __, identity } from "ramda"
const water = cond([
[lte(__, 0), temp => `water freezes at ${temp}°C`],
[gte(__, 100), temp => `water boils at ${temp}°C`],
[T, temp => `nothing special happens at ${temp}°C`],
])
console.log(water(-222))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment