{"id":21301142,"url":"https://github.com/lamdalib/rassal","last_synced_at":"2025-08-01T09:03:33.462Z","repository":{"id":257580251,"uuid":"857302185","full_name":"lamdalib/rassal","owner":"lamdalib","description":"Create random values functional way.","archived":false,"fork":false,"pushed_at":"2024-09-26T19:18:08.000Z","size":476,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-21T15:44:32.406Z","etag":null,"topics":["functional-programming","random","random-value-generation","random-variable-generator","scala3","value-generation"],"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/lamdalib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-14T09:39:23.000Z","updated_at":"2024-09-26T19:18:12.000Z","dependencies_parsed_at":"2024-09-17T14:39:50.378Z","dependency_job_id":"0a8cbbeb-08d5-445d-bd0b-24774778d353","html_url":"https://github.com/lamdalib/rassal","commit_stats":null,"previous_names":["kattulib/rassal","lamdalib/rassal"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamdalib%2Frassal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamdalib%2Frassal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamdalib%2Frassal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamdalib%2Frassal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamdalib","download_url":"https://codeload.github.com/lamdalib/rassal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235082249,"owners_count":18932922,"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":["functional-programming","random","random-value-generation","random-variable-generator","scala3","value-generation"],"created_at":"2024-11-21T15:44:11.928Z","updated_at":"2025-01-22T08:12:04.224Z","avatar_url":"https://github.com/lamdalib.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rassal\n\u003cp\u003e\n    \u003cimg src=\"/docs/icon.png\" width=\"256\" height=\"256\" /\u003e\n\u003c/p\u003e\n\nRassal is a random value generator.\n\n## Getting Rassal\nRight now, Rassal is not a published project. If you want to use the library,\nyou should clone the project first and publish it locally as on the following\ncommand:\n\n```bash\n# on interactive sbt shell\nsbt:rassal\u003e publishLocal\n...\n[info]  published ivy to /home/USER/.ivy2/local/io.github.lamdalib/rassal_3/0.1.0-SNAPSHOT\n[info]  published ivy to /home/USER/.ivy2/local/io.github.lamdalib/rassal-core_3/0.1.0-SNAPSHOT\n\n# on bash\n$ sbt publishLocal\n...\n[info]  published ivy to /home/USER/.ivy2/local/io.github.lamdalib/rassal_3/0.1.0-SNAPSHOT\n[info]  published ivy to /home/USER/.ivy2/local/io.github.lamdalib/rasasl-core_3/0.1.0-SNAPSHOT\n```\n\nThen you can add the library in the library dependencies as others.\n```scala\nlibraryDependencies += \"io.github.lamdalib\" %% \"rassal\" % \"0.1.0-SNAPSHOT\"\n```\n\n## Run Tests\nYou can run all tests as on the following command:\n```bash\n# on interactive sbt shell\nsbt:rassal\u003e tests/test\n\n# on bash\n$ sbt tests/test\n```\n\n## Quick Start\n```scala\nimport rassal.Gen\nimport rassal.syntax.all.*\nimport rassal.instances.all.given\n\nscala\u003e Gen.nextInt.run(Gen.seed(1))\nval res0: (rassal.Seed, Int) = (Seed(25214903928),384748)\n\nscala\u003e Gen.nextInt.withBounds(5, 25).run(Gen.seed(1))\nval res1: (rassal.Seed, Int) = (Seed(25214903928),12)\n\nscala\u003e Gen.nextInt.withBounds(5, 25).asList(3).run(Gen.seed(1))\nval res2: (rassal.Seed, List[Int]) = (Seed(245470556921330),List(14, 6, 12))\n\nscala\u003e Gen.nextDouble.withBounds(1.5, 4.2).toFixed(2).run(Gen.seed(1))\nval res3: (rassal.Seed, Double) = (Seed(25214903928),1.5)\n\nscala\u003e Gen.nextDouble.withBounds(1.5, 4.2).toFixed(2).asList(3).run(Gen.seed(1))\nval res4: (rassal.Seed, List[Double]) = (Seed(245470556921330),List(2.19, 2.94, 1.5))\n```\n\n## Examples\nLet's generate random string values\n```scala\nimport rassal.Gen\nimport rassal.syntax.all.*\nimport rassal.instances.all.given\n\nval (_, stringList) = Gen.nextString.alpha.length(16).asList(10).run(Gen.seed(1))\nprintln(stringList)\n\n// output\nList(\n    mhuyKRzHUshsnalU,\n    IjUSLepdmlzqMscw,\n    SnjDFhbtRjqZodhl,\n    fLVOxnCJIpKgoPkS,\n    NjNgBWcgiOVLlqIi,\n    sZDRoxAnOxYIotPA,\n    idOfiTZWQdNSaPJn,\n    PlsjtDzHBVPUGCxe,\n    qscWotfqFElCdBJg,\n    dKCkfnSpMoZKhVJY\n)\n```\n\nOr we can use LazyList instead of List for better performance\n```scala\nval (_, stringLazyList) = Gen.nextString.alpha.length(16).asLazy.run(Gen.seed(1))\n\nfor i \u003c- stringLazyList.take(5) do {\n    println(i)\n}\n\n// output\ndKCkfnSpMoZKhVJY\nqscWotfqFElCdBJg\nPlsjtDzHBVPUGCxe\nidOfiTZWQdNSaPJn\nsZDRoxAnOxYIotPA\n```\n\nor we can generate a string by template:\n```scala\nval (_, emailStr) = Gen.nextString\n  .asLike(\n    \"$userName@$domain.$tld\",\n    Map(\n      \"$userName\" -\u003e Gen.nextString.alphanumeric.toLower.length(6),\n      \"$domain\" -\u003e Gen.nextString.alpha.toLower.length(4),\n      \"$tld\" -\u003e Gen.nextString.alpha.toLower.length(3)\n    )\n  )\n  .run(Gen.seed(1))\n\n// output\nhifnjc@spmo.kfn\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamdalib%2Frassal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamdalib%2Frassal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamdalib%2Frassal/lists"}