Re: [GHC] #851: Incomplete-pattern checking for n+k patterns is not implemented

2009-11-22 Thread GHC
#851: Incomplete-pattern checking for n+k patterns is not implemented
---+
  Reporter:  simonpj   |  Owner:  
  Type:  bug   | Status:  closed  
  Priority:  low   |  Milestone:  _|_ 
 Component:  Compiler  |Version:  6.4.2   
Resolution:  wontfix   |   Keywords:  warnings
Difficulty:  Unknown   | Os:  Unknown/Multiple
  Testcase:  ds061 |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |  
---+
Changes (by igloo):

  * status:  new => closed
  * failure:  => None/Unknown
  * resolution:  => wontfix

Comment:

 The !NoNPlusKPatterns proposal was accepted for H'2010, so I don't think
 it is worth spending time on this.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/851#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3382: Panic in tidyNPat when using N+k patterns with overloaded strings

2009-07-21 Thread GHC
#3382: Panic in tidyNPat when using N+k patterns with overloaded strings
-+--
Reporter:  batterseapower|Owner:  
Type:  bug   |   Status:  closed  
Priority:  normal|Milestone:  
   Component:  Compiler  |  Version:  6.10.4  
Severity:  normal|   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:  deSugar/should_run/T3382  |   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by simonpj):

  * testcase:  => deSugar/should_run/T3382
  * difficulty:  => Unknown
  * status:  new => closed
  * resolution:  => fixed

Comment:

 Ah yes, excellent point.  Fixed by
 {{{
 Mon Jul 20 07:12:26 GMT Daylight Time 2009  simo...@microsoft.com
   * Fix Trac #3382: desugaring of NPats

   Max spotted that the short-cut rules for desugaring NPats (where
   we compare against a literal) were wrong now that we have overloaded
   strings.
 }}}
 thanks

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3382#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3382: Panic in tidyNPat when using N+k patterns with overloaded strings

2009-07-18 Thread GHC
#3382: Panic in tidyNPat when using N+k patterns with overloaded strings
-+--
Reporter:  batterseapower|  Owner:  
Type:  bug   | Status:  new 
Priority:  normal|  Component:  Compiler
 Version:  6.10.4|   Severity:  normal  
