Implicit parameters:

Jorge Adriano Aires jadrian at mat.uc.pt
Wed Jan 19 16:15:05 EST 2005


Isn't it just the monomorphism restriction at work?
This works fine:

> f () = do
>    a <- get_unique
>    putStr (showInt a "\n")
>    b <- get_unique
>    putStr (showInt b "\n")
>    c <- get_unique
>    putStr (showInt c "\n")                                                                 
>                                                            
>
> get_unique :: (?global_counter :: IORef Int) => IO Int
> get_unique = readIORef ?global_counter


J.A.


More information about the Glasgow-haskell-users mailing list