You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that GHC 8 has callstack printing for uses of error it seems tricky to write doctests that work across multiple versions of GHC.
Example:
### Failure in src/Control/Lens/Traversal.hs:639: expression `[] ^. singular _head'
expected: *** Exception: singular: empty traversal
but got: *** Exception: singular: empty traversal
CallStack (from HasCallStack):
error, called at src/Control/Lens/Traversal.hs:663:46 in main:Control.Lens.Traversal
It might be worth omitting call stack printing somehow for the purposes of writing doctests. This would keep the examples concise and allow them to work more portably.
The text was updated successfully, but these errors were encountered:
I found dealing with callstacks in error messages pretty confusing when I first started using doctests. I didn't see anything in the README, but later on I saw the suggestion @soenkehahn made on sol#136 and it seems to work perfectly.
Hopefully adding this to the README will help other people in the same boat find the solution faster :).
Now that GHC 8 has callstack printing for uses of
error
it seems tricky to write doctests that work across multiple versions of GHC.Example:
It might be worth omitting call stack printing somehow for the purposes of writing doctests. This would keep the examples concise and allow them to work more portably.
The text was updated successfully, but these errors were encountered: