Skip to content

Instantly share code, notes, and snippets.

View Apanatshka's full-sized avatar

Jeff Smits Apanatshka

View GitHub Profile
@Apanatshka
Apanatshka / app.elm
Created October 14, 2015 07:33 — forked from deflexor/app.elm
Elm-lang app that needs speed boost
import Html exposing (Html)
import Debug
import Array exposing (Array)
import Html.Attributes as HtmlA -- exposing (..)
import Html.Events as HtmlE --exposing (on, onClick, targetChecked)
import Signal exposing (Address)
import StartApp.Simple as StartApp
main =
@Apanatshka
Apanatshka / Simple-Undo-Example.elm
Last active August 29, 2015 14:22 — forked from theadam/Simple Undo Example
Added debouncing. Had to change update/undo logic too!
import Html exposing (Html, div, text, input, button)
import Html.Attributes exposing (value, placeholder)
import Html.Events exposing (on, targetValue, onClick)
import Signal as Signal
import List exposing (head, tail)
import Maybe
import Debug
isUpdate ha = case ha of
Just (Update _ _) -> True
type Body x = { pos:(Int,Int), wrap : x }
type Bubble = { radius: Int }
type Box = { w: Int, h: Int }
data Wrap = WBox Box | WBubble Bubble
mv: (Int,Int) -> Body a -> Body a
mv (x,y) body =
let (x0,y0)= body.pos
in { body | pos <- (x0+x, y0+y)}