Created
November 20, 2016 01:54
-
-
Save bolerap/75c8695b03afea2a2961a431b2e602cd 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
-- 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