The solution is described in the page: http://www.haskell.org/haskellwiki/How_to_get_rid_of_IO
You can find answers to many questions on the haskell site by typing keywords in the search field in the upper left corner; however, words of three letters or less are not indexed, so you will need Google for this. Use a search string like: IO site:haskell.org/haskellwiki to find pages about IO Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html -- On Fri, 27 Nov 2009 20:08:44 +0100, <mindfield...@yahoo.com> wrote: > Hi! > I am new to haskell and I would like to do a seemingly very simple task > in it(using wxhaskell). > I would like to change properties based on data acquired from the > outside world(i.e real time, typed text etc.). Probably it sounds stupid > but I simpy cannot do this for days. I am very confused and it is > annoying how a simple task as this is so difficult. > Here are what I tried to do: > > Given a text label and a button, Evry time I press the button I'd like > to read a system dependent time data(for example getCPUTtime) and write > it back on the label. > > Given a text label and a timer. Evry time the timer condition fires i'd > like to read a system dependent time data...(like above) and write it > back > > I couldn't do any of these. Mostly because if acquire any data it comes > in the form of IO <sometype> and set doesn't accept IO type. So I cannot > set the new value. > I coouldn't find any function in the wxhaskell documentation or > tutorials that sets anything based on IO types. > I also found a function unsafePerformIO which could convert an IO to a > non IO type but I couldn't do it anyway. I almost did the second task > but the label didn't refresh by itself. It only refreshed itself when I > moved the window along or continually resized it. > > Can anybody help me? Ther must be some way to do these things. They > cannot be impossible because they are very basic tasks. -- Met vriendelijke groet, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://functor.bamikanarie.com http://members.chello.nl/hjgtuyl/tourdemonad.html -- ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users