RE: 'lub' and 'both' on strictness - what does it mean for products to have different arity?

2016-03-04 Thread Simon Peyton Jones
Well suppose data T a where T1 :: T (Int,Int,Int) T2 :: T (Int,Int) f :: T a -> a -> Int f a b = case a of T1 -> case b of { (x,y,z) -> x+y+z } _ -> 0 g :: T a -> a -> Int f a b = case a of T2 -> case b of { (x,y) -> x+y } _ -> 0 h :: T a -> a -> Int

RE: Specialized type hints

2016-03-04 Thread Simon Peyton Jones
indication that a more general type error improvement sweep would be welcome Absolutely yes. But it depends on someone saying “I want to do that”; and of course on how hard or easy it turns out to be. general UX improvements I would like to undertake. Great! Make Trac tickets proposing

Re: Specialized type hints

2016-03-04 Thread Christopher Allen
I was looking for an indication that a more general type error improvement sweep would be welcome. I could pinpoint a particular type error if you liked (such as the one that prompted this email), but there are general UX improvements I would like to undertake. On Fri, Mar 4, 2016 at 4:25 AM,

RE: Impredicative types in 8.0, again

2016-03-04 Thread Simon Peyton Jones
ImpredicativeTypes is indeed problematic. Perhaps you can add your example as another Trac ticket? It's not really going to get fixed until someone pays sustained attention to it. Alejandro (cc'd) is working on this. We are working on a paper for ICFP... wait a couple of weeks! Simon |

Re: 'lub' and 'both' on strictness - what does it mean for products to have different arity?

2016-03-04 Thread Ömer Sinan Ağacan
Simon, your GADT example clearly shows how lub sometimes needs to handle products with different arities, but the case with bothDmd is still confuses me. I think we need have a code like this: f x + g x Where f puts a S(SS) demand on x and g puts a S(SSS). This looks like a bug/type error to

Impredicative types in 8.0, again

2016-03-04 Thread Kosyrev Serge
Good day! I realise that ImpredicativeTypes is a problematic extension, but I have found something that looks like an outright bug -- no polymorphism involved: , | {-# LANGUAGE ImpredicativeTypes #-} | | module Foo where | | foo :: IO (Maybe Int) | foo = do | pure $ case undefined ::

RE: isRecursiveTyCon

2016-03-04 Thread Simon Peyton Jones
Identifying recursive types is an old and unsatisfactory part of GHC. The code in TcTyDecls was an early attempt and has not received much love since. Partly because it's not so clear exactly what it is trying to do! What precisely does it mean for a TyCon to be "recursive" and what guarantees

RE: Questions on 'proc point splitting' again

2016-03-04 Thread Simon Peyton Jones
Maybe you could just maintain a separate map "on the side" and push it through to the LLVM code gen? I hate the whole proc-point machinery. It's all caused by our inability to take the address of a local label. So to push a return address on the stack we have to make it a top-level

RE: Local bindings in the static form

2016-03-04 Thread Simon Peyton Jones
Facundo Yes, that makes perfect sense. Moreover, it is pretty much exactly what the tct_closed flag on `ATcId` does. The trick will be to guarantee that all those Ids do in fact end up being floated out. We could have a Skype chat about this, preferably after the March 16 ICFP deadline

RE: Specialized type hints

2016-03-04 Thread Simon Peyton Jones
Christopher Improving error message is an excellent goal, and one that I have spent more hours on than I care to tell you. If you have a particular one in mind, could you open a Trac ticket with a particular reproducible test case, the error message you get, and the error message you’d like

RE: Generalising the demand analysis to sum types

2016-03-04 Thread Simon Peyton Jones
| current thought is that you collect the usage demands on the fields of | the constructor for the alternative you're analysing (let's say it's | tag 1) and insert that into a USum where the usage demands on all the | other constructors (all the tags except 1) is UHead. I'm not sure you

Re: Questions on 'proc point splitting' again

2016-03-04 Thread David Spitzenberg
On 03/03/2016 11:32 AM, Ben Gamari wrote: >> Given a CmmGraph, is there a possibility to annotate information to a >> single node within this graph? I.e. I want to annotate to certain >> CmmCalls that they where introduced by 'proc point splitting'. I would >> like to slightly modifiy the