(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| module CustomStartApp (start, App, Config) where | |
| import Html exposing (Html) | |
| import Effects exposing (Effects, Never) | |
| import Task | |
| type alias Config model action portAction = | |
| { init : ( model, Effects action, portAction ) | |
| , update : action -> model -> ( model, Effects action, Maybe portAction ) |
| { | |
| "version": "1.0.0", | |
| "summary": "helpful summary of your project, less than 80 characters", | |
| "repository": "https://github.com/user/project.git", | |
| "license": "BSD3", | |
| "source-directories": [ | |
| "." | |
| ], | |
| "exposed-modules": [], | |
| "dependencies": { |
| module Main where | |
| import Html exposing (Html, text, p) | |
| import Signal exposing (Address) | |
| import Effects exposing (Effects, Never) | |
| import Json.Decode as Json exposing ((:=)) | |
| import StartApp exposing (start) | |
| import Task | |
| import Http |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| module CountDown where | |
| import Graphics.Element exposing (..) | |
| import Time exposing (..) | |
| import String | |
| -- MODEL | |
| minutes = 1 | |
| seconds = 30 |
| // var moment = require("moment"); | |
| var moment = require("moment-timezone"); | |
| var ct = moment(1449011698428).fromNow(); | |
| var la = moment(1449011698428).tz("America/Los_Angeles").format('Z z'); | |
| function createNode (text) { | |
| var node = document.createElement('div'); | |
| node.textContent = text; | |
| node.style.display = "inline-block"; |
| #!/bin/sh | |
| set -e | |
| echo "Warning: You are about to remove all Elm executables!" | |
| installdir=/usr/local/bin | |
| for bin in elm elm-compiler elm-get elm-reactor elm-repl elm-doc elm-server elm-package elm-make | |
| do |
| {-| | |
| > ``` | |
| Consider a simple model for whether a person has the flu or not. Let F=1 | |
| indicate that a person has the flu and F=0 indicate that they don't have the | |
| flu. Let C=1 indicate that the person has a cough and C=0 indicate that they | |
| don't have a cough. Let M=1 indicate that the person has muscle pain and M=0 | |
| indicate that they don't have muscle pain. Assume that C and M are conditionally | |
| independent given F so that the probability model is | |
| P(C=c,M=m,F=f)=P(C=c|F=f)P(M=m|F=f)P(F=f). | |
| Suppose that we ask two different doctors to supply probabilities for this model |
| module Main where | |
| import Signal | |
| import Time exposing (Time, millisecond) | |
| import String | |
| import Html exposing (..) | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (..) | |
| import Effects exposing (Never, Effects) |
| module SignupForm where | |
| import Http | |
| import Task exposing (Task) | |
| import Json.Decode exposing (succeed) | |
| import Html exposing (..) | |
| import Html.Events exposing (..) | |
| import Html.Attributes exposing (id, type', for, value, class) | |
| import StartApp | |
| import Effects exposing (Effects, Never) |