This file contains 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
const app = function(request, response) { | |
response.writeHead(200, { | |
"Content-Type": "text/html", | |
}); | |
response.end("Hello world"); | |
}; | |
module.exports = app; |
This file contains 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
random : Value -> Float | |
random = | |
decodeValue (field "random" float) |
This file contains 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
module EA exposing (..) | |
port ea0 : Int -> Cmd msg | |
port ea1 : Int -> Cmd msg | |
port ea2 : Int -> Cmd msg | |
port ea3 : Int -> Cmd msg | |
port ea4 : Int -> Cmd msg | |
port ea5 : Int -> Cmd msg |
This file contains 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
declare const editsc; // Tells TypeScript that this variable is defined elsewhere | |
editsc.init({ | |
useVersion: "1.0", // The version of the extension API to use | |
name: "Basics", | |
}); | |
// Defines an action allowing the user to select a | |
// block and replace it with a different block | |
editsc.action({ |
This file contains 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
module Main exporting | |
- main | |
procedure main = | |
file : Io.stream <- loop getFilename: | |
case do Util.promptFileName: | |
Ok stream -> | |
Loop.exit getFilename stream | |
This file contains 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
type Decoder a | |
= Decoder ( String -> Maybe a ) | |
type Error | |
= InvalidHeaders | |
| NoRows | |
int : Decoder Int |
This file contains 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
module Thing exposing ( add4 ) | |
add4 : Int -> Int | |
add4 = | |
(+) 4 |
This file contains 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
-- if elm was imperative | |
import Console | |
import Proc | |
type alias Model = | |
{ prompt : String | |
} |
This file contains 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
module Fraction exposing (Fraction, create, toFloat_) | |
-- See https://discourse.elm-lang.org/t/proposal-extending-built-in-typeclasses/5510/2 | |
type Fraction [ number, comparable ] | |
= Fraction Int Int | |
This file contains 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
module NeverGonna exposing (main) | |
import Html exposing (..) | |
main : Html Never -- gonna give you up | |
main = | |
let | |
neverGonna : List String | |
neverGonna = |
NewerOlder