Skip to content

Instantly share code, notes, and snippets.

@Peaker
Forked from sinelaw/indexable.hs
Last active August 29, 2015 14:16
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 Peaker/132f63f3df262b973df2 to your computer and use it in GitHub Desktop.
Save Peaker/132f63f3df262b973df2 to your computer and use it in GitHub Desktop.
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
class Indexable a where
instance c ~ Char => Indexable (String, Int, c) where
instance Indexable ([(String, a)], String, a) where
test1 :: Indexable (a,b,c) => a -> b -> c
test1 x y = undefined
t1 = test1 "hi" (3 :: Int)
main = return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment