Advertisement
Guest User

Untitled

a guest
Nov 5th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.49 KB | None | 0 0
  1. type Item = string
  2. type Quantity = string * decimal
  3. type Ingredient =
  4.   | Raw of Item * Quantity
  5.   | Cooked of Recipe * Quantity
  6.  
  7. type Recipe = {
  8.   mix: Ingredient list
  9.   prep: Preparation list
  10.   }
  11.   with static member Default = {mix = []; prep = []}
  12.  
  13. let ``goat curry`` =
  14.   let addIngredient i container = {container with mix = container.mix |> List.append i}
  15.   Recipe.Default
  16.   |> addIngredient Raw("oil", ("cup", 0.25))
  17.   |> addIngredient Raw("curry powder", ("tablespoon", 8))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement