Created
April 21, 2016 14:42
-
-
Save NathanHowell/2c5158ed54b3813eb84e06c97268ca5e 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
instance (a ~ Proxy "Sum types are not supported by LLVM") => GGetElementIndex a (x :+: y) where | |
type GGetElementPtrType a (x :+: y) = Void | |
ggetElementIndex _ _ = error "Sum types are not supported by LLVM" | |
type family StructElement (a :: [*]) (n :: Nat) :: * where | |
StructElement (x ': xs) 0 = x | |
StructElement (x ': xs) n = StructElement xs (n - 1) | |
StructElement '[] n = Proxy "Attempting to index past end of structure" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment