apachejspωiki
  • G’day (anonymous guest)
  • User Preferences Log in
  • Recent Searches
ReReStartingHaskell
Your trail: 
  • ☰
  • ReReStartingHaskell
  • Attach
  • Edit
  • More...
    • View Page Source
    • Show Reader View
    • Recent Changes
      Page Index
      SystemInfo

      UnusedPages
      UndefinedPages

This page (revision-8) was last changed on 12-Nov-2017 17:04 by john  

This page was created on 11-Nov-2017 15:20 by unknown

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

History

Version Date Modified Size Author Changes ... Change note
8 12-Nov-2017 17:04 1 KB john to previous
7 12-Nov-2017 17:04 1 KB john to previous | to last
6 11-Nov-2017 21:09 1 KB john to previous | to last
5 11-Nov-2017 20:57 1 KB john to previous | to last
4 11-Nov-2017 20:53 1 KB john to previous | to last
3 11-Nov-2017 19:54 952 bytes john to previous | to last
2 11-Nov-2017 16:36 687 bytes john to previous | to last
1 11-Nov-2017 15:20 171 bytes unknown to last

Page References

Incoming links Outgoing links
ReReStartingHaskell
  • Haskell
ReReStartingHaskell
  • 2015-09-27-writing-a-simple-haskell-script-from-scratch

Difference

Difference between version and

At line 1 changed one line
11-Nov-2017
11 Nov 2017: Re-re-starting my adventures in Haskell, for no particularly good reason.
At line 3 removed 2 lines
Re-re-starting my adventures in Haskell, for no particularly good reason.
At line 5 added one line
GitHub repo is here: [https://github.com/JohnL4/ProjectEuler]
At line 7 added 27 lines
...aaaaand, now I have a blank editor in front of me. Now what?
!!! Output
{{putStr}} and {{putStrLn}} for printing to stdout. __NOTE:__ This only prints ''strings''. Use {{print}} as a more general-purpose output.
See this page: [2015-09-27-writing-a-simple-haskell-script-from-scratch]
So... the first problem is adding {{ghc}} to your path in emacs (if you use that editor).
!!! Stack
Actually, a better choice is to install {{stack}}, which manages the entire toolchain for you, kind of like {{npm}} does for Node.
See [https://docs.haskellstack.org/en/stable/install_and_upgrade/], and [http://haskell.github.io/haskell-mode/manual/latest/Compilation.html]. After that, you should be off to the races.
!!! Done
Ok, yay, me. I wrote a Haskell program in an afternoon, after a long break of not writing Haskell. I'm getting better at this!
(See [https://github.com/JohnL4/ProjectEuler/blob/master/Haskell/Problem001/app/Main.hs].)
...Aaaand, oh, darn, there are a couple of really elegant and obvious Haskell one-liners that do the same thing as my program. Dang it!
Oh well, at least I brushed up on my Haskell skillz. Sort of.
Actually, they're just shorter and maybe more obvious. They may not be more elegant because they start with a full list of integers in range [[1..999] and then eliminate invalid values.
This page (revision-8) was last changed on 12-Nov-2017 17:04 by john   Top

About
Help
SysInfo

(page = LeftMenu)

Admin

(page = LeftMenuFooter)

JSPWiki v2.10.2  
JSPWiki v2.10.2