Created
August 20, 2018 15:12
-
-
Save last-g/cfddab60a8520eb51214ef2a7bc48ec2 to your computer and use it in GitHub Desktop.
This file contains 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
module Main where | |
import Prelude | |
import System.Environment | |
fibb_slow :: Integer -> Integer | |
fibb_slow 1 = 1 | |
fibb_slow 2 = 1 | |
fibb_slow x = fibb_slow (x-1) + fibb_slow (x-2) | |
main :: IO () | |
main = do | |
args <- getArgs | |
if length args < 1 | |
then | |
putStrLn "Usage fibb_hs <number>" | |
else do | |
let num = read $ head args :: Integer | |
-- putStrLn $ show __GLASGOW_HASKELL__ | |
putStrLn $ "Haskell says: " ++ show (fibb_slow num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment