Database interface

Tim Docker timd@macquarie.com.au
Thu, 14 Aug 2003 18:59:07 +1000


oleg@pobox.com wrote:

> If I may interject, that's precisely how a Scheme DB interface is
> designed. The main function is a left-fold. Not quite though: it
> provides for a premature termination:
> 
> A major procedure: DB1:fold-left PROC INITIAL-SEED QUERY-OBJECT

Premature termination sounds like a useful property. I can
see two ways this could be done: keep the previous signature,
and use an exception to exit early, or add a boolean return 
value like the scheme version:

   doquery :: Process -> String -> (a -> b  -> IO (b,Bool)) -> b -> IO b

Any opinions on which alternative wouuld be preferable?

Tim