Skip to content

Instantly share code, notes, and snippets.

@bolerap
Created November 20, 2016 01:54
Show Gist options
  • Save bolerap/75c8695b03afea2a2961a431b2e602cd to your computer and use it in GitHub Desktop.
Save bolerap/75c8695b03afea2a2961a431b2e602cd to your computer and use it in GitHub Desktop.
-- Example module in haskell
-- Mr ABC, Sept 2016
--
-- Define a simple module
module Simple
where
-- calculates the arithmetic of two numbers
arithmetic :: Fractional a => a -> a -> a
arithmetic x y = (x + y) / 2
-- calculates the harmonic of two numbers
harmonic :: Fractional => a -> a -> a
harmonic x y = 2 * x * y / (x + y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment