Re: Setting properties of a widget.

Vincenzo Ciancia <[email protected]>
Newsgroups gmane.comp.lang.haskell.gui
Message-ID <[email protected]>
On Sat, 29 Mar 2003 08:39:52 -0800 (PST)
David Sankel <[email protected]> wrote:

> 
>  I'm not sure what you mean by filter?  Something like
>  an onTitleChange callback?

Given a Variable a, I think that it's a good idea to have an ability to
filter the values with something like

addFilter :: (Variable a) -> (a -> IO (Maybe a)) -> IO (IO ())

the IO action returned is to uninstall the filter (wich is like a
callback).

but this is just an idea, there might be reasons not to do it, or to do
it in a simpler way. 

If there are no filters (like in MVar), you can always provide a set/get
pair of functions wich allow filtering, but there is no way to avoid the
ability to bypass the filters.

Of course, I could entirely rewrite an MVar layer on top of the old one,
but that sounds silly.

V.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.