Talk:The Other Prelude
From HaskellWiki
(Difference between revisions)
Nmessenger (Talk  contribs) (RE: flatMap) 
Uchchwhash (Talk  contribs) (reply to NMessenger) 

Line 16:  Line 16:  
* <hask>join</hask> is the same as more specific <hask>concat</hask> as far as I get it. The task it accomplishes is more accurately described by the English word "join" than pseudoEnglish "concat". I think there should be no "concat" at all. One of the principle goals of this project is reducing the API.  * <hask>join</hask> is the same as more specific <hask>concat</hask> as far as I get it. The task it accomplishes is more accurately described by the English word "join" than pseudoEnglish "concat". I think there should be no "concat" at all. One of the principle goals of this project is reducing the API.  
* This is basically a question... (>>=) is equivalent to <hask>concatMap</hask> in the list monad. I am not exactly a fan of the name, the Scala community uses <hask>flatMap</hask> as far as I recall. Should we include the function <hask>flatMap</hask> in the monad? Has one advantage, sometimes it's intuitive. I reckon it's intuitive whenever (=<<) is.  * This is basically a question... (>>=) is equivalent to <hask>concatMap</hask> in the list monad. I am not exactly a fan of the name, the Scala community uses <hask>flatMap</hask> as far as I recall. Should we include the function <hask>flatMap</hask> in the monad? Has one advantage, sometimes it's intuitive. I reckon it's intuitive whenever (=<<) is.  
−  
[[User:UchchwhashPirated Dreams]] 12:38, 28 December 2006 (UTC)  [[User:UchchwhashPirated Dreams]] 12:38, 28 December 2006 (UTC)  
+  ** If we really want to go for consistency, then perhaps 'joinMap'? [[User:NmessengerNmessenger]] 00:05, 4 January 2007 (UTC)  
+  ::: <hask>joinMap</hask> is consistent in that is says what it does :) <hask>flatMap</hask> would have introduced it (<hask>join . map</hask>) as a bit more sophisticated ''concept'' (highlighting the map underneath the monadic container). Doesn't really matter. Thanks for pulling <hask>(>>)</hask> up. I am not aware of any caveats, though the experts may jump in and say "you see, this and that are the reasons we didn't do it ..." and ruin the day ;)  
+  [[User:UchchwhashPirated Dreams]] 11:02, 4 January 2007 (UTC) 
Revision as of 11:02, 4 January 2007
i have no idea what i'm talking about here, but shouldn't "Monad m" imply "Functor m" if we're already starting with a clean slate? Also, what should the solution to "head", etc be? Johannes Ahlmann 09:47, 21 December 2006 (UTC)
 "Monad m" should imply "Functor m". By your question about "head", do you mean the problem of it being undefined on ? BrettGiles 14:13, 21 December 2006 (UTC)[]
 ,headet cetera are projection functions. They can, in fact, be achieved by pattern matching, and are done that way often. It seems to me that at least the Prelude should be very mathematical and leave them out. YMMV. Butfstshould really implyMonad mif we want to be mathematical, and indeed we do. Pirated Dreams 22:33, 21 December 2006 (UTC)Functor m

 I'm not so sure whether you can just leave projections out of the prelude and it definitely wouldn't solve the underlying problem. Also I'd love to see some functions from MissingH (especially a sensible "split") in the prelude. Furthermore there's the question which functions from other libraries should be exported by Prelude (either, list functions, error/catch, fail, fmap, IO functions, mapM, maybe, read/reads, sequence, Numeric functions, ...). There definitely has to be some discussion about the necessity of including some of these. Johannes Ahlmann 12:34, 23 December 2006 (UTC)
1 Naming
Although the name of the page "The Other Prelude" does not seem to fit the Wiki standard (sentence case says: The other prelude), I left it as it appears to be a proper name when you read the content. BrettGiles 14:13, 21 December 2006 (UTC)
 Yes Brett, at least that was my intention. Pirated Dreams 22:33, 21 December 2006 (UTC)
2 Issues
I propose the following:
 The Functor hierarchy proposal should be adopted.
 There will be basic algebra modules in the Prelude hierarchy. Named, possibly, , if the numerical prelude people are happy with it. At this point I think the name, though clear, is very long.TheOtherPrelude.Algebra
 I propose operators to be preferred over alphanumeric names. seems way cooler than(++). YMMV. Vote here. About the precedence issue, I think proper usage of parentheses is enough for all practical purposes. Besides, (++) is associative.M.plus
 is the same as more specificjoinas far as I get it. The task it accomplishes is more accurately described by the English word "join" than pseudoEnglish "concat". I think there should be no "concat" at all. One of the principle goals of this project is reducing the API.concat
 This is basically a question... (>>=) is equivalent to in the list monad. I am not exactly a fan of the name, the Scala community usesconcatMapas far as I recall. Should we include the functionflatMapin the monad? Has one advantage, sometimes it's intuitive. I reckon it's intuitive whenever (=<<) is.flatMap
Pirated Dreams 12:38, 28 December 2006 (UTC)
 If we really want to go for consistency, then perhaps 'joinMap'? Nmessenger 00:05, 4 January 2007 (UTC)
 is consistent in that is says what it does :)joinMapwould have introduced it (flatMap) as a bit more sophisticated concept (highlighting the map underneath the monadic container). Doesn't really matter. Thanks for pullingjoin . mapup. I am not aware of any caveats, though the experts may jump in and say "you see, this and that are the reasons we didn't do it ..." and ruin the day ;)(>>)

Pirated Dreams 11:02, 4 January 2007 (UTC)