This file contains hidden or 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
---------------------------- | |
-- Basic Audio Operations -- | |
---------------------------- | |
getAudio : String -> Task Http.Error Audio | |
play : Audio -> Task error () | |
stop : Audio -> Task error () |
This file contains hidden or 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
import Html exposing (Html, button, text) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (..) | |
import Signal exposing (Signal, Mailbox, Address, mailbox, send) | |
import Task exposing (Task, andThen, succeed, spawn, ThreadID) | |
import Graphics.Element exposing (show) |
This file contains hidden or 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 alias Component state action view | |
= { initial : (state, action) | |
, view : Address action -> state -> view | |
, address : Address action | |
, history : Signal (List (state, action)) | |
} | |
makeComponent | |
: state |
This file contains hidden or 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
import Signal exposing (Address, Mailbox, Signal, forwardTo) | |
import Html exposing (Html, div, ul, li) | |
import List | |
update : ID -> (state -> state) -> ContainerState state -> ContainerState state | |
update id f list = | |
case list of | |
[] -> [] | |
(id', x) :: xs -> | |
if id == id' |
This file contains hidden or 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
import Color exposing (Color) | |
import Graphics.Collage exposing (collage, circle, move, filled) | |
import Graphics.Element exposing (Element, show) | |
import Signal exposing (Signal) | |
import Time | |
type alias Wave = | |
{ center : { x : Float, y : Float } | |
, radius : Float | |
, color : Color |
This file contains hidden or 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
import Html exposing (Html) | |
import Html.Events exposing (onClick) | |
import Signal exposing (Signal, Address, Mailbox) | |
import Json.Decode as Decode exposing (Decoder, (:=)) | |
import Json.Encode as Encode exposing (Value) | |
import List | |
-------------------------------------------- | |
-- Example : | |
initial = 0 |
This file contains hidden or 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
import Signal | |
import Time | |
import List | |
import Graphics.Element exposing (show) | |
import Graphics.Collage as Collage | |
import Color | |
import Random | |
initial = |
This file contains hidden or 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
import Signal exposing (Signal) | |
import Html exposing (Html) | |
import Time | |
import Random exposing (Generator) | |
import Json.Decode exposing (Decoder) | |
import Json.Encode exposing (Value) | |
type alias Encoder a = a -> Value | |
mock |
This file contains hidden or 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
import Html | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (on) | |
import Signal exposing (mailbox) | |
import Json.Decode exposing (Decoder, (:=), int) | |
positionDecoder = |