
nishabda prograaming

pooyint free stail ennum vilikkappedunna taasit prograaming, function nirvachanangal avaa pravartthikkunna aargyumentukal (allengil "pooyintukal") thirichariyaattha oru prograaming maathrkayaanu. pakaram nirvachanangal mattu pravartthanangal rachikkunnu, avayil aargyumentukal kaikaaryam cheiyunna kombinettarukal ulppedunnu. nishabda prograaming saidhaanthika thaalpparyamullathaanu, kaaranam rachanayude karsanamaaya upayogam samavaakya nyaayavaadathinu nannayi anuyojyamaaya prograamukalil kalaashikkunnu. eiii. pii. ell., athinte derivateevukal, forth polulla concatenatteevu bhashakal ennivayulppede chila prograaming bhaashakalude swaabhaavika shaili koodiyaanithu. vaadanaamathinte abhavam pooyint free stylinu anaavashyamaayi avyakthamaaya oru prashasthi nalkunnu, athinaal "ardhashoonyamaaya shaili" enna visheshanamundu.
unix scripting paippukalulla maathruka upayogikkunnu.
amoorthathayude uchithamaaya thalatthil pravartthikkaan sahayikkuka ennathaanu nishabda prograamingile pradhana ashayam.
udaaharanagal.
paitthan.
inipparayunna paitthan coode upayogichu tesit prograaming chithreekarikkaan kazhiyum. thaazhepparayunnathupollu pravartthanangalude oru kramam
def udaaharanam (x):
 baar (phuu (x)))
... gadakangalillaathe, pravartthanangalude oru shreniyude gadanayaayi pooyint free shailiyil ezhuthaam
functoolil ninnu bhaagikamaayi irakkumathi cheyyuka, kuraykkuka
diff compose (* efns):
 bhaagikamaayi thirike nalkuka (kuraykkuka, lamda vii, efn efn (vii), efns)
udaaharanam = rachikkuka (phuu, baar, baas)
kooduthal sankeernamaaya oru udaaharanathinu, hashkell coode ingane vivarthanam cheyyaam
p = bhagika (rachikkuka, bhagika (rachikkuka, f), g)
functional prograaming.
oru lalithamaaya udaaharanam (hashkellil) oru samkhyakalude pattikayude aakethuka kanakkaakkunna oru prograamaanu. oru "pooyint" shaili (cf) upayogichu namukk koottukrishi aavarthichu nirvachikkaam. "moolyam"-level prograaming) ingane
thuka (x: xs) = x + thuka xs
thuka [] = 0
ennirunnaalum, oru madakkam upayogichu namukk ithu upayogichu maattisthaapikkaam
thuka xs = folder (+) 0 xs
pinne aargyument aavasyamilla, athinaal ithu lalithamaakkunnu
thuka = folder (+) 0
athu pooyint free aanu.
mattoru udaaharanam function composition upayogikkunnu
p x y z = f (g x y) z
thaazhepparayunna hashkell polulla suedo coode oru function nirvachanam athinte pooyint free thulyamaayi engane kuraykkaamennu velippeduthunnu
p = \x-> \y-> \z-> f (gxy) z
 = \x-> \y-> f (g x y)
 = \x-> \y-> (f. (g x)) y
 = \x-> f. (jii x)
 (* ivide infix compose oopparettar "."oru kariveppilayaayi upayogikkunnu. *)
 = \x-> (.) eph) (jii x)
 = \x-> (.) eph. g) x
