Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Do IO actions *have* to be glued by the do syntax? (Olumide) 2. Re: Need help groking the statement: expression1 in term:expression2 (Sumit Sahrawat, Maths & Computing, IIT (BHU)) 3. Re: Do IO actions *have* to be glued by the do syntax? (Martin Vlk) 4. Re: Do IO actions *have* to be glued by the do syntax? (Sumit Sahrawat, Maths & Computing, IIT (BHU)) 5. Re: Do IO actions *have* to be glued by the do syntax? (Olumide) 6. Re: Do IO actions *have* to be glued by the do syntax? (Sumit Sahrawat, Maths & Computing, IIT (BHU)) ---------------------------------------------------------------------- Message: 1 Date: Tue, 22 Mar 2016 11:36:53 +0000 From: Olumide <50...@web.de> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Do IO actions *have* to be glued by the do syntax? Message-ID: <56f12e55.2040...@web.de> Content-Type: text/plain; charset=windows-1252; format=flowed Quanyang, do bocks are *not* sugar, and please refer to Daniel's answer for an example of how to answer a beginner's question. - Olumide On 22/03/2016 11:06, Quanyang Liu wrote: > On Tue, Mar 22 2016 at 18:52:41 +0800, Olumide wrote: >> Hello List, >> >> Do IO actions *have* to be glued by the do syntax? Many, if not all, >> the examples that I've come across in LYH seem to suggest so. And if >> so, why? >> >> BTW, if possible I'd appreciate an explanation that does not resort to >> monads. I haven't studied them yet and I'm sure I'd struggle to >> understand any explanation that resorts to monads. >> > > I think you should google that first... do blocks are just sugar... > >> Thanks, >> >> - Olumide > ------------------------------ Message: 2 Date: Tue, 22 Mar 2016 17:08:10 +0530 From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)" <sumit.sahrawat.ap...@iitbhu.ac.in> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Need help groking the statement: expression1 in term:expression2 Message-ID: <cajbew8oe1sfmzymsp5oed2mv4x40dmcv1p4y4_vlcqkhtms...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On 22-Mar-2016 4:14 pm, "Olumide" <50...@web.de> wrote: > randoms' :: (RandomGen g, Random a) => g -> [a] > randoms' gen = let (value, newGen) = random gen in value:randoms' newGen "random gen" returns a pair, whose first element is a random value, and the second element is a new generator. The cons (:) operator takes two values, one is an element, and the other is a list. It returns a new list with the provided arguments as head and tail. Ultimately, randoms' gen returns a list whose first element is a random value, and the rest of the list is the result of calling randoms' on the newly produced generator. Recursively, it generates an infinite lazy list of random elements. Hope this helps :) Regards, Sumit -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160322/24c73eb6/attachment-0001.html> ------------------------------ Message: 3 Date: Tue, 22 Mar 2016 12:41:02 +0100 From: Martin Vlk <mar...@vlkk.cz> To: beginners@haskell.org Subject: Re: [Haskell-beginners] Do IO actions *have* to be glued by the do syntax? Message-ID: <1458646862.2849307.556282290.2ae66...@webmail.messagingengine.com> Content-Type: text/plain; charset="utf-8" Hi Olumide, Yes, do blocks are syntactic sugar. Yes you are right in that answers here should be .. a bit friendlier. But also in my opinion your last post is a bit.. arrogant sounding... M. Dne ?t, 22. b?ezen 2016 v 12:36 h u?ivatel Olumide napsal: > Quanyang, > > do bocks are *not* sugar, and please refer to Daniel's answer for an > example of how to answer a beginner's question. > > - Olumide > > On 22/03/2016 11:06, Quanyang Liu wrote: > > On Tue, Mar 22 2016 at 18:52:41 +0800, Olumide wrote: > >> Hello List, > >> > >> Do IO actions *have* to be glued by the do syntax? Many, if not all, > >> the examples that I've come across in LYH seem to suggest so. And if > >> so, why? > >> > >> BTW, if possible I'd appreciate an explanation that does not resort to > >> monads. I haven't studied them yet and I'm sure I'd struggle to > >> understand any explanation that resorts to monads. > >> > > > > I think you should google that first... do blocks are just sugar... > > > >> Thanks, > >> > >> - Olumide > > > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ Message: 4 Date: Tue, 22 Mar 2016 17:16:40 +0530 From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)" <sumit.sahrawat.ap...@iitbhu.ac.in> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Do IO actions *have* to be glued by the do syntax? Message-ID: <cajbew8mcbebdfy+occq0wz1yu_mfbym2c8773rredxzb1rf...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Olumide, do blocks are indeed syntactic sugar. They are a piece of syntax that converts to a specific type of expressions, namely those using the bind (>>=) operator. It is really helpful, when learning to be able to come up with answers in your own. Learning Haskell has always involved combining many different perspectives on the same topic, told differently in different places. It would only help you if you took the time and dug further for answers. It's really satisfying too! Also, if you haven't, search for the Leavenworth guide. It takes this very question in one of the miscellaneous discussions. Be nice, be respectful. Have fun learning Haskell :) On 22-Mar-2016 5:07 pm, "Olumide" <50...@web.de> wrote: > Quanyang, > > do bocks are *not* sugar, and please refer to Daniel's answer for an > example of how to answer a beginner's question. > > - Olumide > > On 22/03/2016 11:06, Quanyang Liu wrote: > >> On Tue, Mar 22 2016 at 18:52:41 +0800, Olumide wrote: >> >>> Hello List, >>> >>> Do IO actions *have* to be glued by the do syntax? Many, if not all, >>> the examples that I've come across in LYH seem to suggest so. And if >>> so, why? >>> >>> BTW, if possible I'd appreciate an explanation that does not resort to >>> monads. I haven't studied them yet and I'm sure I'd struggle to >>> understand any explanation that resorts to monads. >>> >>> >> I think you should google that first... do blocks are just sugar... >> >> Thanks, >>> >>> - Olumide >>> >> >> > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160322/74e6fcb8/attachment-0001.html> ------------------------------ Message: 5 Date: Tue, 22 Mar 2016 11:46:00 +0000 From: Olumide <50...@web.de> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Do IO actions *have* to be glued by the do syntax? Message-ID: <56f13078.7080...@web.de> Content-Type: text/plain; charset=windows-1252; format=flowed Can I also add that this sort of elitist, unhelpful quip of a pseudo-answer is the reason that I've largely avoided asking Haskell beginner questions on stackoverflow. Haskell is a wonderful language with a steep learning curve and I believe that it is the intention of this group grow the user base of the language by create a place where beginners will not be afraid to ask questions. And hasty ill-thought, poorly worded answers like Quanyang's won't help the language get there sooner. - Olumide On 22/03/2016 11:36, Olumide wrote: > Quanyang, > > do bocks are *not* sugar, and please refer to Daniel's answer for an > example of how to answer a beginner's question. > > - Olumide > > On 22/03/2016 11:06, Quanyang Liu wrote: >> On Tue, Mar 22 2016 at 18:52:41 +0800, Olumide wrote: >>> Hello List, >>> >>> Do IO actions *have* to be glued by the do syntax? Many, if not all, >>> the examples that I've come across in LYH seem to suggest so. And if >>> so, why? >>> >>> BTW, if possible I'd appreciate an explanation that does not resort to >>> monads. I haven't studied them yet and I'm sure I'd struggle to >>> understand any explanation that resorts to monads. >>> >> >> I think you should google that first... do blocks are just sugar... >> >>> Thanks, >>> >>> - Olumide >> > ------------------------------ Message: 6 Date: Tue, 22 Mar 2016 17:17:43 +0530 From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)" <sumit.sahrawat.ap...@iitbhu.ac.in> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Do IO actions *have* to be glued by the do syntax? Message-ID: <cajbew8psgq1svyznd-+agkzddcyudcprdc210z7ferry67h...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Sorry, autocorrect changed learnhaskell to something else. On 22-Mar-2016 5:16 pm, "Sumit Sahrawat, Maths & Computing, IIT (BHU)" < sumit.sahrawat.ap...@iitbhu.ac.in> wrote: > Olumide, do blocks are indeed syntactic sugar. They are a piece of syntax > that converts to a specific type of expressions, namely those using the > bind (>>=) operator. > > It is really helpful, when learning to be able to come up with answers in > your own. Learning Haskell has always involved combining many different > perspectives on the same topic, told differently in different places. It > would only help you if you took the time and dug further for answers. It's > really satisfying too! > > Also, if you haven't, search for the Leavenworth guide. It takes this very > question in one of the miscellaneous discussions. > > Be nice, be respectful. Have fun learning Haskell :) > On 22-Mar-2016 5:07 pm, "Olumide" <50...@web.de> wrote: > >> Quanyang, >> >> do bocks are *not* sugar, and please refer to Daniel's answer for an >> example of how to answer a beginner's question. >> >> - Olumide >> >> On 22/03/2016 11:06, Quanyang Liu wrote: >> >>> On Tue, Mar 22 2016 at 18:52:41 +0800, Olumide wrote: >>> >>>> Hello List, >>>> >>>> Do IO actions *have* to be glued by the do syntax? Many, if not all, >>>> the examples that I've come across in LYH seem to suggest so. And if >>>> so, why? >>>> >>>> BTW, if possible I'd appreciate an explanation that does not resort to >>>> monads. I haven't studied them yet and I'm sure I'd struggle to >>>> understand any explanation that resorts to monads. >>>> >>>> >>> I think you should google that first... do blocks are just sugar... >>> >>> Thanks, >>>> >>>> - Olumide >>>> >>> >>> >> _______________________________________________ >> Beginners mailing list >> Beginners@haskell.org >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160322/1ef24d39/attachment.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 93, Issue 16 *****************************************