{"id":15523094,"url":"https://github.com/xuwei-k/zeroapply","last_synced_at":"2025-04-23T03:48:57.736Z","repository":{"id":19766864,"uuid":"23024808","full_name":"xuwei-k/zeroapply","owner":"xuwei-k","description":"zero cost Apply/Applicative syntax","archived":false,"fork":false,"pushed_at":"2025-03-17T09:39:41.000Z","size":253,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T21:51:05.477Z","etag":null,"topics":["applicative","macros","scala","scalaz"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuwei-k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-16T18:53:53.000Z","updated_at":"2025-03-17T09:39:46.000Z","dependencies_parsed_at":"2023-02-15T20:31:36.374Z","dependency_job_id":"5cd00c82-459b-4a0b-866d-4f45380fb9c3","html_url":"https://github.com/xuwei-k/zeroapply","commit_stats":{"total_commits":494,"total_committers":3,"mean_commits":"164.66666666666666","dds":0.3340080971659919,"last_synced_commit":"2ae9bd869a85796ebb0fa8a8027c859720ae0f4a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Fzeroapply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Fzeroapply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Fzeroapply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Fzeroapply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuwei-k","download_url":"https://codeload.github.com/xuwei-k/zeroapply/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249319594,"owners_count":21250578,"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","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":["applicative","macros","scala","scalaz"],"created_at":"2024-10-02T10:43:30.835Z","updated_at":"2025-04-17T06:30:33.502Z","avatar_url":"https://github.com/xuwei-k.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zeroapply\n\n## Zero Cost `Apply`/`Applicative` Syntax\n\n### example\n\n\n```scala\nzeroapply.OptionApply.apply3(Option(1), Option(2), Option(3))(_ + _ + _)\n```\n\n↓\n\n```scala\n{\n  val x0: _root_.scala.Option[Int] = scala.Option.apply[Int](1);\n  if (x0.isEmpty)\n    _root_.scala.None\n  else\n    {\n      val x1: _root_.scala.Option[Int] = scala.Option.apply[Int](2);\n      if (x1.isEmpty)\n        _root_.scala.None\n      else\n        {\n          val x2: _root_.scala.Option[Int] = scala.Option.apply[Int](3);\n          if (x2.isEmpty)\n            _root_.scala.None\n          else\n            _root_.scala.Some(x0.get.+(x1.get).+(x2.get))\n        }\n    }\n}\n```\n\n\n- [Maven Central Repository Search](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.xuwei-k%22%20AND%20(a%3A%22zeroapply_2.11%22%20OR%20a%3A%22zeroapply-scalaz_2.11%22))\n- [Maven Central](http://repo1.maven.org/maven2/com/github/xuwei-k/)\n\n## [`scalaz.Equal`](https://github.com/scalaz/scalaz/blob/v7.1.5/core/src/main/scala/scalaz/Equal.scala) and [`scalaz.Order`](https://github.com/scalaz/scalaz/blob/v7.1.5/core/src/main/scala/scalaz/Order.scala) macro\n\n```scala\nimport scalaz._, std.AllInstances._\n\ncase class Foo[A, B](a: A, b: B, c: Int)\n\nobject Foo {\n  implicit def instance[A: Order, B: Order]: Order[Foo[A, B]] =\n    zeroapply.CaseClass.order[Foo[A, B]]\n}\n```\n\n↓\n\n```scala\nnew Order[Foo[A, B]] {\n  override def equalIsNatural =\n    Equal[A].equalIsNatural \u0026\u0026 Equal[B].equalIsNatural \u0026\u0026 Equal[Int].equalIsNatural\n\n  override def equal(x1: Foo[A, B], x2: Foo[A, B]) =\n    Equal[A].equal(x1.a, x2.a) \u0026\u0026 Equal[B].equal(x1.b, x2.b) \u0026\u0026 Equal[Int].equal(x1.c, x2.c)\n\n  override def order(x1: Foo[A, B], x2: Foo[A, B]) =\n    Order[A].order(x1.a, x2.a) match {\n      case Ordering.EQ =\u003e\n        Order[B].order(x1.b, x2.b) match {\n          case Ordering.EQ =\u003e Order[Int].order(x1.c, x2.c)\n          case z =\u003e z\n        }\n      case z =\u003e\n        z\n    }\n}\n\n```\n\n### latest stable version\n\n```scala\nlibraryDependencies += \"com.github.xuwei-k\" %% \"zeroapply\" % \"0.5.0\"\n```\n\n```scala\nlibraryDependencies += \"com.github.xuwei-k\" %% \"zeroapply-scalaz\" % \"0.5.0\"\n```\n\n- [API Documentation](https://oss.sonatype.org/service/local/repositories/releases/archive/com/github/xuwei-k/zeroapply-all_2.11/0.5.0/zeroapply-all_2.11-0.5.0-javadoc.jar/!/index.html)\n\n\n### for scalaz 7.2.x\n\n\u003chttps://github.com/xuwei-k/zeroapply/tree/0.2.x\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuwei-k%2Fzeroapply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuwei-k%2Fzeroapply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuwei-k%2Fzeroapply/lists"}