This is about syntax of Haskell.
I am reading the source code of Yampa. I find that a definition like the following data SF' a b where SFArr :: !(DTime > a > Transition a b) > !(FunDesc a b) > SF' a b in Yampa.hs.  next part  An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20140606/ad03af0c/attachment.html> 
That declares those fields to be strict. See also
http://www.haskell.org/haskellwiki/Performance/Data_types On Friday, June 6, 2014, Song Zhang <vxanica at gmail.com> wrote: > This is about syntax of Haskell. > I am reading the source code of Yampa. I find that a definition like the > following > > data SF' a b where > SFArr :: !(DTime > a > Transition a b) > !(FunDesc a b) > SF' a b > > > in Yampa.hs. > An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20140606/89745e72/attachment.html> 
I?m just curious, but is there any practical guide or tutorial on this topic? I found it relatively hard to reason about the time complexity of Haskell programs.
? Xiaojun "Phil (http://cnphil.com/)" Hu On Friday, 6 June, 2014 at 21:05, Bob Ippolito wrote: > That declares those fields to be strict. See also http://www.haskell.org/haskellwiki/Performance/Data_types > > On Friday, June 6, 2014, Song Zhang <vxanica at gmail.com (mailto:vxanica at gmail.com)> wrote: > > This is about syntax of Haskell. > > I am reading the source code of Yampa. I find that a definition like the following > > > > data SF' a b where > > SFArr :: !(DTime > a > Transition a b) > !(FunDesc a b) > SF' a b > > > > > > > > in Yampa.hs. > _______________________________________________ > Beginners mailing list > Beginners at haskell.org (mailto:Beginners at haskell.org) > http://www.haskell.org/mailman/listinfo/beginners > >  next part  An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20140607/21a537b3/attachment.html> 
Administrator

On Sat, Jun 7, 2014 at 11:14 AM, Xiaojun "Phil" Hu <phil at cnphil.com> wrote:
> I found it relatively hard to reason about the time complexity of Haskell > programs. Is that the question you really want to ask? If it is, the answer is trivial: if it's O(f(n)) time in other languages, it's also O(f(n)) time in Haskell. (Note: space is a different story.) But what typically people want to know is: why is my program so slow? You wonder about the constants covered up by BigOh. And so you're going to have to get acquainted with 0) lambda calculus 1) graph reduction, 2) the Gmachine, and 3) the spinelesstagless variant thereof. You're also going to have to learn to read Core and understand some of the higher order coretocore optimizations that GHC performs.  KimEe  next part  An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20140607/5c5ca9de/attachment.html> 
I really like the explanation of Haskell's nonstrict evaluation from
Parallel and Concurrent Programming in Haskell, reading this chapter will probably be sufficient and much easier than studying all of GHC's implementation details: http://chimera.labs.oreilly.com/books/1230000000929/ch02.html#sec_parevalwhnf On Fri, Jun 6, 2014 at 10:15 PM, KimEe Yeoh <ky3 at atamo.com> wrote: > > On Sat, Jun 7, 2014 at 11:14 AM, Xiaojun "Phil" Hu <phil at cnphil.com> > wrote: > >> I found it relatively hard to reason about the time complexity of Haskell >> programs. > > > Is that the question you really want to ask? > > If it is, the answer is trivial: if it's O(f(n)) time in other languages, > it's also O(f(n)) time in Haskell. (Note: space is a different story.) > > But what typically people want to know is: why is my program so slow? > > You wonder about the constants covered up by BigOh. > > And so you're going to have to get acquainted with > > 0) lambda calculus > 1) graph reduction, > 2) the Gmachine, and > 3) the spinelesstagless variant thereof. > > You're also going to have to learn to read Core and understand some of the > higher order coretocore optimizations that GHC performs. > > >  KimEe > > _______________________________________________ > Beginners mailing list > Beginners at haskell.org > http://www.haskell.org/mailman/listinfo/beginners > > An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20140606/7e9defa9/attachment.html> 
Free forum by Nabble  Edit this page 