{"id":16894198,"url":"https://github.com/jsuereth/scala-arm","last_synced_at":"2025-05-15T09:00:18.459Z","repository":{"id":675724,"uuid":"319296","full_name":"jsuereth/scala-arm","owner":"jsuereth","description":"This project aims to be the Scala Incubator project for Automatic-Resource-Management in the scala library","archived":false,"fork":false,"pushed_at":"2020-10-26T13:48:39.000Z","size":570,"stargazers_count":548,"open_issues_count":15,"forks_count":51,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-07T21:11:30.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"www.scala-lang.org","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/jsuereth.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":null,"security":null,"support":null}},"created_at":"2009-09-27T20:32:15.000Z","updated_at":"2025-03-22T13:31:55.000Z","dependencies_parsed_at":"2022-07-20T14:18:56.639Z","dependency_job_id":null,"html_url":"https://github.com/jsuereth/scala-arm","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsuereth%2Fscala-arm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsuereth%2Fscala-arm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsuereth%2Fscala-arm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsuereth%2Fscala-arm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsuereth","download_url":"https://codeload.github.com/jsuereth/scala-arm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254133076,"owners_count":22020264,"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":[],"created_at":"2024-10-13T17:17:58.220Z","updated_at":"2025-05-15T09:00:16.873Z","avatar_url":"https://github.com/jsuereth.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scala Automatic Resource Management\n\n[![Join the chat at https://gitter.im/jsuereth/scala-arm](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jsuereth/scala-arm?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nThis project is an attempt to provide an Automatic-Resource-Management library for the scala distribution.  It is based off of code contributed to the Scalax project.\n\n## Using scala-arm\n\nIn SBT:\n\n    libraryDependencies += \"com.jsuereth\" %% \"scala-arm\" % \"2.0\"\n\n*or* (if you want to manually specify the Scala version for some reason)\n\n    libraryDependencies += \"com.jsuereth\" % \"scala-arm_2.11\" % \"2.0\"\n    libraryDependencies += \"com.jsuereth\" % \"scala-arm_2.12\" % \"2.0\"\n\nIn Maven:\n\n    \u003cdependency\u003e\n       \u003cgroupId\u003ecom.jsuereth\u003c/groupId\u003e\n       \u003cartifactId\u003escala-arm_${scala.binary.version}\u003c/artifactId\u003e\n       \u003cversion\u003e2.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\n\n## Examples\n\nScala-arm provides a way of managing resources and re-using code.  Here's an example:\n\n```scala\n    import resource._\n    // Copy input into output.\n    for {\n      input \u003c- managed(new java.io.FileInputStream(\"test.txt\"))\n      output \u003c- managed(new java.io.FileOutputStream(\"test2.txt\"))\n    } {\n      val buffer = new Array[Byte](512)\n      def read(): Unit = input.read(buffer) match {\n        case -1 =\u003e ()\n        case  n =\u003e\n          output.write(buffer,0,n)\n          read()\n      }\n      read()\n    }\n```\n\nFor more information on usage, see [Usage](http://jsuereth.com/scala-arm/usage.html)\n\n## SCALA LICENSE\n\nCopyright (c) 2002-2013 EPFL, Lausanne, unless otherwise specified.\nAll rights reserved.\n\nThis software was developed by the Programming Methods Laboratory of the\nSwiss Federal Institute of Technology (EPFL), Lausanne, Switzerland.\n\nPermission to use, copy, modify, and distribute this software in source\nor binary form for any purpose with or without fee is hereby granted,\nprovided that the following conditions are met:\n\n   1. Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\n   2. Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n   3. Neither the name of the EPFL nor the names of its contributors\n      may be used to endorse or promote products derived from this\n      software without specific prior written permission.\n\n\nTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsuereth%2Fscala-arm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsuereth%2Fscala-arm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsuereth%2Fscala-arm/lists"}