Arminius / cat-language

Automatically exported from code.google.com/p/cat-language
Other
0 stars 0 forks source link

describe bin_rec #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The docs for bin_rec at http://www.cat-language.com/primitives.html#bin_rec
say:
('a ('a -> bool) ('a -> 'b) ('a -> 'C 'a 'a) ('C 'b 'b -> 'b) -> 'b)
  {{ desc:
      execute a binary recursion process"
The text part is not very specific. What are the 5 arguments on the input?
All I can tell from the type signature is that the 5th one ('a) is a
starting value and the 4th (('a -> bool)) is a termination condition.
It kinda looks like the 3rd is what to do in the base case; 2nd is a
splitting function and 1st is a folding function. But it would be nice to
have that in the desc if correct.
(Ah... the Dr Dobbs article lists the arguments as "input, cond, term,
unfold, fold". It would be good to have that in the desc if it is still true.)

Also, it would be nice to have bin_rec implemented in the online
interpreter, since it is featured prominently in the DDJ article.

bin_rec was 

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by hutt...@gmail.com on 23 Apr 2008 at 6:31