Functions cfold and cfold' (read: see-fold prime) are two different functions, for which you gave the definition of one but not the other.
To clear up your confusion, try giving the type signatures for both. Daume's text is normally pretty good about this but the section on cfold falls down in this regard.