Skip to content

Instantly share code, notes, and snippets.

@mikeobrien
Created December 6, 2010 03:59
Show Gist options
  • Save mikeobrien/729826 to your computer and use it in GitHub Desktop.
Save mikeobrien/729826 to your computer and use it in GitHub Desktop.
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