Skip to content

Commit

Permalink
Update documentation to reflect all changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Feb 21, 2012
1 parent 956eec2 commit 4e75911
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Readme.md
Expand Up @@ -24,18 +24,18 @@ A protocol is a named set of functions and their signatures:
var protocol = require('protocol/core').protocol

var sequence = protocol(('Logical list abstraction', {
first: ('Returns first item of this sequence', [ 'this' ]),
rest: ('Returns sequence of items after the first', [ 'this' ]),
stick: ('Returns sequence of items where head is first, and this is rest', [ 'head', 'this' ])
first: ('Returns first item of this sequence', [ protocol ]),
rest: ('Returns sequence of items after the first', [ protocol ]),
stick: ('Returns sequence of items where head is first, and this is rest', [ Object, protocol ])
}))
```

- No implementations are provided
- Docs can be optionally specified for the protocol and the functions, via
elegant JS hack.
- The above yields a set of polymorphic functions and a protocol object
- The resulting functions dispatch on the type of their `'this'` argument, and
thus must have it in the list of arguments.
- The resulting functions dispatch on the type of their `protocol` argument,
and thus must have it in the list of arguments.

`protocol` will generate an interface containing a corresponding functions.
returned interface may be used to extend data types with it's implementations:
Expand Down

0 comments on commit 4e75911

Please sign in to comment.