Skip to content

Instantly share code, notes, and snippets.

@mooreryan
Created October 21, 2025 14:52
Show Gist options
  • Select an option

  • Save mooreryan/680eb8308bf94c514ed1a84a667a7ea0 to your computer and use it in GitHub Desktop.

Select an option

Save mooreryan/680eb8308bf94c514ed1a84a667a7ea0 to your computer and use it in GitHub Desktop.
Gleam with Elixir Statistics package
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"
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