Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The colour test function returns TRUE or FALSE
- var is_sbp = colour => (colour === "sky_blue_pink") ? TRUE : FALSE;
- // Store the responses to the colour test as a PAIR
- var colourResponses = PAIR(pigs.fly)(elephants.jump);
- // Modify HEAD and TAIL to receive a PAIR
- var HEAD = pair => pair(TRUE);
- var TAIL = pair => pair(FALSE);
- // Now HEAD and TAIL can be used in a more intuitive manner
- HEAD(colourResponses); // -> pigs.fly
- TAIL(colourResponses); // -> elephants.jump
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement