Created
January 11, 2020 04:39
-
-
Save MarcelineVQ/8ab71cab178879334d017cca17fba04d 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
foo : (m : Nat) -> (n : Nat) -> Dec (LT m n) | |
foo Z Z = No absurd | |
foo Z (S k) = Yes (LTESucc LTEZero) | |
foo (S k) Z = No absurd | |
foo (S k) (S j) = case foo k j of | |
(Yes prf) => Yes (LTESucc prf) | |
(No contra) => No (\(LTESucc r) => contra r) | |
foo2 : (m : Nat) -> (n : Nat) -> Dec (LT m n) | |
foo2 m n with (isLTE (S m) n) | |
foo2 m n | (Yes prf) = Yes prf | |
foo2 m n | (No contra) = No contra | |
foo3 : (m : Nat) -> (n : Nat) -> Dec (LT m n) | |
foo3 m n = isLTE (S m) n |
kozross
commented
Jan 11, 2020
foo jx = do
Just x <- jx
| Nothing => foo
bip x
-- ^ fine
foo2 jx = do
Just x <- jx
| Nothing => foo *> blah
bip x
-- ^ problem
foo2 jx = do
Just x <- jx
| Nothing => (foo *> blah)
bip x
-- ^ solution
beb : a -> b -> Something
beb x y with (blah x)
beb x y | foo = ...
-- ^ with requires parens around blah x for some reason
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment