{"id":26282393,"url":"https://github.com/romaniakovlev/scope-translator","last_synced_at":"2025-03-14T16:50:03.561Z","repository":{"id":57737206,"uuid":"78952556","full_name":"RomanIakovlev/scope-translator","owner":"RomanIakovlev","description":"Translation between identically shaped types in Scala","archived":false,"fork":false,"pushed_at":"2019-06-25T13:58:37.000Z","size":26,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-05T09:43:48.810Z","etag":null,"topics":["metaprogramming","scala","shapeless"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/RomanIakovlev.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-14T16:43:23.000Z","updated_at":"2023-07-05T09:43:48.811Z","dependencies_parsed_at":"2022-08-24T06:00:13.919Z","dependency_job_id":null,"html_url":"https://github.com/RomanIakovlev/scope-translator","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanIakovlev%2Fscope-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanIakovlev%2Fscope-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanIakovlev%2Fscope-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanIakovlev%2Fscope-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RomanIakovlev","download_url":"https://codeload.github.com/RomanIakovlev/scope-translator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243615580,"owners_count":20319730,"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":["metaprogramming","scala","shapeless"],"created_at":"2025-03-14T16:50:02.947Z","updated_at":"2025-03-14T16:50:03.530Z","avatar_url":"https://github.com/RomanIakovlev.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scope translator\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.iakovlev/scope-translator_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.iakovlev/scope-translator_2.12/)\n\n## Quote\n\u003e The original is unfaithful to the translation.\n\u003e\n\u003e― **Jorge Luis Borges**\n\n## Overview\n \nThis project aims to provide translation between Scala classes having conforming shape.\nIt is particularly useful when an identical set of types exist in different scopes (packages, etc.).\n\nThe following rules have to be obeyed for successful translation:\n\n* Members of product types (case classes) have to have same types and be in the same order; prior to version 0.2.0 the member names were also taken into account, but in 0.2.0 this restriction has been removed.\n\nRefer to tests for a more detailed illustration of these rules, where both positive and negative examples are available.\n\nIf translation fails for some reason (types don't match, etc.), it results in a compile time error.\n\n## Usage\nAdd dependency to your project:\n\nIn `build.sbt`:\n```scala\nlibraryDependencies += \"net.iakovlev\" %% \"scope-translator\" % \"0.3.2\"\n```\n\nScope translator is published to Sonatype and synced to Maven Central.\nSupported Scala versions are 2.11, 2.12 and 2.13.\n\nThen you can use scope translator in two ways:\n\n* Directly by calling `ScopeTranslator[From, To](a: From)`:\n```scala\nimport net.iakovlev.scopetranslator.ScopeTranslator\ncase class C1()\ncase class C2()\nval c1 = C1()\nval c2: C2 = ScopeTranslator[C1, C2](c1)\n```\n\n* By importing the \ntranslation syntax: \n```scala\nimport net.iakovlev.scopetranslator.syntax._\ncase class C1()\ncase class C2()\nval c1 = C1()\nval c2: C2 = c1.to[C2]\n```  \n\n## Copyright and License\n\nAll code is licensed under the MIT license, available at\nhttp://opensource.org/licenses/mit-license.php and also in the COPYING\nfile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaniakovlev%2Fscope-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromaniakovlev%2Fscope-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaniakovlev%2Fscope-translator/lists"}