![]() |
|
[Tutorial] Haskell - Introduction [LEGENDS] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [Tutorial] Haskell - Introduction [LEGENDS] (/showthread.php?tid=4973502) |
Haskell - Introduction [LEGENDS] - SIM-2015410 - Sep 2, 2015 [img]http://s9.postimg.org/57pm7cwxr/LEGENDS_2_0_HEADER.png[/img]
Haskell An introduction Some of you reading this thread will probably never have even heard of Haskell, and the majority of the rest will never have used it. I would like to see that change. Haskell is one of the most common of the functional languages, and I believe it is important for all well-rounded programmers to be at least partially proficient in this paradigm. For anyone interested in learning Haskell, I will attempt to post some tutorials and perhaps some challenges, to help expose members to this great paradigm and language. Even if these tutorials only interest a few people, at least that is better than none :) [img]http://s9.postimg.org/jzubyp2v3/LEGENDS_2_0_DELIMETER.png[/img]
Advantages to Functional Languages
[img]http://s9.postimg.org/jzubyp2v3/LEGENDS_2_0_DELIMETER.png[/img]
Getting Started with Haskell Here are 3 books/tutorials I recommend for beginners who want to get started with Haskell: [img]http://s9.postimg.org/jzubyp2v3/LEGENDS_2_0_DELIMETER.png[/img]
Installing the Haskell Platform For Windows: Download and install the Glascow Haskell Compiler (GHC) from http://www.haskell.org/platform/windows.html For Mac: You need to install some Apple development tools first. See the notes on http://www.haskell.org/platform/mac.html for more information. It is a good idea to install the 64bit version of the Haskell platform if you have a 64bit system. For Linux: The Haskell Platform is included in the repositories of all major distributions, but the version installed by default may be out of date, so it is advised you update to the latest version. Check out https://www.haskell.org/platform/linux.html for more information. [img]http://s9.postimg.org/jzubyp2v3/LEGENDS_2_0_DELIMETER.png[/img]
Getting Started - Hello World All Haskell source code files end with a .hs extension, so create a new file called helloworld.hs Open this file in a good text editor, I recommend Notepad++. We need to create a main function to run, so enter this code: Code main = putStrLn "Hello World"To run your first program, simply save the file and load it into the GHCi (GHC interpreter) by double clicking the file in windows or by running the GHCi load command: Code Prelude>:load helloworld.hsTo reload the files in ghci if you change them, just run this command: Code Prelude>:rWhen you have opened the file in GHCi or loaded the file, simply type "main" to run your new main function in your program. It should print "Hello Word". [img]http://s9.postimg.org/jzubyp2v3/LEGENDS_2_0_DELIMETER.png[/img]
This tutorial was written by MeshCollider 🤝 * - 0xBB - Sep 2, 2015 Nice tut , very instructive. Will try few compilers to see how it goes. * - BananaTime - Sep 3, 2015 Thats some sexy world bro :) i will love to join :) GL * - g4143 - Sep 3, 2015 I always liked languages which emphasize expressions over statements . They take a little getting used to but they are worth it in the end. * - csrk - Sep 3, 2015 Haskell is my favourite language, by far! This tutorial is very short though, if you need help writing a few points, let me know. :-) More Haskell to the people! * - Velozity™ - Sep 3, 2015 Nice tutorial man, good representing for divine also :D * - 2pac - Sep 3, 2015 thanks for the tut. appreciate it man! * - SIM-2015410 - Sep 3, 2015 (Sep 3, 2015 04:57 AM)Rewbert Wrote: Haskell is my favourite language, by far! This tutorial is very short though, if you need help writing a few points, let me know. :-) Don't worry, I have more planned already :) Thanks for the feedback guys, appreciate it a lot. * - +Haze - Sep 4, 2015 Nice contribution, however Haskell has become obsolete in our generation. The only time you'd see Haskell being used is in educational institutions to teach people how to code, apart from that Haskell is almost never used from what I've seen. * - csrk - Sep 4, 2015 (Sep 4, 2015 03:08 AM)+Haze Wrote: Nice contribution, however Haskell has become obsolete in our generation. The only time you'd see Haskell being used is in educational institutions to teach people how to code, apart from that Haskell is almost never used from what I've seen. There are other functional languages that are, though. Erland, developed at Chalmers university of technology in sweden (my school!!), was used to code whatsapp, which sold for tremendous amounts. The functional scene should not be deemed useless, as it is growing. Other languages, for example java, are introducing more and more functional concepts, with anonymous inner functions, or lambda functions, as one example. |