An warware: fakitin cabal daga GitHub

Tabbas! Ga labarin da kuke so.

-

Kunshin Cabal na Haskell kayan aiki ne mai mahimmanci a cikin ci gaban Haskell. Ana iya amfani da shi wajen kafa sabbin ayyukan Haskell, sarrafa abubuwan dogaro da fakitin gini. Hakanan yana iya ษ—aukar fakiti daga Github, yana sa tsarin haษ“aka ku ya zama santsi. Cabal tsarin gini ne da tattara kayan karatu da shirye-shirye na Haskell. Yana bayyana ma'anar gama gari don marubutan aikace-aikace da dakunan karatu don bayyana dogaron lambar su akan wasu fakiti. Babban abin al'ajabi na Cabal shine yadda yake haษ—awa da Hackage, tarin jama'a na buษ—aษ—ษ—en software da aka rubuta a cikin Haskell.

Kara karantawa

An warware: taswira

A fagen shirye-shirye na aiki, taswira wani babban tsari ne na asali wanda ke aiwatar da aikin da aka bayar ga kowane ษ“angaren jeri, yana samar da jerin sakamako cikin tsari iri ษ—aya. ฦ˜arfi mai ฦ™arfi na taswira shine zuciyar hanyoyin shirye-shirye na aiki don magance matsaloli, musamman a cikin harshe kamar Haskell.

Za mu iya ayyana aikin taswira a Haskell kawai ta amfani da maimaitawa. Mahimmanci, taswira tana aiwatar da aikin ga shugaban lissafin, sannan a maimaita taswirar taswira ga sauran jerin (wutsiya). Lokacin da lissafin ya zama fanko, taswirar kawai tana mayar da lissafin fanko. Wannan yana haifar da ฦ™arin yanayin โ€œmatsala->maganiโ€ na ษ—an adam na gabatowa ayyukan shirye-shirye, maimakon hanyar da aka saba da ita a cikin harsuna masu mahimmanci.

map _ [] = []
map f (x:xs) = f x : map f xs

Kara karantawa

An warware: yadda ake gudanar da haskell a lambar ษ—akin studio na gani

Salon tsara shirye-shirye ya samo asali sosai a cikin 'yan shekarun nan, tare da ฦ™arin mutane suna jingina ga shirye-shirye masu aiki saboda sauฦ™i, inganci da ฦ™ayatarwa. ฦŠaya daga cikin irin wannan harshe da ke jagorantar hanya shine Haskell. Haskell yana aiki ne kawai tare da ingantaccen rubutu mai ฦ™arfi da ฦ™ima mara nauyi, wanda ke ba ku damar sake amfani da lambar ku kuma ya hana ku rubuta lambar da ba ta da yawa. Haskell kuma yana ba ku damar rubuta lamba mai sauฦ™i, bayyananne, da kuma kiyayewa. ฦŠaya daga cikin mahimman abubuwan don ingantaccen coding shine samun saitin yanayi mai kyau, kuma don Haskell, abin da zai iya zama mafi kyau Kayayyakin aikin hurumin kallo.

Kara karantawa

An warware: $ a haskell

Tabbas, zan yi bayanin yadda ake amfani da alamar dala ($) a cikin Haskell ta haษ—a da gabatarwa, maganin matsala, bayanin mataki-mataki-mataki, sassan biyu tare da kanun labarai masu alaฦ™a da ษ—akunan karatu na Haskell ko ayyuka masu dacewa kuma zan yi. tabbatar da bin sauran buฦ™atunku game da inganta SEO.

Haskell daidaitaccen harshe ne, mai aiki da shirye-shirye zalla tare da ฦ™ayyadaddun tatsuniyoyi, mai suna bayan Haskell Curry. A cikin Haskell, ana amfani da ma'aikacin ($) a aikace-aikacen aiki. Mai aiki da kansa aiki ne kawai wanda ke ษ—aukar aiki da wata gardama kuma yana amfani da aikin ga hujjar. Abu mai ban sha'awa game da wannan ma'aikaci shine ฦ™arancinsa, fifikon haษ—in kai na dama. Ana iya amfani da wannan don rage adadin da ake buฦ™ata a cikin magana.

Kara karantawa

An warware: yadda ake shigar stack haske a cikin manjarp

