Code Monkey home page Code Monkey logo

elm-book's Introduction

「基礎からわかる Elm」サンプルコード集

基礎からわかる Elm のサンプルコードです。

本書正誤表

p39

  • (誤) ラムダ記号(λ\)を使って記述します。
  • (正) ラムダ記号(\)を使って記述します。

elm 0.19 から λ 記号が使えなくなったようです。

p44

  • (誤) (1 :: (2 :: (3 :: []))と解釈されます
  • (正) (1 :: (2 :: (3 :: [])))と解釈されます

p76

(誤)

showNumbersUntil =
    String.join "," << List.map String.fromInt << List.range 1 max

(正)

showNumbersUntil =
    String.join "," << List.map String.fromInt << List.range 1

p78

  • (誤) <||>は優先順位かつ結合の向きが逆なので、
  • (正) <||>は優先順位が同じかつ結合の向きが逆なので、

p88

(誤)

List.map toString [1,2,3]

(正)

List.map String.fromInt [1,2,3]

p93

Set

(誤)

Set.length set -- 3

(正)

Set.size set -- 3

Array

(誤)

Array.get 0 -- Just "one"

Array.get 3 -- Nothing

(正)

Array.get 0 array -- Just "one"

Array.get 3 array -- Nothing

p135

(誤)

decodeString (at ["person", "age" ] int   ) json == Ok "42

(正)

decodeString (at ["person", "age" ] int   ) json == Ok 42

p154

(誤)

view : Html msg
view model =
...

(正)

view : Model -> Html msg
view model =
...

p156からp159にかけて、同様に型注釈が誤っている箇所が複数あります。

p168

  • (誤)詳細は《Task》(p150)を参照してください。
  • (正)詳細は《Browser.applicationの制約》(p186)を参照してください。

p187

p191

(誤)

import Url.Parser exposing ((</>), (<?>), s, int, top, map)

(正)

import Url.Parser exposing ((</>), (<?>), Parser, int, map, oneOf, s, top)

p192

(誤)

type Route
    = Top
    | Login
    | Articles (Maybe String)
    | ArticleSettings Int

(正)

type Route
    = Top
    | Login
    | Articles (Maybe String)
    | Article Int
    | ArticleSettings Int

※上記の記述はp191〜p192に跨っています


(誤)

urlToRoute url =
    Url.Parser.perse routeParser url

(正)

urlToRoute url =
    Url.Parser.parse routeParser url

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.