This commit is contained in:
Yann Esposito (Yogsototh) 2019-12-16 15:27:31 +01:00
parent e7015adbb0
commit c9965904a0
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -215,9 +215,7 @@ If you chose Stack: https://haskellstack.org
:CUSTOM_ID: code :CUSTOM_ID: code
:END: :END:
#+begin_src elisp :eval yes
#+name nixb
#+begin_src elisp :export none
(defun nixb () (defun nixb ()
"#! /usr/bin/env nix-shell\n#! nix-shell -i runghc\n#! nix-shell -p \"ghc.withPackages (ps: [ ps.protolude ])\"\n#! nix-shell -I nixpkgs=\"https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz\"") "#! /usr/bin/env nix-shell\n#! nix-shell -i runghc\n#! nix-shell -p \"ghc.withPackages (ps: [ ps.protolude ])\"\n#! nix-shell -I nixpkgs=\"https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz\"")
#+end_src #+end_src
@ -225,6 +223,8 @@ If you chose Stack: https://haskellstack.org
#+RESULTS: #+RESULTS:
: nixb : nixb
#+MACRO: lnk @@html:<a href="$1" target="_blank">$1 ⤓</a>@@
** Don't be afraid ** Don't be afraid
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: don't-be-afraid :CUSTOM_ID: don't-be-afraid
@ -239,9 +239,8 @@ At first I won't show you any Haskell super power. I will start with
similarities between Haskell and other programming languages. Let's jump similarities between Haskell and other programming languages. Let's jump
to the mandatory "Hello World". to the mandatory "Hello World".
[[./hello.hs]] {{{lnk(hello.hs)}}}
#+NAME: hello.hs #+BEGIN_SRC haskell :tangle hello.hs :shebang '(nixb)
#+BEGIN_SRC haskell :tangle hello.hs :shebang (nixb)
main = putStrLn "Hello World!" main = putStrLn "Hello World!"
#+END_SRC #+END_SRC
@ -261,7 +260,7 @@ Now, a program asking your name and replying "Hello" using the name you
entered: entered:
#+NAME: name.hs #+NAME: name.hs
#+BEGIN_SRC haskell :tangle name.hs :shebang (nixb) #+BEGIN_SRC haskell :tangle name.hs :shebang '(nixb)
main = do main = do
print "What is your name?" print "What is your name?"
name <- getLine name <- getLine