Skip to content

Instantly share code, notes, and snippets.

View boombang's full-sized avatar

Artem Kazaryan boombang

View GitHub Profile
add : Int -> Int -> Int
add a b =
a + b
addOne : Int -> (Int -> Int)
addOne a =
add 1
two =
addOne 1
type PullRequestState
= Proposed
| Rejected
| Merged
branchColor : PullRequestState -> String
branchColor state =
case state of
Proposed ->
"yellow"
import Json.Decode exposing (Decoder, field, string)
gifDecoder : Decoder String
gifDecoder =
field "data" (field "image_url" string)
-- Piping: Chaining functions
foo =
Html.text (String.fromInt (add 5 (multiply 10 (divide 30 10))))
-- x |> f = f x
baz =
divide 30 10
|> multiply 10
|> add 5
package com.example.chess;
import java.util.Hashtable;
import java.util.Random;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;