Created
January 9, 2014 16:19
-
-
Save david-christiansen/8336956 to your computer and use it in GitHub Desktop.
First reflected error in Idris
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drc@drc:~/Documents/Code/Idris/error-reflection-test$ idris ErrorTest.idr | |
____ __ _ | |
/ _/___/ /____(_)____ | |
/ // __ / ___/ / ___/ Version 0.9.10.1-git:5361547 | |
_/ // /_/ / / / (__ ) http://www.idris-lang.org/ | |
/___/\__,_/_/ /_/____/ Type :? for help | |
Type checking ./ErrorTest.idr | |
*ErrorTest> the Nat "" | |
ERROR HAPPENED! | |
*ErrorTest> | |
Bye bye | |
drc@drc:~/Documents/Code/Idris/error-reflection-test$ cat ErrorTest.idr | |
module ErrorTest | |
import Language.Reflection.Errors | |
%language ErrorReflection | |
total %error_handler | |
test : Err -> Maybe (List ErrorReportPart) | |
test a = Just [Message "ERROR HAPPENED!"] | |
total %error_handler | |
nothing : Err -> Maybe (List ErrorReportPart) | |
nothing a = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment