Unknown option -XPatternSig used in warning

2007-09-19 Thread Bas van Dijk
Hello,

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.7.20070915


When loading the following incorrect program in ghci:

foo (x :: a) = x

ghci rightly complains:

Illegal signature in pattern: a
Use -XPatternSigs to permit it

OK so I follow the advice and load:

{-# OPTIONS_GHC -XPatternSigs #-}

foo (x :: a) = x

Now ghci complains:

unknown flags in  {-# OPTIONS #-} pragma: -XPatternSigs ???

The following works though:

{-# OPTIONS_GHC -fglasgow-exts #-}

foo (x :: a) = x

results in:

 A pattern type signature cannot bind scoped type variables `a'
  unless the pattern has a rigid type context
In the pattern: x :: a
In the definition of `foo': foo (x :: a) = x

Which I expect.

Should I file a bug report, or is there an easy fix?

regards,

Bas van Dijk
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: Unknown option -XPatternSig used in warning

2007-09-19 Thread Simon Peyton-Jones
I believe this is a known problem with OPTIONS_GHC, and will work on the 
command line.  I think Ian is working on it.  Ian?

Simon

| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
| Behalf Of Bas van Dijk
| Sent: 19 September 2007 13:20
| To: glasgow-haskell-users@haskell.org
| Subject: Unknown option -XPatternSig used in warning
|
| Hello,
|
| $ ghc --version
| The Glorious Glasgow Haskell Compilation System, version 6.7.20070915
|
|
| When loading the following incorrect program in ghci:
|
| foo (x :: a) = x
|
| ghci rightly complains:
|
| Illegal signature in pattern: a
| Use -XPatternSigs to permit it
|
| OK so I follow the advice and load:
|
| {-# OPTIONS_GHC -XPatternSigs #-}
|
| foo (x :: a) = x
|
| Now ghci complains:
|
| unknown flags in  {-# OPTIONS #-} pragma: -XPatternSigs ???
|
| The following works though:
|
| {-# OPTIONS_GHC -fglasgow-exts #-}
|
| foo (x :: a) = x
|
| results in:
|
|  A pattern type signature cannot bind scoped type variables `a'
|   unless the pattern has a rigid type context
| In the pattern: x :: a
| In the definition of `foo': foo (x :: a) = x
|
| Which I expect.
|
| Should I file a bug report, or is there an easy fix?
|
| regards,
|
| Bas van Dijk
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Unknown option -XPatternSig used in warning

2007-09-19 Thread Bas van Dijk
On 9/19/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
 I believe this is a known problem with OPTIONS_GHC, and will work on the 
 command line.  I think Ian is working on it.  Ian?

Via the command line I get the same problem:

 $ ghci -XPatternSigs PatternSig.hs
GHCi, version 6.7.20070915: http://www.haskell.org/ghc/  :? for help
ghc-6.7.20070915: unrecognised flags: -XPatternSigs
Usage: For basic information, try the `--help' option.

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


Re: Unknown option -XPatternSig used in warning

2007-09-19 Thread kahl
  
  | Illegal signature in pattern: a
  | Use -XPatternSigs to permit it
  |

I am very happy to see
that it doesn't recommend -fglasgow-exts anymore!

However, I still would prefer

  Use LANGUAGE pragma with extension ``PatternSigs'' to permit it

since it points out even more things that many may not have known before...


By the way, some of my LANGUAGE pragmas are getting quite long,
and last time I tried I was not allowed to have a line break in there.

Are there any plans to allow line breaks,
or multiple LANGUAGE pragmas?



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


Re: Unknown option -XPatternSig used in warning

2007-09-19 Thread Claus Reinke

Via the command line I get the same problem:

$ ghci -XPatternSigs PatternSig.hs
GHCi, version 6.7.20070915: http://www.haskell.org/ghc/  :? for help
ghc-6.7.20070915: unrecognised flags: -XPatternSigs
Usage: For basic information, try the `--help' option.


   $ /cygdrive/c/fptools/ghc/compiler/stage2/ghc-inplace --supported-languages 
| grep Pat
   PatternGuards
   PatternSignatures
   BangPatterns
   MonoPatBinds

could it be that the error message is incorrect, pointing
to an abbreviated form?


  Illegal signature in pattern: a
   Use -XPatternSigs to permit it


claus


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


Re: Unknown option -XPatternSig used in warning

2007-09-19 Thread Bas van Dijk
On 9/19/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
 ...I'll push a fix.

Thanks! It works now:


 $ ghci -XPatternSignatures PatternSig.hs
GHCi, version 6.9.20070919: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( PatternSig.hs, interpreted )

PatternSig.hs:2:10: Not in scope: type variable `a'
Failed, modules loaded: none.


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


Re: Unknown option -XPatternSig used in warning

2007-09-19 Thread Bas van Dijk
On 9/19/07, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
 You should use {-# LANGUAGE PatternSigs #-}

That should be: {-# LANGUAGE PatternSignatures #-}

It would indeed be better if GHC could print Use LANGUAGE pragma with
extension... like Wolfram mentioned.

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


Re: Unknown option -XPatternSig used in warning

2007-09-19 Thread Ian Lynagh

Hi Wolfram,

On Wed, Sep 19, 2007 at 01:45:00PM -, [EMAIL PROTECTED] wrote:
 
 By the way, some of my LANGUAGE pragmas are getting quite long,
 and last time I tried I was not allowed to have a line break in there.

What version of GHC are you using? This works in 6.6:

{-# LANGUAGE MultiParamTypeClasses,
 OverlappingInstances #-}

module Q where

class Foo a b where
foo :: a - b

instance Foo Int Bool
instance Foo Int a

x :: Int - Bool
x = foo

 Are there any plans to allow line breaks,
 or multiple LANGUAGE pragmas?

This also works:

{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverlappingInstances #-}

module Q where

class Foo a b where
foo :: a - b

instance Foo Int Bool
instance Foo Int a

x :: Int - Bool
x = foo


Thanks
Ian

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