Created
April 17, 2014 12:16
-
-
Save bvssvni/10978809 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
-- describes an Integer representation of Bools | |
-- that also specify how many bits are used | |
data BitVector : Integer -> Integer -> Type | |
-- I want to make sure that the value of the integer | |
-- is always less than 2^first_argument. | |
-- Is this possible? | |
-- takes two Bool and return an Integer. | |
pairOfBoolsToInteger : Bool -> Bool -> BitVector 2 Integer | |
pairOfBoolsToInteger a b = case (a, b) of | |
(False, False) => 0 | |
(True, False) => 1 | |
(False, True) => 2 | |
(True, True) => 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment