Created
December 7, 2018 12:22
-
-
Save Jell/a1fdc65098fecfd73f15ac5027c6709b to your computer and use it in GitHub Desktop.
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
module Test | |
import TestProvider | |
%default total | |
%language TypeProviders | |
add : Int -> Int -> Int | |
add x y = 0 | |
%provide (result : String) with compileTest [ | |
(add 1 2 == 0, "1 + 2 = 3") | |
, (add 1 2 == 0, "1 + 2 = 3") | |
, (add 1 2 == 0, "1 + 2 = 3") | |
] |
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
module TestProvider | |
%default total | |
%access export | |
compileTest : List (Bool, String) -> IO (Provider String) | |
compileTest [] = pure $ Provide "success" | |
compileTest ((True, _) :: xs) = do | |
printLn "pass" | |
compileTest xs | |
compileTest ((False, description) :: xs) = do | |
printLn "failed" | |
pure $ Error description |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment