Skip to content

Instantly share code, notes, and snippets.

@oleks
Last active April 15, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleks/e2f7617eb171d462b43ca7ba4db28db0 to your computer and use it in GitHub Desktop.
Save oleks/e2f7617eb171d462b43ca7ba4db28db0 to your computer and use it in GitHub Desktop.
Using dependent types in regular types
module A
import Data.Vect
data T =
MkT (Vect len Int)
eq' : Vect n Int -> Vect m Int -> Bool
eq' {n} {m} v w = n == m && (exactLength n v) == (exactLength n w)
Eq T where
(==) (MkT v) (MkT w) = eq' v w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment