CINXE.COM

GitHub - tonivade/purefun: Functional Programming library for Java

<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system" data-a11y-link-underlines="true" > <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-74231a1f3bbb.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-8a995f0bacd4.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-f37fb7684b1f.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-9ac301c3ebe5.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-cd826e8636dc.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-f91b0f603451.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-83beb16e0ecf.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-6e122dab64fc.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-18119e682df0.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-225433424a87.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-cba26849680f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-b6cb3703b934.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-ea73c9cb5377.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-4fce88777fa8.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-0210be90f4d3.css" /> <script type="application/json" id="client-env">{"locale":"en","featureFlags":["contentful_lp_flex_features_actions","contentful_lp_flex_features_codespaces","contentful_lp_flex_features_code_review","contentful_lp_flex_features_code_search","contentful_lp_flex_features_discussions","contentful_lp_flex_features_issues","copilot_immersive_issue_preview","copilot_new_references_ui","copilot_chat_repo_custom_instructions_preview","copilot_no_floating_button","copilot_topics_as_references","copilot_read_shared_conversation","copilot_duplicate_thread","dotcom_chat_client_side_skills","experimentation_azure_variant_endpoint","failbot_handle_non_errors","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","github_models_gateway_parse_params","github_models_o3_mini_streaming","insert_before_patch","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","issues_advanced_search_nested_ownership_filters","issues_dashboard_no_redirects","marketing_pages_search_explore_provider","primer_react_css_modules_ga","react_data_router_pull_requests","react_override_default_key","remove_child_patch","sample_network_conn_type","swp_enterprise_contact_form","site_copilot_pro_plus","site_proxima_australia_update","viewscreen_sandbox","issues_react_create_milestone","issues_react_cache_fix_workaround","lifecycle_label_name_updates","copilot_task_oriented_assistive_prompts","issue_types_prevent_private_type_creation","refresh_image_video_src","react_router_dispose_on_disconnect","codespaces_prebuild_region_target_update","turbo_app_id_restore","copilot_code_review_sign_up_closed"]}</script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-89488af87085.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-9da652f58479.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-3abb8f-46b9f4874d95.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-952d624642a1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-f04cb2a9fc8c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-0dbb79f97f8f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-62d275b7ddd9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-78748950cb0c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-a90ac05d2469.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-a1760ffda83d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-ceef33f593fa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-c44a69-efa32db3a345.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-394f8eb34f19.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-fdc7225e42cc.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-2906d7-2a07a295af40.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-be8cb88f481b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-a4a1922eb55f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-a03ee12d659a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-b6294cf703b7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-e3180fe3bcb3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-947061-e7a6c4a19f98.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-62f3e9c52ece.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-768abe60b1f8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-3e000c5d31a9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-d0d0a6-e7f74ee74d91.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-4bcbbbfbe1d4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-1884a015a8c7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-01e85cd1be94.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js-94dc7a2157c1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-4b93df70b903.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-52913063a0b9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-b419a25ee02f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-3eebbd-0763620ad7bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_decorators_js-node_modules_delegated-events_di-e161aa-9d41fb1b6c9e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_remote--3c9c82-b71ef90fbdc7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-10217e4e5a53.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_catalyst_lib_inde-dbbea9-26cce2010167.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-d6d3c94ee97e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-99bc880bd101.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-25e9ddbd9991.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-f1bca44e0926.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-cf2f2ab8dab4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-434cb6-95f395b76298.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-9a233856b02c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-55fea94174bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-0e7e3f0bfc4b.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.a490b7c9fa319e5cb069.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.a490b7c9fa319e5cb069.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <title>GitHub - tonivade/purefun: Functional Programming library for Java</title> <meta name="route-pattern" content="/:user_id/:repository" data-turbo-transient> <meta name="route-controller" content="files" data-turbo-transient> <meta name="route-action" content="disambiguate" data-turbo-transient> <meta name="current-catalog-service-hash" content="f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb"> <meta name="request-id" content="970E:1654BF:4AE2E:5C55F:67F0BA59" data-pjax-transient="true"/><meta name="html-safe-nonce" content="faf3ee42a1e250abeb1ed07c74f4dcda2405f1fc904c2ffb77b5014341600ac7" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzBFOjE2NTRCRjo0QUUyRTo1QzU1Rjo2N0YwQkE1OSIsInZpc2l0b3JfaWQiOiI3NjY1OTM1OTI0MDUwNTczOTEzIiwicmVnaW9uX2VkZ2UiOiJzb3V0aGVhc3Rhc2lhIiwicmVnaW9uX3JlbmRlciI6InNvdXRoZWFzdGFzaWEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="fb0604bbfdc77f8fe6426318394b14d06adb10235e9a008d8134cef71f6b4a1d" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:142195981" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,copilot" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;repo-name&gt;" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Functional Programming library for Java. Contribute to tonivade/purefun development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/tonivade/purefun" /> <meta name="twitter:image" content="https://opengraph.githubassets.com/7c8d1363f95e20a814cdca2892f4cf227e8838ff6e6ff1aa1910409ded6978bc/tonivade/purefun" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="GitHub - tonivade/purefun: Functional Programming library for Java" /><meta name="twitter:description" content="Functional Programming library for Java. Contribute to tonivade/purefun development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/7c8d1363f95e20a814cdca2892f4cf227e8838ff6e6ff1aa1910409ded6978bc/tonivade/purefun" /><meta property="og:image:alt" content="Functional Programming library for Java. Contribute to tonivade/purefun development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="GitHub - tonivade/purefun: Functional Programming library for Java" /><meta property="og:url" content="https://github.com/tonivade/purefun" /><meta property="og:description" content="Functional Programming library for Java. Contribute to tonivade/purefun development by creating an account on GitHub." /> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta http-equiv="x-pjax-version" content="02a7054966f6e852d6433d8e36068459d9bdce0ac44a7bf3404443f2caf9e686" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="e26f9f0ba624ee85cc7ac057d8faa8618a4f25a85eab052c33d018ac0f6b1a46" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="205838381d6e5f35c535dbb12458f905bc43e0b186c86bf75aabbd0c0f36537c" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="69224d30d454d07137548bdbb460eb0ecb2b69d9b4469b956de88fbfafc08d83" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/tonivade/purefun git https://github.com/tonivade/purefun.git"> <meta name="octolytics-dimension-user_id" content="4076036" /><meta name="octolytics-dimension-user_login" content="tonivade" /><meta name="octolytics-dimension-repository_id" content="142195981" /><meta name="octolytics-dimension-repository_nwo" content="tonivade/purefun" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="142195981" /><meta name="octolytics-dimension-repository_network_root_nwo" content="tonivade/purefun" /> <link rel="canonical" href="https://github.com/tonivade/purefun" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="release" content="911079cb5ef57e48562b4d6599f76e4dfe45effe"> <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative header-wrapper js-header-wrapper "> <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ui-commands_ui-commands_ts-2d52c8e72e64.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-1edadb4bd04c.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.a490b7c9fa319e5cb069.module.css" /> <react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script> <div data-target="react-partial.reactRoot"></div> </react-partial> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-4898d1bf4b51.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-45d6658f8b6b.js"></script> <header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark> <h2 class="sr-only">Navigation Menu</h2> <button type="button" class="HeaderMktg-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span class="d-none">Toggle navigation</span> </button> <div class="d-flex flex-column flex-lg-row flex-items-center px-3 px-md-4 px-lg-5 height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <div class="flex-1"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target js-nav-padding-recalculate js-header-menu-toggle Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span class="Button-content"> <span class="Button-label"><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span> </button> </div> <a class="mr-lg-3 color-fg-inherit flex-order-2 js-prevent-focus-on-mobile-nav" href="/" aria-label="Homepage" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to go to homepage&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Logomark;ref_loc:Header&quot;}"> <svg height="32" aria-hidden="true" viewBox="0 0 24 24" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <div class="flex-1 flex-order-2 text-right"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Ftonivade%2Fpurefun" class="HeaderMenu-link HeaderMenu-button d-inline-flex d-lg-none flex-order-1 f5 no-underline border color-border-default rounded-2 px-2 py-1 color-fg-inherit js-prevent-focus-on-mobile-nav" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9095ccf77abbd829d1a242725d575182ea85e7ea1424ff85bc6d96e06f0c7dd1" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to Sign in&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Sign in;ref_loc:Header&quot;}" > Sign in </a> </div> </div> <div class="HeaderMenu js-header-menu height-fit position-lg-relative d-lg-flex flex-column flex-auto top-0"> <div class="HeaderMenu-wrapper d-flex flex-column flex-self-start flex-lg-row flex-auto rounded rounded-lg-0"> <nav class="HeaderMenu-nav" aria-label="Global"> <ul class="d-lg-flex list-style-none"> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_copilot&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_copilot_link_product_navbar&quot;}" href="https://github.com/features/copilot"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Copilot</div> Write better code with AI </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_advanced_security&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_advanced_security_link_product_navbar&quot;}" href="https://github.com/security/advanced-security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Advanced Security</div> Find and fix vulnerabilities </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;actions&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;actions_link_product_navbar&quot;}" href="https://github.com/features/actions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path> </svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;codespaces&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;codespaces_link_product_navbar&quot;}" href="https://github.com/features/codespaces"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;issues&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;issues_link_product_navbar&quot;}" href="https://github.com/features/issues"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path> </svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;code_review&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;code_review_link_product_navbar&quot;}" href="https://github.com/features/code-review"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Review</div> Manage code changes </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;discussions&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;discussions_link_product_navbar&quot;}" href="https://github.com/features/discussions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;code_search&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;code_search_link_product_navbar&quot;}" href="https://github.com/features/code-search"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-square color-fg-subtle mr-3"> <path d="M10.3 8.24a.75.75 0 0 1-.04 1.06L7.352 12l2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M2 3.75C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25Zm1.75-.25a.25.25 0 0 0-.25.25v16.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Search</div> Find more, search less </div> </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="product-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="product-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;all_features&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;all_features_link_product_navbar&quot;}" href="https://github.com/features"> All features </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;documentation&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;documentation_link_product_navbar&quot;}" href="https://docs.github.com"> Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_skills&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_skills_link_product_navbar&quot;}" href="https://skills.github.com"> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;blog&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;blog_link_product_navbar&quot;}" href="https://github.blog"> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 pb-lg-3 mb-3 mb-lg-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-company-size-heading">By company size</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-company-size-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;enterprises&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;enterprises_link_solutions_navbar&quot;}" href="https://github.com/enterprise"> Enterprises </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;small_and_medium_teams&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;small_and_medium_teams_link_solutions_navbar&quot;}" href="https://github.com/team"> Small and medium teams </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;startups&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;startups_link_solutions_navbar&quot;}" href="https://github.com/enterprise/startups"> Startups </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;nonprofits&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;nonprofits_link_solutions_navbar&quot;}" href="/solutions/industry/nonprofits"> Nonprofits </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-use-case-heading">By use case</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-use-case-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devsecops&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devsecops_link_solutions_navbar&quot;}" href="/solutions/use-case/devsecops"> DevSecOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devops&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devops_link_solutions_navbar&quot;}" href="/solutions/use-case/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ci_cd&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ci_cd_link_solutions_navbar&quot;}" href="/solutions/use-case/ci-cd"> CI/CD </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all_use_cases&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_use_cases_link_solutions_navbar&quot;}" href="/solutions/use-case"> View all use cases </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-industry-heading">By industry</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-industry-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;healthcare&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;healthcare_link_solutions_navbar&quot;}" href="/solutions/industry/healthcare"> Healthcare </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;financial_services&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;financial_services_link_solutions_navbar&quot;}" href="/solutions/industry/financial-services"> Financial services </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;manufacturing&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;manufacturing_link_solutions_navbar&quot;}" href="/solutions/industry/manufacturing"> Manufacturing </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;government&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;government_link_solutions_navbar&quot;}" href="/solutions/industry/government"> Government </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all_industries&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_industries_link_solutions_navbar&quot;}" href="/solutions/industry"> View all industries </a></li> </ul> </div> </div> <div class="HeaderMenu-trailing-link rounded-bottom-2 flex-shrink-0 mt-lg-4 px-lg-4 py-4 py-lg-3 f5 text-semibold"> <a href="/solutions"> View all solutions <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-right HeaderMenu-trailing-link-icon"> <path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path> </svg> </a> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Resources <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-topics-heading">Topics</span> <ul class="list-style-none f5" aria-labelledby="resources-topics-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ai&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ai_link_resources_navbar&quot;}" href="/resources/articles/ai"> AI </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devops&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devops_link_resources_navbar&quot;}" href="/resources/articles/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;security&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;security_link_resources_navbar&quot;}" href="/resources/articles/security"> Security </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;software_development&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;software_development_link_resources_navbar&quot;}" href="/resources/articles/software-development"> Software Development </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_link_resources_navbar&quot;}" href="/resources/articles"> View all </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="resources-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;learning_pathways&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;learning_pathways_link_resources_navbar&quot;}" href="https://resources.github.com/learn/pathways"> Learning Pathways <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;events_amp_webinars&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;events_amp_webinars_link_resources_navbar&quot;}" href="https://resources.github.com"> Events &amp; Webinars <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ebooks_amp_whitepapers&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ebooks_amp_whitepapers_link_resources_navbar&quot;}" href="https://github.com/resources/whitepapers"> Ebooks &amp; Whitepapers </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;customer_stories&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;customer_stories_link_resources_navbar&quot;}" href="https://github.com/customer-stories"> Customer Stories </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;partners&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;partners_link_resources_navbar&quot;}" href="https://partner.github.com"> Partners <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;executive_insights&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;executive_insights_link_resources_navbar&quot;}" href="https://github.com/solutions/executive-insights"> Executive Insights </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_sponsors&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_sponsors_link_open_source_navbar&quot;}" href="/sponsors"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;the_readme_project&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;the_readme_project_link_open_source_navbar&quot;}" href="https://github.com/readme"> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="open-source-repositories-heading">Repositories</span> <ul class="list-style-none f5" aria-labelledby="open-source-repositories-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;topics&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;topics_link_open_source_navbar&quot;}" href="https://github.com/topics"> Topics </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;trending&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;trending_link_open_source_navbar&quot;}" href="https://github.com/trending"> Trending </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;collections&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;collections_link_open_source_navbar&quot;}" href="https://github.com/collections"> Collections </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Enterprise <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;enterprise_platform&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;enterprise_platform_link_enterprise_navbar&quot;}" href="/enterprise"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-stack color-fg-subtle mr-3"> <path d="M11.063 1.456a1.749 1.749 0 0 1 1.874 0l8.383 5.316a1.751 1.751 0 0 1 0 2.956l-8.383 5.316a1.749 1.749 0 0 1-1.874 0L2.68 9.728a1.751 1.751 0 0 1 0-2.956Zm1.071 1.267a.25.25 0 0 0-.268 0L3.483 8.039a.25.25 0 0 0 0 .422l8.383 5.316a.25.25 0 0 0 .268 0l8.383-5.316a.25.25 0 0 0 0-.422Z"></path><path d="M1.867 12.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path><path d="M1.867 16.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path> </svg> <div> <div class="color-fg-default h4">Enterprise platform</div> AI-powered developer platform </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="enterprise-available-add-ons-heading">Available add-ons</span> <ul class="list-style-none f5" aria-labelledby="enterprise-available-add-ons-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_advanced_security&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_advanced_security_link_enterprise_navbar&quot;}" href="https://github.com/security/advanced-security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Advanced Security</div> Enterprise-grade security features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;copilot_for_business&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;copilot_for_business_link_enterprise_navbar&quot;}" href="/features/copilot/copilot-business"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">Copilot for business</div> Enterprise-grade AI features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;premium_support&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;premium_support_link_enterprise_navbar&quot;}" href="/premium-support"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Premium Support</div> Enterprise-grade 24/7 support </div> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <a class="HeaderMenu-link no-underline px-0 px-lg-2 py-3 py-lg-2 d-block d-lg-inline-block" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;pricing&quot;,&quot;context&quot;:&quot;global&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;pricing_link_global_navbar&quot;}" href="https://github.com/pricing">Pricing</a> </li> </ul> </nav> <div class="d-flex flex-column flex-lg-row width-full flex-justify-end flex-lg-items-center text-center mt-3 mt-lg-0 text-lg-left ml-lg-3"> <qbsearch-input class="search-input" data-scope="repo:tonivade/purefun" data-custom-scopes-path="/search/custom_scopes" data-delete-custom-scopes-csrf="KkdCvt6jUwvM2RoDUpsiLTcZh7iu6RAH8poFMLdunqa4j0iIxrGR8f3CR84j122JYKA1tF0RW-QWcYZK6Z28aw" data-max-custom-scopes="10" data-header-redesign-enabled="false" data-initial-value="" data-blackbird-suggestions-path="/search/suggestions" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" data-current-repository="tonivade/purefun" data-current-org="" data-current-owner="tonivade" data-logged-in="false" data-copilot-chat-enabled="false" data-nl-search-enabled="false" data-retain-scroll-position="true"> <div class="search-input-container search-with-dialog position-relative d-flex flex-row flex-items-center mr-4 rounded" data-action="click:qbsearch-input#searchInputContainerClicked" > <button type="button" class="header-search-button placeholder input-button form-control d-flex flex-1 flex-self-stretch flex-items-center no-wrap width-full py-0 pl-2 pr-0 text-left border-0 box-shadow-none" data-target="qbsearch-input.inputButton" aria-label="Search or jump to…" aria-haspopup="dialog" placeholder="Search or jump to..." data-hotkey=s,/ autocapitalize="off" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;searchbar&quot;,&quot;context&quot;:&quot;global&quot;,&quot;tag&quot;:&quot;input&quot;,&quot;label&quot;:&quot;searchbar_input_global_navbar&quot;}" data-action="click:qbsearch-input#handleExpand" > <div class="mr-2 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <span class="flex-1" data-target="qbsearch-input.inputButtonText">Search or jump to...</span> <div class="d-flex" data-target="qbsearch-input.hotkeyIndicator"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> </div> </button> <input type="hidden" name="type" class="js-site-search-type-field"> <div class="Overlay--hidden " data-modal-dialog-overlay> <modal-dialog data-action="close:qbsearch-input#handleClose cancel:qbsearch-input#handleClose" data-target="qbsearch-input.searchSuggestionsDialog" role="dialog" id="search-suggestions-dialog" aria-modal="true" aria-labelledby="search-suggestions-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto"> <h1 id="search-suggestions-dialog-header" class="sr-only">Search code, repositories, users, issues, pull requests...</h1> <div class="Overlay-body Overlay-body--paddingNone"> <div data-view-component="true"> <div class="search-suggestions position-fixed width-full color-shadow-large border color-fg-default color-bg-default overflow-hidden d-flex flex-column query-builder-container" style="border-radius: 12px;" data-target="qbsearch-input.queryBuilderContainer" hidden > <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="query-builder-test-form" action="" accept-charset="UTF-8" method="get"> <query-builder data-target="qbsearch-input.queryBuilder" id="query-builder-query-builder-test" data-filter-key=":" data-view-component="true" class="QueryBuilder search-query-builder"> <div class="FormControl FormControl--fullWidth"> <label id="query-builder-test-label" for="query-builder-test" class="FormControl-label sr-only"> Search </label> <div class="QueryBuilder-StyledInput width-fit " data-target="query-builder.styledInput" > <span id="query-builder-test-leadingvisual-wrap" class="FormControl-input-leadingVisualWrap QueryBuilder-leadingVisualWrap"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search FormControl-input-leadingVisual"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </span> <div data-target="query-builder.styledInputContainer" class="QueryBuilder-StyledInputContainer"> <div aria-hidden="true" class="QueryBuilder-StyledInputContent" data-target="query-builder.styledInputContent" ></div> <div class="QueryBuilder-InputWrapper"> <div aria-hidden="true" class="QueryBuilder-Sizer" data-target="query-builder.sizer"></div> <input id="query-builder-test" name="query-builder-test" value="" autocomplete="off" type="text" role="combobox" spellcheck="false" aria-expanded="false" aria-describedby="validation-63d20d70-987d-4ec2-8cdf-d55c0c6917cc" data-target="query-builder.input" data-action=" input:query-builder#inputChange blur:query-builder#inputBlur keydown:query-builder#inputKeydown focus:query-builder#inputFocus " data-view-component="true" class="FormControl-input QueryBuilder-Input FormControl-medium" /> </div> </div> <span class="sr-only" id="query-builder-test-clear">Clear</span> <button role="button" id="query-builder-test-clear-button" aria-labelledby="query-builder-test-clear query-builder-test-label" data-target="query-builder.clearButton" data-action=" click:query-builder#clear focus:query-builder#clearButtonFocus blur:query-builder#clearButtonBlur " variant="small" hidden="hidden" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium mr-1 px-2 py-0 d-flex flex-items-center rounded-1 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x-circle-fill Button-visual"> <path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path> </svg> </button> </div> <template id="search-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </template> <template id="code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="file-code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-code"> <path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path> </svg> </template> <template id="history-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path> </svg> </template> <template id="repo-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> </template> <template id="bookmark-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bookmark"> <path d="M3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 0 1-1.227.579L8 11.722l-3.773 3.107A.751.751 0 0 1 3 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.91l3.023-2.489a.75.75 0 0 1 .954 0l3.023 2.49V2.75a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="plus-circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-plus-circle"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7.25-3.25v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> </template> <template id="trash-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-trash"> <path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path> </svg> </template> <template id="team-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-people"> <path d="M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"></path> </svg> </template> <template id="project-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> </template> <template id="pencil-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pencil"> <path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path> </svg> </template> <template id="copilot-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot"> <path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="copilot-error-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot-error"> <path d="M16 11.24c0 .112-.072.274-.21.467L13 9.688V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-.198 0-.388-.009-.571-.029L6.833 5.226a4.01 4.01 0 0 0 .17-.782c.117-.935-.037-1.395-.241-1.614-.193-.206-.637-.413-1.682-.297-.683.076-1.115.231-1.395.415l-1.257-.91c.579-.564 1.413-.877 2.485-.996 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095Zm-5.083-8.707c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Zm2.511 11.074c-1.393.776-3.272 1.428-5.43 1.428-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.18-.455-.241-.963-.252-1.475L.31 4.107A.747.747 0 0 1 0 3.509V3.49a.748.748 0 0 1 .625-.73c.156-.026.306.047.435.139l14.667 10.578a.592.592 0 0 1 .227.264.752.752 0 0 1 .046.249v.022a.75.75 0 0 1-1.19.596Zm-1.367-.991L5.635 7.964a5.128 5.128 0 0 1-.889.073c-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433 1.539 0 3.089-.505 4.063-.934Z"></path> </svg> </template> <template id="workflow-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-workflow"> <path d="M0 1.75C0 .784.784 0 1.75 0h3.5C6.216 0 7 .784 7 1.75v3.5A1.75 1.75 0 0 1 5.25 7H4v4a1 1 0 0 0 1 1h4v-1.25C9 9.784 9.784 9 10.75 9h3.5c.966 0 1.75.784 1.75 1.75v3.5A1.75 1.75 0 0 1 14.25 16h-3.5A1.75 1.75 0 0 1 9 14.25v-.75H5A2.5 2.5 0 0 1 2.5 11V7h-.75A1.75 1.75 0 0 1 0 5.25Zm1.75-.25a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Zm9 9a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="book-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> </template> <template id="code-review-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-review"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="codespaces-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-codespaces"> <path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> </template> <template id="comment-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment"> <path d="M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h4.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="comment-discussion-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </template> <template id="organization-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-organization"> <path d="M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="rocket-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-rocket"> <path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </template> <template id="shield-check-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield-check"> <path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="heart-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-heart"> <path d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"></path> </svg> </template> <template id="server-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-server"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="globe-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-globe"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"></path> </svg> </template> <template id="issue-opened-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </template> <template id="device-mobile-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-mobile"> <path d="M3.75 0h8.5C13.216 0 14 .784 14 1.75v12.5A1.75 1.75 0 0 1 12.25 16h-8.5A1.75 1.75 0 0 1 2 14.25V1.75C2 .784 2.784 0 3.75 0ZM3.5 1.75v12.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM8 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path> </svg> </template> <template id="package-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-package"> <path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"></path> </svg> </template> <template id="credit-card-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-credit-card"> <path d="M10.75 9a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5h-1.5Z"></path><path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25ZM14.5 6.5h-13v5.75c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm0-2.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25V5h13Z"></path> </svg> </template> <template id="play-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </template> <template id="gift-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-gift"> <path d="M2 2.75A2.75 2.75 0 0 1 4.75 0c.983 0 1.873.42 2.57 1.232.268.318.497.668.68 1.042.183-.375.411-.725.68-1.044C9.376.42 10.266 0 11.25 0a2.75 2.75 0 0 1 2.45 4h.55c.966 0 1.75.784 1.75 1.75v2c0 .698-.409 1.301-1 1.582v4.918A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25V9.332C.409 9.05 0 8.448 0 7.75v-2C0 4.784.784 4 1.75 4h.55c-.192-.375-.3-.8-.3-1.25ZM7.25 9.5H2.5v4.75c0 .138.112.25.25.25h4.5Zm1.5 0v5h4.5a.25.25 0 0 0 .25-.25V9.5Zm0-4V8h5.5a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm-7 0a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h5.5V5.5h-5.5Zm3-4a1.25 1.25 0 0 0 0 2.5h2.309c-.233-.818-.542-1.401-.878-1.793-.43-.502-.915-.707-1.431-.707ZM8.941 4h2.309a1.25 1.25 0 0 0 0-2.5c-.516 0-1 .205-1.43.707-.337.392-.646.975-.879 1.793Z"></path> </svg> </template> <template id="code-square-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="device-desktop-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-desktop"> <path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5Z"></path> </svg> </template> <div class="position-relative"> <ul role="listbox" class="ActionListWrap QueryBuilder-ListWrap" aria-label="Suggestions" data-action=" combobox-commit:query-builder#comboboxCommit mousedown:query-builder#resultsMousedown " data-target="query-builder.resultsList" data-persist-list=false id="query-builder-test-results" ></ul> </div> <div class="FormControl-inlineValidation" id="validation-63d20d70-987d-4ec2-8cdf-d55c0c6917cc" hidden="hidden"> <span class="FormControl-inlineValidation--visual"> <svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg> </span> <span></span> </div> </div> <div data-target="query-builder.screenReaderFeedback" aria-live="polite" aria-atomic="true" class="sr-only"></div> </query-builder></form> <div class="d-flex flex-row color-fg-muted px-3 text-small color-bg-default search-feedback-prompt"> <a target="_blank" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax" data-view-component="true" class="Link color-fg-accent text-normal ml-2">Search syntax tips</a> <div class="d-flex flex-1"></div> </div> </div> </div> </div> </modal-dialog></div> </div> <div data-action="click:qbsearch-input#retract" class="dark-backdrop position-fixed" hidden data-target="qbsearch-input.darkBackdrop"></div> <div class="color-fg-default"> <dialog-helper> <dialog data-target="qbsearch-input.feedbackDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="feedback-dialog" aria-modal="true" aria-labelledby="feedback-dialog-title" aria-describedby="feedback-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="feedback-dialog-title"> Provide feedback </h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="feedback-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="feedback-dialog-title"> <div data-view-component="true" class="Overlay-body"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="code-search-feedback-form" data-turbo="false" action="/search/feedback" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="pCCjHrHuerGTpBZqIV9HUxn4XXauY1/Af7/juxqFzBWDpzliXf64FzPEfF80ExfZZFgQ8A0JKoj5OocwzjxJAA==" /> <p>We read every piece of feedback, and take your input very seriously.</p> <textarea name="feedback" class="form-control width-full mb-2" style="height: 120px" id="feedback"></textarea> <input name="include_email" id="include_email" aria-label="Include my email address so I can be contacted" class="form-control mr-2" type="checkbox"> <label for="include_email" style="font-weight: normal">Include my email address so I can be contacted</label> </form></div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="feedback-dialog" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="code-search-feedback-form" data-action="click:qbsearch-input#submitFeedback" type="submit" data-view-component="true" class="btn-primary btn"> Submit feedback </button> </div> </dialog></dialog-helper> <custom-scopes data-target="qbsearch-input.customScopesManager"> <dialog-helper> <dialog data-target="custom-scopes.customScopesModalDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="custom-scopes-dialog" aria-modal="true" aria-labelledby="custom-scopes-dialog-title" aria-describedby="custom-scopes-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="custom-scopes-dialog-title"> Saved searches </h1> <h2 id="custom-scopes-dialog-description" class="Overlay-description">Use saved searches to filter your results more quickly</h2> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="custom-scopes-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="custom-scopes-dialog-title"> <div data-view-component="true" class="Overlay-body"> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <div hidden class="create-custom-scope-form" data-target="custom-scopes.createCustomScopeForm"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="custom-scopes-dialog-form" data-turbo="false" action="/search/custom_scopes" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="SD8/9nzCTty9uoXa4p74b16UhO7RidvnuF41aVPHxuItMLC14kybLLAJvOOCMhRDbX880qEl1mbs+TA7dix9YA==" /> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <input type="hidden" id="custom_scope_id" name="custom_scope_id" data-target="custom-scopes.customScopesIdField"> <div class="form-group"> <label for="custom_scope_name">Name</label> <auto-check src="/search/custom_scopes/check_name" required only-validate-on-blur="false"> <input type="text" name="custom_scope_name" id="custom_scope_name" data-target="custom-scopes.customScopesNameField" class="form-control" autocomplete="off" placeholder="github-ruby" required maxlength="50"> <input type="hidden" data-csrf="true" value="4oV0KWGsTcfss5sGu44DTeS1truRXSwL7Fw1xi868+tZnCQkW44M+myYDoFqQbxzRscFTBJe3yLnqO+yQKJVPw==" /> </auto-check> </div> <div class="form-group"> <label for="custom_scope_query">Query</label> <input type="text" name="custom_scope_query" id="custom_scope_query" data-target="custom-scopes.customScopesQueryField" class="form-control" autocomplete="off" placeholder="(repo:mona/a OR repo:mona/b) AND lang:python" required maxlength="500"> </div> <p class="text-small color-fg-muted"> To see all available qualifiers, see our <a class="Link--inTextBlock" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax">documentation</a>. </p> </form> </div> <div data-target="custom-scopes.manageCustomScopesForm"> <div data-target="custom-scopes.list"></div> </div> </div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd Overlay-footer--divided"> <button data-action="click:custom-scopes#customScopesCancel" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="custom-scopes-dialog-form" data-action="click:custom-scopes#customScopesSubmit" data-target="custom-scopes.customScopesSubmitButton" type="submit" data-view-component="true" class="btn-primary btn"> Create saved search </button> </div> </dialog></dialog-helper> </custom-scopes> </div> </qbsearch-input> <div class="position-relative HeaderMenu-link-wrap d-lg-inline-block"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Ftonivade%2Fpurefun" class="HeaderMenu-link HeaderMenu-link--sign-in HeaderMenu-button flex-shrink-0 no-underline d-none d-lg-inline-flex border border-lg-0 rounded rounded-lg-0 px-2 py-1" style="margin-left: 12px;" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9095ccf77abbd829d1a242725d575182ea85e7ea1424ff85bc6d96e06f0c7dd1" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to go to homepage&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Sign in;ref_loc:Header&quot;}" > Sign in </a> </div> <a href="/signup?ref_cta=Sign+up&amp;ref_loc=header+logged+out&amp;ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&amp;source=header-repo&amp;source_repo=tonivade%2Fpurefun" class="HeaderMenu-link HeaderMenu-link--sign-up HeaderMenu-button flex-shrink-0 d-flex d-lg-inline-flex no-underline border color-border-default rounded px-2 py-1" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9095ccf77abbd829d1a242725d575182ea85e7ea1424ff85bc6d96e06f0c7dd1" data-analytics-event="{&quot;category&quot;:&quot;Sign up&quot;,&quot;action&quot;:&quot;click to sign up for account&quot;,&quot;label&quot;:&quot;ref_page:/&lt;user-name&gt;/&lt;repo-name&gt;;ref_cta:Sign up;ref_loc:header logged out&quot;}" > Sign up </a> <button type="button" class="sr-only js-header-menu-focus-trap d-block d-lg-none">Reseting focus</button> </div> </div> </div> </div> </header> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <button id="icon-button-db78bc9b-07a1-4d97-a428-cf5472ba64b9" aria-labelledby="tooltip-6784c45f-e5a5-4799-8155-c438b6427a85" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button><tool-tip id="tooltip-6784c45f-e5a5-4799-8155-c438b6427a85" for="icon-button-db78bc9b-07a1-4d97-a428-cf5472ba64b9" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" class="flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled data-project-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--page-header-bgColor, var(--color-page-header-bg));" data-turbo-replace> <div class="d-flex flex-nowrap flex-justify-end mb-3 px-3 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <span class="author flex-self-stretch" itemprop="author"> <a class="url fn" rel="author" data-hovercard-type="user" data-hovercard-url="/users/tonivade/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/tonivade"> tonivade </a> </span> <span class="mx-1 flex-self-stretch color-fg-muted">/</span> <strong itemprop="name" class="mr-2 flex-self-stretch"> <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/tonivade/purefun">purefun</a> </strong> <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span> </div> </div> <div id="repository-details-container" class="flex-shrink-0" data-turbo-replace style="max-width: 70%;"> <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;"> <li> <a href="/login?return_to=%2Ftonivade%2Fpurefun" rel="nofollow" id="repository-details-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d59ad3af6b7d12a461ba6d5031508a3120a172e034aa04aafd923fe1a081f349" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-f42a76b5-444c-4a89-9e0c-e07bf08566a1" for="repository-details-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </li> <li> <a icon="repo-forked" id="fork-button" href="/login?return_to=%2Ftonivade%2Fpurefun" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;repo details fork button&quot;,&quot;repository_id&quot;:142195981,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9b8755a9713d564cc7ac0a3b4d163a261f0c32796f336a16850b671ca843731e" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg>Fork <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="4" data-view-component="true" class="Counter">4</span> </a> </li> <li> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2Ftonivade%2Fpurefun" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:142195981,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="44858b282283807ee63528187a10bd9b11b7e7dcce23f4e52474cebc4ecf69dd" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> <span id="repo-stars-counter-star" aria-label="131 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="131" data-view-component="true" class="Counter js-social-count">131</span> </a></div> </li> </ul> </div> </div> <div id="responsive-meta-container" data-turbo-replace> <div class="d-block d-md-none mb-2 px-3 px-md-4 px-lg-5"> <p class="f4 mb-3 "> Functional Programming library for Java </p> <h3 class="sr-only">License</h3> <div class="mb-2"> <a href="/tonivade/purefun/blob/master/LICENSE" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:license&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> MIT license </a> </div> <div class="mb-3"> <a class="Link--secondary no-underline mr-3" href="/tonivade/purefun/stargazers"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star mr-1"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <span class="text-bold">131</span> stars </a> <a class="Link--secondary no-underline mr-3" href="/tonivade/purefun/forks"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-1"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> <span class="text-bold">4</span> forks </a> <a class="Link--secondary no-underline mr-3 d-inline-block" href="/tonivade/purefun/branches"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch mr-1"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path> </svg> <span>Branches</span> </a> <a class="Link--secondary no-underline d-inline-block" href="/tonivade/purefun/tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-tag mr-1"> <path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path> </svg> <span>Tags</span> </a> <a class="Link--secondary no-underline d-inline-block" href="/tonivade/purefun/activity"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pulse mr-1"> <path d="M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"></path> </svg> <span>Activity</span> </a> </div> <div class="d-flex flex-wrap gap-2"> <div class="flex-1"> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2Ftonivade%2Fpurefun" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:142195981,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="44858b282283807ee63528187a10bd9b11b7e7dcce23f4e52474cebc4ecf69dd" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn btn-block"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> </a></div> </div> <div class="flex-1"> <a href="/login?return_to=%2Ftonivade%2Fpurefun" rel="nofollow" id="files-overview-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/tonivade/purefun&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d59ad3af6b7d12a461ba6d5031508a3120a172e034aa04aafd923fe1a081f349" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn btn-block"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-6374a96c-9b98-4d0f-9178-dad1d29c8e3d" for="files-overview-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </div> <span> </span> </div> </div> </div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <ul data-view-component="true" class="UnderlineNav-body list-style-none"> <li data-view-component="true" class="d-inline-flex"> <a id="code-tab" href="/tonivade/purefun" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments repo_attestations /tonivade/purefun" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Code&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> <span data-content="Code">Code</span> <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="issues-tab" href="/tonivade/purefun/issues" data-tab-item="i1issues-tab" data-selected-links="repo_issues repo_labels repo_milestones /tonivade/purefun/issues" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g i" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Issues&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> <span data-content="Issues">Issues</span> <span id="issues-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="9" data-view-component="true" class="Counter">9</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="pull-requests-tab" href="/tonivade/purefun/pulls" data-tab-item="i2pull-requests-tab" data-selected-links="repo_pulls checks /tonivade/purefun/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Pull requests&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> <span data-content="Pull requests">Pull requests</span> <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="3" data-view-component="true" class="Counter">3</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="actions-tab" href="/tonivade/purefun/actions" data-tab-item="i3actions-tab" data-selected-links="repo_actions /tonivade/purefun/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Actions&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> <span data-content="Actions">Actions</span> <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="projects-tab" href="/tonivade/purefun/projects" data-tab-item="i4projects-tab" data-selected-links="repo_projects new_repo_project repo_project /tonivade/purefun/projects" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g b" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Projects&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> <span data-content="Projects">Projects</span> <span id="projects-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="0" hidden="hidden" data-view-component="true" class="Counter">0</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="security-tab" href="/tonivade/purefun/security" data-tab-item="i5security-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /tonivade/purefun/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Security&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span data-content="Security">Security</span> <include-fragment src="/tonivade/purefun/security/overall-count" accept="text/fragment+html"></include-fragment> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="insights-tab" href="/tonivade/purefun/pulse" data-tab-item="i6insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /tonivade/purefun/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Insights&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> <span data-content="Insights">Insights</span> <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> </ul> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <action-menu data-select-variant="none" data-view-component="true"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-button" popovertarget="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-overlay" aria-controls="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-list" aria-haspopup="true" aria-labelledby="tooltip-d71b9269-199c-42fd-a379-3471e46a2329" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </button><tool-tip id="tooltip-d71b9269-199c-42fd-a379-3471e46a2329" for="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Additional navigation options</tool-tip> <anchored-position data-target="action-menu.overlay" id="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-overlay" anchor="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-button" id="action-menu-72825a9b-3f37-4b57-803b-6e2632be61ee-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li hidden="hidden" data-menu-item="i0code-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-fc9e7cd6-fdd3-4b9e-95d1-aeed6ebad848" href="/tonivade/purefun" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Code </span> </a> </li> <li hidden="hidden" data-menu-item="i1issues-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-903cb68b-093d-48d8-b3f3-99b211205b1f" href="/tonivade/purefun/issues" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Issues </span> </a> </li> <li hidden="hidden" data-menu-item="i2pull-requests-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-0b00eb1a-2b04-4e46-b477-550dbb6449b4" href="/tonivade/purefun/pulls" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Pull requests </span> </a> </li> <li hidden="hidden" data-menu-item="i3actions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-6bba6c11-ca86-4103-826a-b0012d70cfea" href="/tonivade/purefun/actions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Actions </span> </a> </li> <li hidden="hidden" data-menu-item="i4projects-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-8c0555b6-65b3-4f58-953a-aefcaf4ad0d8" href="/tonivade/purefun/projects" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Projects </span> </a> </li> <li hidden="hidden" data-menu-item="i5security-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-55f2aa33-56cc-4a0e-9f9a-5f2bd02aaa10" href="/tonivade/purefun/security" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Security </span> </a> </li> <li hidden="hidden" data-menu-item="i6insights-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-fbefe867-dc96-4885-b270-04e39683586b" href="/tonivade/purefun/pulse" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Insights </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu></div> </nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <h1 class='sr-only'>tonivade/purefun</h1> <div class="clearfix container-xl px-md-4 px-lg-5 px-3"> <div> <div style="max-width: 100%" data-view-component="true" class="Layout Layout--flowRow-until-md react-repos-overview-margin Layout--sidebarPosition-end Layout--sidebarPosition-flowRow-end"> <div data-view-component="true" class="Layout-main"> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_dompurify_dist_purify_es_mjs-dd1d3ea6a436.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_tanstack_query-core_build_modern_queryObserver_js-node_modules_tanstack_-defd52-843b41414e0e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_aria-live_aria-live_ts-ui_packages_history_history_ts-ui_packages_promise-with-re-01dc80-b13b6c1d97b0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_paths_index_ts-04e7ec2d63d9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ref-selector_RefSelector_tsx-7496afc3784d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_commit-attribution_index_ts-ui_packages_commit-checks-status_index_ts-ui_packages-762eaa-d78307eadb45.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_code-view-shared_hooks_use-canonical-object_ts-ui_packages_code-view-shared_hooks-c2dbff-27f8152d69dc.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repos-overview-5da4c053db4d.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.a490b7c9fa319e5cb069.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repos-overview.0ee7cac3ab511a65d9f9.module.css" /> <react-partial partial-name="repos-overview" data-ssr="true" data-attempted-ssr="true" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"initialPayload":{"allShortcutsEnabled":false,"path":"/","repo":{"id":142195981,"defaultBranch":"master","name":"purefun","ownerLogin":"tonivade","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2018-07-24T18:11:55.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/4076036?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1743145610.0","canEdit":false,"refType":"branch","currentOid":"ba02d73d61269ec2b537bc2e2bccf074e642e218"},"tree":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"annotation/src/main/java/com/github/tonivade/purefun","path":"annotation/src/main/java/com/github/tonivade/purefun","contentType":"directory","hasSimplifiedPath":true},{"name":"core","path":"core","contentType":"directory"},{"name":"effect","path":"effect","contentType":"directory"},{"name":"free","path":"free","contentType":"directory"},{"name":"gradle","path":"gradle","contentType":"directory"},{"name":"instances","path":"instances","contentType":"directory"},{"name":"monad","path":"monad","contentType":"directory"},{"name":"optics","path":"optics","contentType":"directory"},{"name":"processor","path":"processor","contentType":"directory"},{"name":"stream","path":"stream","contentType":"directory"},{"name":"transformer","path":"transformer","contentType":"directory"},{"name":"typeclasses","path":"typeclasses","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"build.gradle","path":"build.gradle","contentType":"file"},{"name":"gradle.properties","path":"gradle.properties","contentType":"file"},{"name":"gradlew","path":"gradlew","contentType":"file"},{"name":"gradlew.bat","path":"gradlew.bat","contentType":"file"},{"name":"settings.gradle","path":"settings.gradle","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":null,"totalCount":21,"showBranchInfobar":false},"fileTree":null,"fileTreeProcessingTime":null,"foldersToFetch":[],"treeExpanded":false,"symbolsExpanded":false,"isOverview":true,"overview":{"banners":{"shouldRecommendReadme":false,"isPersonalRepo":false,"showUseActionBanner":false,"actionSlug":null,"actionId":null,"showProtectBranchBanner":false,"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_repo","releasePath":"/tonivade/purefun/releases/new?marketplace=true","showPublishActionBanner":false},"interactionLimitBanner":null,"showInvitationBanner":false,"inviterName":null,"actionsMigrationBannerInfo":{"releaseTags":[],"showImmutableActionsMigrationBanner":false,"initialMigrationStatus":null}},"codeButton":{"contactPath":"/contact","isEnterprise":false,"local":{"protocolInfo":{"httpAvailable":true,"sshAvailable":null,"httpUrl":"https://github.com/tonivade/purefun.git","showCloneWarning":null,"sshUrl":null,"sshCertificatesRequired":null,"sshCertificatesAvailable":null,"ghCliUrl":"gh repo clone tonivade/purefun","defaultProtocol":"http","newSshKeyUrl":"/settings/ssh/new","setProtocolPath":"/users/set_protocol"},"platformInfo":{"cloneUrl":"https://desktop.github.com","showVisualStudioCloneButton":false,"visualStudioCloneUrl":"https://windows.github.com","showXcodeCloneButton":false,"xcodeCloneUrl":"xcode://clone?repo=https%3A%2F%2Fgithub.com%2Ftonivade%2Fpurefun","zipballUrl":"/tonivade/purefun/archive/refs/heads/master.zip"}},"newCodespacePath":"/codespaces/new?hide_repo_select=true\u0026repo=142195981"},"popovers":{"rename":null,"renamedParentRepo":null},"commitCount":"1,814","overviewFiles":[{"displayName":"README.md","repoName":"purefun","refName":"master","path":"README.md","preferredFileType":"readme","tabName":"README","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePurefun\u003c/h1\u003e\u003ca id=\"user-content-purefun\" class=\"anchor\" aria-label=\"Permalink: Purefun\" href=\"#purefun\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" ____ __ \n| _ \\ _ _ _ __ ___ / _|_ _ _ __ \n| |_) | | | | '__/ _ \\ |_| | | | '_ \\ \n| __/| |_| | | | __/ _| |_| | | | |\n|_| \\__,_|_| \\___|_| \\__,_|_| |_|\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e ____ __ \n| _ \\ _ _ _ __ ___ / _|_ _ _ __ \n| |_) | | | | '__/ _ \\ |_| | | | '_ \\ \n| __/| |_| | | | __/ _| |_| | | | |\n|_| \\__,_|_| \\___|_| \\__,_|_| |_|\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/tonivade/purefun/workflows/Java%20CI%20with%20Gradle/badge.svg\"\u003e\u003cimg src=\"https://github.com/tonivade/purefun/workflows/Java%20CI%20with%20Gradle/badge.svg\" alt=\"Build Status\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.codacy.com/app/zeromock/purefun?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=tonivade/purefun\u0026amp;utm_campaign=Badge_Coverage\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/997f127f161e2271dab05170420f449c93747439bd7cde7b8a38d29514002415/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3338343232646231363164613438663039636431393263376537636161376464\" alt=\"Codacy Badge\" data-canonical-src=\"https://api.codacy.com/project/badge/Coverage/38422db161da48f09cd192c7e7caa7dd\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://gitter.im/tonivade/purefun?utm_source=badge\u0026amp;utm_medium=badge\u0026amp;utm_campaign=pr-badge\u0026amp;utm_content=badge\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/d9856b21439449403f252aef1cd3ab62f97725f0ace6f6111eee8868de2ce93f/68747470733a2f2f6261646765732e6769747465722e696d2f746f6e69766164652f7075726566756e2e737667\" alt=\"Join the chat at https://gitter.im/tonivade/purefun\" data-canonical-src=\"https://badges.gitter.im/tonivade/purefun.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis module was developed as the core of the zeromock project. It defines all the basic classes and interfaces\nused in the rest of the project.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eInitially the module only held a few basic interfaces and it has grown to become an entire\nfunctional programming library (well, a humble one), and now is an independent library.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWorking in this library helped me to learn and understand some important concepts\nof functional programming, and over time I implemented higher kinded types and type classes\nin Java. I don't know if this will be helpful for somebody, but the work is here to everyone want to use it.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFinally, I have to say thanks to \u003ca href=\"https://www.vavr.io/\" rel=\"nofollow\"\u003evavr\u003c/a\u003e library author, this library is largely inspired in his work,\nand also to \u003ca href=\"https://www.scala-lang.org/\" rel=\"nofollow\"\u003eScala\u003c/a\u003e standard library authors. I don't want to forget some of the projects I've used as\nreference: \u003ca href=\"https://arrow-kt.io/\" rel=\"nofollow\"\u003eArrow\u003c/a\u003e and \u003ca href=\"https://typelevel.org/cats/\" rel=\"nofollow\"\u003ecats\u003c/a\u003e for type classes implementation,\n\u003ca href=\"https://fs2.io/\" rel=\"nofollow\"\u003efs2\u003c/a\u003e for stream processing, and \u003ca href=\"https://zio.dev/\" rel=\"nofollow\"\u003eZIO\u003c/a\u003e to implement my own version in Java.\nTheir awesome work help me a lot.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDisclaimer\u003c/h2\u003e\u003ca id=\"user-content-disclaimer\" class=\"anchor\" aria-label=\"Permalink: Disclaimer\" href=\"#disclaimer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eThis project is not ready to be used in production\u003c/strong\u003e, I use it to learn functional programming concepts by my self, but,\nif you want to use it, \u003cstrong\u003euse it at your own risk\u003c/strong\u003e. Anyway if you think is useful for you, go ahead, also any\nfeedback and PR are very welcome.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHigher Kinded Types\u003c/h2\u003e\u003ca id=\"user-content-higher-kinded-types\" class=\"anchor\" aria-label=\"Permalink: Higher Kinded Types\" href=\"#higher-kinded-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn this project I have implemented some patterns of functional programming that need Higher Kinded Types. In Java\nthere are not such thing, but it can be simulated using a especial codification of types.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIn Scala we can define a higher kinded typed just like this \u003ccode\u003eMonad[F[_]]\u003c/code\u003e but in Java it can be codified\nlike this \u003ccode\u003eMonad\u0026lt;F\u0026gt;\u003c/code\u003e. Then we can define a type using a special codification like this:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"interface SomeType\u0026lt;T\u0026gt; extends SomeTypeOf\u0026lt;T\u0026gt; { }\n\n// Boilerplate\ninterface SomeTypeOf\u0026lt;T\u0026gt; implements Kind\u0026lt;SomeType\u0026lt;?\u0026gt;, T\u0026gt; {\n\n // this is a safe cast\n static SomeType\u0026lt;T\u0026gt; toSomeType(Kind\u0026lt;SomeType\u0026lt;?\u0026gt;, ? extends T\u0026gt; hkt) {\n return (SomeType\u0026lt;T\u0026gt;) hkt;\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSomeType\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSomeTypeOf\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; { }\n\n\u003cspan class=\"pl-c\"\u003e// Boilerplate\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSomeTypeOf\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eimplements\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eSomeType\u003c/span\u003e\u0026lt;?\u0026gt;, \u003cspan class=\"pl-s1\"\u003eT\u003c/span\u003e\u0026gt; {\n\n \u003cspan class=\"pl-c\"\u003e// this is a safe cast\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSomeType\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003etoSomeType\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eSomeType\u003c/span\u003e\u0026lt;?\u0026gt;, ? \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ehkt\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e (\u003cspan class=\"pl-smi\"\u003eSomeType\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt;) \u003cspan class=\"pl-s1\"\u003ehkt\u003c/span\u003e;\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt can be triky but, in the end is easy to work with. By the way, I tried to hide this details to the user of the library.\nExcept with type classes because is the only way to implement them correctly.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSo, there are interfaces to encode kinds of 1, 2 and 3 types. It can be defined types for 4, 5 or more types, but it wasn't\nnecessary to implement the library.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAnnotation Processor\u003c/h2\u003e\u003ca id=\"user-content-annotation-processor\" class=\"anchor\" aria-label=\"Permalink: Annotation Processor\" href=\"#annotation-processor\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn order to simplify working with higher kinded types, in the last version I've included an annotation processor to generate\nall this boilerplate code:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"@HigherKind\ninterface SomeType\u0026lt;T\u0026gt; extends SomeTypeOf\u0026lt;T\u0026gt; { }\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eHigherKind\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSomeType\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSomeTypeOf\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; { }\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWith this annotation, all the above code, is generated automatically.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eData types\u003c/h2\u003e\u003ca id=\"user-content-data-types\" class=\"anchor\" aria-label=\"Permalink: Data types\" href=\"#data-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eOption\u003c/h3\u003e\u003ca id=\"user-content-option\" class=\"anchor\" aria-label=\"Permalink: Option\" href=\"#option\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIs an alternative to \u003ccode\u003eOptional\u003c/code\u003e of Java standard library. It can contains two values, a \u003ccode\u003esome\u003c/code\u003e or a \u003ccode\u003enone\u003c/code\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Option\u0026lt;String\u0026gt; some = Option.some(\u0026quot;Hello world\u0026quot;);\n\nOption\u0026lt;String\u0026gt; none = Option.none();\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003esome\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esome\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003enone\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003enone\u003c/span\u003e();\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTry\u003c/h3\u003e\u003ca id=\"user-content-try\" class=\"anchor\" aria-label=\"Permalink: Try\" href=\"#try\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIs an implementation of scala \u003ccode\u003eTry\u003c/code\u003e in Java. It can contains two values, a \u003ccode\u003esuccess\u003c/code\u003e or a \u003ccode\u003efailure\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Try\u0026lt;String\u0026gt; success = Try.success(\u0026quot;Hello world\u0026quot;);\n\nTry\u0026lt;String\u0026gt; failure = Try.failure(new RuntimeException(\u0026quot;Error\u0026quot;));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003esuccess\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esuccess\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003efailure\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003efailure\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eRuntimeException\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Error\"\u003c/span\u003e));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEither\u003c/h3\u003e\u003ca id=\"user-content-either\" class=\"anchor\" aria-label=\"Permalink: Either\" href=\"#either\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIs an implementation of scala \u003ccode\u003eEither\u003c/code\u003e in Java.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Either\u0026lt;Integer, String\u0026gt; right = Either.right(\u0026quot;Hello world\u0026quot;);\n\nEither\u0026lt;Integer, String\u0026gt; left = Either.left(100);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eright\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eright\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eleft\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eleft\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e100\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eValidation\u003c/h3\u003e\u003ca id=\"user-content-validation\" class=\"anchor\" aria-label=\"Permalink: Validation\" href=\"#validation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis type represents two different states, valid or invalid, an also it allows to combine several\nvalidations using \u003ccode\u003emapN\u003c/code\u003e methods.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Validation\u0026lt;String, String\u0026gt; name = Validation.valid(\u0026quot;John Smith\u0026quot;);\nValidation\u0026lt;String, String\u0026gt; email = Validation.valid(\u0026quot;john.smith@example.net\u0026quot;);\n\n// Person has a constructor with two String parameters, name and email.\nValdation\u0026lt;Sequence\u0026lt;String\u0026gt;, Person\u0026gt; person = Validation.map2(name, email, Person::new);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eValidation\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ename\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eValidation\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003evalid\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"John Smith\"\u003c/span\u003e);\n\u003cspan class=\"pl-smi\"\u003eValidation\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eemail\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eValidation\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003evalid\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"john.smith@example.net\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e// Person has a constructor with two String parameters, name and email.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003eValdation\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eSequence\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003ePerson\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eperson\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eValidation\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emap2\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ename\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eemail\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003ePerson\u003c/span\u003e::\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eConst\u003c/h3\u003e\u003ca id=\"user-content-const\" class=\"anchor\" aria-label=\"Permalink: Const\" href=\"#const\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA object with a phantom parameter:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Const\u0026lt;String, Integer\u0026gt; constInt = Const.of(\u0026quot;Hello world!\u0026quot;);\n\nConst\u0026lt;String, Float\u0026gt; constFloat = constInt.retag();\n\nassertEquals(\u0026quot;Hello world!\u0026quot;, constFloat.value());\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eConst\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003econstInt\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eConst\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world!\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eConst\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFloat\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003econstFloat\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003econstInt\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eretag\u003c/span\u003e();\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world!\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003econstFloat\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003evalue\u003c/span\u003e());\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFuture\u003c/h3\u003e\u003ca id=\"user-content-future\" class=\"anchor\" aria-label=\"Permalink: Future\" href=\"#future\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis is an experimental implementation of Future. Computations are executed in another thread inmediatelly (since version 5.0 de default executor is a virtual thread per task executor).\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Future\u0026lt;String\u0026gt; future = Future.success(\u0026quot;Hello world!\u0026quot;);\n\nFuture\u0026lt;String\u0026gt; result = future.flatMap(string -\u0026gt; Future.run(string::toUpperCase));\n\nassertEquals(Try.success(\u0026quot;HELLO WORLD!\u0026quot;), result.await());\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eFuture\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003efuture\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eFuture\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esuccess\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world!\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eFuture\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003efuture\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003estring\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eFuture\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003erun\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003estring\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003etoUpperCase\u003c/span\u003e));\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esuccess\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"HELLO WORLD!\"\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eawait\u003c/span\u003e());\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTrampoline\u003c/h3\u003e\u003ca id=\"user-content-trampoline\" class=\"anchor\" aria-label=\"Permalink: Trampoline\" href=\"#trampoline\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eImplements recursion using an iteration and is stack safe.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"private Trampoline\u0026lt;Integer\u0026gt; fibLoop(Integer n) {\n if (n \u0026lt; 2) {\n return Trampoline.done(n);\n }\n return Trampoline.more(() -\u0026gt; fibLoop(n - 1)).flatMap(x -\u0026gt; fibLoop(n - 2).map(y -\u0026gt; x + y));\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eprivate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eTrampoline\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003efibLoop\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-s1\"\u003en\u003c/span\u003e \u0026lt; \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eTrampoline\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003edone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003en\u003c/span\u003e);\n }\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eTrampoline\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emore\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-en\"\u003efibLoop\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003en\u003c/span\u003e - \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e)).\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003efibLoop\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003en\u003c/span\u003e - \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e).\u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e + \u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e));\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTuples\u003c/h3\u003e\u003ca id=\"user-content-tuples\" class=\"anchor\" aria-label=\"Permalink: Tuples\" href=\"#tuples\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThese classes allow to hold some values together, as tuples. There are tuples from 1 to 5.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Tuple1\u0026lt;String\u0026gt; tuple1 = Tuple.of(\u0026quot;Hello world\u0026quot;);\n\nTuple2\u0026lt;String, Integer\u0026gt; tuple2 = Tuple.of(\u0026quot;John Smith\u0026quot;, 100);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eTuple1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003etuple1\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello world\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003etuple2\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"John Smith\"\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e100\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eData structures\u003c/h2\u003e\u003ca id=\"user-content-data-structures\" class=\"anchor\" aria-label=\"Permalink: Data structures\" href=\"#data-structures\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eJava doesn't define immutable collections, so I have implemented some of them.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSequence\u003c/h3\u003e\u003ca id=\"user-content-sequence\" class=\"anchor\" aria-label=\"Permalink: Sequence\" href=\"#sequence\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIs the equivalent to java \u003ccode\u003eCollection\u003c/code\u003e interface. It defines all the common methods. The default implementation use persistent collections based on \u003ca href=\"https://github.com/hrldcpr/pcollections/\"\u003epcollections\u003c/a\u003e library.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImmutableList\u003c/h3\u003e\u003ca id=\"user-content-immutablelist\" class=\"anchor\" aria-label=\"Permalink: ImmutableList\" href=\"#immutablelist\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt represents a linked list. It has a head and a tail. Based on \u003ccode\u003eConsPStack\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImmutableSet\u003c/h3\u003e\u003ca id=\"user-content-immutableset\" class=\"anchor\" aria-label=\"Permalink: ImmutableSet\" href=\"#immutableset\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt represents a set of elements. This elements cannot be duplicated. Based on \u003ccode\u003eHashTreePSet\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImmutableArray\u003c/h3\u003e\u003ca id=\"user-content-immutablearray\" class=\"anchor\" aria-label=\"Permalink: ImmutableArray\" href=\"#immutablearray\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt represents an array. You can access to the elements by its position in the array. Based on \u003ccode\u003eTreePVector\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImmutableMap\u003c/h3\u003e\u003ca id=\"user-content-immutablemap\" class=\"anchor\" aria-label=\"Permalink: ImmutableMap\" href=\"#immutablemap\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis class represents a hash map. Based on \u003ccode\u003eHashTreePMap\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImmutableTree\u003c/h3\u003e\u003ca id=\"user-content-immutabletree\" class=\"anchor\" aria-label=\"Permalink: ImmutableTree\" href=\"#immutabletree\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis class represents a binary tree. Based on \u003ccode\u003eTreePSet\u003c/code\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImmutableTreeMap\u003c/h3\u003e\u003ca id=\"user-content-immutabletreemap\" class=\"anchor\" aria-label=\"Permalink: ImmutableTreeMap\" href=\"#immutabletreemap\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis class represents a binary tree map. Based on \u003ccode\u003eTreePMap\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonads\u003c/h2\u003e\u003ca id=\"user-content-monads\" class=\"anchor\" aria-label=\"Permalink: Monads\" href=\"#monads\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAlso I have implemented some Monads that allows to combine some operations.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eState Monad\u003c/h3\u003e\u003ca id=\"user-content-state-monad\" class=\"anchor\" aria-label=\"Permalink: State Monad\" href=\"#state-monad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIs the traditional State Modad from FP languages, like Haskel or Scala. It allows to combine\noperations over a state. The state should be a immutable class. It recives an state and generates\na tuple with the new state and an intermediate result.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"State\u0026lt;ImmutableList\u0026lt;String\u0026gt;, Option\u0026lt;String\u0026gt;\u0026gt; read = State.state(list -\u0026gt; Tuple.of(list.tail(), list.head()));\n\nTuple\u0026lt;ImmutableList\u0026lt;String\u0026gt;, Option\u0026lt;String\u0026gt;\u0026gt; result = read.run(ImmutableList.of(\u0026quot;a\u0026quot;, \u0026quot;b\u0026quot;, \u0026quot;c\u0026quot;));\n\nassertEquals(Tuple.of(ImmutableList.of(\u0026quot;b\u0026quot;, \u0026quot;c\u0026quot;), Option.some(\u0026quot;a\u0026quot;)), result);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eState\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eread\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eState\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003estate\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003elist\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003elist\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003etail\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003elist\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ehead\u003c/span\u003e()));\n\n\u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003eread\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003erun\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"a\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"b\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"c\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"b\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"c\"\u003c/span\u003e), \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esome\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"a\"\u003c/span\u003e)), \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eReader Monad\u003c/h3\u003e\u003ca id=\"user-content-reader-monad\" class=\"anchor\" aria-label=\"Permalink: Reader Monad\" href=\"#reader-monad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis is an implementation of Reader Monad. It allows to combine operations over a common input.\nIt can be used to inject dependencies.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Reader\u0026lt;ImmutableList\u0026lt;String\u0026gt;, String\u0026gt; read2 = Reader.reader(list -\u0026gt; list.tail().head().orElse(\u0026quot;\u0026quot;));\n\nString result = read2.eval(ImmutableList.of(\u0026quot;a\u0026quot;, \u0026quot;b\u0026quot;, \u0026quot;c\u0026quot;));\n\nassertEqual(\u0026quot;b\u0026quot;, result);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eReader\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eread2\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eReader\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereader\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003elist\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003elist\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003etail\u003c/span\u003e().\u003cspan class=\"pl-en\"\u003ehead\u003c/span\u003e().\u003cspan class=\"pl-en\"\u003eorElse\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003eread2\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eeval\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"a\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"b\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"c\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-en\"\u003eassertEqual\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"b\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eWriter Monad\u003c/h3\u003e\u003ca id=\"user-content-writer-monad\" class=\"anchor\" aria-label=\"Permalink: Writer Monad\" href=\"#writer-monad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt allow to combine operations over a common output.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Writer\u0026lt;ImmutableList\u0026lt;String\u0026gt;, Integer\u0026gt; writer = Writer.\u0026lt;String, Integer\u0026gt;listPure(5)\n .flatMap(value -\u0026gt; listWriter(\u0026quot;add 5\u0026quot;, value + 5))\n .flatMap(value -\u0026gt; listWriter(\u0026quot;plus 2\u0026quot;, value * 2));\n\nassertAll(() -\u0026gt; assertEquals(Integer.valueOf(20), writer.getValue()),\n () -\u0026gt; assertEquals(listOf(\u0026quot;add 5\u0026quot;, \u0026quot;plus 2\u0026quot;), writer.getLog()));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eWriter\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eWriter\u003c/span\u003e.\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt;\u003cspan class=\"pl-en\"\u003elistPure\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003elistWriter\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"add 5\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e + \u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e))\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003elistWriter\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"plus 2\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e * \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e));\n\n\u003cspan class=\"pl-en\"\u003eassertAll\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003evalueOf\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e20\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetValue\u003c/span\u003e()),\n () -\u0026gt; \u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003elistOf\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"add 5\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"plus 2\"\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetLog\u003c/span\u003e()));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eIO Monad\u003c/h3\u003e\u003ca id=\"user-content-io-monad\" class=\"anchor\" aria-label=\"Permalink: IO Monad\" href=\"#io-monad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis is a experimental implementation of IO Monad in java. Inspired in this \u003ca href=\"https://gist.github.com/joergrathlev/f17092d3470dcf732be6\"\u003ework\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"IO\u0026lt;Unit\u0026gt; echo = Console.print(\u0026quot;write your name\u0026quot;)\n .andThen(Console.read())\n .flatMap(name -\u0026gt; Console.print(\u0026quot;Hello \u0026quot; + name))\n .andThen(Console.print(\u0026quot;end\u0026quot;));\n\necho.unsafeRunSync();\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eecho\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eprint\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"write your name\"\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eread\u003c/span\u003e())\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ename\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eprint\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello \"\u003c/span\u003e + \u003cspan class=\"pl-s1\"\u003ename\u003c/span\u003e))\n .\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eprint\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"end\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-s1\"\u003eecho\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eunsafeRunSync\u003c/span\u003e();\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFree\u003c/h2\u003e\u003ca id=\"user-content-free\" class=\"anchor\" aria-label=\"Permalink: Free\" href=\"#free\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFree Monad\u003c/h3\u003e\u003ca id=\"user-content-free-monad\" class=\"anchor\" aria-label=\"Permalink: Free Monad\" href=\"#free-monad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFinally, after hours of hard coding, I managed to implement a Free monad. This is a highly\nunstable implementation and I have implemented because it can be implemented. Inspired\nin this \u003ca href=\"https://github.com/xuwei-k/free-monad-java\"\u003ework\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Free\u0026lt;IOProgram_, Unit\u0026gt; echo =\n IOProgram.write(\u0026quot;what's your name?\u0026quot;)\n .andThen(IOProgram.read())\n .flatMap(text -\u0026gt; IOProgram.write(\u0026quot;Hello \u0026quot; + text))\n .andThen(IOProgram.write(\u0026quot;end\u0026quot;));\n\nKind\u0026lt;IO_, Unit\u0026gt; foldMap = echo.foldMap(IOInstances.monad(), new IOProgramInterperter());\n\nfoldMap.fix(toIO()).unsafeRunSync();\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eFree\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIOProgram_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eecho\u003c/span\u003e =\n \u003cspan class=\"pl-smi\"\u003eIOProgram\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ewrite\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"what's your name?\"\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eIOProgram\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eread\u003c/span\u003e())\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003etext\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eIOProgram\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ewrite\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello \"\u003c/span\u003e + \u003cspan class=\"pl-s1\"\u003etext\u003c/span\u003e))\n .\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eIOProgram\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ewrite\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"end\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003efoldMap\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003eecho\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003efoldMap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eIOInstances\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIOProgramInterperter\u003c/span\u003e());\n\n\u003cspan class=\"pl-s1\"\u003efoldMap\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003etoIO\u003c/span\u003e()).\u003cspan class=\"pl-en\"\u003eunsafeRunSync\u003c/span\u003e();\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFree Applicative\u003c/h3\u003e\u003ca id=\"user-content-free-applicative\" class=\"anchor\" aria-label=\"Permalink: Free Applicative\" href=\"#free-applicative\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSimilar to Free monad, but allows static analysis without to run the program.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"FreeAp\u0026lt;DSL_, Tuple5\u0026lt;Integer, Boolean, Double, String, Unit\u0026gt;\u0026gt; tuple =\n applicative.map5(\n DSL.readInt(2),\n DSL.readBoolean(false),\n DSL.readDouble(2.1),\n DSL.readString(\u0026quot;hola mundo\u0026quot;),\n DSL.readUnit(),\n Tuple::of\n ).fix(toFreeAp());\n\nKind\u0026lt;Id_, Tuple5\u0026lt;Integer, Boolean, Double, String, Unit\u0026gt;\u0026gt; map =\n tuple.foldMap(idTransform(), IdInstances.applicative());\n\nassertEquals(Id.of(Tuple.of(2, false, 2.1, \u0026quot;hola mundo\u0026quot;, unit())), map.fix(toId()));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eFreeAp\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eDSL_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple5\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eBoolean\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eDouble\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003etuple\u003c/span\u003e =\n \u003cspan class=\"pl-s1\"\u003eapplicative\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emap5\u003c/span\u003e(\n \u003cspan class=\"pl-c1\"\u003eDSL\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereadInt\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e),\n \u003cspan class=\"pl-c1\"\u003eDSL\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereadBoolean\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e),\n \u003cspan class=\"pl-c1\"\u003eDSL\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereadDouble\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e2.1\u003c/span\u003e),\n \u003cspan class=\"pl-c1\"\u003eDSL\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereadString\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"hola mundo\"\u003c/span\u003e),\n \u003cspan class=\"pl-c1\"\u003eDSL\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereadUnit\u003c/span\u003e(),\n \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eof\u003c/span\u003e\n ).\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003etoFreeAp\u003c/span\u003e());\n\n\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eId_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple5\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eBoolean\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eDouble\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e =\n \u003cspan class=\"pl-s1\"\u003etuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003efoldMap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eidTransform\u003c/span\u003e(), \u003cspan class=\"pl-smi\"\u003eIdInstances\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eapplicative\u003c/span\u003e());\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eId\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2.1\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"hola mundo\"\u003c/span\u003e, \u003cspan class=\"pl-en\"\u003eunit\u003c/span\u003e())), \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003etoId\u003c/span\u003e()));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonad Transformers\u003c/h2\u003e\u003ca id=\"user-content-monad-transformers\" class=\"anchor\" aria-label=\"Permalink: Monad Transformers\" href=\"#monad-transformers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eOptionT\u003c/h3\u003e\u003ca id=\"user-content-optiont\" class=\"anchor\" aria-label=\"Permalink: OptionT\" href=\"#optiont\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMonad Transformer for \u003ccode\u003eOption\u003c/code\u003e type\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"OptionT\u0026lt;IO_, String\u0026gt; some = OptionT.some(IO.monad(), \u0026quot;abc\u0026quot;);\n\nOptionT\u0026lt;IO_, String\u0026gt; map = some.flatMap(value -\u0026gt; OptionT.some(IOInstances.monad(), value.toUpperCase()));\n\nassertEquals(\u0026quot;ABC\u0026quot;, map.get().fix(toIO()).unsafeRunSync());\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eOptionT\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003esome\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eOptionT\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esome\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-s\"\u003e\"abc\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eOptionT\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003esome\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eOptionT\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esome\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eIOInstances\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003etoUpperCase\u003c/span\u003e()));\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"ABC\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e().\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003etoIO\u003c/span\u003e()).\u003cspan class=\"pl-en\"\u003eunsafeRunSync\u003c/span\u003e());\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEitherT\u003c/h3\u003e\u003ca id=\"user-content-eithert\" class=\"anchor\" aria-label=\"Permalink: EitherT\" href=\"#eithert\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMonad Transformer for \u003ccode\u003eEither\u003c/code\u003e type\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"EitherT\u0026lt;IO_, Nothing, String\u0026gt; right = EitherT.right(IO.monad(), \u0026quot;abc\u0026quot;);\n\nEitherT\u0026lt;IO_, Nothing, String\u0026gt; map = right.flatMap(value -\u0026gt; EitherT.right(IOInstances.monad(), value.toUpperCase()));\n\nassertEquals(\u0026quot;ABC\u0026quot;, map.get().fix(toIO()).unsafeRunSync());\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eEitherT\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eNothing\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eright\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eEitherT\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eright\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-s\"\u003e\"abc\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eEitherT\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eNothing\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003eright\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eEitherT\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eright\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eIOInstances\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003etoUpperCase\u003c/span\u003e()));\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"ABC\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e().\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003etoIO\u003c/span\u003e()).\u003cspan class=\"pl-en\"\u003eunsafeRunSync\u003c/span\u003e());\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStateT\u003c/h3\u003e\u003ca id=\"user-content-statet\" class=\"anchor\" aria-label=\"Permalink: StateT\" href=\"#statet\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMonad Transformer for \u003ccode\u003eState\u003c/code\u003e type\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"StateT\u0026lt;IO_, ImmutableList\u0026lt;String\u0026gt;, Unit\u0026gt; state =\n pure(\u0026quot;a\u0026quot;).flatMap(append(\u0026quot;b\u0026quot;)).flatMap(append(\u0026quot;c\u0026quot;)).flatMap(end());\n\nIO\u0026lt;Tuple2\u0026lt;ImmutableList\u0026lt;String\u0026gt;, Unit\u0026gt;\u0026gt; result = state.run(ImmutableList.empty()).fix(toIO());\n\nassertEquals(Tuple.of(listOf(\u0026quot;a\u0026quot;, \u0026quot;b\u0026quot;, \u0026quot;c\u0026quot;), unit()), result.unsafeRunSync());\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eStateT\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003estate\u003c/span\u003e =\n \u003cspan class=\"pl-en\"\u003epure\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"a\"\u003c/span\u003e).\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eappend\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"b\"\u003c/span\u003e)).\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eappend\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"c\"\u003c/span\u003e)).\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eend\u003c/span\u003e());\n\n\u003cspan class=\"pl-smi\"\u003eIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003estate\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003erun\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eImmutableList\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eempty\u003c/span\u003e()).\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003etoIO\u003c/span\u003e());\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003elistOf\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"a\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"b\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"c\"\u003c/span\u003e), \u003cspan class=\"pl-en\"\u003eunit\u003c/span\u003e()), \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eunsafeRunSync\u003c/span\u003e());\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eWriterT\u003c/h3\u003e\u003ca id=\"user-content-writert\" class=\"anchor\" aria-label=\"Permalink: WriterT\" href=\"#writert\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMonad Transformer for \u003ccode\u003eWriter\u003c/code\u003e type\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"WriterT\u0026lt;Id_, Sequence\u0026lt;String\u0026gt;, Integer\u0026gt; writer =\n WriterT.\u0026lt;Id_, Sequence\u0026lt;String\u0026gt;, Integer\u0026gt;pure(monoid, monad, 5)\n .flatMap(value -\u0026gt; lift(monoid, monad, Tuple.of(listOf(\u0026quot;add 5\u0026quot;), value + 5)))\n .flatMap(value -\u0026gt; lift(monoid, monad, Tuple.of(listOf(\u0026quot;plus 2\u0026quot;), value * 2)));\n\nassertAll(() -\u0026gt; assertEquals(Id.of(Integer.valueOf(20)), writer.getValue()),\n () -\u0026gt; assertEquals(Id.of(listOf(\u0026quot;add 5\u0026quot;, \u0026quot;plus 2\u0026quot;)), writer.getLog()));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eWriterT\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eId_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eSequence\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e =\n \u003cspan class=\"pl-smi\"\u003eWriterT\u003c/span\u003e.\u0026lt;\u003cspan class=\"pl-smi\"\u003eId_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eSequence\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt;\u003cspan class=\"pl-en\"\u003epure\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003emonoid\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emonad\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003elift\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003emonoid\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emonad\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003elistOf\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"add 5\"\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e + \u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e)))\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003elift\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003emonoid\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emonad\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003elistOf\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"plus 2\"\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e * \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e)));\n\n\u003cspan class=\"pl-en\"\u003eassertAll\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eId\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003evalueOf\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e20\u003c/span\u003e)), \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetValue\u003c/span\u003e()),\n () -\u0026gt; \u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eId\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003elistOf\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"add 5\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"plus 2\"\u003c/span\u003e)), \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetLog\u003c/span\u003e()));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eKleisli\u003c/h3\u003e\u003ca id=\"user-content-kleisli\" class=\"anchor\" aria-label=\"Permalink: Kleisli\" href=\"#kleisli\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAlso I implemented the Kleisli composition for functions that returns monadic values like \u003ccode\u003eOption\u003c/code\u003e, \u003ccode\u003eTry\u003c/code\u003e or \u003ccode\u003eEither\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Kleisli\u0026lt;Try_, String, Integer\u0026gt; toInt = Kleisli.lift(Try.monad(), Integer::parseInt);\nKleisli\u0026lt;Try_, Integer, Double\u0026gt; half = Kleisli.lift(Try.monad(), i -\u0026gt; i / 2.);\n\nKind\u0026lt;Try_, Double\u0026gt; result = toInt.compose(half).run(\u0026quot;123\u0026quot;);\n\nassertEquals(Try.success(61.5), result);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eKleisli\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eTry_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003etoInt\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eKleisli\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003elift\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eparseInt\u003c/span\u003e);\n\u003cspan class=\"pl-smi\"\u003eKleisli\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eTry_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eDouble\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ehalf\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eKleisli\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003elift\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emonad\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003ei\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003ei\u003c/span\u003e / \u003cspan class=\"pl-c1\"\u003e2.\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eTry_\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eDouble\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003etoInt\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ecompose\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ehalf\u003c/span\u003e).\u003cspan class=\"pl-en\"\u003erun\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"123\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esuccess\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e61.5\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStream\u003c/h2\u003e\u003ca id=\"user-content-stream\" class=\"anchor\" aria-label=\"Permalink: Stream\" href=\"#stream\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn experimental version of a \u003ccode\u003eStream\u003c/code\u003e like scala fs2 project.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"StreamOf\u0026lt;IO\u0026lt;?\u0026gt;\u0026gt; streamOfIO = Stream.ofIO();\n\nIO\u0026lt;String\u0026gt; readFile = streamOfIO.eval(IO.of(() -\u0026gt; reader(file)))\n .flatMap(reader -\u0026gt; streamOfIO.iterate(() -\u0026gt; Option.of(() -\u0026gt; readLine(reader))))\n .takeWhile(Option::isPresent)\n .map(Option::get)\n .foldLeft(\u0026quot;\u0026quot;, (a, b) -\u0026gt; a + \u0026quot;\\n\u0026quot; + b)\n .fix(IOOf::toIO)\n .recoverWith(UncheckedIOException.class, cons(\u0026quot;--- file not found ---\u0026quot;));\n\nString content = readFile.unsafeRunSync();\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eStreamOf\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eIO\u003c/span\u003e\u0026lt;?\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003estreamOfIO\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eStream\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eofIO\u003c/span\u003e();\n\n\u003cspan class=\"pl-smi\"\u003eIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ereadFile\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003estreamOfIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eeval\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-en\"\u003ereader\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003efile\u003c/span\u003e)))\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003estreamOfIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eiterate\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-en\"\u003ereadLine\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e))))\n .\u003cspan class=\"pl-en\"\u003etakeWhile\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eisPresent\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eget\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003efoldLeft\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"\"\u003c/span\u003e, (\u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eb\u003c/span\u003e) -\u0026gt; \u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e + \u003cspan class=\"pl-s\"\u003e\"\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\"\u003c/span\u003e + \u003cspan class=\"pl-s1\"\u003eb\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003efix\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eIOOf\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003etoIO\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003erecoverWith\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eUncheckedIOException\u003c/span\u003e.\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e, \u003cspan class=\"pl-en\"\u003econs\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"--- file not found ---\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003econtent\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003ereadFile\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eunsafeRunSync\u003c/span\u003e();\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEffects\u003c/h2\u003e\u003ca id=\"user-content-effects\" class=\"anchor\" aria-label=\"Permalink: Effects\" href=\"#effects\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn experimental version of \u003ccode\u003ePureIO\u003c/code\u003e similar to ZIO.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"PureIO\u0026lt;Console, Throwable, Unit\u0026gt; echoProgram =\n Console.println(\u0026quot;what's your name?\u0026quot;)\n .andThen(Console.readln())\n .flatMap(name -\u0026gt; Console.println(\u0026quot;Hello \u0026quot; + name));\n\ninterface Console {\n\n \u0026lt;R extends Console\u0026gt; Console.Service\u0026lt;R\u0026gt; console();\n\n static PureIO\u0026lt;Console, Throwable, String\u0026gt; readln() {\n return PureIO.accessM(env -\u0026gt; env.console().readln());\n }\n\n static PureIO\u0026lt;Console, Throwable, Unit\u0026gt; println(String text) {\n return PureIO.accessM(env -\u0026gt; env.console().println(text));\n }\n\n interface Service\u0026lt;R extends Console\u0026gt; {\n PureIO\u0026lt;R, Throwable, String\u0026gt; readln();\n\n PureIO\u0026lt;R, Throwable, Unit\u0026gt; println(String text);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eechoProgram\u003c/span\u003e =\n \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eprintln\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"what's your name?\"\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereadln\u003c/span\u003e())\n .\u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ename\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eprintln\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Hello \"\u003c/span\u003e + \u003cspan class=\"pl-s1\"\u003ename\u003c/span\u003e));\n\n\u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e.\u003cspan class=\"pl-smi\"\u003eService\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003econsole\u003c/span\u003e();\n\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ereadln\u003c/span\u003e() {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eaccessM\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eenv\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003eenv\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003econsole\u003c/span\u003e().\u003cspan class=\"pl-en\"\u003ereadln\u003c/span\u003e());\n }\n\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eprintln\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003etext\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eaccessM\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eenv\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003eenv\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003econsole\u003c/span\u003e().\u003cspan class=\"pl-en\"\u003eprintln\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003etext\u003c/span\u003e));\n }\n\n \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eService\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eConsole\u003c/span\u003e\u0026gt; {\n \u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ereadln\u003c/span\u003e();\n\n \u003cspan class=\"pl-smi\"\u003ePureIO\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eprintln\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003etext\u003c/span\u003e);\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAdditionally, there are aliases for some PureIO special cases:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"UIO\u0026lt;T\u0026gt; =\u0026gt; PureIO\u0026lt;Void, Void, T\u0026gt;\nEIO\u0026lt;E, T\u0026gt; =\u0026gt; PureIO\u0026lt;Void, E, T\u0026gt;\nTask\u0026lt;T\u0026gt; =\u0026gt; PureIO\u0026lt;Void, Throwable, T\u0026gt;\nRIO\u0026lt;R, T\u0026gt; =\u0026gt; PureIO\u0026lt;R, Throwable, T\u0026gt;\nURIO\u0026lt;T\u0026gt; =\u0026gt; PureIO\u0026lt;R, Void, T\u0026gt;\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eUIO\u0026lt;T\u0026gt; =\u0026gt; PureIO\u0026lt;Void, Void, T\u0026gt;\nEIO\u0026lt;E, T\u0026gt; =\u0026gt; PureIO\u0026lt;Void, E, T\u0026gt;\nTask\u0026lt;T\u0026gt; =\u0026gt; PureIO\u0026lt;Void, Throwable, T\u0026gt;\nRIO\u0026lt;R, T\u0026gt; =\u0026gt; PureIO\u0026lt;R, Throwable, T\u0026gt;\nURIO\u0026lt;T\u0026gt; =\u0026gt; PureIO\u0026lt;R, Void, T\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eType Classes\u003c/h2\u003e\u003ca id=\"user-content-type-classes\" class=\"anchor\" aria-label=\"Permalink: Type Classes\" href=\"#type-classes\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWith higher kinded types simulation we can implement typeclases.\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" Invariant -- Contravariant\n \\\n SemigroupK Functor -- Comonad\n | / \\\n MonoidK _ Applicative Traverse -- Foldable\n | / | \\\n Alternative Selective ApplicativeError\n | |\n MonadWriter Monad |\n \\________________| |\n / / \\ / \n MonadState MonadReader MonadError_____\n \\ \\\n MonadThrow Bracket\n \\ /\n Defer -- MonadDefer -- Timer\n |\n Async\n |\n Concurrent\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e Invariant -- Contravariant\n \\\n SemigroupK Functor -- Comonad\n | / \\\n MonoidK _ Applicative Traverse -- Foldable\n | / | \\\n Alternative Selective ApplicativeError\n | |\n MonadWriter Monad |\n \\________________| |\n / / \\ / \n MonadState MonadReader MonadError_____\n \\ \\\n MonadThrow Bracket\n \\ /\n Defer -- MonadDefer -- Timer\n |\n Async\n |\n Concurrent\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFunctor\u003c/h3\u003e\u003ca id=\"user-content-functor\" class=\"anchor\" aria-label=\"Permalink: Functor\" href=\"#functor\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Functor\u0026lt;F extends \u0026gt; extends Invariant\u0026lt;F\u0026gt; {\n\n \u0026lt;T, R\u0026gt; Kind\u0026lt;F, R\u0026gt; map(Kind\u0026lt;F, T\u0026gt; value, Function1\u0026lt;T, R\u0026gt; map);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFunctor\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eInvariant\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eApplicative\u003c/h3\u003e\u003ca id=\"user-content-applicative\" class=\"anchor\" aria-label=\"Permalink: Applicative\" href=\"#applicative\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Applicative\u0026lt;F\u0026gt; extends Functor\u0026lt;F\u0026gt; {\n\n \u0026lt;T\u0026gt; Kind\u0026lt;F, T\u0026gt; pure(T value);\n\n \u0026lt;T, R\u0026gt; Kind\u0026lt;F, R\u0026gt; ap(Kind\u0026lt;F, T\u0026gt; value, Kind\u0026lt;F, Function1\u0026lt;T, R\u0026gt;\u0026gt; apply);\n\n @Override\n default \u0026lt;T, R\u0026gt; Kind\u0026lt;F, R\u0026gt; map(Kind\u0026lt;F, T\u0026gt; value, Function1\u0026lt;T, R\u0026gt; map) {\n return ap(value, pure(map));\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eApplicative\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFunctor\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003epure\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e);\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eapply\u003c/span\u003e);\n\n \u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eOverride\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-en\"\u003epure\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e));\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSelective\u003c/h3\u003e\u003ca id=\"user-content-selective\" class=\"anchor\" aria-label=\"Permalink: Selective\" href=\"#selective\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Selective\u0026lt;F\u0026gt; extends Applicative\u0026lt;F\u0026gt; {\n\n \u0026lt;A, B\u0026gt; Kind\u0026lt;F, B\u0026gt; select(Kind\u0026lt;F, Either\u0026lt;A, B\u0026gt;\u0026gt; value, Kind\u0026lt;F, Function1\u0026lt;A, B\u0026gt;\u0026gt; apply);\n\n default \u0026lt;A, B, C\u0026gt; Kind\u0026lt;F, C\u0026gt; branch(Kind\u0026lt;F, Either\u0026lt;A, B\u0026gt;\u0026gt; value,\n Kind\u0026lt;F, Function1\u0026lt;A, C\u0026gt;\u0026gt; applyA,\n Kind\u0026lt;F, Function1\u0026lt;B, C\u0026gt;\u0026gt; applyB) {\n Kind\u0026lt;F, Either\u0026lt;A, Either\u0026lt;B, C\u0026gt;\u0026gt;\u0026gt; abc = map(value, either -\u0026gt; either.map(Either::left));\n Kind\u0026lt;F, Function1\u0026lt;A, Either\u0026lt;B, C\u0026gt;\u0026gt;\u0026gt; fabc = map(applyA, fb -\u0026gt; fb.andThen(Either::right));\n return select(select(abc, fabc), applyB);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSelective\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eApplicative\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eselect\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eapply\u003c/span\u003e);\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eC\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eC\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ebranch\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e,\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eC\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eapplyA\u003c/span\u003e,\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eC\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eapplyB\u003c/span\u003e) {\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eC\u003c/span\u003e\u0026gt;\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eabc\u003c/span\u003e = \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eeither\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003eeither\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eleft\u003c/span\u003e));\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eC\u003c/span\u003e\u0026gt;\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003efabc\u003c/span\u003e = \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eapplyA\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003efb\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003efb\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eright\u003c/span\u003e));\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eselect\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eselect\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eabc\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003efabc\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003eapplyB\u003c/span\u003e);\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonad\u003c/h3\u003e\u003ca id=\"user-content-monad\" class=\"anchor\" aria-label=\"Permalink: Monad\" href=\"#monad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Monad\u0026lt;F\u0026gt; extends Selective\u0026lt;F\u0026gt; {\n\n \u0026lt;T, R\u0026gt; Kind\u0026lt;F, R\u0026gt; flatMap(Kind\u0026lt;F, T\u0026gt; value, Function1\u0026lt;T, ? extends Kind\u0026lt;F, R\u0026gt;\u0026gt; map);\n\n @Override\n default \u0026lt;T, R\u0026gt; Kind\u0026lt;F, R\u0026gt; map(Kind\u0026lt;F, T\u0026gt; value, Function1\u0026lt;T, R\u0026gt; map) {\n return flatMap(value, map.andThen(this::pure));\n }\n\n @Override\n default \u0026lt;T, R\u0026gt; Kind\u0026lt;F, R\u0026gt; ap(Kind\u0026lt;F, T\u0026gt; value, Kind\u0026lt;F, Function1\u0026lt;T, R\u0026gt;\u0026gt; apply) {\n return flatMap(apply, map -\u0026gt; map(value, map));\n }\n\n @Override\n default \u0026lt;A, B\u0026gt; Kind\u0026lt;F, B\u0026gt; select(Kind\u0026lt;F, Either\u0026lt;A, B\u0026gt;\u0026gt; value, Kind\u0026lt;F, Function1\u0026lt;A, B\u0026gt;\u0026gt; apply) {\n return flatMap(value, either -\u0026gt; either.fold(a -\u0026gt; map(apply, map -\u0026gt; map.apply(a)), this::\u0026lt;B\u0026gt;pure));\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonad\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSelective\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, ? \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e);\n\n \u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eOverride\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eandThen\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003ethis\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003epure\u003c/span\u003e));\n }\n\n \u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eOverride\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eapply\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eapply\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e));\n }\n\n \u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eOverride\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eselect\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEither\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eapply\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eeither\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003eeither\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003efold\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eapply\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eapply\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e)), \u003cspan class=\"pl-smi\"\u003ethis\u003c/span\u003e::\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u003cspan class=\"pl-s1\"\u003epure\u003c/span\u003e));\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSemigroup\u003c/h3\u003e\u003ca id=\"user-content-semigroup\" class=\"anchor\" aria-label=\"Permalink: Semigroup\" href=\"#semigroup\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt represents a binary operation over a type.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"@FunctionalInterface\npublic interface Semigroup\u0026lt;T\u0026gt; {\n T combine(T t1, T t2);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eFunctionalInterface\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSemigroup\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; {\n \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecombine\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003et1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003et2\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are instances for strings and integers.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonoid\u003c/h3\u003e\u003ca id=\"user-content-monoid\" class=\"anchor\" aria-label=\"Permalink: Monoid\" href=\"#monoid\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eExtends \u003ccode\u003eSemigroup\u003c/code\u003e adding a \u003ccode\u003ezero\u003c/code\u003e operation that represent an identity.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Monoid\u0026lt;T\u0026gt; extends Semigroup\u0026lt;T\u0026gt; {\n T zero();\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonoid\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSemigroup\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; {\n \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ezero\u003c/span\u003e();\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are instances for strings and integers.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSemigroupK\u003c/h3\u003e\u003ca id=\"user-content-semigroupk\" class=\"anchor\" aria-label=\"Permalink: SemigroupK\" href=\"#semigroupk\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt represents a \u003ccode\u003eSemigroup\u003c/code\u003e but defined for a kind, like a List, so it extends a regular \u003ccode\u003eSemigroup\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonoidK\u003c/h3\u003e\u003ca id=\"user-content-monoidk\" class=\"anchor\" aria-label=\"Permalink: MonoidK\" href=\"#monoidk\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe same like \u003ccode\u003eSemigroupK\u003c/code\u003e but for a \u003ccode\u003eMonoid\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInvariant\u003c/h3\u003e\u003ca id=\"user-content-invariant\" class=\"anchor\" aria-label=\"Permalink: Invariant\" href=\"#invariant\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Invariant\u0026lt;F\u0026gt; {\n \u0026lt;A, B\u0026gt; Kind\u0026lt;F, B\u0026gt; imap(Kind\u0026lt;F, A\u0026gt; value, Function1\u0026lt;A, B\u0026gt; map, Function1\u0026lt;B, A\u0026gt; comap);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eInvariant\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eimap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ecomap\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eContravariant\u003c/h3\u003e\u003ca id=\"user-content-contravariant\" class=\"anchor\" aria-label=\"Permalink: Contravariant\" href=\"#contravariant\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Contravariant\u0026lt;F\u0026gt; extends Invariant\u0026lt;F\u0026gt; {\n \u0026lt;A, B\u0026gt; Kind\u0026lt;F, B\u0026gt; contramap(Kind\u0026lt;F, A\u0026gt; value, Function1\u0026lt;B, A\u0026gt; map);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eContravariant\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eInvariant\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003econtramap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eApplicative Error\u003c/h3\u003e\u003ca id=\"user-content-applicative-error\" class=\"anchor\" aria-label=\"Permalink: Applicative Error\" href=\"#applicative-error\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface ApplicativeError\u0026lt;F, E\u0026gt; extends Applicative\u0026lt;F\u0026gt; {\n\n \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; raiseError(E error);\n\n \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; handleErrorWith(Kind\u0026lt;F, A\u0026gt; value, Function1\u0026lt;E, ? extends Kind\u0026lt;F, A\u0026gt;\u0026gt; handler);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eApplicativeError\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eApplicative\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eraiseError\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eerror\u003c/span\u003e);\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ehandleErrorWith\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e, ? \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003ehandler\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonad Error\u003c/h3\u003e\u003ca id=\"user-content-monad-error\" class=\"anchor\" aria-label=\"Permalink: Monad Error\" href=\"#monad-error\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface MonadError\u0026lt;F, E\u0026gt; extends ApplicativeError\u0026lt;F, E\u0026gt;, Monad\u0026lt;F\u0026gt; {\n\n default \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; ensure(Kind\u0026lt;F, A\u0026gt; value, Producer\u0026lt;E\u0026gt; error, Matcher1\u0026lt;A\u0026gt; matcher) {\n return flatMap(value, a -\u0026gt; matcher.match(a) ? pure(a) : raiseError(error.get()));\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadError\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eApplicativeError\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eMonad\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eensure\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eProducer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eerror\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eMatcher1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ematcher\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003ematcher\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ematch\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e) ? \u003cspan class=\"pl-en\"\u003epure\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e) : \u003cspan class=\"pl-en\"\u003eraiseError\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eerror\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e()));\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonad Throw\u003c/h3\u003e\u003ca id=\"user-content-monad-throw\" class=\"anchor\" aria-label=\"Permalink: Monad Throw\" href=\"#monad-throw\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface MonadThrow\u0026lt;F\u0026gt; extends MonadError\u0026lt;F, Throwable\u0026gt; {\n\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadThrow\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadError\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e\u0026gt; {\n\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonadReader\u003c/h3\u003e\u003ca id=\"user-content-monadreader\" class=\"anchor\" aria-label=\"Permalink: MonadReader\" href=\"#monadreader\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface MonadReader\u0026lt;F, R\u0026gt; extends Monad\u0026lt;F\u0026gt; {\n\n Kind\u0026lt;F, R\u0026gt; ask();\n\n default \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; reader(Function1\u0026lt;R, A\u0026gt; mapper) {\n return map(ask(), mapper);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadReader\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonad\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eask\u003c/span\u003e();\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ereader\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eask\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e);\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonadState\u003c/h3\u003e\u003ca id=\"user-content-monadstate\" class=\"anchor\" aria-label=\"Permalink: MonadState\" href=\"#monadstate\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface MonadState\u0026lt;F, S\u0026gt; extends Monad\u0026lt;F\u0026gt; {\n Kind\u0026lt;F, S\u0026gt; get();\n Kind\u0026lt;F, Unit\u0026gt; set(S state);\n\n default Kind\u0026lt;F, Unit\u0026gt; modify(Operator1\u0026lt;S\u0026gt; mapper) {\n return flatMap(get(), s -\u0026gt; set(mapper.apply(s)));\n }\n\n default \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; inspect(Function1\u0026lt;S, A\u0026gt; mapper) {\n return map(get(), mapper);\n }\n\n default \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; state(Function1\u0026lt;S, Tuple2\u0026lt;S, A\u0026gt;\u0026gt; mapper) {\n return flatMap(get(), s -\u0026gt; mapper.apply(s).applyTo((s1, a) -\u0026gt; map(set(s1), x -\u0026gt; a)));\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadState\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonad\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e();\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003estate\u003c/span\u003e);\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003emodify\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOperator1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-en\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eapply\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e)));\n }\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003einspect\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e);\n }\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003estate\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eS\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eflatMap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eapply\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e).\u003cspan class=\"pl-en\"\u003eapplyTo\u003c/span\u003e((\u003cspan class=\"pl-s1\"\u003es1\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e) -\u0026gt; \u003cspan class=\"pl-en\"\u003emap\u003c/span\u003e(\u003cspan class=\"pl-en\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003es1\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-s1\"\u003ea\u003c/span\u003e)));\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonadWriter\u003c/h3\u003e\u003ca id=\"user-content-monadwriter\" class=\"anchor\" aria-label=\"Permalink: MonadWriter\" href=\"#monadwriter\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface MonadWriter\u0026lt;F, W\u0026gt; extends Monad\u0026lt;F\u0026gt; {\n\n \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; writer(Tuple2\u0026lt;W, A\u0026gt; value);\n \u0026lt;A\u0026gt; Kind\u0026lt;F, Tuple2\u0026lt;W, A\u0026gt;\u0026gt; listen(Kind\u0026lt;F, A\u0026gt; value);\n \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; pass(Kind\u0026lt;F, Tuple2\u0026lt;Operator1\u0026lt;W\u0026gt;, A\u0026gt;\u0026gt; value);\n\n default Kind\u0026lt;F, Unit\u0026gt; tell(W writer) {\n return writer(Tuple.of(writer, unit()));\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadWriter\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eW\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonad\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ewriter\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eW\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e);\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eW\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-en\"\u003elisten\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e);\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003epass\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eOperator1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eW\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e);\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003etell\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eW\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ewriter\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e, \u003cspan class=\"pl-en\"\u003eunit\u003c/span\u003e()));\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eComonad\u003c/h3\u003e\u003ca id=\"user-content-comonad\" class=\"anchor\" aria-label=\"Permalink: Comonad\" href=\"#comonad\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Comonad\u0026lt;F\u0026gt; extends Functor\u0026lt;F\u0026gt; {\n\n \u0026lt;A, B\u0026gt; Kind\u0026lt;F, B\u0026gt; coflatMap(Kind\u0026lt;F, A\u0026gt; value, Function1\u0026lt;Kind\u0026lt;F, A\u0026gt;, B\u0026gt; map);\n\n \u0026lt;A\u0026gt; A extract(Kind\u0026lt;F, A\u0026gt; value);\n\n default \u0026lt;A\u0026gt; Kind\u0026lt;F, Kind\u0026lt;F, A\u0026gt;\u0026gt; coflatten(Kind\u0026lt;F, A\u0026gt; value) {\n return coflatMap(value, identity());\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eComonad\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFunctor\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ecoflatMap\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emap\u003c/span\u003e);\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eextract\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e);\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-en\"\u003ecoflatten\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecoflatMap\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-en\"\u003eidentity\u003c/span\u003e());\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFoldable\u003c/h3\u003e\u003ca id=\"user-content-foldable\" class=\"anchor\" aria-label=\"Permalink: Foldable\" href=\"#foldable\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Foldable\u0026lt;F\u0026gt; {\n\n \u0026lt;A, B\u0026gt; B foldLeft(Kind\u0026lt;F, A\u0026gt; value, B initial, Function2\u0026lt;B, A, B\u0026gt; mapper);\n\n \u0026lt;A, B\u0026gt; Eval\u0026lt;B\u0026gt; foldRight(Kind\u0026lt;F, A\u0026gt; value, Eval\u0026lt;B\u0026gt; initial, Function2\u0026lt;A, Eval\u0026lt;B\u0026gt;, Eval\u0026lt;B\u0026gt;\u0026gt; mapper);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFoldable\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efoldLeft\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einitial\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e);\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eEval\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003efoldRight\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEval\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003einitial\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEval\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eEval\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTraverse\u003c/h3\u003e\u003ca id=\"user-content-traverse\" class=\"anchor\" aria-label=\"Permalink: Traverse\" href=\"#traverse\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Traverse\u0026lt;F\u0026gt; extends Functor\u0026lt;F\u0026gt;, Foldable\u0026lt;F\u0026gt; {\n\n \u0026lt;G, T, R\u0026gt; Kind\u0026lt;G, Kind\u0026lt;F, R\u0026gt;\u0026gt; traverse(Applicative\u0026lt;G\u0026gt; applicative, Kind\u0026lt;F, T\u0026gt; value,\n Function1\u0026lt;T, ? extends Kind\u0026lt;G, R\u0026gt;\u0026gt; mapper);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eTraverse\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFunctor\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eFoldable\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eG\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eG\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-en\"\u003etraverse\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eApplicative\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eG\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eapplicative\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e,\n \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e, ? \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eG\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eR\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003emapper\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSemigroupal\u003c/h3\u003e\u003ca id=\"user-content-semigroupal\" class=\"anchor\" aria-label=\"Permalink: Semigroupal\" href=\"#semigroupal\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Semigroupal\u0026lt;F\u0026gt; {\n\n \u0026lt;A, B\u0026gt; Kind\u0026lt;F, Tuple2\u0026lt;A, B\u0026gt;\u0026gt; product(Kind\u0026lt;F, A\u0026gt; fa, Kind\u0026lt;F, B\u0026gt; fb);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSemigroupal\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-en\"\u003eproduct\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003efa\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003efb\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDefer\u003c/h3\u003e\u003ca id=\"user-content-defer\" class=\"anchor\" aria-label=\"Permalink: Defer\" href=\"#defer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Defer\u0026lt;F\u0026gt; {\n\n \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; defer(Producer\u0026lt;Kind\u0026lt;F, A\u0026gt;\u0026gt; defer);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eDefer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003edefer\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eProducer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003edefer\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBracket\u003c/h3\u003e\u003ca id=\"user-content-bracket\" class=\"anchor\" aria-label=\"Permalink: Bracket\" href=\"#bracket\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Bracket\u0026lt;F, E\u0026gt; extends MonadError\u0026lt;F, E\u0026gt; {\n\n \u0026lt;A, B\u0026gt; Kind\u0026lt;F, B\u0026gt; bracket(Kind\u0026lt;F, A\u0026gt; acquire, Function1\u0026lt;A, ? extends Kind\u0026lt;F, B\u0026gt;\u0026gt; use, Consumer1\u0026lt;A\u0026gt; release);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eBracket\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadError\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eE\u003c/span\u003e\u0026gt; {\n\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003ebracket\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eacquire\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e, ? \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eB\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003euse\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eConsumer1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003erelease\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMonadDefer\u003c/h3\u003e\u003ca id=\"user-content-monaddefer\" class=\"anchor\" aria-label=\"Permalink: MonadDefer\" href=\"#monaddefer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface MonadDefer\u0026lt;F\u0026gt; extends MonadThrow\u0026lt;F\u0026gt;, Bracket\u0026lt;F, Throwable\u0026gt;, Defer\u0026lt;F\u0026gt;, Timer\u0026lt;F\u0026gt; {\n\n default \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; later(Producer\u0026lt;A\u0026gt; later) {\n return defer(() -\u0026gt; Try.of(later::get).fold(this::raiseError, this::pure));\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadDefer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadThrow\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eBracket\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eThrowable\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eDefer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt;, \u003cspan class=\"pl-smi\"\u003eTimer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003elater\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eProducer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003elater\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-en\"\u003edefer\u003c/span\u003e(() -\u0026gt; \u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003elater\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eget\u003c/span\u003e).\u003cspan class=\"pl-en\"\u003efold\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003ethis\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003eraiseError\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003ethis\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003epure\u003c/span\u003e));\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAsync\u003c/h3\u003e\u003ca id=\"user-content-async\" class=\"anchor\" aria-label=\"Permalink: Async\" href=\"#async\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Async\u0026lt;F\u0026gt; extends MonadDefer\u0026lt;F\u0026gt; {\n \n \u0026lt;A\u0026gt; Kind\u0026lt;F, A\u0026gt; async(Consumer1\u0026lt;Consumer1\u0026lt;Try\u0026lt;A\u0026gt;\u0026gt;\u0026gt; consumer);\n\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eAsync\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-k\"\u003eextends\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMonadDefer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n \n \u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003easync\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eConsumer1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eConsumer1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eTry\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eA\u003c/span\u003e\u0026gt;\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003econsumer\u003c/span\u003e);\n\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTimer\u003c/h3\u003e\u003ca id=\"user-content-timer\" class=\"anchor\" aria-label=\"Permalink: Timer\" href=\"#timer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface Timer\u0026lt;F\u0026gt; {\n\n Kind\u0026lt;F, Unit\u0026gt; sleep(Duration duration);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eTimer\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e\u0026gt; {\n\n \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eUnit\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003esleep\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eDuration\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eduration\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFunctionK\u003c/h3\u003e\u003ca id=\"user-content-functionk\" class=\"anchor\" aria-label=\"Permalink: FunctionK\" href=\"#functionk\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt represents a natural transformation between two different kinds.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface FunctionK\u0026lt;F, G\u0026gt; {\n \u0026lt;T\u0026gt; Kind\u0026lt;G, T\u0026gt; apply(Kind\u0026lt;F, T\u0026gt; from);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFunctionK\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eG\u003c/span\u003e\u0026gt; {\n \u0026lt;\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eG\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-en\"\u003eapply\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eKind\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eF\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003efrom\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eOptics\u003c/h2\u003e\u003ca id=\"user-content-optics\" class=\"anchor\" aria-label=\"Permalink: Optics\" href=\"#optics\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" __Iso__\n / \\\n Lens Prism\n \\ /\n Optional\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e __Iso__\n / \\\n Lens Prism\n \\ /\n Optional\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eIso\u003c/h3\u003e\u003ca id=\"user-content-iso\" class=\"anchor\" aria-label=\"Permalink: Iso\" href=\"#iso\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn \u003ccode\u003eIso\u003c/code\u003e is an optic which converts elements of some type into elements of other type without loss.\nIn other words, it's \u003cstrong\u003eisomorphic\u003c/strong\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Point point = new Point(1, 2);\n\nIso\u0026lt;Point, Tuple2\u0026lt;Integer, Integer\u0026gt;\u0026gt; pointToTuple = \n Iso.of(p -\u0026gt; Tuple.of(p.x, p.y), \n t -\u0026gt; new Point(t.get1(), t.get2()));\n\nassertEquals(point, pointToTuple.set(pointToTuple.get(point)));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003epoint\u003c/span\u003e = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eIso\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eTuple2\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003epointToTuple\u003c/span\u003e = \n \u003cspan class=\"pl-smi\"\u003eIso\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ep\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ep\u003c/span\u003e.\u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003ep\u003c/span\u003e.\u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e), \n \u003cspan class=\"pl-s1\"\u003et\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003et\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget1\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003et\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget2\u003c/span\u003e()));\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epoint\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003epointToTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epointToTuple\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epoint\u003c/span\u003e)));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLens\u003c/h3\u003e\u003ca id=\"user-content-lens\" class=\"anchor\" aria-label=\"Permalink: Lens\" href=\"#lens\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eLens\u003c/code\u003e is an optic used to zoom inside a structure. In other words, it's an abstraction of a setter and a getter\nbut with immutable objects.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Lens\u0026lt;Employee, String\u0026gt; nameLens = Lens.of(Employee::getName, Employee::withName);\n\nEmployee pepe = new Employee(\u0026quot;pepe\u0026quot;);\n\nassertEquals(\u0026quot;pepe\u0026quot;, nameLens.get(pepe));\nassertEquals(\u0026quot;paco\u0026quot;, nameLens.get(nameLens.set(pepe, \u0026quot;paco\u0026quot;)));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003enameLens\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003egetName\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003ewithName\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"pepe\"\u003c/span\u003e);\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"pepe\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003enameLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e));\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"paco\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003enameLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003enameLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"paco\"\u003c/span\u003e)));\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe can compose Lenses to get deeper inside. For example, if we add an attribute of type \u003ccode\u003eAddress\u003c/code\u003e into \u003ccode\u003eEmployee\u003c/code\u003e.\nWe can create a lens to access the city name of the address of the employee.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Lens\u0026lt;Employee, Address\u0026gt; addressLens = Lens.of(Employee::getAddress, Employee::withAddress);\nLens\u0026lt;Address, String\u0026gt; cityLens = Lens.of(Address::getCity, Address::withCity);\nLens\u0026lt;Employee, String\u0026gt; cityAddressLens = addressLens.compose(cityLens);\n\nEmployee pepe = new Employee(\u0026quot;pepe\u0026quot;, new Address(\u0026quot;Madrid\u0026quot;));\n\nassertEquals(\u0026quot;Madrid\u0026quot;, cityAddressLens.get(pepe));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eaddressLens\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003egetAddress\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003ewithAddress\u003c/span\u003e);\n\u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ecityLens\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003egetCity\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003ewithCity\u003c/span\u003e);\n\u003cspan class=\"pl-smi\"\u003eLens\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003ecityAddressLens\u003c/span\u003e = \u003cspan class=\"pl-s1\"\u003eaddressLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ecompose\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ecityLens\u003c/span\u003e);\n\n\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"pepe\"\u003c/span\u003e, \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Madrid\"\u003c/span\u003e));\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Madrid\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003ecityAddressLens\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eget\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePrism\u003c/h3\u003e\u003ca id=\"user-content-prism\" class=\"anchor\" aria-label=\"Permalink: Prism\" href=\"#prism\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003ePrism\u003c/code\u003e is a lossless invertible optic that can see into a structure and optionally find a value.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Function1\u0026lt;String, Option\u0026lt;Integer\u0026gt;\u0026gt; parseInt = ...; // is a method that only returns a value when the string can be parsed\n\nPrism\u0026lt;String, Integer\u0026gt; stringToInteger = Prism.of(parseInt, String::valueOf);\n\nassertEquals(Option.some(5), stringToInteger.getOption(\u0026quot;5\u0026quot;));\nassertEquals(Option.none(), stringToInteger.getOption(\u0026quot;a\u0026quot;));\nassertEquals(\u0026quot;5\u0026quot;, stringToInteger.reverseGet(5));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eFunction1\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt;\u0026gt; \u003cspan class=\"pl-s1\"\u003eparseInt\u003c/span\u003e = ...; \u003cspan class=\"pl-c\"\u003e// is a method that only returns a value when the string can be parsed\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003ePrism\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eInteger\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003estringToInteger\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003ePrism\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eparseInt\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eString\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003evalueOf\u003c/span\u003e);\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esome\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003estringToInteger\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetOption\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"5\"\u003c/span\u003e));\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003enone\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003estringToInteger\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetOption\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"a\"\u003c/span\u003e));\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"5\"\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003estringToInteger\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003ereverseGet\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eOptional\u003c/h3\u003e\u003ca id=\"user-content-optional\" class=\"anchor\" aria-label=\"Permalink: Optional\" href=\"#optional\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn \u003ccode\u003eOptional\u003c/code\u003e is an optic that allows to see into a structure and getting, setting like a \u003ccode\u003eLens\u003c/code\u003e an optional find a value like a \u003ccode\u003ePrism\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Optional\u0026lt;Employee, Address\u0026gt; addressOptional = Optional.of(\n Employee::withAddress, employee -\u0026gt; Option.of(employee::getAddress)\n);\n\nAddress madrid = new Address(\u0026quot;Madrid\u0026quot;);\nEmployee pepe = new Employee(\u0026quot;pepe\u0026quot;, null);\n\nassertEquals(Option.none(), addressOptional.getOption(pepe));\nassertEquals(Option.some(madrid), addressOptional.getOption(addressOptional.set(pepe, madrid)));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eOptional\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e\u0026gt; \u003cspan class=\"pl-s1\"\u003eaddressOptional\u003c/span\u003e = \u003cspan class=\"pl-smi\"\u003eOptional\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\n \u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003ewithAddress\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eemployee\u003c/span\u003e -\u0026gt; \u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eemployee\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003egetAddress\u003c/span\u003e)\n);\n\n\u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emadrid\u003c/span\u003e = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eAddress\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"Madrid\"\u003c/span\u003e);\n\u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eEmployee\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"pepe\"\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e);\n\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003enone\u003c/span\u003e(), \u003cspan class=\"pl-s1\"\u003eaddressOptional\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetOption\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e));\n\u003cspan class=\"pl-en\"\u003eassertEquals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eOption\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003esome\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003emadrid\u003c/span\u003e), \u003cspan class=\"pl-s1\"\u003eaddressOptional\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003egetOption\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eaddressOptional\u003c/span\u003e.\u003cspan class=\"pl-en\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003epepe\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003emadrid\u003c/span\u003e)));\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eComposition\u003c/h3\u003e\u003ca id=\"user-content-composition\" class=\"anchor\" aria-label=\"Permalink: Composition\" href=\"#composition\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eOptional\u003c/th\u003e\n\u003cth\u003ePrism\u003c/th\u003e\n\u003cth\u003eLens\u003c/th\u003e\n\u003cth\u003eIso\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ePrism\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003ePrism\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003ePrism\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eLens\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003eLens\u003c/td\u003e\n\u003ctd\u003eLens\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eIso\u003c/td\u003e\n\u003ctd\u003eOptional\u003c/td\u003e\n\u003ctd\u003ePrism\u003c/td\u003e\n\u003ctd\u003eLens\u003c/td\u003e\n\u003ctd\u003eIso\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEqual\u003c/h2\u003e\u003ca id=\"user-content-equal\" class=\"anchor\" aria-label=\"Permalink: Equal\" href=\"#equal\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis class helps to create readable \u003ccode\u003eequals\u003c/code\u003e methods. An example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-java notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"@Override\npublic boolean equals(Object obj) {\n return Equal.\u0026lt;Data\u0026gt;of()\n .comparing(Data::getId)\n .comparing(Data::getValue)\n .applyTo(this, obj);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003e@\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eOverride\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eboolean\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eequals\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eObject\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eobj\u003c/span\u003e) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eEqual\u003c/span\u003e.\u0026lt;\u003cspan class=\"pl-smi\"\u003eData\u003c/span\u003e\u0026gt;\u003cspan class=\"pl-en\"\u003eof\u003c/span\u003e()\n .\u003cspan class=\"pl-en\"\u003ecomparing\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eData\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003egetId\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003ecomparing\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003eData\u003c/span\u003e::\u003cspan class=\"pl-s1\"\u003egetValue\u003c/span\u003e)\n .\u003cspan class=\"pl-en\"\u003eapplyTo\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003ethis\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eobj\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStargazers over time\u003c/h2\u003e\u003ca id=\"user-content-stargazers-over-time\" class=\"anchor\" aria-label=\"Permalink: Stargazers over time\" href=\"#stargazers-over-time\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://starchart.cc/tonivade/purefun\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/1bc53b2190634636a678bcca9a87ffd840135f393f49c749a3842879da7d2aa0/68747470733a2f2f7374617263686172742e63632f746f6e69766164652f7075726566756e2e737667\" alt=\"Stargazers over time\" data-canonical-src=\"https://starchart.cc/tonivade/purefun.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLicense\u003c/h2\u003e\u003ca id=\"user-content-license\" class=\"anchor\" aria-label=\"Permalink: License\" href=\"#license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003epurefun is released under MIT license\u003c/p\u003e\n\u003c/article\u003e","loaded":true,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"Purefun","anchor":"purefun","htmlText":"Purefun"},{"level":2,"text":"Disclaimer","anchor":"disclaimer","htmlText":"Disclaimer"},{"level":2,"text":"Higher Kinded Types","anchor":"higher-kinded-types","htmlText":"Higher Kinded Types"},{"level":2,"text":"Annotation Processor","anchor":"annotation-processor","htmlText":"Annotation Processor"},{"level":2,"text":"Data types","anchor":"data-types","htmlText":"Data types"},{"level":3,"text":"Option","anchor":"option","htmlText":"Option"},{"level":3,"text":"Try","anchor":"try","htmlText":"Try"},{"level":3,"text":"Either","anchor":"either","htmlText":"Either"},{"level":3,"text":"Validation","anchor":"validation","htmlText":"Validation"},{"level":3,"text":"Const","anchor":"const","htmlText":"Const"},{"level":3,"text":"Future","anchor":"future","htmlText":"Future"},{"level":3,"text":"Trampoline","anchor":"trampoline","htmlText":"Trampoline"},{"level":3,"text":"Tuples","anchor":"tuples","htmlText":"Tuples"},{"level":2,"text":"Data structures","anchor":"data-structures","htmlText":"Data structures"},{"level":3,"text":"Sequence","anchor":"sequence","htmlText":"Sequence"},{"level":3,"text":"ImmutableList","anchor":"immutablelist","htmlText":"ImmutableList"},{"level":3,"text":"ImmutableSet","anchor":"immutableset","htmlText":"ImmutableSet"},{"level":3,"text":"ImmutableArray","anchor":"immutablearray","htmlText":"ImmutableArray"},{"level":3,"text":"ImmutableMap","anchor":"immutablemap","htmlText":"ImmutableMap"},{"level":3,"text":"ImmutableTree","anchor":"immutabletree","htmlText":"ImmutableTree"},{"level":3,"text":"ImmutableTreeMap","anchor":"immutabletreemap","htmlText":"ImmutableTreeMap"},{"level":2,"text":"Monads","anchor":"monads","htmlText":"Monads"},{"level":3,"text":"State Monad","anchor":"state-monad","htmlText":"State Monad"},{"level":3,"text":"Reader Monad","anchor":"reader-monad","htmlText":"Reader Monad"},{"level":3,"text":"Writer Monad","anchor":"writer-monad","htmlText":"Writer Monad"},{"level":3,"text":"IO Monad","anchor":"io-monad","htmlText":"IO Monad"},{"level":2,"text":"Free","anchor":"free","htmlText":"Free"},{"level":3,"text":"Free Monad","anchor":"free-monad","htmlText":"Free Monad"},{"level":3,"text":"Free Applicative","anchor":"free-applicative","htmlText":"Free Applicative"},{"level":2,"text":"Monad Transformers","anchor":"monad-transformers","htmlText":"Monad Transformers"},{"level":3,"text":"OptionT","anchor":"optiont","htmlText":"OptionT"},{"level":3,"text":"EitherT","anchor":"eithert","htmlText":"EitherT"},{"level":3,"text":"StateT","anchor":"statet","htmlText":"StateT"},{"level":3,"text":"WriterT","anchor":"writert","htmlText":"WriterT"},{"level":3,"text":"Kleisli","anchor":"kleisli","htmlText":"Kleisli"},{"level":2,"text":"Stream","anchor":"stream","htmlText":"Stream"},{"level":2,"text":"Effects","anchor":"effects","htmlText":"Effects"},{"level":2,"text":"Type Classes","anchor":"type-classes","htmlText":"Type Classes"},{"level":3,"text":"Functor","anchor":"functor","htmlText":"Functor"},{"level":3,"text":"Applicative","anchor":"applicative","htmlText":"Applicative"},{"level":3,"text":"Selective","anchor":"selective","htmlText":"Selective"},{"level":3,"text":"Monad","anchor":"monad","htmlText":"Monad"},{"level":3,"text":"Semigroup","anchor":"semigroup","htmlText":"Semigroup"},{"level":3,"text":"Monoid","anchor":"monoid","htmlText":"Monoid"},{"level":3,"text":"SemigroupK","anchor":"semigroupk","htmlText":"SemigroupK"},{"level":3,"text":"MonoidK","anchor":"monoidk","htmlText":"MonoidK"},{"level":3,"text":"Invariant","anchor":"invariant","htmlText":"Invariant"},{"level":3,"text":"Contravariant","anchor":"contravariant","htmlText":"Contravariant"},{"level":3,"text":"Applicative Error","anchor":"applicative-error","htmlText":"Applicative Error"},{"level":3,"text":"Monad Error","anchor":"monad-error","htmlText":"Monad Error"},{"level":3,"text":"Monad Throw","anchor":"monad-throw","htmlText":"Monad Throw"},{"level":3,"text":"MonadReader","anchor":"monadreader","htmlText":"MonadReader"},{"level":3,"text":"MonadState","anchor":"monadstate","htmlText":"MonadState"},{"level":3,"text":"MonadWriter","anchor":"monadwriter","htmlText":"MonadWriter"},{"level":3,"text":"Comonad","anchor":"comonad","htmlText":"Comonad"},{"level":3,"text":"Foldable","anchor":"foldable","htmlText":"Foldable"},{"level":3,"text":"Traverse","anchor":"traverse","htmlText":"Traverse"},{"level":3,"text":"Semigroupal","anchor":"semigroupal","htmlText":"Semigroupal"},{"level":3,"text":"Defer","anchor":"defer","htmlText":"Defer"},{"level":3,"text":"Bracket","anchor":"bracket","htmlText":"Bracket"},{"level":3,"text":"MonadDefer","anchor":"monaddefer","htmlText":"MonadDefer"},{"level":3,"text":"Async","anchor":"async","htmlText":"Async"},{"level":3,"text":"Timer","anchor":"timer","htmlText":"Timer"},{"level":3,"text":"FunctionK","anchor":"functionk","htmlText":"FunctionK"},{"level":2,"text":"Optics","anchor":"optics","htmlText":"Optics"},{"level":3,"text":"Iso","anchor":"iso","htmlText":"Iso"},{"level":3,"text":"Lens","anchor":"lens","htmlText":"Lens"},{"level":3,"text":"Prism","anchor":"prism","htmlText":"Prism"},{"level":3,"text":"Optional","anchor":"optional","htmlText":"Optional"},{"level":3,"text":"Composition","anchor":"composition","htmlText":"Composition"},{"level":2,"text":"Equal","anchor":"equal","htmlText":"Equal"},{"level":2,"text":"Stargazers over time","anchor":"stargazers-over-time","htmlText":"Stargazers over time"},{"level":2,"text":"License","anchor":"license","htmlText":"License"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Ftonivade%2Fpurefun"}},{"displayName":"LICENSE","repoName":"purefun","refName":"master","path":"LICENSE","preferredFileType":"license","tabName":"MIT","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Ftonivade%2Fpurefun"}}],"overviewFilesProcessingTime":0}},"appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-708ec8ade250.js","githubDevUrl":null,"enabled_features":{"copilot_workspace":null,"code_nav_ui_events":false,"overview_shared_code_dropdown_button":true,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}}</script> <div data-target="react-partial.reactRoot"><style data-styled="true" data-styled-version="5.3.11">.iVEunk{margin-top:16px;margin-bottom:16px;}/*!sc*/ .jzuOtQ{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/ .bGojzy{margin-bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;row-gap:16px;}/*!sc*/ .iNSVHo{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;padding-bottom:16px;padding-top:8px;}/*!sc*/ .bVgnfw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;gap:8px;}/*!sc*/ @media screen and (max-width:320px){.bVgnfw{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}}/*!sc*/ .CEgMp{position:relative;}/*!sc*/ @media screen and (max-width:380px){.CEgMp .ref-selector-button-text-container{max-width:80px;}}/*!sc*/ @media screen and (max-width:320px){.CEgMp{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}.CEgMp .overview-ref-selector{width:100%;}.CEgMp .overview-ref-selector > span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;}.CEgMp .overview-ref-selector > span > span[data-component="text"]{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}}/*!sc*/ .gMOVLe[data-size="medium"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:0;}/*!sc*/ .gMOVLe[data-size="medium"] svg{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gMOVLe[data-size="medium"] > span{width:inherit;}/*!sc*/ .gUkoLg{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}/*!sc*/ .bZBlpz{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;}/*!sc*/ .lhTYNA{margin-right:4px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .ffLUq{font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}/*!sc*/ .bmcJak{min-width:0;}/*!sc*/ .fLXEGX{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (max-width:1079px){.fLXEGX{display:none;}}/*!sc*/ .lmSMZJ[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));padding-left:4px;padding-right:4px;}/*!sc*/ .lmSMZJ[data-size="medium"] span[data-component="leadingVisual"]{margin-right:4px !important;}/*!sc*/ .dqfxud{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:1080px){.dqfxud{display:none;}}/*!sc*/ @media screen and (max-width:543px){.dqfxud{display:none;}}/*!sc*/ .fGwBZA[data-size="medium"][data-no-visuals]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .jxTzTd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-left:8px;gap:8px;}/*!sc*/ .gqqBXN{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:8px;}/*!sc*/ @media screen and (max-width:543px){.gqqBXN{display:none;}}/*!sc*/ .dzXgxt{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (max-width:1011px){.dzXgxt{display:none;}}/*!sc*/ .iWFGlI{margin-left:8px;margin-right:8px;margin:0;}/*!sc*/ .vcvyP{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:160px;}/*!sc*/ .YUPas{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:1012px){.YUPas{display:none;}}/*!sc*/ .izFOf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:544px){.izFOf{display:none;}}/*!sc*/ .vIPPs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:16px;}/*!sc*/ .fdROMU{width:100%;border-collapse:separate;border-spacing:0;border:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:6px;table-layout:fixed;overflow:unset;}/*!sc*/ .jGKpsv{height:0px;line-height:0px;}/*!sc*/ .jGKpsv tr{height:0px;font-size:0px;}/*!sc*/ .jdgHnn{padding:16px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:12px;text-align:left;height:40px;}/*!sc*/ .jdgHnn th{padding-left:16px;background-color:var(--bgColor-muted,var(--color-canvas-subtle,#f6f8fa));}/*!sc*/ .bQivRW{width:100%;border-top-left-radius:6px;}/*!sc*/ @media screen and (min-width:544px){.bQivRW{display:none;}}/*!sc*/ .ldkMIO{width:40%;border-top-left-radius:6px;}/*!sc*/ @media screen and (max-width:543px){.ldkMIO{display:none;}}/*!sc*/ .jMbWeI{text-align:right;padding-right:16px;width:136px;border-top-right-radius:6px;}/*!sc*/ .gpqjiB{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:12px;height:40px;}/*!sc*/ .dzCJzi{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;min-width:273px;padding:8px;}/*!sc*/ @media screen and (min-width:544px){.dzCJzi{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}}/*!sc*/ .eNCcrz{text-align:center;vertical-align:center;height:40px;border-top:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));}/*!sc*/ .bHTcCe{border-top:1px solid var(--borderColor-default,var(--color-border-default));cursor:pointer;}/*!sc*/ .csrIcr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;gap:16px;}/*!sc*/ .bUQNHB{border:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:6px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/ @media screen and (max-width:543px){.bUQNHB{margin-left:-16px;margin-right:-16px;max-width:calc(100% + 32px);}}/*!sc*/ @media screen and (min-width:544px){.bUQNHB{max-width:100%;}}/*!sc*/ .jPdcfu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-bottom:1px solid;border-bottom-color:var(--borderColor-default,var(--color-border-default,#d0d7de));-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:8px;position:-webkit-sticky;position:sticky;top:0;background-color:var(--bgColor-default,var(--color-canvas-default,#ffffff));z-index:1;border-top-left-radius:6px;border-top-right-radius:6px;}/*!sc*/ .iphEWz{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;border-bottom:none;max-width:100%;padding-left:8px;padding-right:8px;}/*!sc*/ .hUCRAk{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .cwoBXV[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-subtle,#6e7781));padding-left:8px;padding-right:8px;}/*!sc*/ .QkQOb{padding:32px;overflow:auto;}/*!sc*/ data-styled.g1[id="Box-sc-g0xbh4-0"]{content:"iVEunk,jzuOtQ,bGojzy,iNSVHo,bVgnfw,CEgMp,gMOVLe,gUkoLg,bZBlpz,lhTYNA,ffLUq,bmcJak,fLXEGX,lmSMZJ,dqfxud,fGwBZA,jxTzTd,gqqBXN,dzXgxt,iWFGlI,vcvyP,YUPas,izFOf,vIPPs,fdROMU,jGKpsv,jdgHnn,bQivRW,ldkMIO,jMbWeI,gpqjiB,dzCJzi,eNCcrz,bHTcCe,csrIcr,bUQNHB,jPdcfu,iphEWz,hUCRAk,cwoBXV,QkQOb,"}/*!sc*/ .brGdpi{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}/*!sc*/ data-styled.g5[id="_VisuallyHidden__VisuallyHidden-sc-11jhm7a-0"]{content:"brGdpi,"}/*!sc*/ .hWlpPn{position:relative;display:inline-block;}/*!sc*/ .hWlpPn::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";-webkit-font-smoothing:subpixel-antialiased;color:var(--tooltip-fgColor,var(--fgColor-onEmphasis,var(--color-fg-on-emphasis,#ffffff)));text-align:center;-webkit-text-decoration:none;text-decoration:none;text-shadow:none;text-transform:none;-webkit-letter-spacing:normal;-moz-letter-spacing:normal;-ms-letter-spacing:normal;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--tooltip-bgColor,var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)));border-radius:6px;opacity:0;}/*!sc*/ @-webkit-keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ @keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ .hWlpPn:hover::after,.hWlpPn:active::after,.hWlpPn:focus::after,.hWlpPn:focus-within::after{display:inline-block;-webkit-text-decoration:none;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:0.1s;animation-duration:0.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-no-delay:hover::after,.hWlpPn.tooltipped-no-delay:active::after,.hWlpPn.tooltipped-no-delay:focus::after,.hWlpPn.tooltipped-no-delay:focus-within::after{-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-multiline:hover::after,.hWlpPn.tooltipped-multiline:active::after,.hWlpPn.tooltipped-multiline:focus::after,.hWlpPn.tooltipped-multiline:focus-within::after{display:table-cell;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-se::after,.hWlpPn.tooltipped-sw::after{top:100%;right:50%;margin-top:6px;}/*!sc*/ .hWlpPn.tooltipped-se::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-sw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-n::after,.hWlpPn.tooltipped-ne::after,.hWlpPn.tooltipped-nw::after{right:50%;bottom:100%;margin-bottom:6px;}/*!sc*/ .hWlpPn.tooltipped-ne::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-nw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-n::after{-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);}/*!sc*/ .hWlpPn.tooltipped-w::after{right:100%;bottom:50%;margin-right:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-e::after{bottom:50%;left:100%;margin-left:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-multiline::after{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-s::after,.hWlpPn.tooltipped-multiline.tooltipped-n::after{right:auto;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-w::after,.hWlpPn.tooltipped-multiline.tooltipped-e::after{right:100%;}/*!sc*/ .hWlpPn.tooltipped-align-right-2::after{right:0;margin-right:0;}/*!sc*/ .hWlpPn.tooltipped-align-left-2::after{left:0;margin-left:0;}/*!sc*/ data-styled.g16[id="Tooltip__TooltipBase-sc-17tf59c-0"]{content:"hWlpPn,"}/*!sc*/ .liVpTx{display:inline-block;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap;max-width:125px;}/*!sc*/ data-styled.g18[id="Truncate__StyledTruncate-sc-23o1d2-0"]{content:"liVpTx,"}/*!sc*/ </style> <!-- --> <!-- --> <div class="Box-sc-g0xbh4-0 iVEunk"><div class="Box-sc-g0xbh4-0 jzuOtQ"><div class="Box-sc-g0xbh4-0 bGojzy"></div></div><div class="Box-sc-g0xbh4-0 iNSVHo"><div class="Box-sc-g0xbh4-0 bVgnfw"><div class="Box-sc-g0xbh4-0 CEgMp"><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="master branch" data-testid="anchor-button" class="Box-sc-g0xbh4-0 gMOVLe prc-Button-ButtonBase-c50BI overview-ref-selector width-full" data-loading="false" data-size="medium" data-variant="default" aria-describedby="branch-picker-repos-header-ref-selector-loading-announcement" id="branch-picker-repos-header-ref-selector"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x"><div class="Box-sc-g0xbh4-0 bZBlpz"><div class="Box-sc-g0xbh4-0 lhTYNA"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></div><div class="Box-sc-g0xbh4-0 ffLUq ref-selector-button-text-container"><span class="Box-sc-g0xbh4-0 bmcJak prc-Text-Text-0ima0"> <!-- -->master</span></div></div></span><span data-component="trailingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><button hidden="" data-hotkey-scope="read-only-cursor-text-area"></button></div><div class="Box-sc-g0xbh4-0 fLXEGX"><a style="--button-color:fg.muted" type="button" href="/tonivade/purefun/branches" class="Box-sc-g0xbh4-0 lmSMZJ prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rclab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Branches</span></span></a><a style="--button-color:fg.muted" type="button" href="/tonivade/purefun/tags" class="Box-sc-g0xbh4-0 lmSMZJ prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rklab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-tag" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Tags</span></span></a></div><div class="Box-sc-g0xbh4-0 dqfxud"><a style="--button-color:fg.muted" type="button" aria-label="Go to Branches page" href="/tonivade/purefun/branches" class="Box-sc-g0xbh4-0 fGwBZA prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":Relab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></a><a style="--button-color:fg.muted" type="button" aria-label="Go to Tags page" href="/tonivade/purefun/tags" class="Box-sc-g0xbh4-0 fGwBZA prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":Rmlab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-tag" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path></svg></a></div></div><div class="Box-sc-g0xbh4-0 jxTzTd"><div class="Box-sc-g0xbh4-0 gqqBXN"><div class="Box-sc-g0xbh4-0 dzXgxt"><!--$--><div class="Box-sc-g0xbh4-0 iWFGlI"><span class="Box-sc-g0xbh4-0 vcvyP TextInput-wrapper prc-components-TextInputWrapper-i1ofR prc-components-TextInputBaseWrapper-ueK9q" data-leading-visual="true" data-trailing-visual="true" aria-busy="false"><span class="TextInput-icon" id=":R2j5ab:" aria-hidden="true"><svg aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span><input type="text" aria-label="Go to file" role="combobox" aria-controls="file-results-list" aria-expanded="false" aria-haspopup="dialog" autoCorrect="off" spellcheck="false" placeholder="Go to file" aria-describedby=":R2j5ab: :R2j5abH1:" data-component="input" class="prc-components-Input-Ic-y8" value=""/><span class="TextInput-icon" id=":R2j5abH1:" aria-hidden="true"></span></span></div><!--/$--></div><div class="Box-sc-g0xbh4-0 YUPas"><button type="button" class="prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":Rr5ab:-loading-announcement"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x">Go to file</span></span></button></div><div class="react-directory-add-file-icon"></div><div class="react-directory-remove-file-icon"></div></div><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="primary" aria-describedby=":R55ab:-loading-announcement" id=":R55ab:"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-code hide-sm" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Code</span><span data-component="trailingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><div class="Box-sc-g0xbh4-0 izFOf"><button data-component="IconButton" type="button" aria-label="Open more actions menu" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-c50BI prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R75ab:-loading-announcement" id=":R75ab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button></div></div></div><div class="Box-sc-g0xbh4-0 vIPPs"><div data-hpc="true"><button hidden="" data-testid="focus-next-element-button" data-hotkey="j"></button><button hidden="" data-testid="focus-previous-element-button" data-hotkey="k"></button><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading" id="folders-and-files">Folders and files</h2><table aria-labelledby="folders-and-files" class="Box-sc-g0xbh4-0 fdROMU"><thead class="Box-sc-g0xbh4-0 jGKpsv"><tr class="Box-sc-g0xbh4-0 jdgHnn"><th colSpan="2" class="Box-sc-g0xbh4-0 bQivRW"><span class="text-bold">Name</span></th><th colSpan="1" class="Box-sc-g0xbh4-0 ldkMIO"><span class="text-bold">Name</span></th><th class="hide-sm"><div title="Last commit message" class="Truncate__StyledTruncate-sc-23o1d2-0 liVpTx width-fit"><span class="text-bold">Last commit message</span></div></th><th colSpan="1" class="Box-sc-g0xbh4-0 jMbWeI"><div title="Last commit date" class="Truncate__StyledTruncate-sc-23o1d2-0 liVpTx width-fit"><span class="text-bold">Last commit date</span></div></th></tr></thead><tbody><tr class="Box-sc-g0xbh4-0 gpqjiB"><td colSpan="3" class="bgColor-muted p-1 rounded-top-2"><div class="Box-sc-g0xbh4-0 dzCJzi"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">Latest commit</h2><div style="width:120px" class="Skeleton Skeleton--text" data-testid="loading"> </div><div class="d-flex flex-shrink-0 gap-2"><div data-testid="latest-commit-details" class="d-none d-sm-flex flex-items-center"></div><div class="d-flex gap-2"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">History</h2><a href="/tonivade/purefun/commits/master/" class="prc-Button-ButtonBase-c50BI d-none d-lg-flex LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":Raqj8pab:-loading-announcement"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x"><span class="fgColor-default">1,814 Commits</span></span></span></a><div class="d-sm-none"></div><div class="d-flex d-lg-none"><span role="tooltip" aria-label="1,814 Commits" id="history-icon-button-tooltip" class="Tooltip__TooltipBase-sc-17tf59c-0 hWlpPn tooltipped-n"><a href="/tonivade/purefun/commits/master/" class="prc-Button-ButtonBase-c50BI LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":R1iqj8pab:-loading-announcement history-icon-button-tooltip"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span></span></a></span></div></div></div></div></td></tr><tr class="react-directory-row undefined" id="folder-row-0"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".github" aria-label=".github, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/.github">.github</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".github" aria-label=".github, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/.github">.github</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-1"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="This path skips through empty directories" aria-label="annotation/src/main/java/com/github/tonivade/purefun, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/annotation/src/main/java/com/github/tonivade/purefun"><span class="react-directory-default-color" data-testid="path-name-segment">annotation/</span><span class="react-directory-default-color" data-testid="path-name-segment">src/</span><span class="react-directory-default-color" data-testid="path-name-segment">main/</span><span class="react-directory-default-color" data-testid="path-name-segment">java/</span><span class="react-directory-default-color" data-testid="path-name-segment">com/</span><span class="react-directory-default-color" data-testid="path-name-segment">github/</span><span class="react-directory-default-color" data-testid="path-name-segment">tonivade/</span><span class="" data-testid="path-name-segment">purefun</span></a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="This path skips through empty directories" aria-label="annotation/src/main/java/com/github/tonivade/purefun, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/annotation/src/main/java/com/github/tonivade/purefun"><span class="react-directory-default-color" data-testid="path-name-segment">annotation/</span><span class="react-directory-default-color" data-testid="path-name-segment">src/</span><span class="react-directory-default-color" data-testid="path-name-segment">main/</span><span class="react-directory-default-color" data-testid="path-name-segment">java/</span><span class="react-directory-default-color" data-testid="path-name-segment">com/</span><span class="react-directory-default-color" data-testid="path-name-segment">github/</span><span class="react-directory-default-color" data-testid="path-name-segment">tonivade/</span><span class="" data-testid="path-name-segment">purefun</span></a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-2"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="core" aria-label="core, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/core">core</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="core" aria-label="core, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/core">core</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-3"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="effect" aria-label="effect, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/effect">effect</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="effect" aria-label="effect, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/effect">effect</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-4"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="free" aria-label="free, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/free">free</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="free" aria-label="free, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/free">free</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-5"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradle" aria-label="gradle, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/gradle">gradle</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradle" aria-label="gradle, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/gradle">gradle</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-6"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="instances" aria-label="instances, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/instances">instances</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="instances" aria-label="instances, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/instances">instances</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-7"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="monad" aria-label="monad, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/monad">monad</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="monad" aria-label="monad, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/monad">monad</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-8"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="optics" aria-label="optics, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/optics">optics</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="optics" aria-label="optics, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/optics">optics</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-9"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="processor" aria-label="processor, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/processor">processor</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="processor" aria-label="processor, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/processor">processor</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-10"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="stream" aria-label="stream, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/stream">stream</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="stream" aria-label="stream, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/stream">stream</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-11"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="transformer" aria-label="transformer, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/transformer">transformer</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="transformer" aria-label="transformer, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/transformer">transformer</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-12"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="typeclasses" aria-label="typeclasses, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/typeclasses">typeclasses</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="typeclasses" aria-label="typeclasses, (Directory)" class="Link--primary" href="/tonivade/purefun/tree/master/typeclasses">typeclasses</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-13"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitignore" aria-label=".gitignore, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/.gitignore">.gitignore</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitignore" aria-label=".gitignore, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/.gitignore">.gitignore</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-14"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSE" aria-label="LICENSE, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/LICENSE">LICENSE</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSE" aria-label="LICENSE, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/LICENSE">LICENSE</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-15"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="README.md" aria-label="README.md, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/README.md">README.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="README.md" aria-label="README.md, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/README.md">README.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-16"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="build.gradle" aria-label="build.gradle, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/build.gradle">build.gradle</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="build.gradle" aria-label="build.gradle, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/build.gradle">build.gradle</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-17"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradle.properties" aria-label="gradle.properties, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/gradle.properties">gradle.properties</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradle.properties" aria-label="gradle.properties, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/gradle.properties">gradle.properties</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-18"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradlew" aria-label="gradlew, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/gradlew">gradlew</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradlew" aria-label="gradlew, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/gradlew">gradlew</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-19"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradlew.bat" aria-label="gradlew.bat, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/gradlew.bat">gradlew.bat</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="gradlew.bat" aria-label="gradlew.bat, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/gradlew.bat">gradlew.bat</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-20"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="settings.gradle" aria-label="settings.gradle, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/settings.gradle">settings.gradle</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="settings.gradle" aria-label="settings.gradle, (File)" class="Link--primary" href="/tonivade/purefun/blob/master/settings.gradle">settings.gradle</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="Box-sc-g0xbh4-0 eNCcrz show-for-mobile" data-testid="view-all-files-row"><td colSpan="3" class="Box-sc-g0xbh4-0 bHTcCe"><div><button class="prc-Link-Link-85e08">View all files</button></div></td></tr></tbody></table></div><div class="Box-sc-g0xbh4-0 csrIcr"><div class="Box-sc-g0xbh4-0 bUQNHB"><div itemscope="" itemType="https://schema.org/abstract" class="Box-sc-g0xbh4-0 jPdcfu"><h2 class="_VisuallyHidden__VisuallyHidden-sc-11jhm7a-0 brGdpi">Repository files navigation</h2><nav class="Box-sc-g0xbh4-0 iphEWz prc-components-UnderlineWrapper-oOh5J" aria-label="Repository files"><ul class="prc-components-UnderlineItemList-b23Hf" role="list"><li class="Box-sc-g0xbh4-0 hUCRAk"><a class="prc-components-UnderlineItem-lJsg-" href="#" aria-current="page"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-book" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path></svg></span><span data-component="text" data-content="README">README</span></a></li><li class="Box-sc-g0xbh4-0 hUCRAk"><a class="prc-components-UnderlineItem-lJsg-" href="#"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-law" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg></span><span data-component="text" data-content="MIT license">MIT license</span></a></li></ul></nav><button style="--button-color:fg.subtle" type="button" aria-label="Outline" aria-haspopup="true" aria-expanded="false" tabindex="0" class="Box-sc-g0xbh4-0 cwoBXV prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rr9ab:-loading-announcement" id=":Rr9ab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-list-unordered" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg></button></div><div class="Box-sc-g0xbh4-0 QkQOb js-snippet-clipboard-copy-unpositioned undefined" data-hpc="true"><article class="markdown-body entry-content container-lg" itemprop="text"><div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Purefun</h1><a id="user-content-purefun" class="anchor" aria-label="Permalink: Purefun" href="#purefun"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ____ __ | _ \ _ _ _ __ ___ / _|_ _ _ __ | |_) | | | | '__/ _ \ |_| | | | '_ \ | __/| |_| | | | __/ _| |_| | | | | |_| \__,_|_| \___|_| \__,_|_| |_|"><pre class="notranslate"><code> ____ __ | _ \ _ _ _ __ ___ / _|_ _ _ __ | |_) | | | | '__/ _ \ |_| | | | '_ \ | __/| |_| | | | __/ _| |_| | | | | |_| \__,_|_| \___|_| \__,_|_| |_| </code></pre></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://github.com/tonivade/purefun/workflows/Java%20CI%20with%20Gradle/badge.svg"><img src="https://github.com/tonivade/purefun/workflows/Java%20CI%20with%20Gradle/badge.svg" alt="Build Status" style="max-width: 100%;"></a> <a href="https://www.codacy.com/app/zeromock/purefun?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=tonivade/purefun&amp;utm_campaign=Badge_Coverage" rel="nofollow"><img src="https://camo.githubusercontent.com/997f127f161e2271dab05170420f449c93747439bd7cde7b8a38d29514002415/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3338343232646231363164613438663039636431393263376537636161376464" alt="Codacy Badge" data-canonical-src="https://api.codacy.com/project/badge/Coverage/38422db161da48f09cd192c7e7caa7dd" style="max-width: 100%;"></a> <a href="https://gitter.im/tonivade/purefun?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge" rel="nofollow"><img src="https://camo.githubusercontent.com/d9856b21439449403f252aef1cd3ab62f97725f0ace6f6111eee8868de2ce93f/68747470733a2f2f6261646765732e6769747465722e696d2f746f6e69766164652f7075726566756e2e737667" alt="Join the chat at https://gitter.im/tonivade/purefun" data-canonical-src="https://badges.gitter.im/tonivade/purefun.svg" style="max-width: 100%;"></a></p> <p dir="auto">This module was developed as the core of the zeromock project. It defines all the basic classes and interfaces used in the rest of the project.</p> <p dir="auto">Initially the module only held a few basic interfaces and it has grown to become an entire functional programming library (well, a humble one), and now is an independent library.</p> <p dir="auto">Working in this library helped me to learn and understand some important concepts of functional programming, and over time I implemented higher kinded types and type classes in Java. I don't know if this will be helpful for somebody, but the work is here to everyone want to use it.</p> <p dir="auto">Finally, I have to say thanks to <a href="https://www.vavr.io/" rel="nofollow">vavr</a> library author, this library is largely inspired in his work, and also to <a href="https://www.scala-lang.org/" rel="nofollow">Scala</a> standard library authors. I don't want to forget some of the projects I've used as reference: <a href="https://arrow-kt.io/" rel="nofollow">Arrow</a> and <a href="https://typelevel.org/cats/" rel="nofollow">cats</a> for type classes implementation, <a href="https://fs2.io/" rel="nofollow">fs2</a> for stream processing, and <a href="https://zio.dev/" rel="nofollow">ZIO</a> to implement my own version in Java. Their awesome work help me a lot.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Disclaimer</h2><a id="user-content-disclaimer" class="anchor" aria-label="Permalink: Disclaimer" href="#disclaimer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><strong>This project is not ready to be used in production</strong>, I use it to learn functional programming concepts by my self, but, if you want to use it, <strong>use it at your own risk</strong>. Anyway if you think is useful for you, go ahead, also any feedback and PR are very welcome.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Higher Kinded Types</h2><a id="user-content-higher-kinded-types" class="anchor" aria-label="Permalink: Higher Kinded Types" href="#higher-kinded-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">In this project I have implemented some patterns of functional programming that need Higher Kinded Types. In Java there are not such thing, but it can be simulated using a especial codification of types.</p> <p dir="auto">In Scala we can define a higher kinded typed just like this <code>Monad[F[_]]</code> but in Java it can be codified like this <code>Monad&lt;F&gt;</code>. Then we can define a type using a special codification like this:</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface SomeType&lt;T&gt; extends SomeTypeOf&lt;T&gt; { } // Boilerplate interface SomeTypeOf&lt;T&gt; implements Kind&lt;SomeType&lt;?&gt;, T&gt; { // this is a safe cast static SomeType&lt;T&gt; toSomeType(Kind&lt;SomeType&lt;?&gt;, ? extends T&gt; hkt) { return (SomeType&lt;T&gt;) hkt; } }"><pre><span class="pl-k">interface</span> <span class="pl-smi">SomeType</span>&lt;<span class="pl-smi">T</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">SomeTypeOf</span>&lt;<span class="pl-smi">T</span>&gt; { } <span class="pl-c">// Boilerplate</span> <span class="pl-k">interface</span> <span class="pl-smi">SomeTypeOf</span>&lt;<span class="pl-smi">T</span>&gt; <span class="pl-k">implements</span> <span class="pl-s1">Kind</span>&lt;<span class="pl-smi">SomeType</span>&lt;?&gt;, <span class="pl-s1">T</span>&gt; { <span class="pl-c">// this is a safe cast</span> <span class="pl-k">static</span> <span class="pl-smi">SomeType</span>&lt;<span class="pl-smi">T</span>&gt; <span class="pl-en">toSomeType</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">SomeType</span>&lt;?&gt;, ? <span class="pl-k">extends</span> <span class="pl-smi">T</span>&gt; <span class="pl-s1">hkt</span>) { <span class="pl-k">return</span> (<span class="pl-smi">SomeType</span>&lt;<span class="pl-smi">T</span>&gt;) <span class="pl-s1">hkt</span>; } }</pre></div> <p dir="auto">It can be triky but, in the end is easy to work with. By the way, I tried to hide this details to the user of the library. Except with type classes because is the only way to implement them correctly.</p> <p dir="auto">So, there are interfaces to encode kinds of 1, 2 and 3 types. It can be defined types for 4, 5 or more types, but it wasn't necessary to implement the library.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Annotation Processor</h2><a id="user-content-annotation-processor" class="anchor" aria-label="Permalink: Annotation Processor" href="#annotation-processor"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">In order to simplify working with higher kinded types, in the last version I've included an annotation processor to generate all this boilerplate code:</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@HigherKind interface SomeType&lt;T&gt; extends SomeTypeOf&lt;T&gt; { }"><pre><span class="pl-c1">@</span><span class="pl-c1">HigherKind</span> <span class="pl-k">interface</span> <span class="pl-smi">SomeType</span>&lt;<span class="pl-smi">T</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">SomeTypeOf</span>&lt;<span class="pl-smi">T</span>&gt; { }</pre></div> <p dir="auto">With this annotation, all the above code, is generated automatically.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Data types</h2><a id="user-content-data-types" class="anchor" aria-label="Permalink: Data types" href="#data-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Option</h3><a id="user-content-option" class="anchor" aria-label="Permalink: Option" href="#option"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Is an alternative to <code>Optional</code> of Java standard library. It can contains two values, a <code>some</code> or a <code>none</code></p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Option&lt;String&gt; some = Option.some(&quot;Hello world&quot;); Option&lt;String&gt; none = Option.none();"><pre><span class="pl-smi">Option</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">some</span> = <span class="pl-smi">Option</span>.<span class="pl-en">some</span>(<span class="pl-s">"Hello world"</span>); <span class="pl-smi">Option</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">none</span> = <span class="pl-smi">Option</span>.<span class="pl-en">none</span>();</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Try</h3><a id="user-content-try" class="anchor" aria-label="Permalink: Try" href="#try"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Is an implementation of scala <code>Try</code> in Java. It can contains two values, a <code>success</code> or a <code>failure</code>.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Try&lt;String&gt; success = Try.success(&quot;Hello world&quot;); Try&lt;String&gt; failure = Try.failure(new RuntimeException(&quot;Error&quot;));"><pre><span class="pl-smi">Try</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">success</span> = <span class="pl-smi">Try</span>.<span class="pl-en">success</span>(<span class="pl-s">"Hello world"</span>); <span class="pl-smi">Try</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">failure</span> = <span class="pl-smi">Try</span>.<span class="pl-en">failure</span>(<span class="pl-k">new</span> <span class="pl-smi">RuntimeException</span>(<span class="pl-s">"Error"</span>));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Either</h3><a id="user-content-either" class="anchor" aria-label="Permalink: Either" href="#either"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Is an implementation of scala <code>Either</code> in Java.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Either&lt;Integer, String&gt; right = Either.right(&quot;Hello world&quot;); Either&lt;Integer, String&gt; left = Either.left(100);"><pre><span class="pl-smi">Either</span>&lt;<span class="pl-smi">Integer</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">right</span> = <span class="pl-smi">Either</span>.<span class="pl-en">right</span>(<span class="pl-s">"Hello world"</span>); <span class="pl-smi">Either</span>&lt;<span class="pl-smi">Integer</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">left</span> = <span class="pl-smi">Either</span>.<span class="pl-en">left</span>(<span class="pl-c1">100</span>);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Validation</h3><a id="user-content-validation" class="anchor" aria-label="Permalink: Validation" href="#validation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This type represents two different states, valid or invalid, an also it allows to combine several validations using <code>mapN</code> methods.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Validation&lt;String, String&gt; name = Validation.valid(&quot;John Smith&quot;); Validation&lt;String, String&gt; email = Validation.valid(&quot;john.smith@example.net&quot;); // Person has a constructor with two String parameters, name and email. Valdation&lt;Sequence&lt;String&gt;, Person&gt; person = Validation.map2(name, email, Person::new);"><pre><span class="pl-smi">Validation</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">name</span> = <span class="pl-smi">Validation</span>.<span class="pl-en">valid</span>(<span class="pl-s">"John Smith"</span>); <span class="pl-smi">Validation</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">email</span> = <span class="pl-smi">Validation</span>.<span class="pl-en">valid</span>(<span class="pl-s">"john.smith@example.net"</span>); <span class="pl-c">// Person has a constructor with two String parameters, name and email.</span> <span class="pl-smi">Valdation</span>&lt;<span class="pl-smi">Sequence</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Person</span>&gt; <span class="pl-s1">person</span> = <span class="pl-smi">Validation</span>.<span class="pl-en">map2</span>(<span class="pl-s1">name</span>, <span class="pl-s1">email</span>, <span class="pl-smi">Person</span>::<span class="pl-k">new</span>);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Const</h3><a id="user-content-const" class="anchor" aria-label="Permalink: Const" href="#const"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A object with a phantom parameter:</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Const&lt;String, Integer&gt; constInt = Const.of(&quot;Hello world!&quot;); Const&lt;String, Float&gt; constFloat = constInt.retag(); assertEquals(&quot;Hello world!&quot;, constFloat.value());"><pre><span class="pl-smi">Const</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">Integer</span>&gt; <span class="pl-s1">constInt</span> = <span class="pl-smi">Const</span>.<span class="pl-en">of</span>(<span class="pl-s">"Hello world!"</span>); <span class="pl-smi">Const</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">Float</span>&gt; <span class="pl-s1">constFloat</span> = <span class="pl-s1">constInt</span>.<span class="pl-en">retag</span>(); <span class="pl-en">assertEquals</span>(<span class="pl-s">"Hello world!"</span>, <span class="pl-s1">constFloat</span>.<span class="pl-en">value</span>());</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Future</h3><a id="user-content-future" class="anchor" aria-label="Permalink: Future" href="#future"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This is an experimental implementation of Future. Computations are executed in another thread inmediatelly (since version 5.0 de default executor is a virtual thread per task executor).</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Future&lt;String&gt; future = Future.success(&quot;Hello world!&quot;); Future&lt;String&gt; result = future.flatMap(string -&gt; Future.run(string::toUpperCase)); assertEquals(Try.success(&quot;HELLO WORLD!&quot;), result.await());"><pre><span class="pl-smi">Future</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">future</span> = <span class="pl-smi">Future</span>.<span class="pl-en">success</span>(<span class="pl-s">"Hello world!"</span>); <span class="pl-smi">Future</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">result</span> = <span class="pl-s1">future</span>.<span class="pl-en">flatMap</span>(<span class="pl-s1">string</span> -&gt; <span class="pl-smi">Future</span>.<span class="pl-en">run</span>(<span class="pl-s1">string</span>::<span class="pl-s1">toUpperCase</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Try</span>.<span class="pl-en">success</span>(<span class="pl-s">"HELLO WORLD!"</span>), <span class="pl-s1">result</span>.<span class="pl-en">await</span>());</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Trampoline</h3><a id="user-content-trampoline" class="anchor" aria-label="Permalink: Trampoline" href="#trampoline"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Implements recursion using an iteration and is stack safe.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="private Trampoline&lt;Integer&gt; fibLoop(Integer n) { if (n &lt; 2) { return Trampoline.done(n); } return Trampoline.more(() -&gt; fibLoop(n - 1)).flatMap(x -&gt; fibLoop(n - 2).map(y -&gt; x + y)); }"><pre><span class="pl-k">private</span> <span class="pl-smi">Trampoline</span>&lt;<span class="pl-smi">Integer</span>&gt; <span class="pl-en">fibLoop</span>(<span class="pl-smi">Integer</span> <span class="pl-s1">n</span>) { <span class="pl-k">if</span> (<span class="pl-s1">n</span> &lt; <span class="pl-c1">2</span>) { <span class="pl-k">return</span> <span class="pl-smi">Trampoline</span>.<span class="pl-en">done</span>(<span class="pl-s1">n</span>); } <span class="pl-k">return</span> <span class="pl-smi">Trampoline</span>.<span class="pl-en">more</span>(() -&gt; <span class="pl-en">fibLoop</span>(<span class="pl-s1">n</span> - <span class="pl-c1">1</span>)).<span class="pl-en">flatMap</span>(<span class="pl-s1">x</span> -&gt; <span class="pl-en">fibLoop</span>(<span class="pl-s1">n</span> - <span class="pl-c1">2</span>).<span class="pl-en">map</span>(<span class="pl-s1">y</span> -&gt; <span class="pl-s1">x</span> + <span class="pl-s1">y</span>)); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Tuples</h3><a id="user-content-tuples" class="anchor" aria-label="Permalink: Tuples" href="#tuples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">These classes allow to hold some values together, as tuples. There are tuples from 1 to 5.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Tuple1&lt;String&gt; tuple1 = Tuple.of(&quot;Hello world&quot;); Tuple2&lt;String, Integer&gt; tuple2 = Tuple.of(&quot;John Smith&quot;, 100);"><pre><span class="pl-smi">Tuple1</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">tuple1</span> = <span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-s">"Hello world"</span>); <span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">Integer</span>&gt; <span class="pl-s1">tuple2</span> = <span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-s">"John Smith"</span>, <span class="pl-c1">100</span>);</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Data structures</h2><a id="user-content-data-structures" class="anchor" aria-label="Permalink: Data structures" href="#data-structures"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Java doesn't define immutable collections, so I have implemented some of them.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Sequence</h3><a id="user-content-sequence" class="anchor" aria-label="Permalink: Sequence" href="#sequence"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Is the equivalent to java <code>Collection</code> interface. It defines all the common methods. The default implementation use persistent collections based on <a href="https://github.com/hrldcpr/pcollections/">pcollections</a> library.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">ImmutableList</h3><a id="user-content-immutablelist" class="anchor" aria-label="Permalink: ImmutableList" href="#immutablelist"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It represents a linked list. It has a head and a tail. Based on <code>ConsPStack</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">ImmutableSet</h3><a id="user-content-immutableset" class="anchor" aria-label="Permalink: ImmutableSet" href="#immutableset"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It represents a set of elements. This elements cannot be duplicated. Based on <code>HashTreePSet</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">ImmutableArray</h3><a id="user-content-immutablearray" class="anchor" aria-label="Permalink: ImmutableArray" href="#immutablearray"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It represents an array. You can access to the elements by its position in the array. Based on <code>TreePVector</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">ImmutableMap</h3><a id="user-content-immutablemap" class="anchor" aria-label="Permalink: ImmutableMap" href="#immutablemap"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This class represents a hash map. Based on <code>HashTreePMap</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">ImmutableTree</h3><a id="user-content-immutabletree" class="anchor" aria-label="Permalink: ImmutableTree" href="#immutabletree"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This class represents a binary tree. Based on <code>TreePSet</code></p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">ImmutableTreeMap</h3><a id="user-content-immutabletreemap" class="anchor" aria-label="Permalink: ImmutableTreeMap" href="#immutabletreemap"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This class represents a binary tree map. Based on <code>TreePMap</code>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Monads</h2><a id="user-content-monads" class="anchor" aria-label="Permalink: Monads" href="#monads"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Also I have implemented some Monads that allows to combine some operations.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">State Monad</h3><a id="user-content-state-monad" class="anchor" aria-label="Permalink: State Monad" href="#state-monad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Is the traditional State Modad from FP languages, like Haskel or Scala. It allows to combine operations over a state. The state should be a immutable class. It recives an state and generates a tuple with the new state and an intermediate result.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="State&lt;ImmutableList&lt;String&gt;, Option&lt;String&gt;&gt; read = State.state(list -&gt; Tuple.of(list.tail(), list.head())); Tuple&lt;ImmutableList&lt;String&gt;, Option&lt;String&gt;&gt; result = read.run(ImmutableList.of(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)); assertEquals(Tuple.of(ImmutableList.of(&quot;b&quot;, &quot;c&quot;), Option.some(&quot;a&quot;)), result);"><pre><span class="pl-smi">State</span>&lt;<span class="pl-smi">ImmutableList</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Option</span>&lt;<span class="pl-smi">String</span>&gt;&gt; <span class="pl-s1">read</span> = <span class="pl-smi">State</span>.<span class="pl-en">state</span>(<span class="pl-s1">list</span> -&gt; <span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-s1">list</span>.<span class="pl-en">tail</span>(), <span class="pl-s1">list</span>.<span class="pl-en">head</span>())); <span class="pl-smi">Tuple</span>&lt;<span class="pl-smi">ImmutableList</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Option</span>&lt;<span class="pl-smi">String</span>&gt;&gt; <span class="pl-s1">result</span> = <span class="pl-s1">read</span>.<span class="pl-en">run</span>(<span class="pl-smi">ImmutableList</span>.<span class="pl-en">of</span>(<span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>, <span class="pl-s">"c"</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-smi">ImmutableList</span>.<span class="pl-en">of</span>(<span class="pl-s">"b"</span>, <span class="pl-s">"c"</span>), <span class="pl-smi">Option</span>.<span class="pl-en">some</span>(<span class="pl-s">"a"</span>)), <span class="pl-s1">result</span>);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Reader Monad</h3><a id="user-content-reader-monad" class="anchor" aria-label="Permalink: Reader Monad" href="#reader-monad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This is an implementation of Reader Monad. It allows to combine operations over a common input. It can be used to inject dependencies.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Reader&lt;ImmutableList&lt;String&gt;, String&gt; read2 = Reader.reader(list -&gt; list.tail().head().orElse(&quot;&quot;)); String result = read2.eval(ImmutableList.of(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)); assertEqual(&quot;b&quot;, result);"><pre><span class="pl-smi">Reader</span>&lt;<span class="pl-smi">ImmutableList</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">String</span>&gt; <span class="pl-s1">read2</span> = <span class="pl-smi">Reader</span>.<span class="pl-en">reader</span>(<span class="pl-s1">list</span> -&gt; <span class="pl-s1">list</span>.<span class="pl-en">tail</span>().<span class="pl-en">head</span>().<span class="pl-en">orElse</span>(<span class="pl-s">""</span>)); <span class="pl-smi">String</span> <span class="pl-s1">result</span> = <span class="pl-s1">read2</span>.<span class="pl-en">eval</span>(<span class="pl-smi">ImmutableList</span>.<span class="pl-en">of</span>(<span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>, <span class="pl-s">"c"</span>)); <span class="pl-en">assertEqual</span>(<span class="pl-s">"b"</span>, <span class="pl-s1">result</span>);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Writer Monad</h3><a id="user-content-writer-monad" class="anchor" aria-label="Permalink: Writer Monad" href="#writer-monad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It allow to combine operations over a common output.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Writer&lt;ImmutableList&lt;String&gt;, Integer&gt; writer = Writer.&lt;String, Integer&gt;listPure(5) .flatMap(value -&gt; listWriter(&quot;add 5&quot;, value + 5)) .flatMap(value -&gt; listWriter(&quot;plus 2&quot;, value * 2)); assertAll(() -&gt; assertEquals(Integer.valueOf(20), writer.getValue()), () -&gt; assertEquals(listOf(&quot;add 5&quot;, &quot;plus 2&quot;), writer.getLog()));"><pre><span class="pl-smi">Writer</span>&lt;<span class="pl-smi">ImmutableList</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Integer</span>&gt; <span class="pl-s1">writer</span> = <span class="pl-smi">Writer</span>.&lt;<span class="pl-smi">String</span>, <span class="pl-smi">Integer</span>&gt;<span class="pl-en">listPure</span>(<span class="pl-c1">5</span>) .<span class="pl-en">flatMap</span>(<span class="pl-s1">value</span> -&gt; <span class="pl-en">listWriter</span>(<span class="pl-s">"add 5"</span>, <span class="pl-s1">value</span> + <span class="pl-c1">5</span>)) .<span class="pl-en">flatMap</span>(<span class="pl-s1">value</span> -&gt; <span class="pl-en">listWriter</span>(<span class="pl-s">"plus 2"</span>, <span class="pl-s1">value</span> * <span class="pl-c1">2</span>)); <span class="pl-en">assertAll</span>(() -&gt; <span class="pl-en">assertEquals</span>(<span class="pl-smi">Integer</span>.<span class="pl-en">valueOf</span>(<span class="pl-c1">20</span>), <span class="pl-s1">writer</span>.<span class="pl-en">getValue</span>()), () -&gt; <span class="pl-en">assertEquals</span>(<span class="pl-en">listOf</span>(<span class="pl-s">"add 5"</span>, <span class="pl-s">"plus 2"</span>), <span class="pl-s1">writer</span>.<span class="pl-en">getLog</span>()));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">IO Monad</h3><a id="user-content-io-monad" class="anchor" aria-label="Permalink: IO Monad" href="#io-monad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This is a experimental implementation of IO Monad in java. Inspired in this <a href="https://gist.github.com/joergrathlev/f17092d3470dcf732be6">work</a>.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="IO&lt;Unit&gt; echo = Console.print(&quot;write your name&quot;) .andThen(Console.read()) .flatMap(name -&gt; Console.print(&quot;Hello &quot; + name)) .andThen(Console.print(&quot;end&quot;)); echo.unsafeRunSync();"><pre><span class="pl-smi">IO</span>&lt;<span class="pl-smi">Unit</span>&gt; <span class="pl-s1">echo</span> = <span class="pl-smi">Console</span>.<span class="pl-en">print</span>(<span class="pl-s">"write your name"</span>) .<span class="pl-en">andThen</span>(<span class="pl-smi">Console</span>.<span class="pl-en">read</span>()) .<span class="pl-en">flatMap</span>(<span class="pl-s1">name</span> -&gt; <span class="pl-smi">Console</span>.<span class="pl-en">print</span>(<span class="pl-s">"Hello "</span> + <span class="pl-s1">name</span>)) .<span class="pl-en">andThen</span>(<span class="pl-smi">Console</span>.<span class="pl-en">print</span>(<span class="pl-s">"end"</span>)); <span class="pl-s1">echo</span>.<span class="pl-en">unsafeRunSync</span>();</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Free</h2><a id="user-content-free" class="anchor" aria-label="Permalink: Free" href="#free"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Free Monad</h3><a id="user-content-free-monad" class="anchor" aria-label="Permalink: Free Monad" href="#free-monad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Finally, after hours of hard coding, I managed to implement a Free monad. This is a highly unstable implementation and I have implemented because it can be implemented. Inspired in this <a href="https://github.com/xuwei-k/free-monad-java">work</a>.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Free&lt;IOProgram_, Unit&gt; echo = IOProgram.write(&quot;what's your name?&quot;) .andThen(IOProgram.read()) .flatMap(text -&gt; IOProgram.write(&quot;Hello &quot; + text)) .andThen(IOProgram.write(&quot;end&quot;)); Kind&lt;IO_, Unit&gt; foldMap = echo.foldMap(IOInstances.monad(), new IOProgramInterperter()); foldMap.fix(toIO()).unsafeRunSync();"><pre><span class="pl-smi">Free</span>&lt;<span class="pl-smi">IOProgram_</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-s1">echo</span> = <span class="pl-smi">IOProgram</span>.<span class="pl-en">write</span>(<span class="pl-s">"what's your name?"</span>) .<span class="pl-en">andThen</span>(<span class="pl-smi">IOProgram</span>.<span class="pl-en">read</span>()) .<span class="pl-en">flatMap</span>(<span class="pl-s1">text</span> -&gt; <span class="pl-smi">IOProgram</span>.<span class="pl-en">write</span>(<span class="pl-s">"Hello "</span> + <span class="pl-s1">text</span>)) .<span class="pl-en">andThen</span>(<span class="pl-smi">IOProgram</span>.<span class="pl-en">write</span>(<span class="pl-s">"end"</span>)); <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">IO_</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-s1">foldMap</span> = <span class="pl-s1">echo</span>.<span class="pl-en">foldMap</span>(<span class="pl-smi">IOInstances</span>.<span class="pl-en">monad</span>(), <span class="pl-k">new</span> <span class="pl-smi">IOProgramInterperter</span>()); <span class="pl-s1">foldMap</span>.<span class="pl-en">fix</span>(<span class="pl-en">toIO</span>()).<span class="pl-en">unsafeRunSync</span>();</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Free Applicative</h3><a id="user-content-free-applicative" class="anchor" aria-label="Permalink: Free Applicative" href="#free-applicative"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Similar to Free monad, but allows static analysis without to run the program.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="FreeAp&lt;DSL_, Tuple5&lt;Integer, Boolean, Double, String, Unit&gt;&gt; tuple = applicative.map5( DSL.readInt(2), DSL.readBoolean(false), DSL.readDouble(2.1), DSL.readString(&quot;hola mundo&quot;), DSL.readUnit(), Tuple::of ).fix(toFreeAp()); Kind&lt;Id_, Tuple5&lt;Integer, Boolean, Double, String, Unit&gt;&gt; map = tuple.foldMap(idTransform(), IdInstances.applicative()); assertEquals(Id.of(Tuple.of(2, false, 2.1, &quot;hola mundo&quot;, unit())), map.fix(toId()));"><pre><span class="pl-smi">FreeAp</span>&lt;<span class="pl-smi">DSL_</span>, <span class="pl-smi">Tuple5</span>&lt;<span class="pl-smi">Integer</span>, <span class="pl-smi">Boolean</span>, <span class="pl-smi">Double</span>, <span class="pl-smi">String</span>, <span class="pl-smi">Unit</span>&gt;&gt; <span class="pl-s1">tuple</span> = <span class="pl-s1">applicative</span>.<span class="pl-en">map5</span>( <span class="pl-c1">DSL</span>.<span class="pl-en">readInt</span>(<span class="pl-c1">2</span>), <span class="pl-c1">DSL</span>.<span class="pl-en">readBoolean</span>(<span class="pl-c1">false</span>), <span class="pl-c1">DSL</span>.<span class="pl-en">readDouble</span>(<span class="pl-c1">2.1</span>), <span class="pl-c1">DSL</span>.<span class="pl-en">readString</span>(<span class="pl-s">"hola mundo"</span>), <span class="pl-c1">DSL</span>.<span class="pl-en">readUnit</span>(), <span class="pl-smi">Tuple</span>::<span class="pl-s1">of</span> ).<span class="pl-en">fix</span>(<span class="pl-en">toFreeAp</span>()); <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">Id_</span>, <span class="pl-smi">Tuple5</span>&lt;<span class="pl-smi">Integer</span>, <span class="pl-smi">Boolean</span>, <span class="pl-smi">Double</span>, <span class="pl-smi">String</span>, <span class="pl-smi">Unit</span>&gt;&gt; <span class="pl-s1">map</span> = <span class="pl-s1">tuple</span>.<span class="pl-en">foldMap</span>(<span class="pl-en">idTransform</span>(), <span class="pl-smi">IdInstances</span>.<span class="pl-en">applicative</span>()); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Id</span>.<span class="pl-en">of</span>(<span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-c1">2</span>, <span class="pl-c1">false</span>, <span class="pl-c1">2.1</span>, <span class="pl-s">"hola mundo"</span>, <span class="pl-en">unit</span>())), <span class="pl-s1">map</span>.<span class="pl-en">fix</span>(<span class="pl-en">toId</span>()));</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Monad Transformers</h2><a id="user-content-monad-transformers" class="anchor" aria-label="Permalink: Monad Transformers" href="#monad-transformers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">OptionT</h3><a id="user-content-optiont" class="anchor" aria-label="Permalink: OptionT" href="#optiont"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Monad Transformer for <code>Option</code> type</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="OptionT&lt;IO_, String&gt; some = OptionT.some(IO.monad(), &quot;abc&quot;); OptionT&lt;IO_, String&gt; map = some.flatMap(value -&gt; OptionT.some(IOInstances.monad(), value.toUpperCase())); assertEquals(&quot;ABC&quot;, map.get().fix(toIO()).unsafeRunSync());"><pre><span class="pl-smi">OptionT</span>&lt;<span class="pl-smi">IO_</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">some</span> = <span class="pl-smi">OptionT</span>.<span class="pl-en">some</span>(<span class="pl-c1">IO</span>.<span class="pl-en">monad</span>(), <span class="pl-s">"abc"</span>); <span class="pl-smi">OptionT</span>&lt;<span class="pl-smi">IO_</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">map</span> = <span class="pl-s1">some</span>.<span class="pl-en">flatMap</span>(<span class="pl-s1">value</span> -&gt; <span class="pl-smi">OptionT</span>.<span class="pl-en">some</span>(<span class="pl-smi">IOInstances</span>.<span class="pl-en">monad</span>(), <span class="pl-s1">value</span>.<span class="pl-en">toUpperCase</span>())); <span class="pl-en">assertEquals</span>(<span class="pl-s">"ABC"</span>, <span class="pl-s1">map</span>.<span class="pl-en">get</span>().<span class="pl-en">fix</span>(<span class="pl-en">toIO</span>()).<span class="pl-en">unsafeRunSync</span>());</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">EitherT</h3><a id="user-content-eithert" class="anchor" aria-label="Permalink: EitherT" href="#eithert"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Monad Transformer for <code>Either</code> type</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="EitherT&lt;IO_, Nothing, String&gt; right = EitherT.right(IO.monad(), &quot;abc&quot;); EitherT&lt;IO_, Nothing, String&gt; map = right.flatMap(value -&gt; EitherT.right(IOInstances.monad(), value.toUpperCase())); assertEquals(&quot;ABC&quot;, map.get().fix(toIO()).unsafeRunSync());"><pre><span class="pl-smi">EitherT</span>&lt;<span class="pl-smi">IO_</span>, <span class="pl-smi">Nothing</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">right</span> = <span class="pl-smi">EitherT</span>.<span class="pl-en">right</span>(<span class="pl-c1">IO</span>.<span class="pl-en">monad</span>(), <span class="pl-s">"abc"</span>); <span class="pl-smi">EitherT</span>&lt;<span class="pl-smi">IO_</span>, <span class="pl-smi">Nothing</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">map</span> = <span class="pl-s1">right</span>.<span class="pl-en">flatMap</span>(<span class="pl-s1">value</span> -&gt; <span class="pl-smi">EitherT</span>.<span class="pl-en">right</span>(<span class="pl-smi">IOInstances</span>.<span class="pl-en">monad</span>(), <span class="pl-s1">value</span>.<span class="pl-en">toUpperCase</span>())); <span class="pl-en">assertEquals</span>(<span class="pl-s">"ABC"</span>, <span class="pl-s1">map</span>.<span class="pl-en">get</span>().<span class="pl-en">fix</span>(<span class="pl-en">toIO</span>()).<span class="pl-en">unsafeRunSync</span>());</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">StateT</h3><a id="user-content-statet" class="anchor" aria-label="Permalink: StateT" href="#statet"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Monad Transformer for <code>State</code> type</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="StateT&lt;IO_, ImmutableList&lt;String&gt;, Unit&gt; state = pure(&quot;a&quot;).flatMap(append(&quot;b&quot;)).flatMap(append(&quot;c&quot;)).flatMap(end()); IO&lt;Tuple2&lt;ImmutableList&lt;String&gt;, Unit&gt;&gt; result = state.run(ImmutableList.empty()).fix(toIO()); assertEquals(Tuple.of(listOf(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;), unit()), result.unsafeRunSync());"><pre><span class="pl-smi">StateT</span>&lt;<span class="pl-smi">IO_</span>, <span class="pl-smi">ImmutableList</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Unit</span>&gt; <span class="pl-s1">state</span> = <span class="pl-en">pure</span>(<span class="pl-s">"a"</span>).<span class="pl-en">flatMap</span>(<span class="pl-en">append</span>(<span class="pl-s">"b"</span>)).<span class="pl-en">flatMap</span>(<span class="pl-en">append</span>(<span class="pl-s">"c"</span>)).<span class="pl-en">flatMap</span>(<span class="pl-en">end</span>()); <span class="pl-smi">IO</span>&lt;<span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">ImmutableList</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Unit</span>&gt;&gt; <span class="pl-s1">result</span> = <span class="pl-s1">state</span>.<span class="pl-en">run</span>(<span class="pl-smi">ImmutableList</span>.<span class="pl-en">empty</span>()).<span class="pl-en">fix</span>(<span class="pl-en">toIO</span>()); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-en">listOf</span>(<span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>, <span class="pl-s">"c"</span>), <span class="pl-en">unit</span>()), <span class="pl-s1">result</span>.<span class="pl-en">unsafeRunSync</span>());</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">WriterT</h3><a id="user-content-writert" class="anchor" aria-label="Permalink: WriterT" href="#writert"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Monad Transformer for <code>Writer</code> type</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="WriterT&lt;Id_, Sequence&lt;String&gt;, Integer&gt; writer = WriterT.&lt;Id_, Sequence&lt;String&gt;, Integer&gt;pure(monoid, monad, 5) .flatMap(value -&gt; lift(monoid, monad, Tuple.of(listOf(&quot;add 5&quot;), value + 5))) .flatMap(value -&gt; lift(monoid, monad, Tuple.of(listOf(&quot;plus 2&quot;), value * 2))); assertAll(() -&gt; assertEquals(Id.of(Integer.valueOf(20)), writer.getValue()), () -&gt; assertEquals(Id.of(listOf(&quot;add 5&quot;, &quot;plus 2&quot;)), writer.getLog()));"><pre><span class="pl-smi">WriterT</span>&lt;<span class="pl-smi">Id_</span>, <span class="pl-smi">Sequence</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Integer</span>&gt; <span class="pl-s1">writer</span> = <span class="pl-smi">WriterT</span>.&lt;<span class="pl-smi">Id_</span>, <span class="pl-smi">Sequence</span>&lt;<span class="pl-smi">String</span>&gt;, <span class="pl-smi">Integer</span>&gt;<span class="pl-en">pure</span>(<span class="pl-s1">monoid</span>, <span class="pl-s1">monad</span>, <span class="pl-c1">5</span>) .<span class="pl-en">flatMap</span>(<span class="pl-s1">value</span> -&gt; <span class="pl-en">lift</span>(<span class="pl-s1">monoid</span>, <span class="pl-s1">monad</span>, <span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-en">listOf</span>(<span class="pl-s">"add 5"</span>), <span class="pl-s1">value</span> + <span class="pl-c1">5</span>))) .<span class="pl-en">flatMap</span>(<span class="pl-s1">value</span> -&gt; <span class="pl-en">lift</span>(<span class="pl-s1">monoid</span>, <span class="pl-s1">monad</span>, <span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-en">listOf</span>(<span class="pl-s">"plus 2"</span>), <span class="pl-s1">value</span> * <span class="pl-c1">2</span>))); <span class="pl-en">assertAll</span>(() -&gt; <span class="pl-en">assertEquals</span>(<span class="pl-smi">Id</span>.<span class="pl-en">of</span>(<span class="pl-smi">Integer</span>.<span class="pl-en">valueOf</span>(<span class="pl-c1">20</span>)), <span class="pl-s1">writer</span>.<span class="pl-en">getValue</span>()), () -&gt; <span class="pl-en">assertEquals</span>(<span class="pl-smi">Id</span>.<span class="pl-en">of</span>(<span class="pl-en">listOf</span>(<span class="pl-s">"add 5"</span>, <span class="pl-s">"plus 2"</span>)), <span class="pl-s1">writer</span>.<span class="pl-en">getLog</span>()));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Kleisli</h3><a id="user-content-kleisli" class="anchor" aria-label="Permalink: Kleisli" href="#kleisli"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Also I implemented the Kleisli composition for functions that returns monadic values like <code>Option</code>, <code>Try</code> or <code>Either</code>.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Kleisli&lt;Try_, String, Integer&gt; toInt = Kleisli.lift(Try.monad(), Integer::parseInt); Kleisli&lt;Try_, Integer, Double&gt; half = Kleisli.lift(Try.monad(), i -&gt; i / 2.); Kind&lt;Try_, Double&gt; result = toInt.compose(half).run(&quot;123&quot;); assertEquals(Try.success(61.5), result);"><pre><span class="pl-smi">Kleisli</span>&lt;<span class="pl-smi">Try_</span>, <span class="pl-smi">String</span>, <span class="pl-smi">Integer</span>&gt; <span class="pl-s1">toInt</span> = <span class="pl-smi">Kleisli</span>.<span class="pl-en">lift</span>(<span class="pl-smi">Try</span>.<span class="pl-en">monad</span>(), <span class="pl-smi">Integer</span>::<span class="pl-s1">parseInt</span>); <span class="pl-smi">Kleisli</span>&lt;<span class="pl-smi">Try_</span>, <span class="pl-smi">Integer</span>, <span class="pl-smi">Double</span>&gt; <span class="pl-s1">half</span> = <span class="pl-smi">Kleisli</span>.<span class="pl-en">lift</span>(<span class="pl-smi">Try</span>.<span class="pl-en">monad</span>(), <span class="pl-s1">i</span> -&gt; <span class="pl-s1">i</span> / <span class="pl-c1">2.</span>); <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">Try_</span>, <span class="pl-smi">Double</span>&gt; <span class="pl-s1">result</span> = <span class="pl-s1">toInt</span>.<span class="pl-en">compose</span>(<span class="pl-s1">half</span>).<span class="pl-en">run</span>(<span class="pl-s">"123"</span>); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Try</span>.<span class="pl-en">success</span>(<span class="pl-c1">61.5</span>), <span class="pl-s1">result</span>);</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stream</h2><a id="user-content-stream" class="anchor" aria-label="Permalink: Stream" href="#stream"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An experimental version of a <code>Stream</code> like scala fs2 project.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="StreamOf&lt;IO&lt;?&gt;&gt; streamOfIO = Stream.ofIO(); IO&lt;String&gt; readFile = streamOfIO.eval(IO.of(() -&gt; reader(file))) .flatMap(reader -&gt; streamOfIO.iterate(() -&gt; Option.of(() -&gt; readLine(reader)))) .takeWhile(Option::isPresent) .map(Option::get) .foldLeft(&quot;&quot;, (a, b) -&gt; a + &quot;\n&quot; + b) .fix(IOOf::toIO) .recoverWith(UncheckedIOException.class, cons(&quot;--- file not found ---&quot;)); String content = readFile.unsafeRunSync();"><pre><span class="pl-smi">StreamOf</span>&lt;<span class="pl-smi">IO</span>&lt;?&gt;&gt; <span class="pl-s1">streamOfIO</span> = <span class="pl-smi">Stream</span>.<span class="pl-en">ofIO</span>(); <span class="pl-smi">IO</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">readFile</span> = <span class="pl-s1">streamOfIO</span>.<span class="pl-en">eval</span>(<span class="pl-c1">IO</span>.<span class="pl-en">of</span>(() -&gt; <span class="pl-en">reader</span>(<span class="pl-s1">file</span>))) .<span class="pl-en">flatMap</span>(<span class="pl-s1">reader</span> -&gt; <span class="pl-s1">streamOfIO</span>.<span class="pl-en">iterate</span>(() -&gt; <span class="pl-smi">Option</span>.<span class="pl-en">of</span>(() -&gt; <span class="pl-en">readLine</span>(<span class="pl-s1">reader</span>)))) .<span class="pl-en">takeWhile</span>(<span class="pl-smi">Option</span>::<span class="pl-s1">isPresent</span>) .<span class="pl-en">map</span>(<span class="pl-smi">Option</span>::<span class="pl-s1">get</span>) .<span class="pl-en">foldLeft</span>(<span class="pl-s">""</span>, (<span class="pl-s1">a</span>, <span class="pl-s1">b</span>) -&gt; <span class="pl-s1">a</span> + <span class="pl-s">"<span class="pl-cce">\n</span>"</span> + <span class="pl-s1">b</span>) .<span class="pl-en">fix</span>(<span class="pl-smi">IOOf</span>::<span class="pl-s1">toIO</span>) .<span class="pl-en">recoverWith</span>(<span class="pl-smi">UncheckedIOException</span>.<span class="pl-k">class</span>, <span class="pl-en">cons</span>(<span class="pl-s">"--- file not found ---"</span>)); <span class="pl-smi">String</span> <span class="pl-s1">content</span> = <span class="pl-s1">readFile</span>.<span class="pl-en">unsafeRunSync</span>();</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Effects</h2><a id="user-content-effects" class="anchor" aria-label="Permalink: Effects" href="#effects"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An experimental version of <code>PureIO</code> similar to ZIO.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="PureIO&lt;Console, Throwable, Unit&gt; echoProgram = Console.println(&quot;what's your name?&quot;) .andThen(Console.readln()) .flatMap(name -&gt; Console.println(&quot;Hello &quot; + name)); interface Console { &lt;R extends Console&gt; Console.Service&lt;R&gt; console(); static PureIO&lt;Console, Throwable, String&gt; readln() { return PureIO.accessM(env -&gt; env.console().readln()); } static PureIO&lt;Console, Throwable, Unit&gt; println(String text) { return PureIO.accessM(env -&gt; env.console().println(text)); } interface Service&lt;R extends Console&gt; { PureIO&lt;R, Throwable, String&gt; readln(); PureIO&lt;R, Throwable, Unit&gt; println(String text); } }"><pre><span class="pl-smi">PureIO</span>&lt;<span class="pl-smi">Console</span>, <span class="pl-smi">Throwable</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-s1">echoProgram</span> = <span class="pl-smi">Console</span>.<span class="pl-en">println</span>(<span class="pl-s">"what's your name?"</span>) .<span class="pl-en">andThen</span>(<span class="pl-smi">Console</span>.<span class="pl-en">readln</span>()) .<span class="pl-en">flatMap</span>(<span class="pl-s1">name</span> -&gt; <span class="pl-smi">Console</span>.<span class="pl-en">println</span>(<span class="pl-s">"Hello "</span> + <span class="pl-s1">name</span>)); <span class="pl-k">interface</span> <span class="pl-smi">Console</span> { &lt;<span class="pl-smi">R</span> <span class="pl-k">extends</span> <span class="pl-smi">Console</span>&gt; <span class="pl-smi">Console</span>.<span class="pl-smi">Service</span>&lt;<span class="pl-smi">R</span>&gt; <span class="pl-en">console</span>(); <span class="pl-k">static</span> <span class="pl-smi">PureIO</span>&lt;<span class="pl-smi">Console</span>, <span class="pl-smi">Throwable</span>, <span class="pl-smi">String</span>&gt; <span class="pl-en">readln</span>() { <span class="pl-k">return</span> <span class="pl-smi">PureIO</span>.<span class="pl-en">accessM</span>(<span class="pl-s1">env</span> -&gt; <span class="pl-s1">env</span>.<span class="pl-en">console</span>().<span class="pl-en">readln</span>()); } <span class="pl-k">static</span> <span class="pl-smi">PureIO</span>&lt;<span class="pl-smi">Console</span>, <span class="pl-smi">Throwable</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-en">println</span>(<span class="pl-smi">String</span> <span class="pl-s1">text</span>) { <span class="pl-k">return</span> <span class="pl-smi">PureIO</span>.<span class="pl-en">accessM</span>(<span class="pl-s1">env</span> -&gt; <span class="pl-s1">env</span>.<span class="pl-en">console</span>().<span class="pl-en">println</span>(<span class="pl-s1">text</span>)); } <span class="pl-k">interface</span> <span class="pl-smi">Service</span>&lt;<span class="pl-smi">R</span> <span class="pl-k">extends</span> <span class="pl-smi">Console</span>&gt; { <span class="pl-smi">PureIO</span>&lt;<span class="pl-smi">R</span>, <span class="pl-smi">Throwable</span>, <span class="pl-smi">String</span>&gt; <span class="pl-en">readln</span>(); <span class="pl-smi">PureIO</span>&lt;<span class="pl-smi">R</span>, <span class="pl-smi">Throwable</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-en">println</span>(<span class="pl-smi">String</span> <span class="pl-s1">text</span>); } }</pre></div> <p dir="auto">Additionally, there are aliases for some PureIO special cases:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="UIO&lt;T&gt; =&gt; PureIO&lt;Void, Void, T&gt; EIO&lt;E, T&gt; =&gt; PureIO&lt;Void, E, T&gt; Task&lt;T&gt; =&gt; PureIO&lt;Void, Throwable, T&gt; RIO&lt;R, T&gt; =&gt; PureIO&lt;R, Throwable, T&gt; URIO&lt;T&gt; =&gt; PureIO&lt;R, Void, T&gt;"><pre class="notranslate"><code>UIO&lt;T&gt; =&gt; PureIO&lt;Void, Void, T&gt; EIO&lt;E, T&gt; =&gt; PureIO&lt;Void, E, T&gt; Task&lt;T&gt; =&gt; PureIO&lt;Void, Throwable, T&gt; RIO&lt;R, T&gt; =&gt; PureIO&lt;R, Throwable, T&gt; URIO&lt;T&gt; =&gt; PureIO&lt;R, Void, T&gt; </code></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Type Classes</h2><a id="user-content-type-classes" class="anchor" aria-label="Permalink: Type Classes" href="#type-classes"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">With higher kinded types simulation we can implement typeclases.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Invariant -- Contravariant \ SemigroupK Functor -- Comonad | / \ MonoidK _ Applicative Traverse -- Foldable | / | \ Alternative Selective ApplicativeError | | MonadWriter Monad | \________________| | / / \ / MonadState MonadReader MonadError_____ \ \ MonadThrow Bracket \ / Defer -- MonadDefer -- Timer | Async | Concurrent"><pre class="notranslate"><code> Invariant -- Contravariant \ SemigroupK Functor -- Comonad | / \ MonoidK _ Applicative Traverse -- Foldable | / | \ Alternative Selective ApplicativeError | | MonadWriter Monad | \________________| | / / \ / MonadState MonadReader MonadError_____ \ \ MonadThrow Bracket \ / Defer -- MonadDefer -- Timer | Async | Concurrent </code></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Functor</h3><a id="user-content-functor" class="anchor" aria-label="Permalink: Functor" href="#functor"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Functor&lt;F extends &gt; extends Invariant&lt;F&gt; { &lt;T, R&gt; Kind&lt;F, R&gt; map(Kind&lt;F, T&gt; value, Function1&lt;T, R&gt; map); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Functor</span>&lt;<span class="pl-smi">F</span> <span class="pl-k">extends</span> &gt; <span class="pl-k">extends</span> <span class="pl-smi">Invariant</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">map</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-s1">map</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Applicative</h3><a id="user-content-applicative" class="anchor" aria-label="Permalink: Applicative" href="#applicative"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Applicative&lt;F&gt; extends Functor&lt;F&gt; { &lt;T&gt; Kind&lt;F, T&gt; pure(T value); &lt;T, R&gt; Kind&lt;F, R&gt; ap(Kind&lt;F, T&gt; value, Kind&lt;F, Function1&lt;T, R&gt;&gt; apply); @Override default &lt;T, R&gt; Kind&lt;F, R&gt; map(Kind&lt;F, T&gt; value, Function1&lt;T, R&gt; map) { return ap(value, pure(map)); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Applicative</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Functor</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">T</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-en">pure</span>(<span class="pl-smi">T</span> <span class="pl-s1">value</span>); &lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">ap</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt;&gt; <span class="pl-s1">apply</span>); <span class="pl-c1">@</span><span class="pl-c1">Override</span> <span class="pl-k">default</span> &lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">map</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-s1">map</span>) { <span class="pl-k">return</span> <span class="pl-en">ap</span>(<span class="pl-s1">value</span>, <span class="pl-en">pure</span>(<span class="pl-s1">map</span>)); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Selective</h3><a id="user-content-selective" class="anchor" aria-label="Permalink: Selective" href="#selective"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Selective&lt;F&gt; extends Applicative&lt;F&gt; { &lt;A, B&gt; Kind&lt;F, B&gt; select(Kind&lt;F, Either&lt;A, B&gt;&gt; value, Kind&lt;F, Function1&lt;A, B&gt;&gt; apply); default &lt;A, B, C&gt; Kind&lt;F, C&gt; branch(Kind&lt;F, Either&lt;A, B&gt;&gt; value, Kind&lt;F, Function1&lt;A, C&gt;&gt; applyA, Kind&lt;F, Function1&lt;B, C&gt;&gt; applyB) { Kind&lt;F, Either&lt;A, Either&lt;B, C&gt;&gt;&gt; abc = map(value, either -&gt; either.map(Either::left)); Kind&lt;F, Function1&lt;A, Either&lt;B, C&gt;&gt;&gt; fabc = map(applyA, fb -&gt; fb.andThen(Either::right)); return select(select(abc, fabc), applyB); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Selective</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Applicative</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-en">select</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Either</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">apply</span>); <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>, <span class="pl-smi">C</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">C</span>&gt; <span class="pl-en">branch</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Either</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">C</span>&gt;&gt; <span class="pl-s1">applyA</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">B</span>, <span class="pl-smi">C</span>&gt;&gt; <span class="pl-s1">applyB</span>) { <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Either</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">Either</span>&lt;<span class="pl-smi">B</span>, <span class="pl-smi">C</span>&gt;&gt;&gt; <span class="pl-s1">abc</span> = <span class="pl-en">map</span>(<span class="pl-s1">value</span>, <span class="pl-s1">either</span> -&gt; <span class="pl-s1">either</span>.<span class="pl-en">map</span>(<span class="pl-smi">Either</span>::<span class="pl-s1">left</span>)); <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">Either</span>&lt;<span class="pl-smi">B</span>, <span class="pl-smi">C</span>&gt;&gt;&gt; <span class="pl-s1">fabc</span> = <span class="pl-en">map</span>(<span class="pl-s1">applyA</span>, <span class="pl-s1">fb</span> -&gt; <span class="pl-s1">fb</span>.<span class="pl-en">andThen</span>(<span class="pl-smi">Either</span>::<span class="pl-s1">right</span>)); <span class="pl-k">return</span> <span class="pl-en">select</span>(<span class="pl-en">select</span>(<span class="pl-s1">abc</span>, <span class="pl-s1">fabc</span>), <span class="pl-s1">applyB</span>); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Monad</h3><a id="user-content-monad" class="anchor" aria-label="Permalink: Monad" href="#monad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Monad&lt;F&gt; extends Selective&lt;F&gt; { &lt;T, R&gt; Kind&lt;F, R&gt; flatMap(Kind&lt;F, T&gt; value, Function1&lt;T, ? extends Kind&lt;F, R&gt;&gt; map); @Override default &lt;T, R&gt; Kind&lt;F, R&gt; map(Kind&lt;F, T&gt; value, Function1&lt;T, R&gt; map) { return flatMap(value, map.andThen(this::pure)); } @Override default &lt;T, R&gt; Kind&lt;F, R&gt; ap(Kind&lt;F, T&gt; value, Kind&lt;F, Function1&lt;T, R&gt;&gt; apply) { return flatMap(apply, map -&gt; map(value, map)); } @Override default &lt;A, B&gt; Kind&lt;F, B&gt; select(Kind&lt;F, Either&lt;A, B&gt;&gt; value, Kind&lt;F, Function1&lt;A, B&gt;&gt; apply) { return flatMap(value, either -&gt; either.fold(a -&gt; map(apply, map -&gt; map.apply(a)), this::&lt;B&gt;pure)); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Monad</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Selective</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">flatMap</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, ? <span class="pl-k">extends</span> <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt;&gt; <span class="pl-s1">map</span>); <span class="pl-c1">@</span><span class="pl-c1">Override</span> <span class="pl-k">default</span> &lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">map</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-s1">map</span>) { <span class="pl-k">return</span> <span class="pl-en">flatMap</span>(<span class="pl-s1">value</span>, <span class="pl-s1">map</span>.<span class="pl-en">andThen</span>(<span class="pl-smi">this</span>::<span class="pl-s1">pure</span>)); } <span class="pl-c1">@</span><span class="pl-c1">Override</span> <span class="pl-k">default</span> &lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">ap</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt;&gt; <span class="pl-s1">apply</span>) { <span class="pl-k">return</span> <span class="pl-en">flatMap</span>(<span class="pl-s1">apply</span>, <span class="pl-s1">map</span> -&gt; <span class="pl-en">map</span>(<span class="pl-s1">value</span>, <span class="pl-s1">map</span>)); } <span class="pl-c1">@</span><span class="pl-c1">Override</span> <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-en">select</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Either</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">apply</span>) { <span class="pl-k">return</span> <span class="pl-en">flatMap</span>(<span class="pl-s1">value</span>, <span class="pl-s1">either</span> -&gt; <span class="pl-s1">either</span>.<span class="pl-en">fold</span>(<span class="pl-s1">a</span> -&gt; <span class="pl-en">map</span>(<span class="pl-s1">apply</span>, <span class="pl-s1">map</span> -&gt; <span class="pl-s1">map</span>.<span class="pl-en">apply</span>(<span class="pl-s1">a</span>)), <span class="pl-smi">this</span>::&lt;<span class="pl-smi">B</span>&gt;<span class="pl-s1">pure</span>)); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Semigroup</h3><a id="user-content-semigroup" class="anchor" aria-label="Permalink: Semigroup" href="#semigroup"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It represents a binary operation over a type.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@FunctionalInterface public interface Semigroup&lt;T&gt; { T combine(T t1, T t2); }"><pre><span class="pl-c1">@</span><span class="pl-c1">FunctionalInterface</span> <span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Semigroup</span>&lt;<span class="pl-smi">T</span>&gt; { <span class="pl-smi">T</span> <span class="pl-en">combine</span>(<span class="pl-smi">T</span> <span class="pl-s1">t1</span>, <span class="pl-smi">T</span> <span class="pl-s1">t2</span>); }</pre></div> <p dir="auto">There are instances for strings and integers.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Monoid</h3><a id="user-content-monoid" class="anchor" aria-label="Permalink: Monoid" href="#monoid"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Extends <code>Semigroup</code> adding a <code>zero</code> operation that represent an identity.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Monoid&lt;T&gt; extends Semigroup&lt;T&gt; { T zero(); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Monoid</span>&lt;<span class="pl-smi">T</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Semigroup</span>&lt;<span class="pl-smi">T</span>&gt; { <span class="pl-smi">T</span> <span class="pl-en">zero</span>(); }</pre></div> <p dir="auto">There are instances for strings and integers.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">SemigroupK</h3><a id="user-content-semigroupk" class="anchor" aria-label="Permalink: SemigroupK" href="#semigroupk"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It represents a <code>Semigroup</code> but defined for a kind, like a List, so it extends a regular <code>Semigroup</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">MonoidK</h3><a id="user-content-monoidk" class="anchor" aria-label="Permalink: MonoidK" href="#monoidk"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The same like <code>SemigroupK</code> but for a <code>Monoid</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Invariant</h3><a id="user-content-invariant" class="anchor" aria-label="Permalink: Invariant" href="#invariant"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Invariant&lt;F&gt; { &lt;A, B&gt; Kind&lt;F, B&gt; imap(Kind&lt;F, A&gt; value, Function1&lt;A, B&gt; map, Function1&lt;B, A&gt; comap); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Invariant</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-en">imap</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-s1">map</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">B</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">comap</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Contravariant</h3><a id="user-content-contravariant" class="anchor" aria-label="Permalink: Contravariant" href="#contravariant"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Contravariant&lt;F&gt; extends Invariant&lt;F&gt; { &lt;A, B&gt; Kind&lt;F, B&gt; contramap(Kind&lt;F, A&gt; value, Function1&lt;B, A&gt; map); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Contravariant</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Invariant</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-en">contramap</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">B</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">map</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Applicative Error</h3><a id="user-content-applicative-error" class="anchor" aria-label="Permalink: Applicative Error" href="#applicative-error"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface ApplicativeError&lt;F, E&gt; extends Applicative&lt;F&gt; { &lt;A&gt; Kind&lt;F, A&gt; raiseError(E error); &lt;A&gt; Kind&lt;F, A&gt; handleErrorWith(Kind&lt;F, A&gt; value, Function1&lt;E, ? extends Kind&lt;F, A&gt;&gt; handler); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">ApplicativeError</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">E</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Applicative</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">raiseError</span>(<span class="pl-smi">E</span> <span class="pl-s1">error</span>); &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">handleErrorWith</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">E</span>, ? <span class="pl-k">extends</span> <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt;&gt; <span class="pl-s1">handler</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Monad Error</h3><a id="user-content-monad-error" class="anchor" aria-label="Permalink: Monad Error" href="#monad-error"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MonadError&lt;F, E&gt; extends ApplicativeError&lt;F, E&gt;, Monad&lt;F&gt; { default &lt;A&gt; Kind&lt;F, A&gt; ensure(Kind&lt;F, A&gt; value, Producer&lt;E&gt; error, Matcher1&lt;A&gt; matcher) { return flatMap(value, a -&gt; matcher.match(a) ? pure(a) : raiseError(error.get())); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MonadError</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">E</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">ApplicativeError</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">E</span>&gt;, <span class="pl-smi">Monad</span>&lt;<span class="pl-smi">F</span>&gt; { <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">ensure</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Producer</span>&lt;<span class="pl-smi">E</span>&gt; <span class="pl-s1">error</span>, <span class="pl-smi">Matcher1</span>&lt;<span class="pl-smi">A</span>&gt; <span class="pl-s1">matcher</span>) { <span class="pl-k">return</span> <span class="pl-en">flatMap</span>(<span class="pl-s1">value</span>, <span class="pl-s1">a</span> -&gt; <span class="pl-s1">matcher</span>.<span class="pl-en">match</span>(<span class="pl-s1">a</span>) ? <span class="pl-en">pure</span>(<span class="pl-s1">a</span>) : <span class="pl-en">raiseError</span>(<span class="pl-s1">error</span>.<span class="pl-en">get</span>())); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Monad Throw</h3><a id="user-content-monad-throw" class="anchor" aria-label="Permalink: Monad Throw" href="#monad-throw"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MonadThrow&lt;F&gt; extends MonadError&lt;F, Throwable&gt; { }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MonadThrow</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">MonadError</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Throwable</span>&gt; { }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">MonadReader</h3><a id="user-content-monadreader" class="anchor" aria-label="Permalink: MonadReader" href="#monadreader"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MonadReader&lt;F, R&gt; extends Monad&lt;F&gt; { Kind&lt;F, R&gt; ask(); default &lt;A&gt; Kind&lt;F, A&gt; reader(Function1&lt;R, A&gt; mapper) { return map(ask(), mapper); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MonadReader</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Monad</span>&lt;<span class="pl-smi">F</span>&gt; { <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt; <span class="pl-en">ask</span>(); <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">reader</span>(<span class="pl-smi">Function1</span>&lt;<span class="pl-smi">R</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">mapper</span>) { <span class="pl-k">return</span> <span class="pl-en">map</span>(<span class="pl-en">ask</span>(), <span class="pl-s1">mapper</span>); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">MonadState</h3><a id="user-content-monadstate" class="anchor" aria-label="Permalink: MonadState" href="#monadstate"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MonadState&lt;F, S&gt; extends Monad&lt;F&gt; { Kind&lt;F, S&gt; get(); Kind&lt;F, Unit&gt; set(S state); default Kind&lt;F, Unit&gt; modify(Operator1&lt;S&gt; mapper) { return flatMap(get(), s -&gt; set(mapper.apply(s))); } default &lt;A&gt; Kind&lt;F, A&gt; inspect(Function1&lt;S, A&gt; mapper) { return map(get(), mapper); } default &lt;A&gt; Kind&lt;F, A&gt; state(Function1&lt;S, Tuple2&lt;S, A&gt;&gt; mapper) { return flatMap(get(), s -&gt; mapper.apply(s).applyTo((s1, a) -&gt; map(set(s1), x -&gt; a))); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MonadState</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">S</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Monad</span>&lt;<span class="pl-smi">F</span>&gt; { <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">S</span>&gt; <span class="pl-en">get</span>(); <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-en">set</span>(<span class="pl-smi">S</span> <span class="pl-s1">state</span>); <span class="pl-k">default</span> <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-en">modify</span>(<span class="pl-smi">Operator1</span>&lt;<span class="pl-smi">S</span>&gt; <span class="pl-s1">mapper</span>) { <span class="pl-k">return</span> <span class="pl-en">flatMap</span>(<span class="pl-en">get</span>(), <span class="pl-s1">s</span> -&gt; <span class="pl-en">set</span>(<span class="pl-s1">mapper</span>.<span class="pl-en">apply</span>(<span class="pl-s1">s</span>))); } <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">inspect</span>(<span class="pl-smi">Function1</span>&lt;<span class="pl-smi">S</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">mapper</span>) { <span class="pl-k">return</span> <span class="pl-en">map</span>(<span class="pl-en">get</span>(), <span class="pl-s1">mapper</span>); } <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">state</span>(<span class="pl-smi">Function1</span>&lt;<span class="pl-smi">S</span>, <span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">S</span>, <span class="pl-smi">A</span>&gt;&gt; <span class="pl-s1">mapper</span>) { <span class="pl-k">return</span> <span class="pl-en">flatMap</span>(<span class="pl-en">get</span>(), <span class="pl-s1">s</span> -&gt; <span class="pl-s1">mapper</span>.<span class="pl-en">apply</span>(<span class="pl-s1">s</span>).<span class="pl-en">applyTo</span>((<span class="pl-s1">s1</span>, <span class="pl-s1">a</span>) -&gt; <span class="pl-en">map</span>(<span class="pl-en">set</span>(<span class="pl-s1">s1</span>), <span class="pl-s1">x</span> -&gt; <span class="pl-s1">a</span>))); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">MonadWriter</h3><a id="user-content-monadwriter" class="anchor" aria-label="Permalink: MonadWriter" href="#monadwriter"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MonadWriter&lt;F, W&gt; extends Monad&lt;F&gt; { &lt;A&gt; Kind&lt;F, A&gt; writer(Tuple2&lt;W, A&gt; value); &lt;A&gt; Kind&lt;F, Tuple2&lt;W, A&gt;&gt; listen(Kind&lt;F, A&gt; value); &lt;A&gt; Kind&lt;F, A&gt; pass(Kind&lt;F, Tuple2&lt;Operator1&lt;W&gt;, A&gt;&gt; value); default Kind&lt;F, Unit&gt; tell(W writer) { return writer(Tuple.of(writer, unit())); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MonadWriter</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">W</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Monad</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">writer</span>(<span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">W</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>); &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">W</span>, <span class="pl-smi">A</span>&gt;&gt; <span class="pl-en">listen</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>); &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">pass</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">Operator1</span>&lt;<span class="pl-smi">W</span>&gt;, <span class="pl-smi">A</span>&gt;&gt; <span class="pl-s1">value</span>); <span class="pl-k">default</span> <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-en">tell</span>(<span class="pl-smi">W</span> <span class="pl-s1">writer</span>) { <span class="pl-k">return</span> <span class="pl-en">writer</span>(<span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-s1">writer</span>, <span class="pl-en">unit</span>())); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Comonad</h3><a id="user-content-comonad" class="anchor" aria-label="Permalink: Comonad" href="#comonad"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Comonad&lt;F&gt; extends Functor&lt;F&gt; { &lt;A, B&gt; Kind&lt;F, B&gt; coflatMap(Kind&lt;F, A&gt; value, Function1&lt;Kind&lt;F, A&gt;, B&gt; map); &lt;A&gt; A extract(Kind&lt;F, A&gt; value); default &lt;A&gt; Kind&lt;F, Kind&lt;F, A&gt;&gt; coflatten(Kind&lt;F, A&gt; value) { return coflatMap(value, identity()); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Comonad</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Functor</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-en">coflatMap</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt;, <span class="pl-smi">B</span>&gt; <span class="pl-s1">map</span>); &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">A</span> <span class="pl-en">extract</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>); <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt;&gt; <span class="pl-en">coflatten</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>) { <span class="pl-k">return</span> <span class="pl-en">coflatMap</span>(<span class="pl-s1">value</span>, <span class="pl-en">identity</span>()); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Foldable</h3><a id="user-content-foldable" class="anchor" aria-label="Permalink: Foldable" href="#foldable"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Foldable&lt;F&gt; { &lt;A, B&gt; B foldLeft(Kind&lt;F, A&gt; value, B initial, Function2&lt;B, A, B&gt; mapper); &lt;A, B&gt; Eval&lt;B&gt; foldRight(Kind&lt;F, A&gt; value, Eval&lt;B&gt; initial, Function2&lt;A, Eval&lt;B&gt;, Eval&lt;B&gt;&gt; mapper); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Foldable</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">B</span> <span class="pl-en">foldLeft</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">B</span> <span class="pl-s1">initial</span>, <span class="pl-smi">Function2</span>&lt;<span class="pl-smi">B</span>, <span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-s1">mapper</span>); &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Eval</span>&lt;<span class="pl-smi">B</span>&gt; <span class="pl-en">foldRight</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Eval</span>&lt;<span class="pl-smi">B</span>&gt; <span class="pl-s1">initial</span>, <span class="pl-smi">Function2</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">Eval</span>&lt;<span class="pl-smi">B</span>&gt;, <span class="pl-smi">Eval</span>&lt;<span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">mapper</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Traverse</h3><a id="user-content-traverse" class="anchor" aria-label="Permalink: Traverse" href="#traverse"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Traverse&lt;F&gt; extends Functor&lt;F&gt;, Foldable&lt;F&gt; { &lt;G, T, R&gt; Kind&lt;G, Kind&lt;F, R&gt;&gt; traverse(Applicative&lt;G&gt; applicative, Kind&lt;F, T&gt; value, Function1&lt;T, ? extends Kind&lt;G, R&gt;&gt; mapper); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Traverse</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">Functor</span>&lt;<span class="pl-smi">F</span>&gt;, <span class="pl-smi">Foldable</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">G</span>, <span class="pl-smi">T</span>, <span class="pl-smi">R</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">G</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">R</span>&gt;&gt; <span class="pl-en">traverse</span>(<span class="pl-smi">Applicative</span>&lt;<span class="pl-smi">G</span>&gt; <span class="pl-s1">applicative</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">value</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">T</span>, ? <span class="pl-k">extends</span> <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">G</span>, <span class="pl-smi">R</span>&gt;&gt; <span class="pl-s1">mapper</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Semigroupal</h3><a id="user-content-semigroupal" class="anchor" aria-label="Permalink: Semigroupal" href="#semigroupal"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Semigroupal&lt;F&gt; { &lt;A, B&gt; Kind&lt;F, Tuple2&lt;A, B&gt;&gt; product(Kind&lt;F, A&gt; fa, Kind&lt;F, B&gt; fb); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Semigroupal</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-en">product</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">fa</span>, <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-s1">fb</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Defer</h3><a id="user-content-defer" class="anchor" aria-label="Permalink: Defer" href="#defer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Defer&lt;F&gt; { &lt;A&gt; Kind&lt;F, A&gt; defer(Producer&lt;Kind&lt;F, A&gt;&gt; defer); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Defer</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">defer</span>(<span class="pl-smi">Producer</span>&lt;<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt;&gt; <span class="pl-s1">defer</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Bracket</h3><a id="user-content-bracket" class="anchor" aria-label="Permalink: Bracket" href="#bracket"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Bracket&lt;F, E&gt; extends MonadError&lt;F, E&gt; { &lt;A, B&gt; Kind&lt;F, B&gt; bracket(Kind&lt;F, A&gt; acquire, Function1&lt;A, ? extends Kind&lt;F, B&gt;&gt; use, Consumer1&lt;A&gt; release); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Bracket</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">E</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">MonadError</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">E</span>&gt; { &lt;<span class="pl-smi">A</span>, <span class="pl-smi">B</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt; <span class="pl-en">bracket</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-s1">acquire</span>, <span class="pl-smi">Function1</span>&lt;<span class="pl-smi">A</span>, ? <span class="pl-k">extends</span> <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">B</span>&gt;&gt; <span class="pl-s1">use</span>, <span class="pl-smi">Consumer1</span>&lt;<span class="pl-smi">A</span>&gt; <span class="pl-s1">release</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">MonadDefer</h3><a id="user-content-monaddefer" class="anchor" aria-label="Permalink: MonadDefer" href="#monaddefer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MonadDefer&lt;F&gt; extends MonadThrow&lt;F&gt;, Bracket&lt;F, Throwable&gt;, Defer&lt;F&gt;, Timer&lt;F&gt; { default &lt;A&gt; Kind&lt;F, A&gt; later(Producer&lt;A&gt; later) { return defer(() -&gt; Try.of(later::get).fold(this::raiseError, this::pure)); } }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MonadDefer</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">MonadThrow</span>&lt;<span class="pl-smi">F</span>&gt;, <span class="pl-smi">Bracket</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Throwable</span>&gt;, <span class="pl-smi">Defer</span>&lt;<span class="pl-smi">F</span>&gt;, <span class="pl-smi">Timer</span>&lt;<span class="pl-smi">F</span>&gt; { <span class="pl-k">default</span> &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">later</span>(<span class="pl-smi">Producer</span>&lt;<span class="pl-smi">A</span>&gt; <span class="pl-s1">later</span>) { <span class="pl-k">return</span> <span class="pl-en">defer</span>(() -&gt; <span class="pl-smi">Try</span>.<span class="pl-en">of</span>(<span class="pl-s1">later</span>::<span class="pl-s1">get</span>).<span class="pl-en">fold</span>(<span class="pl-smi">this</span>::<span class="pl-s1">raiseError</span>, <span class="pl-smi">this</span>::<span class="pl-s1">pure</span>)); } }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Async</h3><a id="user-content-async" class="anchor" aria-label="Permalink: Async" href="#async"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Async&lt;F&gt; extends MonadDefer&lt;F&gt; { &lt;A&gt; Kind&lt;F, A&gt; async(Consumer1&lt;Consumer1&lt;Try&lt;A&gt;&gt;&gt; consumer); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Async</span>&lt;<span class="pl-smi">F</span>&gt; <span class="pl-k">extends</span> <span class="pl-smi">MonadDefer</span>&lt;<span class="pl-smi">F</span>&gt; { &lt;<span class="pl-smi">A</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">A</span>&gt; <span class="pl-en">async</span>(<span class="pl-smi">Consumer1</span>&lt;<span class="pl-smi">Consumer1</span>&lt;<span class="pl-smi">Try</span>&lt;<span class="pl-smi">A</span>&gt;&gt;&gt; <span class="pl-s1">consumer</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Timer</h3><a id="user-content-timer" class="anchor" aria-label="Permalink: Timer" href="#timer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface Timer&lt;F&gt; { Kind&lt;F, Unit&gt; sleep(Duration duration); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">Timer</span>&lt;<span class="pl-smi">F</span>&gt; { <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">Unit</span>&gt; <span class="pl-en">sleep</span>(<span class="pl-smi">Duration</span> <span class="pl-s1">duration</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">FunctionK</h3><a id="user-content-functionk" class="anchor" aria-label="Permalink: FunctionK" href="#functionk"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It represents a natural transformation between two different kinds.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface FunctionK&lt;F, G&gt; { &lt;T&gt; Kind&lt;G, T&gt; apply(Kind&lt;F, T&gt; from); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">FunctionK</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">G</span>&gt; { &lt;<span class="pl-smi">T</span>&gt; <span class="pl-smi">Kind</span>&lt;<span class="pl-smi">G</span>, <span class="pl-smi">T</span>&gt; <span class="pl-en">apply</span>(<span class="pl-smi">Kind</span>&lt;<span class="pl-smi">F</span>, <span class="pl-smi">T</span>&gt; <span class="pl-s1">from</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Optics</h2><a id="user-content-optics" class="anchor" aria-label="Permalink: Optics" href="#optics"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" __Iso__ / \ Lens Prism \ / Optional"><pre class="notranslate"><code> __Iso__ / \ Lens Prism \ / Optional </code></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Iso</h3><a id="user-content-iso" class="anchor" aria-label="Permalink: Iso" href="#iso"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An <code>Iso</code> is an optic which converts elements of some type into elements of other type without loss. In other words, it's <strong>isomorphic</strong>.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Point point = new Point(1, 2); Iso&lt;Point, Tuple2&lt;Integer, Integer&gt;&gt; pointToTuple = Iso.of(p -&gt; Tuple.of(p.x, p.y), t -&gt; new Point(t.get1(), t.get2())); assertEquals(point, pointToTuple.set(pointToTuple.get(point)));"><pre><span class="pl-smi">Point</span> <span class="pl-s1">point</span> = <span class="pl-k">new</span> <span class="pl-smi">Point</span>(<span class="pl-c1">1</span>, <span class="pl-c1">2</span>); <span class="pl-smi">Iso</span>&lt;<span class="pl-smi">Point</span>, <span class="pl-smi">Tuple2</span>&lt;<span class="pl-smi">Integer</span>, <span class="pl-smi">Integer</span>&gt;&gt; <span class="pl-s1">pointToTuple</span> = <span class="pl-smi">Iso</span>.<span class="pl-en">of</span>(<span class="pl-s1">p</span> -&gt; <span class="pl-smi">Tuple</span>.<span class="pl-en">of</span>(<span class="pl-s1">p</span>.<span class="pl-s1">x</span>, <span class="pl-s1">p</span>.<span class="pl-s1">y</span>), <span class="pl-s1">t</span> -&gt; <span class="pl-k">new</span> <span class="pl-smi">Point</span>(<span class="pl-s1">t</span>.<span class="pl-en">get1</span>(), <span class="pl-s1">t</span>.<span class="pl-en">get2</span>())); <span class="pl-en">assertEquals</span>(<span class="pl-s1">point</span>, <span class="pl-s1">pointToTuple</span>.<span class="pl-en">set</span>(<span class="pl-s1">pointToTuple</span>.<span class="pl-en">get</span>(<span class="pl-s1">point</span>)));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Lens</h3><a id="user-content-lens" class="anchor" aria-label="Permalink: Lens" href="#lens"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>Lens</code> is an optic used to zoom inside a structure. In other words, it's an abstraction of a setter and a getter but with immutable objects.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Lens&lt;Employee, String&gt; nameLens = Lens.of(Employee::getName, Employee::withName); Employee pepe = new Employee(&quot;pepe&quot;); assertEquals(&quot;pepe&quot;, nameLens.get(pepe)); assertEquals(&quot;paco&quot;, nameLens.get(nameLens.set(pepe, &quot;paco&quot;)));"><pre><span class="pl-smi">Lens</span>&lt;<span class="pl-smi">Employee</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">nameLens</span> = <span class="pl-smi">Lens</span>.<span class="pl-en">of</span>(<span class="pl-smi">Employee</span>::<span class="pl-s1">getName</span>, <span class="pl-smi">Employee</span>::<span class="pl-s1">withName</span>); <span class="pl-smi">Employee</span> <span class="pl-s1">pepe</span> = <span class="pl-k">new</span> <span class="pl-smi">Employee</span>(<span class="pl-s">"pepe"</span>); <span class="pl-en">assertEquals</span>(<span class="pl-s">"pepe"</span>, <span class="pl-s1">nameLens</span>.<span class="pl-en">get</span>(<span class="pl-s1">pepe</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-s">"paco"</span>, <span class="pl-s1">nameLens</span>.<span class="pl-en">get</span>(<span class="pl-s1">nameLens</span>.<span class="pl-en">set</span>(<span class="pl-s1">pepe</span>, <span class="pl-s">"paco"</span>)));</pre></div> <p dir="auto">We can compose Lenses to get deeper inside. For example, if we add an attribute of type <code>Address</code> into <code>Employee</code>. We can create a lens to access the city name of the address of the employee.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Lens&lt;Employee, Address&gt; addressLens = Lens.of(Employee::getAddress, Employee::withAddress); Lens&lt;Address, String&gt; cityLens = Lens.of(Address::getCity, Address::withCity); Lens&lt;Employee, String&gt; cityAddressLens = addressLens.compose(cityLens); Employee pepe = new Employee(&quot;pepe&quot;, new Address(&quot;Madrid&quot;)); assertEquals(&quot;Madrid&quot;, cityAddressLens.get(pepe));"><pre><span class="pl-smi">Lens</span>&lt;<span class="pl-smi">Employee</span>, <span class="pl-smi">Address</span>&gt; <span class="pl-s1">addressLens</span> = <span class="pl-smi">Lens</span>.<span class="pl-en">of</span>(<span class="pl-smi">Employee</span>::<span class="pl-s1">getAddress</span>, <span class="pl-smi">Employee</span>::<span class="pl-s1">withAddress</span>); <span class="pl-smi">Lens</span>&lt;<span class="pl-smi">Address</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">cityLens</span> = <span class="pl-smi">Lens</span>.<span class="pl-en">of</span>(<span class="pl-smi">Address</span>::<span class="pl-s1">getCity</span>, <span class="pl-smi">Address</span>::<span class="pl-s1">withCity</span>); <span class="pl-smi">Lens</span>&lt;<span class="pl-smi">Employee</span>, <span class="pl-smi">String</span>&gt; <span class="pl-s1">cityAddressLens</span> = <span class="pl-s1">addressLens</span>.<span class="pl-en">compose</span>(<span class="pl-s1">cityLens</span>); <span class="pl-smi">Employee</span> <span class="pl-s1">pepe</span> = <span class="pl-k">new</span> <span class="pl-smi">Employee</span>(<span class="pl-s">"pepe"</span>, <span class="pl-k">new</span> <span class="pl-smi">Address</span>(<span class="pl-s">"Madrid"</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-s">"Madrid"</span>, <span class="pl-s1">cityAddressLens</span>.<span class="pl-en">get</span>(<span class="pl-s1">pepe</span>));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Prism</h3><a id="user-content-prism" class="anchor" aria-label="Permalink: Prism" href="#prism"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>Prism</code> is a lossless invertible optic that can see into a structure and optionally find a value.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Function1&lt;String, Option&lt;Integer&gt;&gt; parseInt = ...; // is a method that only returns a value when the string can be parsed Prism&lt;String, Integer&gt; stringToInteger = Prism.of(parseInt, String::valueOf); assertEquals(Option.some(5), stringToInteger.getOption(&quot;5&quot;)); assertEquals(Option.none(), stringToInteger.getOption(&quot;a&quot;)); assertEquals(&quot;5&quot;, stringToInteger.reverseGet(5));"><pre><span class="pl-smi">Function1</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">Option</span>&lt;<span class="pl-smi">Integer</span>&gt;&gt; <span class="pl-s1">parseInt</span> = ...; <span class="pl-c">// is a method that only returns a value when the string can be parsed</span> <span class="pl-smi">Prism</span>&lt;<span class="pl-smi">String</span>, <span class="pl-smi">Integer</span>&gt; <span class="pl-s1">stringToInteger</span> = <span class="pl-smi">Prism</span>.<span class="pl-en">of</span>(<span class="pl-s1">parseInt</span>, <span class="pl-smi">String</span>::<span class="pl-s1">valueOf</span>); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Option</span>.<span class="pl-en">some</span>(<span class="pl-c1">5</span>), <span class="pl-s1">stringToInteger</span>.<span class="pl-en">getOption</span>(<span class="pl-s">"5"</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Option</span>.<span class="pl-en">none</span>(), <span class="pl-s1">stringToInteger</span>.<span class="pl-en">getOption</span>(<span class="pl-s">"a"</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-s">"5"</span>, <span class="pl-s1">stringToInteger</span>.<span class="pl-en">reverseGet</span>(<span class="pl-c1">5</span>));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Optional</h3><a id="user-content-optional" class="anchor" aria-label="Permalink: Optional" href="#optional"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An <code>Optional</code> is an optic that allows to see into a structure and getting, setting like a <code>Lens</code> an optional find a value like a <code>Prism</code>.</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Optional&lt;Employee, Address&gt; addressOptional = Optional.of( Employee::withAddress, employee -&gt; Option.of(employee::getAddress) ); Address madrid = new Address(&quot;Madrid&quot;); Employee pepe = new Employee(&quot;pepe&quot;, null); assertEquals(Option.none(), addressOptional.getOption(pepe)); assertEquals(Option.some(madrid), addressOptional.getOption(addressOptional.set(pepe, madrid)));"><pre><span class="pl-smi">Optional</span>&lt;<span class="pl-smi">Employee</span>, <span class="pl-smi">Address</span>&gt; <span class="pl-s1">addressOptional</span> = <span class="pl-smi">Optional</span>.<span class="pl-en">of</span>( <span class="pl-smi">Employee</span>::<span class="pl-s1">withAddress</span>, <span class="pl-s1">employee</span> -&gt; <span class="pl-smi">Option</span>.<span class="pl-en">of</span>(<span class="pl-s1">employee</span>::<span class="pl-s1">getAddress</span>) ); <span class="pl-smi">Address</span> <span class="pl-s1">madrid</span> = <span class="pl-k">new</span> <span class="pl-smi">Address</span>(<span class="pl-s">"Madrid"</span>); <span class="pl-smi">Employee</span> <span class="pl-s1">pepe</span> = <span class="pl-k">new</span> <span class="pl-smi">Employee</span>(<span class="pl-s">"pepe"</span>, <span class="pl-c1">null</span>); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Option</span>.<span class="pl-en">none</span>(), <span class="pl-s1">addressOptional</span>.<span class="pl-en">getOption</span>(<span class="pl-s1">pepe</span>)); <span class="pl-en">assertEquals</span>(<span class="pl-smi">Option</span>.<span class="pl-en">some</span>(<span class="pl-s1">madrid</span>), <span class="pl-s1">addressOptional</span>.<span class="pl-en">getOption</span>(<span class="pl-s1">addressOptional</span>.<span class="pl-en">set</span>(<span class="pl-s1">pepe</span>, <span class="pl-s1">madrid</span>)));</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Composition</h3><a id="user-content-composition" class="anchor" aria-label="Permalink: Composition" href="#composition"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <markdown-accessiblity-table><table> <thead> <tr> <th></th> <th>Optional</th> <th>Prism</th> <th>Lens</th> <th>Iso</th> </tr> </thead> <tbody> <tr> <td>Optional</td> <td>Optional</td> <td>Optional</td> <td>Optional</td> <td>Optional</td> </tr> <tr> <td>Prism</td> <td>Optional</td> <td>Prism</td> <td>Optional</td> <td>Prism</td> </tr> <tr> <td>Lens</td> <td>Optional</td> <td>Optional</td> <td>Lens</td> <td>Lens</td> </tr> <tr> <td>Iso</td> <td>Optional</td> <td>Prism</td> <td>Lens</td> <td>Iso</td> </tr> </tbody> </table></markdown-accessiblity-table> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Equal</h2><a id="user-content-equal" class="anchor" aria-label="Permalink: Equal" href="#equal"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This class helps to create readable <code>equals</code> methods. An example:</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Override public boolean equals(Object obj) { return Equal.&lt;Data&gt;of() .comparing(Data::getId) .comparing(Data::getValue) .applyTo(this, obj); }"><pre><span class="pl-c1">@</span><span class="pl-c1">Override</span> <span class="pl-k">public</span> <span class="pl-smi">boolean</span> <span class="pl-en">equals</span>(<span class="pl-smi">Object</span> <span class="pl-s1">obj</span>) { <span class="pl-k">return</span> <span class="pl-smi">Equal</span>.&lt;<span class="pl-smi">Data</span>&gt;<span class="pl-en">of</span>() .<span class="pl-en">comparing</span>(<span class="pl-smi">Data</span>::<span class="pl-s1">getId</span>) .<span class="pl-en">comparing</span>(<span class="pl-smi">Data</span>::<span class="pl-s1">getValue</span>) .<span class="pl-en">applyTo</span>(<span class="pl-smi">this</span>, <span class="pl-s1">obj</span>); }</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stargazers over time</h2><a id="user-content-stargazers-over-time" class="anchor" aria-label="Permalink: Stargazers over time" href="#stargazers-over-time"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><a href="https://starchart.cc/tonivade/purefun" rel="nofollow"><img src="https://camo.githubusercontent.com/1bc53b2190634636a678bcca9a87ffd840135f393f49c749a3842879da7d2aa0/68747470733a2f2f7374617263686172742e63632f746f6e69766164652f7075726566756e2e737667" alt="Stargazers over time" data-canonical-src="https://starchart.cc/tonivade/purefun.svg" style="max-width: 100%;"></a></p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">License</h2><a id="user-content-license" class="anchor" aria-label="Permalink: License" href="#license"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">purefun is released under MIT license</p> </article></div></div></div></div></div> <!-- --> <!-- --> <script type="application/json" id="__PRIMER_DATA_:R0:__">{"resolvedServerColorMode":"day"}</script></div> </react-partial> <input type="hidden" data-csrf="true" value="EWjOKj/sN+UOALnIG9dxNs16OfTxhXd+2stxnMRxsc/DPxFCHM/mljcWzaL1EqnCwS37V4prN6pOn04oXESFRA==" /> </div> <div data-view-component="true" class="Layout-sidebar"> <div class="BorderGrid about-margin" data-pjax> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <div class="hide-sm hide-md"> <h2 class="mb-3 h4">About</h2> <p class="f4 my-3"> Functional Programming library for Java </p> <h3 class="sr-only">Topics</h3> <div class="my-3"> <div class="f6"> <a href="/topics/java" title="Topic: java" data-view-component="true" class="topic-tag topic-tag-link"> java </a> <a href="/topics/monads" title="Topic: monads" data-view-component="true" class="topic-tag topic-tag-link"> monads </a> <a href="/topics/memoization" title="Topic: memoization" data-view-component="true" class="topic-tag topic-tag-link"> memoization </a> <a href="/topics/stream" title="Topic: stream" data-view-component="true" class="topic-tag topic-tag-link"> stream </a> <a href="/topics/experimental" title="Topic: experimental" data-view-component="true" class="topic-tag topic-tag-link"> experimental </a> <a href="/topics/functional-programming" title="Topic: functional-programming" data-view-component="true" class="topic-tag topic-tag-link"> functional-programming </a> <a href="/topics/tuples" title="Topic: tuples" data-view-component="true" class="topic-tag topic-tag-link"> tuples </a> <a href="/topics/effects" title="Topic: effects" data-view-component="true" class="topic-tag topic-tag-link"> effects </a> <a href="/topics/io-monad" title="Topic: io-monad" data-view-component="true" class="topic-tag topic-tag-link"> io-monad </a> <a href="/topics/monad" title="Topic: monad" data-view-component="true" class="topic-tag topic-tag-link"> monad </a> <a href="/topics/free-monad" title="Topic: free-monad" data-view-component="true" class="topic-tag topic-tag-link"> free-monad </a> <a href="/topics/typeclasses" title="Topic: typeclasses" data-view-component="true" class="topic-tag topic-tag-link"> typeclasses </a> <a href="/topics/monad-transformers" title="Topic: monad-transformers" data-view-component="true" class="topic-tag topic-tag-link"> monad-transformers </a> <a href="/topics/immutable-collections" title="Topic: immutable-collections" data-view-component="true" class="topic-tag topic-tag-link"> immutable-collections </a> <a href="/topics/mtl" title="Topic: mtl" data-view-component="true" class="topic-tag topic-tag-link"> mtl </a> <a href="/topics/tagless-final" title="Topic: tagless-final" data-view-component="true" class="topic-tag topic-tag-link"> tagless-final </a> <a href="/topics/higher-kinded-types" title="Topic: higher-kinded-types" data-view-component="true" class="topic-tag topic-tag-link"> higher-kinded-types </a> </div> </div> <h3 class="sr-only">Resources</h3> <div class="mt-2"> <a class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:readme&quot;}" href="#readme-ov-file"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book mr-2"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> Readme </a> </div> <h3 class="sr-only">License</h3> <div class="mt-2"> <a href="#MIT-1-ov-file" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:license&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> MIT license </a> </div> <include-fragment src="/tonivade/purefun/hovercards/citation/sidebar_partial?tree_name=master"> </include-fragment> <div class="mt-2"> <a href="/tonivade/purefun/activity" data-view-component="true" class="Link Link--muted"><svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pulse mr-2"> <path d="M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"></path> </svg> <span class="color-fg-muted">Activity</span></a> </div> <h3 class="sr-only">Stars</h3> <div class="mt-2"> <a href="/tonivade/purefun/stargazers" data-view-component="true" class="Link Link--muted"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <strong>131</strong> stars</a> </div> <h3 class="sr-only">Watchers</h3> <div class="mt-2"> <a href="/tonivade/purefun/watchers" data-view-component="true" class="Link Link--muted"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-eye mr-2"> <path d="M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 0 1 0 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.83.88 9.576.43 8.898a1.62 1.62 0 0 1 0-1.798c.45-.677 1.367-1.931 2.637-3.022C4.33 2.992 6.019 2 8 2ZM1.679 7.932a.12.12 0 0 0 0 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 0 0 0-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.825.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717ZM8 10a2 2 0 1 1-.001-3.999A2 2 0 0 1 8 10Z"></path> </svg> <strong>7</strong> watching</a> </div> <h3 class="sr-only">Forks</h3> <div class="mt-2"> <a href="/tonivade/purefun/forks" data-view-component="true" class="Link Link--muted"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> <strong>4</strong> forks</a> </div> <div class="mt-2"> <a class="Link--muted" href="/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Ftonivade%2Fpurefun&amp;report=tonivade+%28user%29"> Report repository </a> </div> </div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame"> <a href="/tonivade/purefun/releases" data-view-component="true" class="Link--primary no-underline Link">Releases <span title="2" data-view-component="true" class="Counter">2</span></a></h2> <a class="Link--primary d-flex no-underline" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/tonivade/purefun/releases/tag/5.0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-tag flex-shrink-0 mt-1 color-fg-success"> <path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path> </svg> <div class="ml-2 min-width-0"> <div class="d-flex"> <span class="css-truncate css-truncate-target text-bold mr-2" style="max-width: none;">v5.0 new release</span> <span title="Label: Latest" data-view-component="true" class="Label Label--success flex-shrink-0"> Latest </span> </div> <div class="text-small color-fg-muted"><relative-time datetime="2024-06-15T08:10:41Z" class="no-wrap">Jun 15, 2024</relative-time></div> </div> </a> <div data-view-component="true" class="mt-3"> <a text="small" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/tonivade/purefun/releases" data-view-component="true" class="Link">+ 1 release</a></div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3"> <a href="/users/tonivade/packages?repo_name=purefun" data-view-component="true" class="Link--primary no-underline Link d-flex flex-items-center">Packages <span title="0" hidden="hidden" data-view-component="true" class="Counter ml-1">0</span></a></h2> <div class="text-small color-fg-muted" > No packages published <br> </div> </div> </div> <div class="BorderGrid-row" hidden> <div class="BorderGrid-cell"> <include-fragment src="/tonivade/purefun/used_by_list" accept="text/fragment+html"> </include-fragment> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3"> <a href="/tonivade/purefun/graphs/contributors" data-view-component="true" class="Link--primary no-underline Link d-flex flex-items-center">Contributors <span title="3" data-view-component="true" class="Counter ml-1">3</span></a></h2> <include-fragment src="/tonivade/purefun/contributors_list?count=3&amp;current_repository=purefun&amp;items_to_show=3" aria-busy="true" aria-label="Loading contributors"> <ul class="list-style-none "> <li class="mb-2 d-flex"> <div class="Skeleton avatar avatar-user mr-2" style="width:32px;height:32px;"></div> <div class="Skeleton Skeleton--text flex-1 flex-self-center f4">&nbsp;</div> </li> <li class="mb-2 d-flex"> <div class="Skeleton avatar avatar-user mr-2" style="width:32px;height:32px;"></div> <div class="Skeleton Skeleton--text flex-1 flex-self-center f4">&nbsp;</div> </li> <li class="mb-2 d-flex"> <div class="Skeleton avatar avatar-user mr-2" style="width:32px;height:32px;"></div> <div class="Skeleton Skeleton--text flex-1 flex-self-center f4">&nbsp;</div> </li> </ul> </include-fragment> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3">Languages</h2> <div class="mb-2"> <span data-view-component="true" class="Progress"> <span style="background-color:#b07219 !important;;width: 100.0%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> </span></div> <ul class="list-style-none"> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/tonivade/purefun/search?l=java" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#b07219;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">Java</span> <span>100.0%</span> </a> </li> </ul> </div> </div> </div> </div> </div></div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" > <h2 class='sr-only'>Footer</h2> <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap"> <div class="d-flex flex-items-center flex-shrink-0 mx-2"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <span> &copy; 2025 GitHub,&nbsp;Inc. </span> </div> <nav aria-label="Footer"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to Terms&quot;,&quot;label&quot;:&quot;text:terms&quot;}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to privacy&quot;,&quot;label&quot;:&quot;text:privacy&quot;}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to security&quot;,&quot;label&quot;:&quot;text:security&quot;}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to status&quot;,&quot;label&quot;:&quot;text:status&quot;}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to docs&quot;,&quot;label&quot;:&quot;text:docs&quot;}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to contact&quot;,&quot;label&quot;:&quot;text:contact&quot;}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a> </li> <li class="mx-2" > <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;cookies&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;cookies_link_subfooter_footer&quot;}" > Manage cookies </button> </cookie-consent-link> </li> <li class="mx-2"> <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;dont_share_info&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;dont_share_info_link_subfooter_footer&quot;}" > Do not share my personal information </button> </cookie-consent-link> </li> </ul> </nav> </div> </footer> <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can’t perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div> <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10