{"id":13561731,"url":"https://github.com/ianmackenzie/elm-units-interval","last_synced_at":"2025-09-08T02:45:05.553Z","repository":{"id":144366267,"uuid":"162043410","full_name":"ianmackenzie/elm-units-interval","owner":"ianmackenzie","description":"Version of elm-interval based on elm-units","archived":false,"fork":false,"pushed_at":"2021-04-19T23:54:24.000Z","size":69,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-31T21:36:38.998Z","etag":null,"topics":["elm","interval","units"],"latest_commit_sha":null,"homepage":"","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianmackenzie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS"}},"created_at":"2018-12-16T21:40:17.000Z","updated_at":"2023-11-04T19:54:50.000Z","dependencies_parsed_at":"2023-03-22T12:17:24.821Z","dependency_job_id":null,"html_url":"https://github.com/ianmackenzie/elm-units-interval","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/ianmackenzie/elm-units-interval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-units-interval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-units-interval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-units-interval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-units-interval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianmackenzie","download_url":"https://codeload.github.com/ianmackenzie/elm-units-interval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-units-interval/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274125530,"owners_count":25226490,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","interval","units"],"created_at":"2024-08-01T13:01:00.461Z","updated_at":"2025-09-08T02:45:05.524Z","avatar_url":"https://github.com/ianmackenzie.png","language":"Elm","funding_links":[],"categories":["Elm"],"sub_categories":[],"readme":"# elm-units-interval\n\nThis package lets you work with ranges of values (intervals) based on the\n`Quantity` type from [`elm-units`][elm-units]. You can do things like:\n\n- Check if a given value is within an interval\n- Construct intervals from lists of values or other intervals\n- Find the intersection of two intervals\n- Perform [arithmetic][interval-arithmetic] on intervals\n\n```elm\nimport Quantity.Interval as Interval exposing (Interval)\nimport Angle exposing (Radians)\nimport Pixels exposing (Pixels)\n\nangleRange : Interval Float Radians\nangleRange =\n    Interval.fromEndpoints\n        ( Angle.degrees 0, Angle.degrees 180 )\n\nwidthRange : Interval Int Pixels\nwidthRange =\n    Interval.fromEndpoints\n        ( Pixels.int 100, Pixels.int 300 )\n```\n\nVarious functionality is included for constructing intervals (including as the\nunion or intersection of other intervals) and checking for overlap, intersection\nor containment:\n\n```elm\nimport Quantity.Interval as Interval exposing (Interval)\nimport Length\nimport Duration\n\ndistanceInterval =\n    Interval.fromEndpoints\n        ( Length.meters 10, Length.meters 20 )\n\nInterval.endpoints distanceInterval\n--\u003e ( Length.meters 10, Length.meters 20 )\n\nInterval.hull\n    (Length.feet 5)\n    [ Length.feet 3\n    , Length.feet 2\n    , Length.feet 4\n    ]\n--\u003e Interval.fromEndpoints\n--\u003e     ( Length.feet 2, Length.feet 5 )\n\nInterval.aggregate2\n    (Interval.fromEndpoints\n        ( Duration.minutes 1\n        , Duration.minutes 2\n        )\n    )\n    (Interval.fromEndpoints\n        ( Duration.minutes 3\n        , Duration.minutes\n        )\n    )\n--\u003e Interval.fromEndpoints\n--\u003e     ( Duration.minutes 1, Duration.minutes 5 )\n\nInterval.intersection\n    (Interval.fromEndpoints\n        ( Duration.hours 1\n        , Duration.hours 3\n        )\n    )\n    (Interval.fromEndpoints\n        ( Duration.hours 2\n        , Duration.hours 5\n        )\n    )\n--\u003e Just \u003c|\n--\u003e     Interval.fromEndpoints\n--\u003e         ( Duration.hours 2\n--\u003e         , Duration.hours 3\n--\u003e         )\n\nInterval.fromEndpoints\n    ( Angle.radians 0, Angle.radians pi )\n    |\u003e Interval.contains (Angle.degrees 90)\n--\u003e True\n\nInterval.fromEndpoints\n    ( Angle.radians 0, Angle.radians pi )\n    |\u003e Interval.contains (Angle.degrees 270)\n--\u003e False\n```\n\nMost functionality is contained in the [`Quantity.Interval`](Quantity-Interval)\nmodule, but some functionality specific to particular kinds of intervals is\ncontained in [`Angle.Interval`](Angle-Interval) and [`Temperature.Interval`](Temperature-Interval).\n\n[elm-interval]: https://package.elm-lang.org/packages/ianmackenzie/elm-interval/latest/\n[elm-units]: https://package.elm-lang.org/packages/ianmackenzie/elm-units/latest/\n[interval-arithmetic]: https://en.wikipedia.org/wiki/Interval_arithmetic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-units-interval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianmackenzie%2Felm-units-interval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-units-interval/lists"}