Sanya Stack Haskell a Manjaro na iya zama tafiya mai ban sha'awa sosai. Ko kai ฦ™wararren mai haษ“aka Haskell ne, ko kuma fara farawa, samun ingantaccen yanayin ci gaba yana da mahimmanci ga aikin ku. A cikin wannan labarin, zan jagorance ku ta hanyar kafa Stack Haskell a cikin Manjaro - kyakkyawan tsarin aiki mai sauฦ™in amfani, cikakke ga masu shirye-shirye.

Kara karantawa

An warware: aikin da ba a san shi ba

Ayyukan da ba a sani ba, wanda aka fi sani da ayyukan lambda, wani muhimmin sashi ne na harsunan shirye-shirye masu aiki kamar Haskell. Ba kamar ayyukan gargajiya ba, ayyukan da ba a san su ba ba su da suna. Ana bayyana su akan tashi kuma yawanci ana amfani dasu lokacin da ake buฦ™atar aiki sau ษ—aya kawai. Bari mu nutse cikin matsala da za a iya magance ta da kyau ta amfani da ayyukan da ba a san su ba.

Kara karantawa

An warware: m fita

A matsayina na mai haษ“aka Haskell tare da gogewa mai yawa a cikin fagen SEO da salon zamani, Na fahimci wajibcin isar da lambar aiki tare da salo mai salo. Mahimman abubuwan da ke faruwa a duniyar shirye-shirye sun yi daidai da waษ—anda aka gani akan catwalk - sake maimaita sauฦ™i, haษ“akawa, da ฦ™ima.

A cikin sararin samaniyarmu na Haskell, Fitar Interactive tana kwatankwacin babban kayan duniya, 'The Little Black Dress' wanda Coco Chanel ya gabatar a cikin 1920s. Kayan aiki ne a cikin makamanmu wanda, idan aka yi amfani da shi daidai, yana ba da mafita ga ษ—imbin matsalolin aiwatar da code.

Yanzu, bari mu nutse cikin warware matsalarmu a hannunmu: Fitowar Sadarwa.

module Main (babban) inda
shigo da System.Fita

babba :: IO ()
main = yi
saka StrLn โ€œHello! Buga wani abu sannan zan daina.โ€
userInput <- getLine putStrLn ("Ka ce:" ++ mai amfaniInput) fitaNasara [/code]

Rarraba Kallon Haskell Mu

Maganin Haskell ษ—in mu, kamar Chanel's Little Black Dress, yana da kyau cikin sauฦ™i. Yana amfani da ฦดan maษ“alli kaษ—an da aka haษ—a su cikin ฦ™ayatacciyar hanya.

Babban aikin yana farawa tare da gabatarwa ga mai amfani (kamar yadda na farko da samfurin titin jirgi ya yi). Sa'an nan aikin yana neman shigarwa kuma yana sarrafa shi da kyau, kamar ฦ™wararrun ฦ™irar ฦ™ira da ke sarrafa matsalar rashin aikin tufafi.

Kara karantawa

An warware: nemo matsayi na ฦ™asa a cikin kirtani

Da kyau, bari mu fara kan yadda ake nemo kirtani a cikin kirtani a Haskell.

Haskell Harshen shirye-shirye ne kawai mai aiki wanda aka sani da babban matakin sa na abstraction da ma'anar magana. ฦŠaya daga cikin ษ—awainiya na gama gari lokacin da ake mu'amala da kirtani shine nemo ฦ™aramin kirtani a cikin babban kirtani - wato, gano ainihin matsayi inda wani jerin haruffa ya bayyana.

Kara karantawa

An warware: tuple zuwa jeri

Tabbas, na fi shirin rubuta koyawa na Haskell Tuple zuwa Lissafi. Gashi nan:

'Yan bulolin wani muhimmin al'amari ne na Haskell programming language. Suna samar da hanya mai sauฦ™i don adana ฦ™ima mai yawa tare a cikin tsari ษ—aya, amma ba kamar lissafi ba, waษ—annan dabi'u na iya zama nau'i daban-daban. Koyaya, wani lokacin zaku iya gano cewa tuple ba shine mafi kyawun tsari don buฦ™atun ku ba, kuma kuna son canza shi zuwa jeri. Wannan labarin zai zurfafa zurfin yadda ake canza tuple zuwa jeri a Haskell.

Kara karantawa