Add gitignore and a multiline function
This commit is contained in:
parent
92df99aa2b
commit
c4bda1886f
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@ -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.*
|
13
prax1/prax1.hs
Normal file → Executable file
13
prax1/prax1.hs
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env runghc
|
||||||
-- This is a comment
|
-- This is a comment
|
||||||
|
|
||||||
doubleMe x = x * 3
|
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
|
-- ' <- uptick is used as convetion to mark lightly modified function
|
||||||
doubleSmallNumber' x = (if x <= 100 then doubleMe x else x) + 1
|
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 ++ "!")
|
||||||
|
Loading…
Reference in New Issue
Block a user