Floating instance and pi

Hi, I'd like to make my ADT an instance of the Floating class, but I'm not sure what to put for pi, and GHC gives a warning without it: Warning: No explicit method nor default method for `GHC.Float.pi' I tried setting it to undefined, but that gives an error: `pi' is not a (visible) method of class `Floating' Any idea? Paul

2009/5/29 Paul Keir
Hi,
I'd like to make my ADT an instance of the Floating class, but I'm not sure what to put for pi, and GHC gives a warning without it:
Warning: No explicit method nor default method for `GHC.Float.pi'
I tried setting it to undefined, but that gives an error:
`pi' is not a (visible) method of class `Floating'
Any idea?
Paul
Are you sure that your ADT fits into the Floating class in the first place? I reckon if it did, defining "pi" for it wouldn't be a problem. Could you show us the code you have? -- Deniz Dogan

Oops, I was hiding the Prelude's pi. My apologies.
-----Original Message-----
From: Deniz Dogan [mailto:deniz.a.m.dogan@gmail.com]
Sent: Fri 5/29/2009 5:01 PM
To: Paul Keir
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Floating instance and pi[MESSAGE NOT SCANNED]
2009/5/29 Paul Keir
Hi,
I'd like to make my ADT an instance of the Floating class, but I'm not sure what to put for pi, and GHC gives a warning without it:
Warning: No explicit method nor default method for `GHC.Float.pi'
I tried setting it to undefined, but that gives an error:
`pi' is not a (visible) method of class `Floating'
Any idea?
Paul
Are you sure that your ADT fits into the Floating class in the first place? I reckon if it did, defining "pi" for it wouldn't be a problem. Could you show us the code you have? -- Deniz Dogan
participants (2)
-
Deniz Dogan
-
Paul Keir