RE: Pattern matching, implict par. question

2003-02-14 Thread Simon Peyton-Jones
Well the definition clearly falls under the monomorphism restriction as
laid down by the Report, because you haven't given a signature for
us,n,j.  I suggest 

ctPar :: (?ctPar::CTPar) = CTPar
ctPar = ?ctPar

(us,n,j) = ctPar

That should work

Simon

| -Original Message-
| From: Jorge Adriano [mailto:[EMAIL PROTECTED]]
| Sent: 13 February 2003 14:36
| To: Haskell Cafe; [EMAIL PROTECTED]
| Subject: Pattern matching, implict par. question
| 
| Hello, When trying
| 
| type CTPar = ([Double],Int,Int)
| ctPar  ::(?ctPar::CTPar)=CTPar
| ctPar@(us,n,j) = ?ctPar
| 
| I got this error message in ghci is:
| Illegal overloaded type signature(s)
| in a binding group for ctPar, us, n, j
| that falls under the monomorphism restriction
| When generalising the type(s) for ctPar, us, n, j
| Failed, modules loaded: CrossTypeOps.
| 
| Should the monomorphis restriction really apply here?
| The values of us,j,n do depend on the context, but not their types
(right?).
| 
| J.A.
| 
| 
| ___
| Glasgow-haskell-users mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Pattern matching, implict par. question

2003-02-13 Thread Jorge Adriano
Hello, When trying 

type CTPar = ([Double],Int,Int)
ctPar  ::(?ctPar::CTPar)=CTPar 
ctPar@(us,n,j) = ?ctPar

I got this error message in ghci is:
Illegal overloaded type signature(s)
in a binding group for ctPar, us, n, j
that falls under the monomorphism restriction
When generalising the type(s) for ctPar, us, n, j
Failed, modules loaded: CrossTypeOps.

Should the monomorphis restriction really apply here?
The values of us,j,n do depend on the context, but not their types (right?).

J.A.


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe