Docsity

Functional programming language, Study notes of Java Programming

Partial preview of the text

Download Functional programming language and more Study notes Java Programming in PDF only on Docsity!

camiin o.3 Explain funcHonal programming language ___ Ane—2© FuncHonal programming 1S a para en ing paradigm -that-treats computattonas + O44 _evaluvion of mathamatical fu ncHons_and-aveids ____ changing _sta+e_and mutable data. ——__—_— cnc oe oineiatatnes applytng_and com pasting funcHons, _ 2a inert strasting with imperatty e pragramnm ng, which __ _______ focuses on_sequences_ of coramands thay — —_ __s change. program state. _ a —~ ks __* key principles of 4 fonal_programming wages include — 4), Pure Functlons i nied : __. Funclions 4nat, given the same input, will ___ ______dlways_return +e Same output and have no_side effects (Hhey do Not modFfy any external state or have obeservable interac- +fons with +he outside world beyond returning — = at Nae.) 9) Tmmutability Data struchires ar generally not madifted | “otter creation instead, operatfons thal | __alw SS a ue ee __ new, Maditied copy This simplifies reasoning — about program state and reduces potencia) | {pigs wis te ae ae | So sisihiredia te aa. | ms i ——___—_F> - ao Fae camiin t + First - class and Wigher + order. functions. & “i seeePupeogs one: -+reated_as first class civizens, | __. meaning +hey canbe assig ned +o.variables, passed __. }as_agruments +o other functions, and returned las values. from--funckans.————___—__— _|_Wigher = order functians_are funclions +hat- take other functions _as_arg uments_or yehurn. ——— _«, functions as_resul+s : : 2a 1), Recursion s- Functional \acqus} <5 often ose _ | ECUBSLON AS A PRIMATY ‘mechanism feo ‘yhemation xe ple cing Agadihopal loops Found 10 ‘em persone Jang Mages. Js | | | 15] ] 4 | Addon tages of Functional Prre gramming. _ ae a ReFerenta| T[anspavan 4 3= = E T —— Pn” expxeSsico adn be weplaced Ne \ 2 3 vA yalue wWitheat chaodns the programs behavior. this 1 o dime: “QoMsequencs __ oF Powe Functions: 904 ematabitity es 20} | T \ | ] ~ | Predictability and testability ae nae 7 Pyse Papchons bre eastes bo test _ and weasen abou+ be cause Shewe behaviors 1 _ enticse ly deters mined by thelr 1 pak __— and thes Ihave ne fide eF-feck<.