Pattern matching, implict par. question

Simon Peyton-Jones simonpj@microsoft.com
Fri, 14 Feb 2003 10:45:56 -0000


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=20

ctPar :: (?ctPar::CTPar) =3D> CTPar
ctPar =3D ?ctPar

(us,n,j) =3D ctPar

That should work

Simon

| -----Original Message-----
| From: Jorge Adriano [mailto:jadrian@mat.uc.pt]
| Sent: 13 February 2003 14:36
| To: Haskell Cafe; glasgow-haskell-users@haskell.org
| Subject: Pattern matching, implict par. question
|=20
| Hello, When trying
|=20
| type CTPar =3D ([Double],Int,Int)
| ctPar          ::(?ctPar::CTPar)=3D>CTPar
| ctPar@(us,n,j) =3D ?ctPar
|=20
| 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."
|=20
| Should the monomorphis restriction really apply here?
| The values of us,j,n do depend on the context, but not their types
(right?).
|=20
| J.A.
|=20
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users