Advertisement
Guest User

Untitled

a guest
Apr 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // The colour test function returns TRUE or FALSE
  2. var is_sbp = colour => (colour === "sky_blue_pink") ? TRUE : FALSE;
  3.  
  4. // Store the responses to the colour test as a PAIR
  5. var colourResponses = PAIR(pigs.fly)(elephants.jump);
  6.  
  7. // Modify HEAD and TAIL to receive a PAIR
  8. var HEAD = pair => pair(TRUE);
  9. var TAIL = pair => pair(FALSE);
  10.  
  11. // Now HEAD and TAIL can be used in a more intuitive manner
  12. HEAD(colourResponses); // -> pigs.fly
  13. TAIL(colourResponses); // -> elephants.jump
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement