diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eee88b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +dist +dist-* +cabal-dev +*.o +*.hi +*.chi +*.chs.h +*.dyn_o +*.dyn_hi +.hpc +.hsenv +.cabal-sandbox/ +cabal.sandbox.config +*.prof +*.aux +*.hp +*.eventlog +.stack-work/ +cabal.project.local +.HTF/ +.ghc.environment.* diff --git a/prax1/prax1.hs b/prax1/prax1.hs old mode 100644 new mode 100755 index 16ed447..b2ee5f5 --- a/prax1/prax1.hs +++ b/prax1/prax1.hs @@ -1,3 +1,4 @@ +#!/usr/bin/env runghc -- This is a comment doubleMe x = x * 3 @@ -8,3 +9,15 @@ doubleSmallNumber x = if x <= 100 then doubleMe x else x -- ' <- uptick is used as convetion to mark lightly modified function doubleSmallNumber' x = (if x <= 100 then doubleMe x else x) + 1 + +-- compile: ghc -dynamic prax1.hs +-- flag -dynamic is needed under Arch Linux, can be leaved off on ther envs + +-- runghc prax1.hs +-- this also works ↑ + +-- entrypoint +main = do + putStrLn "Hello World" + name <- getLine + putStrLn ("Hello " ++ name ++ "!")