[Haskell-cafe] Delaling with State StateT and IO in the same function

2007-02-26 Thread Alfonso Acosta
Hello, I know StateT is exactly aimed at dealing with a state and an inner monad but I have an example in which I have to mix State and IO and in which I didn't get to an elegant solution using StateT. I have a higher order function which gets some State processing functions as input, makes

Re: [Haskell-cafe] Delaling with State StateT and IO in the same function

2007-02-26 Thread Kirsten Chevalier
On 2/26/07, Alfonso Acosta [EMAIL PROTECTED] wrote: The returned type is a StateT and the only way in which I succesfully managed to internally work with both State and StateT is converting from the former to the later one using this function (not elegant at all) I may be missing something,

Re: [Haskell-cafe] Delaling with State StateT and IO in the same function

2007-02-26 Thread Alfonso Acosta
On 2/27/07, Kirsten Chevalier [EMAIL PROTECTED] wrote: I may be missing something, but why are you using both State and StateT? Maybe I don't understand your code, but it seems like you could be using StateT everywhere you're currently using State. Well, as far as I know using StateT s IO a

Re: [Haskell-cafe] Delaling with State StateT and IO in the same function

2007-02-26 Thread Kirsten Chevalier
On 2/26/07, Alfonso Acosta [EMAIL PROTECTED] wrote: On 2/27/07, Kirsten Chevalier [EMAIL PROTECTED] wrote: I may be missing something, but why are you using both State and StateT? Maybe I don't understand your code, but it seems like you could be using StateT everywhere you're currently

Re: [Haskell-cafe] Delaling with State StateT and IO in the same function

2007-02-26 Thread Alfonso Acosta
On 2/27/07, Kirsten Chevalier [EMAIL PROTECTED] wrote: So what if you changed your netlist function so that the type sig would be: netlist :: DT.Traversable f = (State s (S HDPrimSignal) - State s v ) - -- new (State s (Type,v) - S v - State s ()) - -- define