RE: -XStrict: Why some binders are not made strict?

2015-12-15 Thread Simon Peyton Jones
johan.tib...@gmail.com> | Cc: ghc-devs@haskell.org | Subject: Re: -XStrict: Why some binders are not made strict? | | Thanks Simon, this is an interesting and compelling interpretation. | But I'm wondering whether it is enough to specify the dynamic | semantics unambiguously. | | Two exampl

RE: -XStrict: Why some binders are not made strict?

2015-12-14 Thread Simon Peyton Jones
mplemented design (modulo | any bugs). The trouble is that the implemented design is not well described. | > > | > > Simon | > > | > > | -Original Message----- | > > | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Roman | > > | Cheplyaka | > > |

Re: -XStrict: Why some binders are not made strict?

2015-12-14 Thread Adam Sandberg Eriksson
ign is not well > > described. > > > > Simon > > > > | -Original Message- > > | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Roman > > | Cheplyaka > > | Sent: 11 December 2015 12:57 > > | To: Johan Tibe

Re: -XStrict: Why some binders are not made strict?

2015-12-14 Thread Johan Tibell
; I quite like this design. It's not clear to me that anything useful > is gained by forcing y and z in M3 before evaluating the body "...". > > > > > > > > > So Roman's design makes sense, but so does the implemented design > (modulo any bugs). The troub

Re: -XStrict: Why some binders are not made strict?

2015-12-11 Thread Johan Tibell
I believe Scala has optional lazy values, but you could also consider in strict languages if you do manual thunking. If we force strictness all the way down it's not really call-by-value either, because the caller doesn't know what to evaluate (I think). In addition, making pattern matching

Re: -XStrict: Why some binders are not made strict?

2015-12-11 Thread Roman Cheplyaka
On 12/11/2015 02:21 PM, Johan Tibell wrote: > If we force strictness all the way down it's not really call-by-value > either, because the caller doesn't know what to evaluate (I think). Not sure what you mean here. > In addition, making pattern matching strict in this way makes it hard to > mix

Re: -XStrict: Why some binders are not made strict?

2015-12-11 Thread Roman Cheplyaka
not well described. > > Simon > > | -Original Message- > | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Roman > | Cheplyaka > | Sent: 11 December 2015 12:57 > | To: Johan Tibell <johan.tib...@gmail.com> > | Cc: ghc-devs@haskell.org > |

RE: -XStrict: Why some binders are not made strict?

2015-12-11 Thread Simon Peyton Jones
ted design is not well described. Simon | -Original Message- | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Roman | Cheplyaka | Sent: 11 December 2015 12:57 | To: Johan Tibell <johan.tib...@gmail.com> | Cc: ghc-devs@haskell.org | Subject: Re: -XStrict: Why some bind

Re: -XStrict: Why some binders are not made strict?

2015-12-11 Thread Ömer Sinan Ağacan
I agree with Roman here. Probably another reason for making every binding strict is this: (sorry if this is mentioned) Suppose I imported `data D = D ...` from another library and I'm in -XStrict. In this code: case ... of D b1 b2 ... -> I should be able to assume that b1, b2 ...

RE: -XStrict: Why some binders are not made strict?

2015-12-11 Thread Simon Peyton Jones
[mailto:ghc-devs-boun...@haskell.org] On Behalf Of Johan Tibell Sent: 11 December 2015 12:22 To: Roman Cheplyaka <r...@ro-che.info> Cc: ghc-devs@haskell.org Subject: Re: -XStrict: Why some binders are not made strict? I believe Scala has optional lazy values, but you could also consider in

Re: -XStrict: Why some binders are not made strict?

2015-12-10 Thread Roman Cheplyaka
On 12/10/2015 04:34 PM, Johan Tibell wrote: > I'm snowed under but I promise I will try to reply soon! To think about > in the mean time: what do existing strict languages with pattern > matching do? Well, strict languages do not have lazy data to force to begin with, do they? Personally, I find

Re: -XStrict: Why some binders are not made strict?

2015-12-10 Thread Adam Sandberg Eriksson
doesn't say one way or the other. >> >> What's the answer?  And could the user manual please say? >> >> Thanks >> >> Simon >> >> | -Original Message- >> | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Ömer &

RE: -XStrict: Why some binders are not made strict?

2015-12-08 Thread Simon Peyton Jones
...@haskell.org] On Behalf Of Ömer | Sinan Agacan | Sent: 08 December 2015 01:41 | To: ghc-devs <ghc-devs@haskell.org> | Subject: -XStrict: Why some binders are not made strict? | | Let's say I have this code: | | zip :: [a] -> [b] -> [(a, b)] | zip [] [] = [] | zip (x : xs) (y :

-XStrict: Why some binders are not made strict?

2015-12-07 Thread Ömer Sinan Ağacan
Let's say I have this code: zip :: [a] -> [b] -> [(a, b)] zip [] [] = [] zip (x : xs) (y : ys) = (x, y) : zip xs ys With -XStrict 'x', 'xs', 'y' and 'ys' don't become strict. I'm wondering about the motivation behind this, I found this interesting. I always thought -XStrict gives me

Re: -XStrict: Why some binders are not made strict?

2015-12-07 Thread Ömer Sinan Ağacan
> Aren't those already guaranteed to be strict because of pattern matching? Try > it again with irrefutable patterns. But pattern matching only forces the evaluation up to the pattern that is matched. We need another pattern matching(or seq etc.) on x, y, xs and ys here. If you look at the

Re: -XStrict: Why some binders are not made strict?

2015-12-07 Thread Brandon Allbery
On Mon, Dec 7, 2015 at 8:40 PM, Ömer Sinan Ağacan wrote: > With -XStrict 'x', 'xs', 'y' and 'ys' don't become strict. I'm wondering > about > the motivation behind this, I found this interesting. I always thought > -XStrict > gives me this guarantee: If I'm using an