{"id":13561697,"url":"https://github.com/benweidig/a-functional-approach-to-java","last_synced_at":"2026-01-16T18:49:37.146Z","repository":{"id":165621124,"uuid":"597107330","full_name":"benweidig/a-functional-approach-to-java","owner":"benweidig","description":"Examples of the O'Reilly book \"A Functional Approach to Java\"","archived":false,"fork":false,"pushed_at":"2024-07-27T13:57:01.000Z","size":881,"stargazers_count":47,"open_issues_count":0,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T17:38:38.970Z","etag":null,"topics":["book","functional-programming","java","object-oriented","oreilly"],"latest_commit_sha":null,"homepage":"https://www.oreilly.com/library/view/a-functional-approach/9781098109912/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benweidig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-03T16:39:21.000Z","updated_at":"2025-03-21T09:09:35.000Z","dependencies_parsed_at":"2024-06-22T07:39:09.913Z","dependency_job_id":"620f18d5-ccc6-43c8-927f-01be2538cd0e","html_url":"https://github.com/benweidig/a-functional-approach-to-java","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/benweidig/a-functional-approach-to-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benweidig%2Fa-functional-approach-to-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benweidig%2Fa-functional-approach-to-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benweidig%2Fa-functional-approach-to-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benweidig%2Fa-functional-approach-to-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benweidig","download_url":"https://codeload.github.com/benweidig/a-functional-approach-to-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benweidig%2Fa-functional-approach-to-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["book","functional-programming","java","object-oriented","oreilly"],"created_at":"2024-08-01T13:01:00.062Z","updated_at":"2026-01-16T18:49:37.122Z","avatar_url":"https://github.com/benweidig.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# A Functional Approach to Java\n\nThis is the accompanying repository for the O'Reilly book [A Functional Approach to Java](https://a-functional-approach-to-java.com).\n\n\u003cimg src=\"assets/a-functional-approach-to-java.png\" alt=\"Book Cover\" height=\"400\" width=\"305\" title=\"Book Cover\" /\u003e\n\n\n## How To Use\n\nThe repository is structured like the book.\n\nEach explicit example has its own directory containing code, usually Java and JShell files.\n\nThe actual implementation of the examples might differ from their counterparts in the book to make them easier to use.\n\nMany examples are supposed to highlight how a specific code syntax is used and don't represent a full-fledged example with actual output.\nEspecially JShell scripts don't have explicit output, but the results are printed anyway.\n\nNevertheless, the examples should be helpful as a starting point to experiment.\n\n### Java/Gradle\n\nTo not require a myriad of intermediate folders (`src/main/java` etc.), the examples are plain files with an adapted classpath.\nThis way, you can start sill start examples with Gradle.\n\nAll examples are grouped by chapters, see:\n\n```shell\n./gradlew tasks\n```\n\nThe task name for each example is unique and runs without requiring the subproject:\n\n```shell\n# Actually runs :02-functional-java:example-2-9\n./gradlew example-2-9\n```\n\n\n### JShell\n\nExamples with lowercase-dash-separated names are JShell-compatible files.\nThey have the `.jsh` extension, so they do not clash with the `.java` files for Gradle.\n\nThe examples from the book can mostly be run directly in [JShell](https://belief-driven-design.com/jshell-the-java-repl-82d804e6cbf/):\n\n\n```shell\njshell part-2/06-data-processing-with-streams/example-6-15/fruits-naive.jsh\n\n# or\n\ncd part-2/06-data-processing-with-streams/example-6-15/\njshell fruits-naive.jsh\n```\n\nSome code, however, demonstrates invalid code, throws Exceptions, or won't compile at all.\nOther examples won't compile due to parsing rules of new lines.\nI've tried to mark such examples with a comment in the header.\n\n\n\n## Get the Book\n\nBesides using the [O'Reilly Learning Platform](https://www.oreilly.com/library/view/a-functional-approach/9781098109912/), you can buy a paperback version of the book at your favorite store.\nHere are a few direct links to US stores:\n\n* [Amazon](https://www.amazon.com/-/de/dp/1098109929)\n* [Barnes \u0026 Noble](https://www.barnesandnoble.com/w/a-functional-approach-to-java-ben-weidig/1141565109?ean=9781098109929)\n* [Books Inc](https://www.booksinc.net/book/9781098109929)\n* [Powell's Books](https://www.powells.com/book/functional-approach-to-java-augmenting-object-oriented-java-code-with-functional-principles-9781098109929)\n\nISBN-10: 1098109929  \nISBN-13: 9781098109929\n\nThe book is also available in Polish and Korean:\n\n* [Helion.pl (Polish)](https://helion.pl/ksiazki/java-podejscie-funkcyjne-rozszerzanie-obiektowego-kodu-javy-o-zasady-programowania-funkcyjnego-ben-weidig,japofu.htm)\n* [Kyobo (Korean)](https://product.kyobobook.co.kr/detail/S000212762854)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenweidig%2Fa-functional-approach-to-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenweidig%2Fa-functional-approach-to-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenweidig%2Fa-functional-approach-to-java/lists"}