{"id":32160460,"url":"https://github.com/sheyll/function-builder","last_synced_at":"2025-10-21T13:41:29.580Z","repository":{"id":59152563,"uuid":"166933933","full_name":"sheyll/function-builder","owner":"sheyll","description":"Poly Variadic Functions in Haskell","archived":false,"fork":false,"pushed_at":"2019-02-06T00:29:06.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T11:55:48.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheyll.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-22T05:39:42.000Z","updated_at":"2019-02-06T00:28:58.000Z","dependencies_parsed_at":"2022-09-13T11:01:18.987Z","dependency_job_id":null,"html_url":"https://github.com/sheyll/function-builder","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sheyll/function-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Ffunction-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Ffunction-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Ffunction-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Ffunction-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheyll","download_url":"https://codeload.github.com/sheyll/function-builder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Ffunction-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280272333,"owners_count":26302259,"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-21T02:00:06.614Z","response_time":58,"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":[],"created_at":"2025-10-21T13:41:28.539Z","updated_at":"2025-10-21T13:41:29.573Z","avatar_url":"https://github.com/sheyll.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/sheyll/function-builder.svg?branch=master)](https://travis-ci.org/sheyll/function-builder)\n\n[![Hackage](https://img.shields.io/hackage/v/function-builder.svg?style=flat)](http://hackage.haskell.org/package/function-builder)\n\n# A library for making Monoid writing functions with variable number of parameters\n\n**Also known as: Holey monoids.**\n\nThis library is made to be useful especially for library authors, who want to provide users\nwith building blocks to create functions that compose a monoidal structure\nfrom their parameters in a type safe way. Think of `printf`.\n\n**This library** allows the author of such a library to easily add the\nbuilding blocks, allowing users to build **poly variadic functions**, i.e. with parameters\ndepending on the order and composition of these building blocks.\n\nSeveral `FunctionBuilder` values sharing a common monoidal output type can be composed\nto a big `FunctionBuilder` value, in order to build an **output function** that\nhas a flexible number and types of parameters depending, on the individual\n`FunctionBuilder`s used. This output function can be obtained by `toFunction`.\n\n`FunctionBuilder`s can also be composed via standard type classes.\n\nThis module gives you ready-made `Functor`, `Applicative`, `Semigroup`, `Monoid` and Category` instances;\n\nFor example, this library could be used to build a string formatting\nlibrary, that allows users to compose arbitrary, _printf-style_ render **functions**\nfrom reusable building blocks, such that they can be re-combined in order to make\nget functions, that can be applied to parameters that fill place holders, like e.g.:\n\n     module AStringFormatter where\n\n     str :: String -\u003e FunctionBuilder String next next\n     str = immediate\n\n     renderInt :: FunctionBuiler String next (Int -\u003e next)\n     renderInt = deferred show\n\n     renderFloat :: FunctionBuiler String next (Float -\u003e next)\n     renderFloat = ...\n\nThen the user of YourStringFormatter can write:\n\n     module CpuTempFormatter where\n\n     import AStringFormatter\n\n     renderCpuTemp :: Int -\u003e Float -\u003e String\n     renderCpuTemp =\n       toFunction (str \"CPU \" . renderInt . str \" Temperature: \" . renderFloat)\n\n## Similar Libraries\n\n* [polyToMonoid](http://hackage.haskell.org/package/polyToMonoid)\n\n* [HoleyMonoid](http://hackage.haskell.org/package/HoleyMonoid)\n\n* [formatting](http://hackage.haskell.org/package/formatting)\n\n* [category-printf](http://hackage.haskell.org/package/category-printf-0.1.1.0)\n I learned from the author of that library Cale Gibbard in [this reddit comment](https://www.reddit.com/r/haskellquestions/comments/an2qoh/quantifiedconstraints_what_is_it_i_am_not_getting/efsla4g) that the `Format` type in that library (called `FunctionBuilder` in this library) is an alias for\n\n     \"(...)the cokleisli category for the comonad of functions on a monoid, which is already in the comonad library\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheyll%2Ffunction-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheyll%2Ffunction-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheyll%2Ffunction-builder/lists"}