#haskell - Sun 25 Mar 2007 between 00:27 and 00:36

NY Lost Funds



dmeadbut not so dumbed down
jcreighit's seems silly that map isn't (Functor f) => (a -> b) -> f a -> f b; what's the point of a rich type system if you don't use it?
s/^it's/it/
dmeadmmmm
isn't map just for lists?
jcreighdmwit: no!
dmwit: I mean, yes, the map in prelude is.
dmeadah
Data.Map is different?
nmessengerjcreigh is speaking of Functor's fmap
jcreighdmwit: Data.Map is "Map" (ie, associative array)
yeah, basically, I don't see why map shouldn't be fmap to begin with
nmessenger@type Data.Map.map -- unrelated
lambdabotforall a b k. (a -> b) -> Data.Map.Map k a -> Data.Map.Map k b
nmessengerwait, no, that's fmap isn't it? :)
jcreigh(I know H98 thought polymorphism was confusing; I think arbitrary warts are confusing.)
sorear@remember jcreigh it seems silly that map isn't (Functor f) => (a -> b) -> f a -> f b; what's the point of a rich type system if you don't use it?
lambdabotDone.
nmessengerjcreigh: perhaps there should be a BeginnersPrelude with more monomorphism that newbies start out with?
sorear@google Stefan O'Rear video game
lambdabothttp://www.amazon.com/tag/computer%20reference
sorearwtf?
nmessengerlambdabot: what?
dmeadnmessenger: it's called hugs maybe?
nmessengerand really, the case of map/fmap is just naming. Not that bad
jcreighnmessenger: maybe. I don't know what the best solution would be. I think Haskell tutorials/books aimed at newbies could hand-wave. ie, "map has type (a -> b) -> [a] -> [b]", with a footnote to the effect that it's more general than that, but don't worry your pretty little head about that just yet.
sorear@google Stefan O'Rear videogame industry
lambdabothttp://www.nabble.com/Where-prelude-alternatives--classes-and-types-to-get-values--t3245170.html
Title: Nabble - Where prelude alternatives/ classes and types to get values?
nmessengermap f (newbieMeantItToBeAList :: NotAList) -- what?!! What the hell does "NotAList not an instance of Functor mean?!!?!"
dmead?src map
lambdabotmap _ [] = []
map f (x:xs) = f x : map f xs
dmeadlooks like a list to me =/
jcreighnmessenger: it confused me at first. for a while, I thought fmap was somehow different than map. It took me some time to realize that they were the same.
Saizani think newbie should learn polymorphism and typeclasses from the very start.
jcreighdmwit: he means of "map" really was fmap
s/of/if/
nmessengerdmead: my comment was in the context of a polymorphic map
dmead?src fmap

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 94 101 108 

IrcArchive

NY Lost Funds