Created
November 27, 2015 18:47
-
-
Save corajr/6e5f13b9aab1e1d2958f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Example where | |
| {-@ divide' :: Int -> {v: Int | v != 0} -> Int @-} | |
| divide' :: Int -> Int -> Int | |
| divide' n d = n `div` d | |
| -- liquid knows we're lying! | |
| {-@ maybeZero :: Bool -> {v: Int | v != 0} @-} | |
| maybeZero :: Bool -> Int | |
| maybeZero True = 1 | |
| maybeZero False = 0 | |
| divResult = divide' 4 (maybeZero False) | |
| -- div1 = divide' 4 1 | |
| main = print divResult |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment