Skip to content

Instantly share code, notes, and snippets.

@skatenerd
Created August 6, 2014 21:31
Show Gist options
  • Save skatenerd/63cb48b49c7014c133ec to your computer and use it in GitHub Desktop.
Save skatenerd/63cb48b49c7014c133ec to your computer and use it in GitHub Desktop.
fails to compile. i'm not sure why - shouldn't "d" just represent *any type*, so 999 is legal to put in there?
class WithInt c where
combinate :: Integral i => i -> c -> [(i,c,d)]
data Wut = Wut deriving (Show)
instance WithInt Wut where
combinate i w = if (i == 0)
then []
else (i,w,999):combinate (i - 1) w
main = let l :: [(Int, Wut, Int)]
l = combinate 8 Wut
in putStrLn $ show $ l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment