Created
October 21, 2025 14:52
-
-
Save mooreryan/680eb8308bf94c514ed1a84a667a7ea0 to your computer and use it in GitHub Desktop.
Gleam with Elixir Statistics package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name = "stat" | |
| version = "1.0.0" | |
| [dependencies] | |
| gleam_stdlib = ">= 0.44.0 and < 2.0.0" | |
| statistics = ">= 0.6.3 and < 1.0.0" | |
| [dev-dependencies] | |
| gleeunit = ">= 1.0.0 and < 2.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gleam/list | |
| pub fn main() -> Nil { | |
| list.range(1, 10) | |
| |> list.map(fn(_) { random_normal(mean: 0.0, sd: 1.0) }) | |
| |> echo | |
| Nil | |
| } | |
| @external(erlang, "Elixir.Statistics.Distributions.Normal", "rand") | |
| fn random_normal(mean mean: Float, sd sd: Float) -> Float |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment