Tue, 6 Jul 1999 12:51:23 +0100 (BST), Peter Hancock <[EMAIL PROTECTED]> pisze:

> I thought that one could start with something simple, like a "before"
> list and an "after list".

Ah, thanks, I've forgotten about this trick, which I've seen a long
time ago in some Turbo Pascal demo! :-)  It might be good to split
lines as a whole, not their contents, probably except the current line,
so going through the whole file won't take ages.

Although the interface should be abstract, it probably can't be too
abstract, because now the cursor position is a very important property
of the buffer and line boundaries are explicit.

> One could some kind of ANSI screen handling stuff - there were some
> examples among the hugs demos once.

I have to think about a good abstraction of terminal actions. I
don't quite like the idea from that module, because it does not allow
integration with arbitrary IO (or I miss something?) and it heavily
depends on the terminal having particular properties, offered in a
context-independent interface of control sequences. For example it
does not fit with an extension of performing several actions virtually
and rendering the screen contents with all of them applied at once.

Or maybe it does fit, because one could write a terminal emulator
to which the codes would be sent, instead of directly to stdout :-)
The minor disadvantage is the need of keeping the terminal emulator
and the sequence generator know the same language. Maybe some more
abstract representation of the language woule be better, I don't know.

Hmm, maybe it's enough to encode terminal actions simply in IO ().
The disadvantage is that there is only one global terminal for
a program; probably not a big practical problem, but seems to be
less functional-style... The advantage is that "lots of functions"
is more extensible than "lots of constants of a type". Ah, an abstract
language is less extensible than raw escape sequences...

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
 \__/          GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-



Reply via email to