Created
June 5, 2013 03:06
-
-
Save mjdominus/5711342 to your computer and use it in GitHub Desktop.
what is 'lower" for?
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
data Zero | |
data Succ a | |
lower :: Succ a -> a | |
lower = undefined | |
class Modulus a where | |
modulus :: a -> Integer | |
instance Modulus Zero where | |
modulus = \a -> 0 | |
instance (Modulus a) => Modulus (Succ a) where | |
modulus = \a -> 1 + modulus (lower a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment