{"id":16086865,"url":"https://github.com/olekscode/function","last_synced_at":"2025-10-13T17:13:49.465Z","repository":{"id":88081427,"uuid":"236250078","full_name":"olekscode/Function","owner":"olekscode","description":"Reification of a mathematical function as an object. Allows  function arithmetics and function composition.","archived":false,"fork":false,"pushed_at":"2020-01-26T01:16:13.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T14:43:43.118Z","etag":null,"topics":["function","function-composition","mathematics","pharo"],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olekscode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-26T00:43:54.000Z","updated_at":"2020-10-30T03:17:47.000Z","dependencies_parsed_at":"2023-05-18T05:00:18.082Z","dependency_job_id":null,"html_url":"https://github.com/olekscode/Function","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olekscode/Function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FFunction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FFunction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FFunction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FFunction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olekscode","download_url":"https://codeload.github.com/olekscode/Function/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FFunction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016287,"owners_count":26085827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["function","function-composition","mathematics","pharo"],"created_at":"2024-10-09T13:25:47.417Z","updated_at":"2025-10-13T17:13:49.448Z","avatar_url":"https://github.com/olekscode.png","language":"Smalltalk","readme":"# Function\n\n[![Build Status](https://travis-ci.org/olekscode/Function.svg?branch=master)](https://travis-ci.org/olekscode/Function)\n[![Build status](https://ci.appveyor.com/api/projects/status/2fcibtphyy2tgk42?svg=true)](https://ci.appveyor.com/project/olekscode/function)\n[![Coverage Status](https://coveralls.io/repos/github/olekscode/Function/badge.svg?branch=master)](https://coveralls.io/github/olekscode/Function?branch=master)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/olekscode/Function/master/LICENSE)\n[![Pharo version](https://img.shields.io/badge/Pharo-7.0-%23aac9ff.svg)](https://pharo.org/download)\n[![Pharo version](https://img.shields.io/badge/Pharo-8.0-%23aac9ff.svg)](https://pharo.org/download)\n\nReification of a mathematical function as an object. Allows  function arithmetics and function composition.\n\n## Installation\n\nTo install Functon, go to the Playground (Ctrl+OW) in your Pharo image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):\n\n```Smalltalk\nMetacello new\n  baseline: 'Function';\n  repository: 'github://olekscode/Function/src';\n  load.\n```\n\n## How to use?\n\nFunctions can be defined using block closures:\n\n```Smalltalk\nf := [ :x | x sin ] asFunction.\ng := [ :x | x cos ] asFunction.\nh := [ :x | x + 1 ] asFunction.\n\nalpha := Float pi / 2.\n```\n### Adding Two Functions\n\nIn the following example, `f + g` is a new function `(f+g)(x) = sin(x) + cos(x)`:\n\n```Smalltalk\n(f + g) value: alpha. \"1.0\"\n```\n\n### Composition of Functions\n\nComposition of two functions `f(x)` and `h(x)` is a new function `(f@h)(x) = f(h(x))`. In our example, `(f@h)(x) = sin(x+1)` and `(h@f)(x) = sin(x) + 1`:\n\n```Smalltalk\n(f @ h) value: alpha. \"0.54\"\n(h @ f) value: alpha. \"2.0\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folekscode%2Ffunction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folekscode%2Ffunction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folekscode%2Ffunction/lists"}