[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-719667-105":59,"doc-detail-719667-en":130,"doc-similar-719667":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","perish-or-flourish-a-holistic-evaluation-of-large-language-models-for-code-generation-in-functional-programming","Perish or Flourish - A Holistic Evaluation of Large Language Models for Code Generation in Functional Programming","","Functional programming offers reliable foundations for secure software, yet adoption is hindered by its steep learning curve. Large Language Models (LLMs) for code generation create opportunities to reduce this barrier, but evaluations largely emphasize imperative languages, leaving functional capabilities insufficiently studied. FPEval and FPBench address this by testing 721 functional-programming tasks across difficulty levels and languages, combining executable test suites with static analysis.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/perish-or-flourish-a-holistic-evaluation-of-large-language-models-for-code-generation-in-functional-programming/719667/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/perish-or-flourish-a-holistic-evaluation-of-large-language-models-for-code-generation-in-functional-programming/719667.png","ImageObject",300,407,{"name":92,"@type":93},"Jiven","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-24","2026-11-18",true,{"@type":102,"interactionType":103,"userInteractionCount":81},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What gap does the paper address in evaluating LLMs?","Question",{"text":112,"@type":113},"Most prior evaluations focus on imperative languages, while the ability of LLMs to generate idiomatic, maintainable functional programming code remains under-explored.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What are FPEval and FPBench?",{"text":117,"@type":113},"FPEval is a holistic evaluation framework, powered by FPBench, a benchmark containing 721 functional programming tasks across three difficulty levels and mainstream functional languages.",{"name":119,"@type":110,"acceptedAnswer":120},"How do the authors assess code quality beyond correctness?",{"text":121,"@type":113},"They combine comprehensive executable test suites with static-analysis tools to evaluate both functional correctness and code style, maintainability, and related concerns.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},719667,1795010760,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":81,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":19,"preview_urls":145},1099513958607,"https://ap-avatar.wpscdn.com/avatar/100002390cf8733938c?x-image-process=image/resize,m_fixed,w_180,h_180&k=1778829742770036399","Perish or Flourish? A Holistic Evaluation of Large Language Models for Code Generation in Functional Programming  \nNguyet-Anh H. Lang 1 Eric Lang2 Bach Le2  \nQuyet-Thang Huynh 1 * Thanh Le-Cong3  \n1 Hanoi University of Science and Technology  \n2The University of Melbourne, Australia  \n3 Singapore University of Technology and Design, Singapore  \nAbstract  \nFunctional programming provides strong foundations for developing reliable and secure software systems, yet its adoption remains limited because of its steep learning curve. Recent advances in Large Language Models (LLMs) for code generation present new opportunities to lower these barriers. However, most evaluations of LLMs focus on imperative programming languages, and their capabilities in functional programming languages remain under-explored. To address this gap, we introduce FPEval, a holistic evaluation framework equipped with FPBench, a new benchmark of 721 programming tasks across three difficulty levels and three mainstream functionalprogramming languages: Haskell, OCaml, and Scala. FPEval combines comprehensive executable test suites with static-analysis tools to assess both functional correctness and code style and maintainability. Using this framework, we evaluate seven state-of-the-art LLMs, including GPT-5 and Claude Opus 4.6, on functional programming tasks, with Java included as an imperative baseline. Our results demonstrate that LLM performance in functional programming improves substantially with model advancement; however, error rates remain significantly higher in functional-first languages (Haskell and OCaml) than in hybrid (Scala) or imperative (Java) languages. More critically, LLMs frequently generate non-idiomatic functional code that follows imperative patterns, raising concerns about code style and maintainability. Finally, we show that LLMs can partially self-repair both correctness and quality issues when provided with static-analysis feedback and hand-crafted instructions targeting common issue types, paving the way for future improvements.  \n1 Introduction  \nFunctional programming is a long-standing programming paradigm that conceptualizes computa-  \n* Corresponding author: [thanghq@soict.hust.edu.vn](thanghq@soict.hust.edu.vn)  \ntion as the evaluation of mathematical functions rather than a sequence of state-mutating commandsin widely-used imperative programming. This model of computation offers unique advantages over imperative programming, resulting in software systems that are modular, deterministic, and susceptible to formal reasoning. For example, functional programming offers immutability, which ensures that a variable’s value cannot be changed during its existence. Immutability enables functional programming to mitigate common sources of software bugs in imperative programming such as side effects and race conditions. Consequently, functional programming is increasingly recognized as a future paradigm for reliable and secure software development (Achten, 2013 ; Hughes, 1989 ; Ray et al., 2014) . Despite these benefits, functional programming poses a steep learning curve. The paradigm requires a fundamental shift from imperative commands with mutable state to high-level abstractions of program behaviors such as recursion, higher-order functions, and monads, which many developers find difficult. Consequently, functional programming remains unduly less popular in practice than imperative programming.  \nThe recent rise of coding assistants powered by Large Language Models (LLMs), such as GitHub Copilot (Chen et al., 2021), Cursor (Anysphere, 2023), and Claude Code (Anthropic, 2025a), presents new opportunities for functional programming. By supporting software developers in tasks such as code generation (Li et al., 2022 ; Chen et al., 2021), bug fixing (Xia et al., 2023 ; Le-Cong et al., 2025b), and technical question answering (Xu et al., 2023 ; Widyasari et al., 2023), these tools offer particular benefits to novice programmers and have ","cbCaieKGa1vDyiRH","https://ap.wps.com/l/cbCaieKGa1vDyiRH","pdf",854778,23,"English","# Abstract\n# 1 Introduction\n## Motivation and background\n## Study objective and research questions\n## Evaluation framework (FPEval)","[{\"question\":\"What gap does the paper address in evaluating LLMs?\",\"answer\":\"Most prior evaluations focus on imperative languages, while the ability of LLMs to generate idiomatic, maintainable functional programming code remains under-explored.\"},{\"question\":\"What are FPEval and FPBench?\",\"answer\":\"FPEval is a holistic evaluation framework, powered by FPBench, a benchmark containing 721 functional programming tasks across three difficulty levels and mainstream functional languages.\"},{\"question\":\"How do the authors assess code quality beyond correctness?\",\"answer\":\"They combine comprehensive executable test suites with static-analysis tools to evaluate both functional correctness and code style, maintainability, and related concerns.\"}]","Perish or Flourish - A Holistic Evaluation of Large Language Models for Code Generation in Functional Programming | PDF",58,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/890e7f1beec30c1c496465a27b4744e5.webp",983,1390,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/23edbc4e72a9e2cd2f6999dab2f8a59a.webp",982,1388,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/91c05682e85124557d2e8f667e32b0f4.webp",981,1387,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/d7f6cd4fb7cc4d4b0eba945934517609.webp",980,1385,{"list":163,"token":66},[164,170,176,183,189,196,202,208,214,220],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":24,"category_name":40,"create_tm":169},685651,"Chapter 1 - Basic Principles of Programming Languages","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999685593/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=kpeaDPmhcKTOrj3%2BobLbAf1W%2B0c%3D","chapter-1-basic-principles-of-programming-languages",1794016327,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":29,"category_name":40,"create_tm":175},657467,"No Code AI - Automatic generation of Function Block Diagrams from documentation and associated heuristic for context-aware ML algorithm training","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975489128/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=WA7jFgNWIFiHNUA3izra7E5ne9E%3D","no-code-ai-automatic-generation-of-function-block-diagrams-from-documentation-and-associated-heuristic-for-context-aware-ml-algorithm-training",1792980391,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":181,"category_name":40,"create_tm":182},504890,"Declaratively solving Google Code Jam problems with Picat","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229931954341/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=FxraazhLxvbBhCTBysxrZgZ2r%2Bo%3D","declaratively-solving-google-code-jam-problems-with-picat",11,1791077818,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":39,"category_name":40,"create_tm":188},504882,"Picat - A Logic-based Multi-paradigm Language - Personal Discussion","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229932145436/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=ngJGWK%2Bd37hGDmrY3XS8BymbvZ4%3D","picat-a-logic-based-multi-paradigm-language-personal-discussion",1791077225,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":194,"category_name":40,"create_tm":195},39887,"Types and Programming Languages","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229792622722/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=YnEuy1q0lsdKPz39Me0G0E4XBBA%3D","types-and-programming-languages",26,1783087703,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":14,"category_name":40,"create_tm":201},732868,"Some History of Functional Programming - D. A. Turner","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031780229/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=iILIAsP1pgWXE3MniSbTGI7r9Ug%3D","some-history-of-functional-programming-d-a-turner",1795382635,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":39,"category_name":40,"create_tm":207},508663,"PertEval - Paper - Unveiling Real Knowledge Capacity of LLMs with Knowledge-Invariant Perturbations","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229935309948/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=55yYhysRVrozBqtICLMKeKUkvmA%3D","perteval-paper-unveiling-real-knowledge-capacity-of-llms-with-knowledge-invariant-perturbations",1791231333,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":181,"category_name":40,"create_tm":213},419356,"Comparing large language models and search engine responses to common orthodontic questions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229922304747/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=gY7msXdyrl7SmTAINYmRiyyAPjc%3D","comparing-large-language-models-and-search-engine-responses-to-common-orthodontic-questions",1790616699,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":14,"category_name":40,"create_tm":219},732867,"Programming Languages for Information Security - A Dissertation - Doctor of Philosophy","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031413400/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=qKBS9Em9BOozMnXJDDCJwSqzmqU%3D","programming-languages-for-information-security-a-dissertation-doctor-of-philosophy",1795382634,{"doc_id":221,"doc_title":222,"file_type":137,"home_preview_img_url":223,"slug":224,"view_count":19,"category_name":40,"create_tm":225},672648,"Functional Shell and Reusable Components for Easy GUIs","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229989726117/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=jJIP4XtrCzD2B3MkWZJ6xapRgWk%3D","functional-shell-and-reusable-components-for-easy-guis",1793602830]