
6 Feb
2010
6 Feb
'10
12:27 a.m.
Hi all - I'm doing a public-domain package of "functional" programs" in C, and that involves trying to replicate (in C) a number of Haskell functions. The two that I'm looking at now are "pred" and "succ". I've seen the examples on zvon.org, which give "pred 5" as being 4, and "pred B" as being "A". Ok, that's fine, no problem. However, is my understanding correct that this can be extended to lists (arrays in C) so that (for example) for a list ["foo", "bar", "baz"] , "pred "bar" " would give you "foo" , and "succ "bar" " would give you "baz"? Thanks in advance - bye for now - - Andy