Haskell
bahasa pemrograman fungsional
Haskell adalah bahasa pemrograman fungsional murni. Nama bahasa pemrograman Haskell diambil dari nama seseorang matematikawan Haskell Curry, yang terkenal akan karyanya di bidang combinatory logic. Haskell hanya mengenal expression dan equation.
Contoh
Hello World
Berikut ini adalah contoh program sederhana yang akan mencetak kalimat "Hello, World!".
main = putStrLn "Hello, world!"
Penjumlahan Sederhana
Berikut ini adalah contoh program sederhana yang akan mencetak hasil penjumlahan antara 2 dan 10.
main = print (2 + 10)
Cetak Nama
Berikut ini adalah contoh program sederhana yang akan meminta nama pengguna dan mencetaknya kembali.
main = do
putStrLn "Masukan nama Anda:"
nama <- getLine
putStrLn ("Selamat datang, " ++ nama ++ "!")
Referensi
- ^ Marlow, Simon (24 November 2009). "Announcing Haskell 2010". Haskell mailing list. http://www.haskell.org/pipermail/haskell/2009-November/021750.html. Diakses pada 12 March 2011.
- ^ a b c d e f g h i j k l m Haskell 98 Report, p. xi
- ^ Norell, Ulf (2008). "Dependently Typed Programming in Agda" (PDF). Gothenburg: Chalmers University. Diakses tanggal 9 February 2012.
- ^ Stroustrup, Bjarne; Sutton, Andrew (2011). "Design of Concept Libraries for C++" (PDF). Diarsipkan dari versi asli (PDF) tanggal 2011-08-25.
- ^ Meijer, Erik (1 October 2009). "C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals, Chapter 1 of 13". Channel 9. Microsoft. Diakses tanggal 9 February 2012.
- ^ Drobi, Sadek (4 March 2009). "Erik Meijer on LINQ". InfoQ. QCon SF 2008: C4Media Inc. Diakses tanggal 9 February 2012.
- ^ Hudak, Paul; Hughes, John; Peyton Jones, Simon; Wadler, Philip (2007). "A history of Haskell: being lazy with class". Proceedings of the third ACM SIGPLAN conference on History of programming languages (HOPL III): 12–1–12–55. doi:10.1145/1238844.1238856. ISBN [[Special:BookSources/978-1-59593-766-X |978-1-59593-766-X [[Kategori:Artikel dengan ISBN salah]]]] Periksa nilai: invalid character
|isbn=
(bantuan). - ^ Hickey, Rich. "Clojure Bookshelf". Listmania!. Amazon.com. Diakses tanggal 9 February 2012.
- ^ Heller, Martin (18 October 2011). "Turn up your nose at Dart and smell the CoffeeScript". JavaWorld. InfoWorld. Diakses tanggal 9 February 2012.
- ^ Syme, Don; Granicz, Adam; Cisternino, Antonio (2007). Expert F#. Apress. hlm. 2.
F# also draws from Haskell particularly with regard to two advanced language features called sequence expressions and workflows.
- ^ "Glossary of Terms and Jargon". Perl Foundation Perl 6 Wiki. The Perl Foundation. 28 February. Diakses tanggal 9 February 2012.
- ^ Kuchling, A. M. "Functional Programming HOWTO". Python v2.7.2 documentation. Python Software Foundation. Diakses tanggal 9 February 2012.
- ^ Fogus, Michael (6 August 2010). "MartinOdersky take(5) toList". Send More Paramedics. Diakses tanggal 9 February 2012.
- ^ Erik Meijer, "Confessions of a Used Programming Language Salesman",[1] OOPSLA 2007
Pranala luar
Wikibooks memiliki buku di:
- Situs web resmi
- Language and library specification at the Haskell Wiki
- Haskell di Curlie (dari DMOZ)
- Various
- The Evolution of a Haskell Programmer, slightly humorous overview of different programming styles available in Haskell
- Online Bibliography of Haskell Research
- Haskell Weekly News
- The Monad.Reader, quarterly magazine on Haskell topics
- Markus (29 August 2008). "Episode 108: Simon Peyton Jones on Functional Programming and Haskell". Software Engineering Radio (Podcast). http://www.se-radio.net/2008/08/episode-108-simon-peyton-jones-on-functional-programming-and-haskell/.
- Leksah, a GTK-based Haskell IDE written in Haskell
- Tutorials
- Try Haskell!, an in-browser interactive tutorial
- Yet Another Haskell Tutorial, by Hal Daumé III; assumes far less prior knowledge than official tutorial
- The Haskell Cheatsheet, compact language reference and mini-tutorial