p = (.) eph. jii.
avasaanamaayi, oru sankeernamaaya udaaharanam kaanunnathin, oru pattika edukkukayum athil oru function prayogikkukayum thudarnnu oru maanadandatthe adisthaanamaakki gadakangal filter cheyyukayum cheiyunna oru mapp filter prograam sangalppikkuka.
emm. eph. maanadanda oopparettar pattika = filter maanadandam (mapp oopparettar pattika)
ithu pooyint free aayi prakadippikkaam 
mf = (. mapp). (.). filter
munbu paranjathupole, 'pooyint free' yile pooyintukal vaadangale soochippikkunnu, allathe dottukalude upayogatheyalla; oru saadhaarana thettidhaaranayaanu.
oru hashkell expression pooyint free roopathilekku yaanthrikamaayi parivartthanam cheiyunnathinaayi kurachu prograamukal ezhuthiyittundu.
eiii. pii. ell kudumbam.
jeey yill, akkangalude oru listt (shreni) yude sharashari kanakkakkaan nirmmicha oru functionil samanamaaya pooyint free coode sambhavikkunnu
eiii. vii. jii =: +/% #
shreniyilekku mapping (qoq 2) sammeshan (qoq 3) cheythukondu qoq 1 shreniyude enangal samgrahikkunnu. shreniyile moolakangalude ennam (cockves 5) kondu cockves _ 4 thukaye harikkunnu.
yoolarude soothravaakyam _ 1 nishabdamaayi prakadippikkunnu
cos =: 2 o. ]
paapam =: 1 o. ]
euler =: @j. = koos jeey. paapam
(kokvi _ 6 ennathu oru aadima functionaanu, athinte monadic nirvachanam kokvi _ 7 thavana x umm athinte diadic nirvachanam kokvi _ 8 umm aanu.) dialog aaplil prakadippicha athe nishabda kanakkukoottalukal
avg-+ shh shh shh shh shh shh
koos 2
paapam
eulercalk koos + 0j1 × siin 0j1 ennaanu saadhaaranayaayi i ennu ezhuthunnathu. 
ulerdirect-0j1 × 12-nuu thulyamaanu 
eee rund reethikalum ore phalam nalkunnundo? 
eulercheck-ulerdirect = eulercalk
eulercheck 1 1 2 3 
1 1 1 1 
athe, ithuvare valare nannayi!
staakk adisthaanamaakkiyullathaanu.
staakk-ooriyantad prograaming bhashakalil (avayil bhooribhaagavum staakk adisthaanamaakkiyullava) pooyint-free reethikal saadhaaranayaayi upayogikkunnu. udaaharanathinu, fibonacci nambarukal anakkukoottunnathinulla oru nadapadikramam postscriptil inipparayunnathupole kaanapedaam
/faib
 dup dup 1 ikyu exch 0 ikyu allengil illa
 dup 1 sub faib
 exch 2 sub faib
 cherkkuka
 ) aanenkil
} def
pipe lineukal.
unix pipeline.
unix scriptingil staanderd inputtil ninnu daatta sweekarikkukayum phalangal staanderd aouttputtilekku ayaykkukayum cheiyunna computer prograamukalaan functionukal. udaaharanathinu,
tharamthirikkuka | unique-sii | tharamthirikkuka-rn
oru nishabdamo pooyint free rachanayo aanu, athu athinte vaadangaludeyum vaadangaludeyum ennam, kanakkukal kurayunna kramatthil nalkunnu. sortt', 'unique' ennivayaanu functionukal, '-sii', '-rn' enniva functionukal niyanthrikkunnu, pakshe aargyumentukal paraamarshichittilla. pipe '|'composition oopparettaraanu.
pipelineukal pravartthikkunna reethi kaaranam, oru jody staanderd inputt/outtputtu streaminte roopathil oru samayat oru "aargyument" maathrame saadhaaranayaayi pasacan kazhiyoo. perulla paippukalil ninnu adhika phayal discriptarukal thurakkaan kazhiyumenkilum, ithu inii pooyint free sailiyalla.
jeey. kyu.
jeey. kyu oru jeey. ezz. oo. ooriyantad prograaming bhaashayaan.
dhii'|'pipeline roopappeduthunnathinaayi filterukal bandhippikkaan 'chihnam upayogikkunnu.
parichithamaaya reethiyil. udaaharanathina
 [1,2] | cherkkuka
(athe, oru sreniye vilayiruthunna oru jecue filteraanu jeson shreni.)
unix pipelineukalkku samaanamaanengilum, jecue pipelineukal anuvadikkunnu
onniladhikam sweekarthaakkalkku ayaykkenda incoming daatta
aarr. echu. ezz oof dhaa '|'samaantharamaayi ennapole. udaaharanathinu, 'aadu/length' enna prograam
oru shreniyile samkhyakalude sharashari kanakkakkum, angane
 [1,2] | cherkkuka/neelam
1.5 aayi vilayiruthunnu
athupole
 [1,2] | [neelam, koottal, koottal/neelam]
[2,3,1.5 ennathilekku vilayiruthunnu]
oru dott ('.') rhs, e-ll oru attaachment pooyint nirvachikkaan upayogikkaam.jii.:
 1. | [.,.]
[1,1] ennathil vilayiruthunnu]
athupole
 2 | poow (.;)
paav (x; y) ennathu x ennathinte power y aayathinal ithu 4 aayi vilayiruthunnu.
fibonassi sequence.
fibonassi sequence srishtikkunnathinulla oru tesit jecue prograam ithaayirikkum
 [0,1] | reakers ([avasaanamaayi, cherkkuka]) | aadyam
ivide, [0,1] aadya rund inangalaayi edukkenda prarambha jodiyaanu
fibonassi shreniyil. (eee jody [1,1] athupole thanne upayogikkaam
veriyant nirvachanam.)
aksharamala tokkanukal antharnirmmitha filterukalaanu 'aadyam', 'avasaanatheth
avarude inputt arekalude aadyatheyum avasaanatheyum gadakangal yathaakramam purappeduvikkuka;
reakers (eph)' athinte inputtilekku oru filter, eph, aavarthichu prayogikkunnu.
puthiya filterukale nishabda shailiyil nirvachikkanum jeey. kyu anuvadikkunnu.jii.:
 def faiba [0,1] | reakers ([avasaanamaayi, cherkkuka]) | aadyam;
yoonari functionukalude ghadana.
eee lekhanathile paithaninekkurichulla vibhaagathil, inipparayunna paitthan nirvachanam pariganikkunnu
def udaaharanam (x):
 baar (phuu (x)))
pooyint free shailiyil, ithu paitthanil ingane ezhuthaam
udaaharanam = rachikkuka (phuu, baar, baas)
jeey. kyu. yill, thulyamaaya pooyint-free nirvachanam ithaayirikkum
 def udaaharanam phuu | baar | baas;

