Created
December 6, 2010 03:59
-
-
Save mikeobrien/729826 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Math | |
type IPhoton = | |
abstract EnergyByWavelength : float -> float -> float | |
abstract EnergyByFrequency : (float * float) -> float | |
// ----------------------------------^ Specifying tupled params | |
type Photon = | |
member x.h = 6.62606896e-34 | |
member x.c = 2.99792458e8 | |
interface IPhoton with | |
member x.EnergyByWavelength lambda multiplier = (x.h * x.c) / (lambda * multiplier) | |
member x.EnergyByFrequency (nu, multiplier) = x.h * (nu * multiplier) | |
// ------------------^ Error: This override takes a different number of arguments to the corresponding abstract member |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment