Skip to content

Instantly share code, notes, and snippets.

@lessless
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lessless/058cd060bfce30b37951 to your computer and use it in GitHub Desktop.
Save lessless/058cd060bfce30b37951 to your computer and use it in GitHub Desktop.
% A customer enters, sees our menu and asks if he could have the prices of all the items costing between $3 and $10 with taxes % (say 7%) counted in afterwards.
3> RestaurantMenu = [{steak, 5.99}, {beer, 3.99}, {poutine, 3.50}, {kitten, 20.99}, {water, 0.00}].
[{steak,5.99},
{beer,3.99},
{poutine,3.5},
{kitten,20.99},
{water,0.0}]
4> [{Item, Price*1.07} || {Item, Price} <- RestaurantMenu, Price >= 3, Price =< 10].
[{steak,6.409300000000001},{beer,4.2693},{poutine,3.745}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment