Re: GHC error message on type mismatch

2013-11-07 Thread Roman Cheplyaka
* Daniel Trstenjak [2013-11-08 05:54:49+0100] > Perhaps: > > Couldn't match type `A' with `B´ > Real type: B > Given type: A > > > Or instead of 'Given', like others have suggested: 'Provided' or 'Supplied'. So far in this thread I haven't seen any suggestions better than status quo.

Re: GHC error message on type mismatch

2013-11-07 Thread Dan Frumin
Hi everyone > On 07 Nov 2013, at 23:54, Daniel Trstenjak wrote: > > > Hi Simon, > >> On Thu, Nov 07, 2013 at 02:02:06PM +, Simon Peyton-Jones wrote: >> The motivation is this. Consider >> >>f True >> >> where f :: Int -> Char >> >> Then >> f *expects* an argument of type Int >>

Re: GHC error message on type mismatch

2013-11-07 Thread Carter Schonwald
i'm not sure how change the words to synonyms helps communicate the exact same thing better, :) That said, once you start digging into really really fancy types, you'll certainly discover examples where the error messages are confusing and need some care to better communicate what is indeed the er

Re: GHC error message on type mismatch

2013-11-07 Thread Daniel Trstenjak
Hi Simon, On Thu, Nov 07, 2013 at 02:02:06PM +, Simon Peyton-Jones wrote: > The motivation is this. Consider > > f True > > where f :: Int -> Char > > Then > f *expects* an argument of type Int > but the *actual* argument has type Bool > > Does that help? If you would switch t

Re: match_co: needs more cases

2013-11-07 Thread Evan Laforge
On Thu, Nov 7, 2013 at 4:20 PM, Carter Schonwald wrote: > specialize only fires on functions that have type class constraints / are > part of a type class. Furthermore, the function needs to be marked > INLINEABLE or INLINE for specialization to work (unless the specialize > pragma was written in

Re: match_co: needs more cases

2013-11-07 Thread Carter Schonwald
specialize only fires on functions that have type class constraints / are part of a type class. Furthermore, the function needs to be marked INLINEABLE or INLINE for specialization to work (unless the specialize pragma was written in the defining module) not sure if that helps, cheers -Carter

Re: match_co: needs more cases

2013-11-07 Thread Evan Laforge
On Thu, Nov 7, 2013 at 11:11 AM, crockeea wrote: > I got this error with a small example, so I thought I'd post it for you. I > could only get it to work when split over two files. Mine is similar, sorry I've been lazy about getting a small reproduction, I assumed it wasn't too important. I have

RE: match_co: needs more cases

2013-11-07 Thread crockeea
I got this error with a small example, so I thought I'd post it for you. I could only get it to work when split over two files. Main.hs: import qualified Data.Vector.Unboxed as U import Helper main = do let iters = 100 dim = 221184 y = U.replicate dim 0 :: U.Vector (ZqW M)

Re: GHC error message on type mismatch

2013-11-07 Thread David Fox
It *is* sometimes difficult to remember that my expectations and I are not part of this equation - it might be a better prompt to say something like type mismatch between function parameter and supplied value: function parameter type: A supplied value type: B On Thu, Nov 7, 2013 a

RE: GHC error message on type mismatch

2013-11-07 Thread Simon Peyton-Jones
The motivation is this. Consider f True where f :: Int -> Char Then f *expects* an argument of type Int but the *actual* argument has type Bool Does that help? Simon | -Original Message- | From: Glasgow-haskell-users [mailto:glasgow-haskell-users- | boun...@haskell.org] O

Re: GHC error message on type mismatch

2013-11-07 Thread David Luposchainsky
On 2013-11-07 12:52, Daniel Trstenjak wrote: > My problem is with 'Expected' and 'Actual', that I'm often unsure if > the compiler is "expecting" something or if I'm the expecting one > and the same goes for "actual". Funny you mention it; I think I just got too used to the fact that every time I

GHC error message on type mismatch

2013-11-07 Thread Daniel Trstenjak
Hello, I don't know if I'm the only one struggeling with this GHC error message on type mismatches or it's because I'm not a full time Haskeller, or because I'm not a native english speaker. Couldn't match type `A' with `B´ Expected type: B Actual type: A My problem is with 'Expected

Re: love for hpc?

2013-11-07 Thread Erik Hesselink
I use HPC. It's really powerful in combination with tests, to see how much of your code is covered. But I have also run into some of the problems you mention, mostly to do with tix files. Erik On Thu, Nov 7, 2013 at 6:03 AM, Evan Laforge wrote: > Is anyone out there using HPC? It seems like it

Re: love for hpc?

2013-11-07 Thread Johan Tibell
Aside: cabal supports hpc and puts the various files (e.g. .tix) in separate directories to avoid problems like these. On Thu, Nov 7, 2013 at 8:55 AM, Roman Cheplyaka wrote: > So Evan's prediction was accurate ;-) > > * Carter Schonwald [2013-11-07 00:29:24-0500] > > Evan, > > > > if you want