Skip to content

Instantly share code, notes, and snippets.

Created October 2, 2017 01:49
Show Gist options
  • Save anonymous/d13aba83854822e334efc88d1f25bc32 to your computer and use it in GitHub Desktop.
Save anonymous/d13aba83854822e334efc88d1f25bc32 to your computer and use it in GitHub Desktop.
pipeline
{
"repository": "https://github.com/user/project.git",
"version": "1.0.0",
"elm-version": "0.18.0 <= v < 1.0.0",
"summary": "My first Ellie project.",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"native-modules": false,
"dependencies": {
"elm-lang/core": "5.1.1 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"matthewsj/elm-ordering": "1.1.0 <= v < 2.0.0"
}
}
<html>
<head>
<style>
html {
background: #F7F7F7;
color: red;
}
</style>
</head>
<body>
<script>
var app = Elm.Main.fullscreen()
</script>
</body>
</html>
module Main exposing (main)
import Html exposing (Html, text)
import Ordering exposing (..)
a : List Int
a =
[ 2, 28, 6, 34, -9 ]
tuple : Int -> ( Int, Int, Int )
tuple =
\x -> ( x, x * x, -x )
type alias A =
{ foo : Int, bar : Int, baz : Int }
tupToA : ( Int, Int, Int ) -> A
tupToA =
\( x, y, z ) -> { foo = x, bar = y, baz = z }
b =
List.map tuple a
c =
List.map tupToA b
main : Html msg
main =
c
|> List.sortWith (Ordering.byField .foo)
|> List.reverse
|> List.reverse
|> toString
|> Html.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment