Ambiguous type variable error msg

前端 未结 5 565
终归单人心
终归单人心 2020-12-08 10:35

I don\'t think it is a bug, but I am a bit puzzled as to why that doesn\'t work. A bonus question is why does it mention variable e? There is no variable e.

    P         


        
5条回答
  •  伪装坚强ぢ
    2020-12-08 11:35

    Try giving your handler the type SomeException -> IO x, where x is a concrete type, e.g.

    import Control.Exception
    let f _ = putStrLn "error" :: SomeException -> IO () 
    in handle f undefined 
    

提交回复
热议问题