Dan Mead on 2 Feb 2010 11:40:44 -0800 |
jim: I just asked about let/where in #haskell. there was no consensus i'll appeal to a higher power, hold on. On Tue, Feb 2, 2010 at 11:15 AM, Jim <ludflu@gmail.com> wrote: > Hi Dan, > > Thanks for your talk last night. It was great to see some Haskell code doing > some realistic stuff like hitting the DB. (As opposed to the more abstract > Haskell example one generally encounters) Also the non-mystical approach to > monadic operations is refreshing. > > I've been thinking about a couple items: > > 1. Tail Call Optimization in Haskell > > I'm quite certain that it works fine. See dons' comment > > http://www.reddit.com/comments/6xnk5/ive_got_two_weeks_of_vacation_coming_up_should_i/c055b9w > > Where it gets confusing is that often, my first run at a haskell tail > recursive function lazily accumulates something against a very large list, > resulting in a stack overflow. But that's due to inappropriate laziness, not > lack of optimized tail recursion. Then I replace foldl with foldl' and > things work out fine- strictly accumulating a lazy list. > I think Mattias might have said something to this effect last night- "the > two issues are orthogonal". However, my head was spinning too much from all > the abstractions to process it. > > Re-reading the Real World Haskell section on "Strictness and Tail Recursion" > (pg 571 in the printed version) it does seem that the issues are conflated, > which is uncharacteristicaly confusing for this book. > > 2. Let vs. Where / Strict vs Lazy > > I can't find anything to support the idea that one is lazy and the other > strict. > http://www.haskell.org/haskellwiki/Let_vs._Where > > It seems like either one could be lazy or strict depending on how its coded. > > The major difference seems to the scope of the bindings: "let..in" is an > expression, but "where" applies to the preceding block- which doesn't have > to be an expression. > Its strange that I've been able to use both without clearly understanding > the difference... > > 3. I've found the "Hoogle" search engine very helpful. > > http://www.haskell.org/hoogle/ > > If you just enter a type signature, it finds all the matching functions. > > --Jim > > > > > On Mon, Feb 1, 2010 at 4:07 PM, Dan Mead <d.w.mead@gmail.com> wrote: >> >> Hey all >> >> My plan for tonight is to go over some slides about the language, walk >> through some example code and get >> people writing a bit of code. So bring your laptops! >> >> -Dan >> >> On Wed, Jan 27, 2010 at 3:28 PM, Hristo Asenov >> <hristo.s.asenov@gmail.com> wrote: >> > I will be able to be there as well. >> > >> > On Wed, Jan 27, 2010 at 2:19 PM, Nik Kolev <nkolev@gmail.com> wrote: >> >> >> >> i should be able to make it >> >> >> >> On Wed, Jan 27, 2010 at 10:53 AM, Aaron Feng <aaron.feng@gmail.com> >> >> wrote: >> >>> >> >>> Hi All, >> >>> >> >>> I'm thinking about scheduling the Haskell workshop on Feb 1st. What >> >>> do you guys think? I'll send out the RSVP again later >> >>> if people are cool with it. >> >>> >> >>> Thanks, >> >>> >> >>> Aaron >> >> >> > >> > > > > > -- > --Jim >
|
|