[Haskell-cafe] IO trouble

Xiao-Yong Jin xj2106 at columbia.edu
Tue May 12 16:59:36 EDT 2009


Hi,

I can't really describe it in the subject.  So let me try to
do it here.

I have two functions

> f :: a -> b
> g :: (a -> b) -> c -> d

and I use them as

> gf :: c -> d
> gf = g f

Now I want to handle exceptions in f and redefine f as in f'

> f' :: a -> IO (Either e b)

So my question is how to define gf' now to use f' instead of
f?

> gf' :: c -> IO (Either e d)

Thanks in advance.
Xiao-Yong
-- 
    c/*    __o/*
    <\     * (__
    */\      <


More information about the Haskell-Cafe mailing list