
I was solving some programming puzzles today[1], and found myself pining for Map comprehensions. Maybe there should be a Comprehensible class that's automatically mapped to comprehension syntax. It's rather odd to have them only for lists. That would be both more general and more elegant than just bringing back monad comprehensions. Is there any obvious reason why this wouldn't work? [1] www.projecteuler.net <-- fun stuff! -- -- Diego Navarro

What would the Comprehensible class have? And how would it be different from Monad(Zero)? -- Lennart On Dec 30, 2006, at 10:05 , Diego Navarro wrote:
I was solving some programming puzzles today[1], and found myself pining for Map comprehensions.
Maybe there should be a Comprehensible class that's automatically mapped to comprehension syntax. It's rather odd to have them only for lists. That would be both more general and more elegant than just bringing back monad comprehensions.
Is there any obvious reason why this wouldn't work?
[1] www.projecteuler.net <-- fun stuff!
-- -- Diego Navarro _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi
I was solving some programming puzzles today[1], and found myself pining for Map comprehensions.
[ ... (key,val) <- fromList map, ... ] It isn't really that much more than a straight comprehension would be on a map. By default should a map comprehension let you inspect the values, or the keys, or both? Thanks Neil

Hello Diego, Saturday, December 30, 2006, 6:05:46 PM, you wrote:
Maybe there should be a Comprehensible class that's automatically mapped to comprehension syntax. It's rather odd to have them only for lists. That would be both more general and more elegant than just bringing back monad comprehensions.
Is there any obvious reason why this wouldn't work?
"it will make error messages harder to understand for novices", "it will make execution slower", "it will make programs more buggy" - standard list of arguments against making anything in Haskell more polymorphic :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (4)
-
Bulat Ziganshin
-
Diego Navarro
-
Lennart Augustsson
-
Neil Mitchell