anchor.diff:              | "pastry"::stuff -> // only handles '/pastry'
                   let error_message = sprintf "Unrecognized pastry request url: '%s'" path
                   Invalid(error_message, 404, "Illegal action")
  +
  +            | "resource"::tail -> // Someone requests a resource
  +                let destination =
  +                    match tail with
  +                    | "user"::name::[] ->
  +                        Ok(hash (sprintf "user/%s" name))
  +                    | "user"::name::unwanted_stuff ->
  +                        let error_message = sprintf "Bad user path '%s'. It should be on the form '/resource/user/<username>'" path
  +                        Error(error_message, 400, "Invalid URL")
  +                    | "workflow"::workflow::[] ->
  +                        Ok(hash (sprintf "workflow/%s" workflow))
  +                    | "workflow"::workflow::event::attribute::[] ->
  +                        Ok(hash (sprintf "workflow/%s/%s" workflow event))
  +                    | "workflow"::badly_formed_path ->
  +                        let error_message = sprintf "Bad workflow path '%s'. It should be on the form '/resource/workflow/<name>[/<eventname>/<attribute>]'" path
  +                        Error(error_message, 400, "Invalid URL")
  +                    | unknown_resource::whatever ->
  +                        let error_message = sprintf "Unknown resource type: '%s'" unknown_resource
  +                        Error(error_message, 404, "Not found")
  +                    | _ ->
  +                        Error("Whatever that is, it isn't here", 404, "Not found")
  +
  +                match destination with
  +                | Ok(resource_url) ->
  +                    failwith "Not implemented"
  +                    //let send_func (partial_resource_url: string) (method: string) (string: data) : HttpListenerResponse =
  +                    //    send_message Resource(partial_resource_url)
  +                | Error(msg, status, reason) ->
  +                    Invalid(msg, status, reason)
               | _ ->
  -                let error_message = sprintf "Not related to pastry: %s" path
  +                let error_message = sprintf "Not related to this: %s" path
                   Invalid(error_message, 200, "Not found")
   
           match result with
           | Valid(updated_node) ->
  -            listen updated_node // Listen again
  +            listen updated_node handler state// Listen again
           | Invalid(error_message, status, reason) ->
               error error_message
               reply response error_message status reason
  -
  -    ignore <| listen node // Start listening
  +            listen node handler state
  +
  +    ignore <| listen node handler_arg state_arg// Start listening
   
   // Creates a local node and makes it join the Pastry network
  -let join_network (address: NetworkLocation) (peer: NetworkLocation option) =
  +let join_network<'a> (address: NetworkLocation) (peer: NetworkLocation option) (handler: ResourceRequestFunc<'a>) (state: 'a) =
       let guid = hash address
       printfn "? Pastry GUID: %020d%020d" guid.a guid.b
       let node: Node = {
  
positive.code: | Valid of Node
  | Invalid of string * int * string
  
  //type DeliverFunc = string -> GUID -> unit
  //type ForwardFunc = string -> GUID -> GUID -> string * GUID
  //type NewLeafFunc = GUID list -> unit
  
negative.code:     listener.Prefixes.Add basepath
      listener.Start ()
  
      // A function to handle resource requests
      // context (for replying to this call!), split_path (without /resources), send_func, state -> state
      //type ResourceRequestFunc<'a> = HttpListenerContext -> string list -> SendFunc -> 'a -> 'a
  
      let rec listen (node: Node) (handler: ResourceRequestFunc<'a>) (state: 'a) =
          // Listen for a a message
  
          let cxt      = listener.GetContext()
  