Explicit function call

Pavel G. Zhbanov pavel@joker.botik.ru
Wed, 12 Mar 2003 17:26:54 +0300


On Wed, Mar 12, 2003 at 07:52:52AM -0600, Jon Cast wrote:
> pavel@joker.botik.ru (Pavel G. Zhbanov) wrote:
> > > If it doesn't have a side effect, why do it anyway? The result 'c'
> > > does not depend on a.
> 
> > myFunc uses IORef and it's (IORef's) result I use afterwards in some
> > other functions.
> 
> OK: what is myFunc's type?  If it ends in IO alpha, for some alpha, you
> can say: do a <- myFunc ... etc.  If it doesn't, then you should
> probably re-think its definition.
> 
> Jon Cast

myFunc :: a  -> [b]
(a and b are my own types)

Actually, inside myFunc I used unsafePerformIO (didn't want to change
the whole programm just because of one function). The purpose of myFunc
is to append some value to "some list" lying somewhere (somewhere is
"defined" by IORef), store the resulting list and return a copy. 

I want to do something like this (in a sequence):
append two values to "some list" , then call a function (myFunc2) that 
uses "some list" and return the value returned by myFunc2.
-- 
Pavel Zhbanov