[#7] Custom Errors for runEIO#13
Conversation
| ghcid.txt | ||
|
|
||
| # Stack | ||
| .stack-work/ | ||
| stack.yaml.lock | ||
|
|
||
| # Nix | ||
| shell.nix | ||
|
|
There was a problem hiding this comment.
I hope you don't mind me adding these. I like to use nix-shell to pull in all the project dependencies (such as ghc, and cabal) and use ghcid for development. I didn't want to clutter up anyone else's workflow so I added the files I use to .gitignore. If this is annoying I can just stage my files more carefully and remove this.
| ( 'Text "The 'runEIO' handler requires that all exceptions in 'EIO' to be handled." | ||
| ':$$: 'Text "The action 'runEIO' is applied to throws the following unhandled exceptions:" |
There was a problem hiding this comment.
I tried to keep the text as similar to your suggestion as possible.
| @since 0.0.0.0 | ||
| -} | ||
| runEIO :: EIO '[] () -> IO () | ||
| runEIO :: DisallowUnhandledExceptions excepts => EIO excepts () -> IO () |
There was a problem hiding this comment.
Being new to custom type errors, and type level programming in general, I wasn't sure if there was a cleaner way to convey, to the consumer of this function, that the type variable excepts is constrained to the kind [Type]
|
Whoops, this isn't actually ready for review, I added DocTests and found a bug where my type family for a custom error message can't resolve |
|
Okay, sorted out the funny type error, I was using the EIO constructor to lift an IO action, but I really need an |
This haskell code generates the corresponding type error: