Using existential types

Tomasz Zielonka t.zielonka at
Fri Oct 3 11:54:43 EDT 2003

On Fri, Oct 03, 2003 at 09:42:48AM +0200, Tomasz Zielonka wrote:
> However this approach has caveats. For example you can't store the state
> of Stat and restart it later. All steps are done within one call to
> runStat.

I was wrong. I can write:

updateStat :: Stat i o -> i -> Stat i o
updateStat (Stat init update result) i = (Stat (update init i) update result)

Best regards,

More information about the Haskell-Cafe mailing list