Skip to content

Instantly share code, notes, and snippets.

View laszlopandy's full-sized avatar

Laszlo Pandy laszlopandy

  • Prezi.com
  • Budapest
View GitHub Profile
@laszlopandy
laszlopandy / A.ts
Created March 14, 2017 15:12
TypeScript examples
module prezi.a {
import Test = prezi.a.Test;
export function printNumber() {
console.log(Test.getNumber());
}
}
module prezi.a {
export module Test {
export function getNumber(): number {
@laszlopandy
laszlopandy / README.md
Last active August 29, 2015 14:22
Use cases for elm-make

Use cases of elm-make

  • elm make X.elm

    • install dependencies found in elm-package.json
    • compile X.elm, and all modules it depends on
    • write concatenated output to elm.js
  • elm make X.elm --output=x.js

    • write concatenated output to x.js
@laszlopandy
laszlopandy / minimal_test.js
Created January 11, 2015 21:19
Closure compiler dead-code-elimination test.
this['Elm'] = (function() {
var Elm_Debug_make = function() {
function watchSummary() {
return "Banana1";
}
function crash() {
throw new Error("crash");
}
@laszlopandy
laszlopandy / Proposal.md
Last active August 29, 2015 14:05
Laszlo's JSON parsing proposal

Laszlo's JSON parsing proposal

The following functions should be available in Elm's standard library:

module Json where

parse : String -> Maybe JsonValue
getProp : String -> JsonValue -> Maybe JsonValue
toString : JsonValue -> Maybe String
toInt : JsonValue -> Maybe Int

Elm Style Guide

Purpose

The goal of the style guide is foremost to promote consistency and reuse of pattern from other languages in order to improve readability and make Elm easier for beginners. This includes moving Elm away from Haskell’s indentation style and even making some parts look closer to JavaScript. These decisions are intentional.

We would like Elm to look friendly and familiar to users of any language — especially JavaScript — so they can discover Elm’s powerful features without being overwhelmed. This does not intend to weaken or discourage any features of Elm, but instead to make them more accessible.

A secondary goal of the style guide is to encourage short diffs when changes are made. This makes changes more clear, and helps when multiple people are collaborating.

Whitespace

@laszlopandy
laszlopandy / CreateGist.elm
Last active December 17, 2015 16:58
Gist creator using GitHub's Http API from Elm
import Json
import Dict
import Http
import Graphics.Input as Input
jsonObject list = Json.Object (Dict.fromList list)
sendAfter sig = Http.send <| foldp (\b _ -> b) (Http.get "") sig
asObject obj =