User loginNavigation 
Type classes and type generator restrictionsHello LtU. I've been lurking for a while, but this is my first post. I'm not really sure where it ranks on the scale from "how did you get through undergrad without reading X" to "do your own research, dude". I've tried googling everything I can think of, and reading breadth first from Glynn, Stuckey, and Sulzmann's paper "Type classes and constraint In a Haskellesque language with Haskell type classes, imagine a type generator, Set. This type generator requires that its argument be an instance of the Equality type class (because otherwise, how could it ensure that its elements are distinct). Set is also an instance of the Haskell Functor type class, because we can map over sets. With theSet having type Set integer, and a map function with the usual type (namely, (Functor f) => (a > b) > F a > F b), everything seems good. But here's my problem: map (+) theSet appears to have the type Set (integer > integer). KABOOM! Functions aren't in the Equality type class, and so we can't specialize Set at integer > integer. Does anyone know how to build a type inference / type checking algorithm that reports this error (statically)? If so, could you point me in the right direction? By Douglas McClean at 20080723 23:44  LtU Forum  previous forum topic  next forum topic  other blogs  4971 reads

Browse archivesActive forum topics 
Recent comments
1 hour 34 min ago
11 hours 6 min ago
11 hours 43 min ago
13 hours 1 min ago
13 hours 14 min ago
17 hours 23 min ago
18 hours 9 min ago
18 hours 9 min ago
1 day 22 min ago
1 day 45 min ago