Haskell: Perbezaan antara semakan

Daripada Wikipedia, ensiklopedia bebas.
Kandungan dihapus Kandungan ditambah
Aviator (bincang | sumb.)
haskell curry bukan pencipta haskell. silap.
Aviator (bincang | sumb.)
Tiada ringkasan suntingan
Baris 4: Baris 4:


==Contoh aturcara dalam Bahasa Hugs==
==Contoh aturcara dalam Bahasa Hugs==
module FastSort where
module FastSort where
import Gofer
import Gofer
samsort 1 = sorting [] 0 1
samsort 1 = sorting [] 0 1
where sorting ls k [] = head(merepairs ls 0)
where sorting ls k [] = head(merepairs ls 0)
12): ls) (k/2)
12): ls) (k/2)


==Atur cara ''hello world''==
==Atur cara ''hello world''==
Baris 17: Baris 17:
main = putStrLn "Hello, world!"
main = putStrLn "Hello, world!"
</pre>
</pre>

==Pautan luar==

{{wikibooks|en:Haskell}}
* [http://www.haskell.org Tapak web Haskell]
* [http://darcs.haskell.org/yaht/yaht.pdf Yet Another Haskell Tutorial]


{{Daftar bahasa pengaturcaraan}}
{{Daftar bahasa pengaturcaraan}}

Semakan pada 16:36, 17 Oktober 2008

Haskell ialah sebuah bahasa pengaturcaraan kefungsian yang tulen. Bahasa ini mendapat nama daripada Haskell Curry, seorang tokoh matematik yang banyak menyumbang dalam ilmu logik kombinator.

Satu pentafsir Haskell ialah Hugs (Haskell User's Gofer System).

Contoh aturcara dalam Bahasa Hugs

module FastSort where import Gofer samsort 1 = sorting [] 0 1

  where sorting ls k [] = head(merepairs ls 0)

12): ls) (k/2)

Atur cara hello world

Berikut adalah contoh atur cara hello world dalam Haskell.

main = putStrLn "Hello, world!"

Pautan luar