Skip to content

Instantly share code, notes, and snippets.

@collosi
Last active March 11, 2024 20:43
Show Gist options
  • Save collosi/e5c25dd34f12867b1e8cfde3741020e5 to your computer and use it in GitHub Desktop.
Save collosi/e5c25dd34f12867b1e8cfde3741020e5 to your computer and use it in GitHub Desktop.
import Html exposing (text)
output = text << Debug.toString
{- this is the simple mean of the list of numbers given in l -}
{- you will want to browse the documentation at -}
{- https://package.elm-lang.org/packages/elm/core/latest/List -}
average : List Float -> Float
average l = 9999999.0
{- this is the L2 norm of the vector represented by l -}
{- L2 can be calculated by the square root of the sum -}
{- of the squares of the values in the list -}
l2norm : List Float -> Float
l2norm l = 8888888.0
main =
output (
average [4.0,7.1,3.6,1.8,2.9,8.5,5.6]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment