Haskell: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Cobayisreh (bicara | kontrib)
Tidak ada ringkasan suntingan
Tidak ada ringkasan suntingan
 
(22 revisi perantara oleh 15 pengguna tidak ditampilkan)
Baris 1:
{{Infobox programming language
| name = Haskell
| logo = [[FileBerkas:Haskell-Logo.svg|120px|Logo of Haskell]]
| paradigm = [[functionalpemrograman programmingfungsional|functionalFungsional]], lazymalas/[[non-strictbahasa programmingpemrograman languagetidak ketat|non-stricttidak ketat]], [[modularpemrograman programmingmodular|modular]]
| year = 1990
| designer = [[Simon Peyton Jones]], [[Lennart Augustsson]], [[Dave Barton]], [[Brian Boutel]], [[Warren Burton (computer scientist)|Warren Burton]], [[Joseph Fasel]], [[Kevin Hammond (computer scientist)|Kevin Hammond]], [[Ralf Hinze]], [[Paul Hudak]], [[John Hughes (computerilmuan scientistkomputer)|John Hughes]], [[Thomas Johnsson]], [[Mark Jones, (computer[[Simon scientist)|MarkPeyton Jones]], [[John Launchbury]], [[Erik Meijer (computerilmuan scientistkomputer)|Erik Meijer]], [[John Peterson (computer scientist)|John Peterson]], [[Alastair Reid (computer scientist)|Alastair Reid]], [[Colin Runciman]], [[Philip Wadler]]
| developer = =
| latest release version = <!-- Of the language specification, not the [[Haskell Platform]]! -->Haskell 2010<ref name="2010ann">{{cite mailing list |url=http://www.haskell.org/pipermail/haskell/2009-November/021750.html |title=Announcing Haskell 2010 |date=24 November 2009 |accessdate=12 March 2011 |mailinglist=Haskell |last=Marlow |first=Simon}}</ref>
| latest release date = {{start date and age|df=yes|2010|07}}
| latest test version = Haskell 2011{{Citation needed|date=June 2011}}
| latest test date = =
| typing = [[staticpengetikan typingstatis|staticStatis]], [[strongpengetikan typingkuat|strongkuat]], [[typepengetikan inferencedisimpulkan|inferreddisimpulkan]]
| implementations = [[Glasgow Haskell Compiler|GHC]], [[Hugs]], [http://www.cs.york.ac.uk/fp/nhc98/ NHC], [http://repetae.net/john/computer/jhc/ JHC], [[Yhc]], [http://www.cs.uu.nl/wiki/UHC UHC]
| dialects = [[Helium (Haskell)|Helium]], [[Gofer (softwareperangkat lunak)|Gofer]], [[Hugs]], [[Ωmega]]
| influenced = [[Agda (theorem prover)|Agda]],<ref>{{cite web|url=http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf|title=Dependently Typed Programming in Agda|last=Norell|first=Ulf|year=2008|publisher=Chalmers University|accessdate=9 February 2012|location=Gothenburg|archive-date=2014-04-01|archive-url=https://web.archive.org/web/20140401144502/http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf|dead-url=no}}</ref> [[Bluespec, Inc.|Bluespec]],{{Citation needed|date=February 2012}} [[C++11]]/[[Concepts (C++)|Concepts]],<ref>{{cite journal|title=Design of Concept Libraries for C++|first1=Bjarne|last1=Stroustrup|authorlink1=Bjarne Stroustrup|first2=Andrew|last2=Sutton|url=http://www2.research.att.com/~bs/sle2011-concepts.pdf|year=2011|archiveurl=https://web.archive.org/web/20110825052517/http://www2.research.att.com/~bs/sle2011-concepts.pdf|archivedate=2011-08-25|journal=|access-date=2021-02-21|dead-url=yes}}</ref> [[C Sharp (programmingbahasa languagepemrograman)|C#]]/[[Language Integrated Query|LINQ]],<ref>{{cite web|url=http://channel9.msdn.com/shows/Going+Deep/Lecture-Series-Erik-Meijer-Functional-Programming-Fundamentals-Chapter-1/|title=C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals, Chapter 1 of 13|last=Meijer|first=Erik|date=1 October 2009|work=[[Channel 9 (discussion forum)|Channel 9]]|publisher=Microsoft|accessdate=9 February 2012|archive-date=2012-06-16|archive-url=https://web.archive.org/web/20120616051226/http://channel9.msdn.com/shows/Going+Deep/Lecture-Series-Erik-Meijer-Functional-Programming-Fundamentals-Chapter-1/|dead-url=yes}}</ref><ref>{{cite news|url=http://www.infoq.com/interviews/LINQ-Erik-Meijer|title=Erik Meijer on LINQ|last=Drobi|first=Sadek|date=4 March 2009|work=InfoQ|publisher=C4Media Inc.|accessdate=9 February 2012|location=QCon [[San Francisco|SF]] 2008|archive-date=2021-01-26|archive-url=https://web.archive.org/web/20210126191443/https://www.infoq.com/interviews/LINQ-Erik-Meijer/|dead-url=no}}</ref> [[CAL (QuarkKerangka Frameworkkerja Quark)|CAL]],{{Citation needed|date=February 2012}} [[Cayenne (programmingbahasa languagepemrograman)|Cayenne]],{{Citation needed|date=February 2012}} [[Clean (programming language)|Clean]],<ref>{{cite journal
| first1 = Paul
| last1 = Hudak
| authorlink1 = Paul Hudak
| first2 = John
| last2 = Hughes
| authorlink2 = John Hughes (computer scientist)
| first3 = Simon
| last3 = Peyton Jones
| authorlink3 = Simon Peyton Jones
| first4 = Philip
| last4 = Wadler
| authorlink4 = Philip Wadler
| title = A history of Haskell: being lazy with class
| doi = 10.1145/1238844.1238856
| year = 2007
| journal = Proceedings of the third ACM [[SIGPLAN]] conference on History of programming languages ([[HOPL]] III)
| pages = 12–1–12–55
| isbn = 978-1-59593-766-X {{Please check ISBN|reason=Check digit (X) does not correspond to calculated figure.}}
}}</ref> [[Clojure]],<ref>{{cite web|url=http://www.amazon.com/gp/richpub/listmania/fullview/R3LG3ZBZS4GCTH|title=Clojure Bookshelf|last=Hickey|first=Rich|work=Listmania!|publisher=Amazon.com|accessdate=9 February 2012|archive-date=2012-03-19|archive-url=https://web.archive.org/web/20120319065828/http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH|dead-url=no}}</ref> [[CoffeeScript]],<ref>{{cite news|url=http://www.javaworld.com/javaworld/jw-10-2011/111018-coffeescript-vs-dart.html|title=Turn up your nose at Dart and smell the CoffeeScript|last=Heller|first=Martin|date=18 October 2011|work=JavaWorld|publisher=InfoWorld|accessdate=9 February 2012|archive-date=2012-02-10|archive-url=https://web.archive.org/web/20120210141629/http://www.javaworld.com/javaworld/jw-10-2011/111018-coffeescript-vs-dart.html|dead-url=yes}}</ref> [[Curry (programming language)|Curry]],{{Citation needed|date=February 2012}} [[Epigram (programming language)|Epigram]],{{Citation needed|date=February 2012}} [[Escher (programming language)|Escher]],{{Citation needed|date=February 2012}} [[F Sharp (programming language)|F#]],<ref>{{cite book|last1=Syme|first1=Don|authorlink1=Don Syme|last2=Granicz|first2=Adam|last3=Cisternino|first3=Antonio|title=Expert F#|year=2007|publisher=[[Apress]]|page=2 |quote=F# also draws from Haskell particularly with regard to two advanced language features called ''sequence expressions'' and ''workflows''.}}</ref> [[Factor (programmingbahasa languagepemrograman)|Factor]],{{Citation needed|date=February 2012}} [[Isabelle theorem prover|Isabelle]],{{Citation needed|date=February 2012}} [[Generics in Java|Java Generics]],{{Citation needed|date=February 2012}} [[Kaya (programmingbahasa languagepemrograman)|Kaya]],{{Citation needed|date=February 2012}} [[Mercury (programmingbahasa languagepemrograman)|Mercury]],{{Citation needed|date=February 2012}} [[Ωmegainterpretasi interpreterΩmega|Omega]],{{Citation needed|date=February 2012}} [[Perl 6]],<ref>{{cite web|url=http://www.perlfoundation.org/perl6/index.cgi?glossary_of_terms_and_jargon|title=Glossary of Terms and Jargon|date=28 February|work=Perl Foundation Perl 6 Wiki|publisher=[[The Perl Foundation]]|accessdate=9 February 2012|archive-date=2012-01-21|archive-url=https://web.archive.org/web/20120121145808/http://www.perlfoundation.org/perl6/index.cgi?glossary_of_terms_and_jargon|dead-url=yes}}</ref> [[Python (programmingbahasa languagepemrograman)|Python]],<ref>{{cite web|url=http://docs.python.org/howto/functional.html|title=Functional Programming HOWTO|last=Kuchling|first=A. M.|work=Python v2.7.2 documentation|publisher=Python Software Foundation|accessdate=9 February 2012|archive-date=2012-10-24|archive-url=https://web.archive.org/web/20121024163217/http://docs.python.org/howto/functional.html|dead-url=no}}</ref> [[Qi (programmingbahasa languagepemrograman)|Qi]],{{Citation needed|date=February 2012}} [[Scala (programmingbahasa languagepemrograman)|Scala]],<ref>{{cite web|url=http://blog.fogus.me/2010/08/06/martinodersky-take5-tolist/|title=MartinOdersky take(5) toList|last=Fogus|first=Michael|date=6 August 2010|work=Send More Paramedics|accessdate=9 February 2012|archive-date=2012-02-14|archive-url=https://web.archive.org/web/20120214225555/http://blog.fogus.me/2010/08/06/martinodersky-take5-tolist/|dead-url=no}}</ref> [[Timber (programming language)|Timber]],{{Citation needed|date=February 2012}} [[Visual Basic .NET|Visual Basic 9.0]]<ref>[[Erik Meijer (computer scientist)|Erik Meijer]], "Confessions of a Used Programming Language Salesman",[https://web.archive.org/web/20110923133552/http://research.microsoft.com/en-us/um/people/emeijer/papers/es012-meijer.pdf] [[OOPSLA]] 2007</ref>
| influenced by = [[APL (programmingperangkat languagelunak)|APL]],{{Citation needed|date=February 2012}} [[Clean (programmingperangkat languagelunak)|Clean]],<ref name="haskell-report-influences"/> [[FP (programmingperangkat languagelunak)|FP]],<ref name="haskell-report-influences"/> [[Gofer (programmingperangkat languagelunak)|Gofer]],<ref name="haskell-report-influences"/> [[Hope (programmingperangkat languagelunak)|Hope]] anddan Hope<sup>+</sup>,<ref name="haskell-report-influences"/> [[Id (programmingperangkat languagelunak)|Id]],<ref name="haskell-report-influences"/> [[ISWIM]],<ref name="haskell-report-influences"/> [[Kent Recursive Calculator|KRC]],<ref name="haskell-report-influences"/> [[Lisp (programmingperangkat languagelunak)|Lisp]],<ref name="haskell-report-influences">Haskell 98 Report, p. xi</ref> [[Miranda (programmingperangkat languagelunak)|Miranda]],<ref name="haskell-report-influences"/> [[ML (programming language)|ML]] and [[Standard ML]],<ref name="haskell-report-influences"/> [[Orwell (programming language)|Orwell]], [[SASL (programming language)|SASL]],<ref name="haskell-report-influences"/> [[SISAL]],<ref name="haskell-report-influences"/> [[Scheme (programmingbahasa languagepemrograman)|Scheme]]<ref name="haskell-report-influences"/>
| operating system = [[Cross-Lintas platform]]
| license = =
| website = {{url|http://haskell.org}}
| file ext = <code>.hs</code>, <code>.lhs</code>
}}
'''Haskell''' adalah bahasa [[Pemrograman Fungsional|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''.
 
[[Semantik (ilmu komputer)|Semantik]] Haskell secara historis didasarkan pada bahasa pemrograman Miranda, yang berfungsi untuk memfokuskan upaya kelompok kerja Haskell awal.<ref>Edward Kmett, [https://www.youtube.com/watch?v=hIZxTQP1ifo Edward Kmett – Type Classes vs. the World]</ref> Spesifikasi formal terakhir dari bahasa tersebut dibuat pada bulan Juli 2010, sementara pengembangan GHC terus memperluas Haskell melalui ekstensi bahasa.
== Hello World ==
 
Berikut ini adalah contoh program sederhana yang akan mencetak kalimat "Hello, World!"
Haskell digunakan dalam akademi dan industri.<ref>{{Citation|last=Mossberg|first=Erik|title=erkmos/haskell-companies|date=2020-06-08|url=https://github.com/erkmos/haskell-companies|access-date=2020-06-22}}</ref><ref>{{cite book|last1=O'Sullivan|first1=Bryan|last2=Goerzen|first2=John|last3=Stewart|first3=Donald Bruce|date=15 November 2008|url=https://books.google.com/books?id=nh0okI1a1sQC|title=Real World Haskell: Code You Can Believe In|publisher="O'Reilly Media, Inc."|isbn=978-0-596-55430-9|pages=xxviii-xxxi|language=en}}</ref><ref>{{cite web|title=Haskell in Production: Riskbook|url=https://serokell.io/blog/haskell-in-industry-riskbook|website=Serokell Software Development Company|language=en|access-date=2021-09-07}}</ref> {{As of|2021|May}}, Haskell adalah bahasa pemrograman terpopuler ke-28 menurut [[Google Search|Google Pencarian]] untuk tutorial,<ref>{{cite web|last=|first=|date=May 2021|title=PYPL PopularitY of Programming Language index|url=http://pypl.github.io/PYPL.html|website=pypl.github.io|language=en|archive-url=https://web.archive.org/web/20210507222106/https://pypl.github.io/PYPL.html|archive-date=7 May 2021|access-date=16 May 2021|url-status=dead}}</ref> dan berjumlah kurang dari 1% pengguna aktif di repositori kode sumber [[GitHub]].<ref>{{cite web|last=Frederickson|first=Ben|title=Ranking Programming Languages by GitHub Users|url=https://www.benfrederickson.com/ranking-programming-languages-by-github-users/|website=www.benfrederickson.com|access-date=6 September 2019}}</ref>
<source lang=haskell>
 
main = putStrLn "Hello, world!"
== Sejarah ==
</source>
Setelah perilisan [[Miranda (bahasa pemrograman)|Miranda]] oleh Research Software Ltd. pada tahun 1985, minat terhadap bahasa fungsional yang malas tumbuh. Pada tahun 1987, ada lebih dari selusin bahasa pemrograman yang tidak [[Fungsi ketat|ketat]] dan murni fungsional. Miranda merupakan yang paling banyak digunakan, tapi itu adalah [[perangkat lunak berpemilik]]. Pada konferensi [[Functional Programming Languages and Computer Architecture]] (FPCA '87) di [[Portland, Oregon]], ada konsensus yang kuat bahwa sebuah komite dibentuk untuk menentukan [[standar terbuka]] untuk bahasa-bahasa tersebut. Tujuan komite ini adalah untuk menggabungkan bahasa-[[Pemrograman fungsional|bahasa fungsional]] yang ada menjadi bahasa yang umum untuk digunakan sebagai dasar pengmebangan masa depan dalam desain bahasa fungsional.{{sfn|Peyton Jones|2003|loc=Preface}}
==Pranala Luar==
 
== Contoh ==
 
=== Hello World ===
Berikut ini adalah contoh program sederhana yang akan mencetak kalimat "Hello, World!".
<sourcesyntaxhighlight lang="haskell">
main = putStrLn "Hello, world!"
</syntaxhighlight>
 
=== Penjumlahan sederhana ===
Berikut ini adalah contoh program sederhana yang akan mencetak hasil penjumlahan antara 2 dan 10.<syntaxhighlight lang="haskell">
main = print (2 + 10)
</syntaxhighlight>
 
=== Cetak nama ===
Berikut ini adalah contoh program sederhana yang akan meminta nama pengguna dan mencetaknya kembali.<syntaxhighlight lang="haskell" line="1">
main = do
putStrLn "Masukan nama Anda:"
nama <- getLine
putStrLn ("Selamat datang, " ++ nama ++ "!")
</syntaxhighlight>
 
== Referensi ==
{{reflist}}
 
== Pranala Luarluar ==
{{Wikibooks|Haskell}}
{{Wikibooks|Write Yourself a Scheme in 48 Hours}}
* {{Official website|http://haskell.org}}
* [http://www.haskell.org/haskellwiki/Language_and_library_specification Language and library specification] {{Webarchive|url=https://web.archive.org/web/20150102195106/https://www.haskell.org/haskellwiki/Language_and_library_specification |date=2015-01-02 }} at the Haskell Wiki
* {{dmoz|Computers/Programming/Languages/Haskell|Haskell}}
; Various
* [http://www.willamette.edu/~fruehr/haskell/evolution.html The Evolution of a Haskell Programmer] {{Webarchive|url=https://web.archive.org/web/20070101192126/http://www.willamette.edu/~fruehr/haskell/evolution.html |date=2007-01-01 }}, slightly humorous overview of different programming styles available in Haskell
* [http://haskell.readscheme.org/ Online Bibliography of Haskell Research] {{Webarchive|url=https://web.archive.org/web/20080915054919/http://haskell.readscheme.org/ |date=2008-09-15 }}
* [http://contemplatecode.blogspot.com/search/label/HWN Haskell Weekly News] {{Webarchive|url=https://web.archive.org/web/20230519125853/http://contemplatecode.blogspot.com/search/label/HWN |date=2023-05-19 }}
* [http://themonadreader.wordpress.com/ The Monad.Reader] {{Webarchive|url=https://web.archive.org/web/20230608031832/https://themonadreader.wordpress.com/ |date=2023-06-08 }}, quarterly magazine on Haskell topics
* {{cite podcast|url=http://www.se-radio.net/2008/08/episode-108-simon-peyton-jones-on-functional-programming-and-haskell/ |title=Episode 108: Simon Peyton Jones on Functional Programming and Haskell |website=Software Engineering Radio |host=Markus |date=29 August 2008}}
* [http://leksah.org/ Leksah] {{Webarchive|url=https://web.archive.org/web/20120513234524/http://leksah.org/ |date=2012-05-13 }}, a GTK-based Haskell IDE written in Haskell
;Tutorials
* [http://tryhaskell.org/ Try Haskell!] {{Webarchive|url=https://web.archive.org/web/20230802163743/https://tryhaskell.org/ |date=2023-08-02 }}, an in-browser interactive tutorial
* [http://hal3.name/docs/daume02yaht.pdf Yet Another Haskell Tutorial] {{Webarchive|url=https://web.archive.org/web/20100415154045/http://hal3.name/docs/daume02yaht.pdf |date=2010-04-15 }}, by Hal Daumé III; assumes far less prior knowledge than official tutorial
* [http://cheatsheet.codeslower.com/ The Haskell Cheatsheet] {{Webarchive|url=https://web.archive.org/web/20230815210229/http://cheatsheet.codeslower.com/ |date=2023-08-15 }}, compact language reference and mini-tutorial
{{Daftar bahasa pemrograman}}
{{stub}}
 
{{Authority control}}
 
[[Kategori:Bahasa pemrograman]]
[[Kategori:Perangkat lunak bebas]]
 
 
[[ar:هاسكل (لغة برمجة)]]
{{stub}}
[[az:Haskell (proqramlaşdırma dili)]]
[[bg:Haskell]]
[[ca:Haskell]]
[[cs:Haskell]]
[[de:Haskell (Programmiersprache)]]
[[el:Haskell]]
[[en:Haskell (programming language)]]
[[eo:Haskell]]
[[es:Haskell]]
[[et:Haskell]]
[[fa:هسکل (زبان برنامه‌نویسی)]]
[[fi:Haskell]]
[[fr:Haskell]]
[[gl:Haskell]]
[[he:Haskell]]
[[hr:Haskell (programski jezik)]]
[[hu:Haskell (programozási nyelv)]]
[[is:Haskell (forritunarmál)]]
[[it:Haskell (linguaggio)]]
[[ja:Haskell]]
[[kk:Мәтінді автоматты өңдеу]]
[[ko:하스켈]]
[[la:Haskell]]
[[lv:Haskell]]
[[ms:Haskell]]
[[nl:Haskell (programmeertaal)]]
[[pl:Haskell]]
[[pt:Haskell (linguagem de programação)]]
[[ro:Haskell]]
[[ru:Haskell]]
[[simple:Haskell (programming language)]]
[[sk:Haskell (programovací jazyk)]]
[[sl:Haskell]]
[[sv:Haskell (programspråk)]]
[[tg:Haskell]]
[[tr:Haskell]]
[[uk:Haskell]]
[[vi:Haskell (ngôn ngữ lập trình)]]
[[zh:Haskell]]