{"id":23132092,"url":"https://github.com/natserract/lamblichus","last_synced_at":"2026-04-30T01:32:55.422Z","repository":{"id":62430810,"uuid":"487779802","full_name":"natserract/lamblichus","owner":"natserract","description":"Functors macros in Elixir inspired from haskell,  and purescript","archived":false,"fork":false,"pushed_at":"2022-05-03T09:47:41.000Z","size":7057,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T08:22:55.273Z","etag":null,"topics":["elixir","functors","haskell","macro","metaprogramming"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/lamblichus","language":"Elixir","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/natserract.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-02T09:03:30.000Z","updated_at":"2022-05-03T09:47:52.000Z","dependencies_parsed_at":"2022-11-01T20:21:52.110Z","dependency_job_id":null,"html_url":"https://github.com/natserract/lamblichus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/natserract/lamblichus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natserract%2Flamblichus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natserract%2Flamblichus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natserract%2Flamblichus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natserract%2Flamblichus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natserract","download_url":"https://codeload.github.com/natserract/lamblichus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natserract%2Flamblichus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32451136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","functors","haskell","macro","metaprogramming"],"created_at":"2024-12-17T11:17:01.412Z","updated_at":"2026-04-30T01:32:55.407Z","avatar_url":"https://github.com/natserract.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lamblichus\n\nLamblichus is a **elixir [macro](https://elixir-lang.org/getting-started/meta/macros.html)** for implemented [functor](https://www.haskellforall.com/2012/09/the-functor-design-pattern.html), like in haskell\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `lamblichus` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:lamblichus, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/lamblichus\u003e.\n\n\nHaskell ways:\n```hs\n~ (+1) \u003c$\u003e [1, 2, 3, 4]\n-- Output: [2, 3, 4, 5]\n\n~ (\\x -\u003e Just x) \u003c$\u003e [1, 2, 3, 4, 5]\n-- Output: [Just 1,Just 2,Just 3,Just 4,Just 5]\n\n~ ((\\a -\u003e a + 1) \u003c$\u003e (\\b -\u003e b * 2)) 8\n-- Output: 17\n\n~ ((\\a -\u003e a + 1) \u003c\u0026\u003e (\\b -\u003e b * 2)) 8\n-- Output: 18\n```\n\n## Example: \n\n```ex\n~ functor (fn n -\u003e n * 2 end), [1, 2, 3] # Output: [2, 4, 6]\n~ (fn n -\u003e n * 2 end) \u003c~\u003e [1, 2, 3] # Output: [2, 4, 6]\n\n~ (functor (fn n -\u003e n + 1 end), (fn n -\u003e n * 2 end)).(8) # Output: 17\n~ ((fn n -\u003e n + 1 end) \u003c~\u003e (fn n -\u003e n * 2 end)).(8) # Output: 17\n\n~ functor_flipped [1, 2, 3], (fn n -\u003e n + 1 end) # Output: [2, 3, 4]\n~ [1, 2, 3] \u003c|\u003e fn n -\u003e n + 1 end # Output: [2, 3, 4]\n\n~ (functor_flipped (fn n -\u003e n + 1 end), (fn n -\u003e n * 2 end)).(8) # Output: 18\n~ ((fn n -\u003e n + 1 end) \u003c|\u003e (fn n -\u003e n * 2 end)).(8) # Output: 18\n\n~ fmap (fn n -\u003e n * 2 end), [1, 2, 3] # Output: [2, 4, 6]\n~ flip ((fn n -\u003e n + 1 end), (fn n -\u003e n * 2 end)).(8) # Output: 18\n```\n\n## References:\n- [https://shane.logsdon.io/writing/functors-applicatives-and-monads-in-elixir/](https://shane.logsdon.io/writing/functors-applicatives-and-monads-in-elixir/)\n- [https://hexdocs.pm/elixir/Module.html#module-compile-callbacks](https://hexdocs.pm/elixir/Module.html#module-compile-callbacks)\n- [https://coder-question.com/cq-blog/318128](https://coder-question.com/cq-blog/318128)\n- [https://brooklinmyers.medium.com/using-use-usefully-in-elixir-and-phoenix-b59a5ea08ad2](https://brooklinmyers.medium.com/using-use-usefully-in-elixir-and-phoenix-b59a5ea08ad2)\n- [https://github.com/elixir-lang/elixir/blob/main/lib/elixir/src/elixir_parser.yrl](https://github.com/elixir-lang/elixir/blob/main/lib/elixir/src/elixir_parser.yrl)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatserract%2Flamblichus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatserract%2Flamblichus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatserract%2Flamblichus/lists"}