{"id":18423557,"url":"https://github.com/chadtech/random-pcg-pipeline","last_synced_at":"2025-04-13T14:45:49.678Z","repository":{"id":57674537,"uuid":"120126885","full_name":"Chadtech/random-pcg-pipeline","owner":"Chadtech","description":"This is a package that makes getting random values a little bit easier in Elm.","archived":false,"fork":false,"pushed_at":"2018-02-03T20:32:07.000Z","size":2,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T07:42:07.904Z","etag":null,"topics":["elm","random"],"latest_commit_sha":null,"homepage":"","language":"Elm","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/Chadtech.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":"2018-02-03T20:27:32.000Z","updated_at":"2019-08-15T15:54:45.000Z","dependencies_parsed_at":"2022-08-29T17:41:06.146Z","dependency_job_id":null,"html_url":"https://github.com/Chadtech/random-pcg-pipeline","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadtech%2Frandom-pcg-pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadtech%2Frandom-pcg-pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadtech%2Frandom-pcg-pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadtech%2Frandom-pcg-pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chadtech","download_url":"https://codeload.github.com/Chadtech/random-pcg-pipeline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732346,"owners_count":21152842,"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":["elm","random"],"created_at":"2024-11-06T04:37:46.134Z","updated_at":"2025-04-13T14:45:49.647Z","avatar_url":"https://github.com/Chadtech.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Random Pcg Pipeline\n\nThis is a package that makes getting random values a little bit easier in Elm. Its just like the package `Chadtech/random-pipeline`, except its adapted to use `mgold/elm-random-pcg` instead of the core random package.\n\nHeres a side by side comparison between `Random` and `Random.Pipeline`\n\n```elm\n-- Random\nmodelGenerator : Generator Model\nmodelGenerator =\n    Random.map4 Model\n        positionGenerator\n        enemiesGenerator\n        uuidGenerator\n        nameGenerator\n\n\ninit : Seed -\u003e ( Model, Seed )\ninit =\n    Random.step modelGenerator\n\n\n-- Random.Pcg.Pipeline\nimport Random.Pcg.Pipeline exposing (from, with)\n\ninit : Seed -\u003e ( Model, Seed )\ninit seed =\n    Model\n        |\u003e from seed\n        |\u003e with positionGenerator\n        |\u003e with enemiesGenerator\n        |\u003e with uuidGenerator\n        |\u003e with nameGenerator\n```\n\nA little bit cleaner right? And what if we wanted to keep the seed in our `Model` too? Just use `Random.Pipeline.finish`\n\n```elm\nimport Random.Pcg.Pipeline exposing (from, with, finish)\n\ninit : Seed -\u003e Model\ninit seed =\n    Model\n        |\u003e from seed\n        |\u003e with positionGenerator\n        |\u003e with enemiesGenerator\n        |\u003e with uuidGenerator\n        |\u003e with nameGenerator\n        |\u003e finish\n\n\ntype alias Model =\n    { pos : Position\n    , enemies : List Enemy\n    , uuid : Uuid\n    , name : String\n    , seed : Seed\n    }\n```\n\nIt also has `always` that can hardcode values into your random generation.\n\n```elm\nimport Random.Pcg.Pipeline exposing (from, with, finish, always)\n\nupdate : Msg -\u003e Model -\u003e Model\nupdate msg model =\n    case msg of\n        Restart -\u003e\n            Model\n                |\u003e from model.seed\n                |\u003e with positionGenerator\n                |\u003e with enemiesGenerator\n                |\u003e always model.uuid\n                |\u003e always model.name\n                |\u003e finish\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadtech%2Frandom-pcg-pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchadtech%2Frandom-pcg-pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadtech%2Frandom-pcg-pipeline/lists"}