Created
April 26, 2017 15:16
-
-
Save infinisil/f275566604f9f38d9544b3a331f3b21e 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
import Data.Vect | |
ChooseType : (n : Nat) -> (k : Nat) -> {auto ok : LTE k n} -> Type | |
ChooseType n Z {ok=LTEZero} = () | |
ChooseType n@(S ns) (S Z) {ok=(LTESucc oks)} = Fin n | |
ChooseType n@(S ns) (S ks) {ok=(LTESucc oks)} = (Fin n, ChooseType ns ks) | |
data Choice : (n : Nat) -> (k : Nat) -> Type where | |
Choose : (n : Nat) -> (k : Nat) -> { auto ok : LTE k n } -> | |
ChooseType n k -> Choice n k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment