{"id":17251032,"url":"https://github.com/fumieval/objective","last_synced_at":"2026-03-03T19:01:48.619Z","repository":{"id":20892438,"uuid":"24179873","full_name":"fumieval/objective","owner":"fumieval","description":"Purely functional objects","archived":false,"fork":false,"pushed_at":"2021-10-27T11:01:05.000Z","size":178,"stargazers_count":73,"open_issues_count":3,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-16T13:35:56.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fumieval.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":"2014-09-18T08:17:45.000Z","updated_at":"2024-09-19T01:42:47.000Z","dependencies_parsed_at":"2022-08-29T13:30:12.902Z","dependency_job_id":null,"html_url":"https://github.com/fumieval/objective","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fumieval/objective","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fobjective","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fobjective/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fobjective/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fobjective/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fumieval","download_url":"https://codeload.github.com/fumieval/objective/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fobjective/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30056056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-10-15T06:50:10.551Z","updated_at":"2026-03-03T19:01:48.590Z","avatar_url":"https://github.com/fumieval.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"objective\n====\n\n[![Hackage](https://img.shields.io/hackage/v/objective.svg)](https://hackage.haskell.org/package/objective) [![Build Status](https://secure.travis-ci.org/fumieval/objective.png?branch=master)](http://travis-ci.org/fumieval/objective)\n\nPaper: https://fumieval.github.io/papers/en/2015-Haskell-objects.html\n\nThis package provides composable objects and instances.\n\nIntroduction\n----\n\nThe primal construct, `Object`, models _object-oriented_ objects. `Object f g` represents an object.\n\n```haskell\nnewtype Object f g = Object { runObject :: forall x. f x -\u003e g (x, Object f g) }\n```\n\nAn object interprets a message `f a` and returns the result `a` and the next object `Object f g`, on `g`.\n\n```haskell\ndata Counter a where\n  Increment :: Counter ()\n  Print :: Counter Int\n\ncounter :: Int -\u003e Object Counter IO\ncounter n = Object $ \\case\n  Increment -\u003e return ((), counter (n + 1))\n  Print -\u003e print n \u003e\u003e return (n, counter n)\n```\n\n`new :: Object f g -\u003e IO (Instance f g)` creates an instance of an object.\n\n`(.-) :: (MonadIO m, MonadMask m) =\u003e Instance f m -\u003e f a -\u003e m a` sends a message to an instance. This can be used to handle instances in the typical OOP fashion.\n\n```haskell\n\u003e i \u003c- new (counter 0)\n\u003e i .- Increment\n\u003e i .- Print\n1\n\u003e i .- Increment\n\u003e i .- Print\n2\n```\n\nInterestingly, `Object (Skeleton t) m` and `Object t m` are isomorphic (`Skeleton` is an operational monad). `cascading` lets objects to handle an operational monad.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumieval%2Fobjective","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffumieval%2Fobjective","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumieval%2Fobjective/lists"}