Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting point for ELM #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions starting_points/elm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
elm-stuff/
50 changes: 50 additions & 0 deletions starting_points/elm/GameOfLife.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
module GameOfLife exposing (..)

import Html exposing (Html, Attribute, button, div, text, table, tr, td)


main =
Html.beginnerProgram
{ model = model
, view = view
, update = update
}



-- MODEL


type alias Model =
{}


model : Model
model =
{}



-- UPDATE


type Msg
= Nop


update : Msg -> Model -> Model
update msg model =
case msg of
Nop ->
model



-- VIEW


view : Model -> Html Msg
view model =
div []
[ div [] [ text "Conway's Game of Life" ]
]
48 changes: 48 additions & 0 deletions starting_points/elm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## ELM Starting Point

All you ever wanted to know about ELM at http://elm-lang.org/

More references
- http://elm-lang.org/docs/syntax
- http://package.elm-lang.org/packages/elm-community/elm-test/latest
- http://package.elm-lang.org/

### Installing ELM

```
npm install -g elm
npm install -g elm-test
```
More options at https://guide.elm-lang.org/get_started.html

### Running and Testing

Preparing
```
elm-package install -y
pushd tests && elm-package install -y && popd
```

Running tests
```
elm-test
```

Running the application
```
elm reactor
```
Then open your favorite browser, probably at http://localhost:8000/

### Atom

```
apm install language-elm
```

You might appreciate code formatting, via https://github.com/avh4/elm-format
```
apm install elm-format
```

More details and options at https://boonofcode.svbtle.com/setting-up-an-atom-elm-dev-environment
16 changes: 16 additions & 0 deletions starting_points/elm/elm-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "1.0.0",
"summary": "Conway's Game of Life",
"repository": "https://github.com/frawa/coderetreat.git",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
"elm-community/elm-test": "3.1.0 <= v < 4.0.0",
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
}
13 changes: 13 additions & 0 deletions starting_points/elm/tests/Main.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
port module Main exposing (..)

import Tests
import Test.Runner.Node exposing (run)
import Json.Encode exposing (Value)


main : Test.Runner.Node.TestProgram
main =
run emit Tests.all


port emit : ( String, Value ) -> Cmd msg
14 changes: 14 additions & 0 deletions starting_points/elm/tests/Tests.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Tests exposing (..)

import Test exposing (..)
import Expect
import GameOfLife exposing (..)


all : Test
all =
describe "Let's get going"
[ test "red" <|
\() ->
Expect.equal True False
]
18 changes: 18 additions & 0 deletions starting_points/elm/tests/elm-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "1.0.0",
"summary": "Test Conway's Game of Live",
"repository": "https://github.com/frawa/coderetreat.git",
"license": "BSD3",
"source-directories": [
".",
".."
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-lang/html": "1.1.0 <= v < 2.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}