Keywords:|   Testcase:  
  Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-+--
 Spotted this while reading the source code to tidyNPat. It looked dubious
 to me, and indeed it is:

 {{{
 {-# OPTIONS_GHC -XOverloadedStrings #-}
 module Main where

 import Data.String

 instance IsString Int where
 fromString x = 1337

 f :: Int -> String
 f "hello" = "correct"
 f _   = "false"

 main = do
 print $ f 1337
 print $ f 1338
 }}}

 Result:

 {{{
 mbolingbr...@mb566 ~/Programming/Checkouts
 $ ghc --make Boog.hs
 [1 of 1] Compiling Main ( Boog.hs, Boog.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 6.10.3 for i386-apple-darwin):
 tidyNPat
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3382>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #851: Incomplete-pattern checking for n+k patterns is not implemented

2006-10-21 Thread GHC
#851: Incomplete-pattern checking for n+k patterns is not implemented
--+-
 Reporter:  simonpj   |  Owner: 
 Type:  bug   | Status:  new
 Priority:  low   |  Milestone:  _|_
Component:  Compiler  |Version:  6.4.2  
 Severity:  normal| Resolution: 
 Keywords:  warnings  | Difficulty:  Unknown
 Testcase:  ds061 |   Architecture:  Unknown
   Os:  Unknown   |  
--+-
Changes (by igloo):

  * keywords:  => warnings
  * testcase:  => ds061

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/851>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #851: Incomplete-pattern checking for n+k patterns is not implemented

2006-09-28 Thread GHC
#851: Incomplete-pattern checking for n+k patterns is not implemented
---+
  Reporter:  simonpj   |  Owner: 
  Type:  bug   | Status:  new
  Priority:  low   |  Milestone:  _|_
 Component:  Compiler  |Version:  6.4.2  
  Severity:  normal| Resolution: 
  Keywords:| Os:  Unknown
Difficulty:  Unknown   |   Architecture:  Unknown
---+
Changes (by simonpj):

  * milestone:  => _|_
  * priority:  normal => low

Comment:

 See Task #595

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/851>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #851: Incomplete-pattern checking for n+k patterns is not implemented

2006-08-08 Thread GHC
#851: Incomplete-pattern checking for n+k patterns is not implemented
-+--
Reporter:  simonpj   |Owner: 
Type:  bug   |   Status:  new
Priority:  normal|Milestone: 
   Component:  Compiler  |  Version:  6.4.2  
Severity:  normal| Keywords: 
  Os:  Unknown   |   Difficulty:  Unknown
Architecture:  Unknown   |  
-+--
The check for incomplete patterns does not understand about n+k patterns.
 Here's an example:
 {{{
 f 0 = True
 f (n+1) = False
 }}}
 GHC says, rather confusingly:
 {{{
 Warning: Pattern match(es) are non-exhaustive
  In the definition of `f':
  Patterns not matched: #x with #x `notElem` [0#]
 }}}
 The reason is in {{{compiler/deSugar/Check.hs}}} which says
 {{{
 -- Horrible hack.  The simplify_pat stuff converts NPlusK pats to
 WildPats
 -- which of course loses the info that they can fail to match.  So
 we
 -- stick in a CanFail as if it were a guard.
 -- The Right Thing to do is for the whole system to treat NPlusK
 pats properly
 }}}
 See ticket:595

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/851>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


RE: Erroneous warning with n+k patterns

2005-08-22 Thread Simon Peyton-Jones
OK, well I've fixed this one.  But not overlap warnings in general

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-bugs-
| [EMAIL PROTECTED] On Behalf Of Ian Lynagh
| Sent: 20 August 2005 02:39
| To: glasgow-haskell-bugs@haskell.org
| Subject: Erroneous warning with n+k patterns
| 
| 
| Hi all,
| 
| This function:
| 
| g :: Int -> Int
| g (x+1) = 1
| g _ = 0
| 
| (erroneously) gives this warning:
| 
| Warning: Pattern match(es) are overlapped
|  In the definition of `g': g _ = ...
| 
| I'm not sure if this is covered by the first item on
| http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html
| but if so (well, probably even if not; I've grown quite attached to
| -Wall -Werror) then I'd like to add my voice to those who would like
to
| see the mentioned overhaul done.
| 
| 
| Thanks
| Ian
| 
| ___
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Erroneous warning with n+k patterns

2005-08-19 Thread Ian Lynagh

Hi all,

This function:

g :: Int -> Int
g (x+1) = 1
g _ = 0

(erroneously) gives this warning:

Warning: Pattern match(es) are overlapped
 In the definition of `g': g _ = ...

I'm not sure if this is covered by the first item on
http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html
but if so (well, probably even if not; I've grown quite attached to
-Wall -Werror) then I'd like to add my voice to those who would like to
see the mentioned overhaul done.


Thanks
Ian

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


RE: n + k patterns

2003-05-29 Thread Simon Peyton-Jones
Good point.  Fixed in the head, but not in 6.0

Thanks

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
| Behalf Of Ralf Hinze
| Sent: 28 May 2003 20:40
| To: GHC bugs
| Subject: n + k patterns
| 
| GHCi infers for
| 
| > fac 0 =  1
| > fac (n + 1)   =  (n + 1) * fac n
| 
| the following type
| 
|   / _ \ /\  /\/ __(_)
|  / /_\// /_/ / /  | |  GHC Interactive, version 5.04.2, for
Haskell 98.
| / /_\\/ __  / /___| |  http://www.haskell.org/ghc/
| \/\/ /_/\/|_|  Type :? for help.
| 
| Loading package base ... linking ... done.
| Loading package haskell98 ... linking ... done.
| Compiling Main ( Fac.lhs, interpreted )
| Ok, modules loaded: Main.
| *Main> :t fac
| forall a. (Num a, Ord a) => a -> a
| 
| The Report, however, states that
| 
|   3.17.2  Informal Semantics of Pattern Matching
|   <...>
|   An n+k pattern can only be matched against a value in the class
Integral.
| 
| Cheers, Ralf
| 
| ___
| Glasgow-haskell-bugs mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


n + k patterns

2003-05-29 Thread Ralf Hinze
GHCi infers for

> fac 0 =  1
> fac (n + 1)   =  (n + 1) * fac n

the following type

  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 5.04.2, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.
Loading package haskell98 ... linking ... done.
Compiling Main ( Fac.lhs, interpreted )
Ok, modules loaded: Main.
*Main> :t fac
forall a. (Num a, Ord a) => a -> a

The Report, however, states that

3.17.2  Informal Semantics of Pattern Matching
<...>
An n+k pattern can only be matched against a value in the class Integral. 

Cheers, Ralf

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs