├── .circleci └── config.yml ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── book.json ├── book ├── CNAME ├── README.md ├── SUMMARY.md ├── about_translation.md ├── appendix │ ├── function_types.md │ ├── types_as_bits.md │ └── types_as_sets.md ├── architecture │ ├── README.md │ ├── buttons.md │ ├── buttons.svg │ ├── checkboxes.md │ ├── forms.md │ ├── hints.mp4 │ ├── radio_buttons.md │ ├── text_fields.md │ └── try.png ├── core_language.md ├── effects │ ├── README.md │ ├── diagrams │ │ ├── debug.svg │ │ ├── element.svg │ │ ├── int.svg │ │ ├── sandbox.svg │ │ └── string.svg │ ├── http.md │ ├── json.md │ ├── random.md │ └── time.md ├── error_handling │ ├── README.md │ ├── maybe.md │ └── result.md ├── google0dc2a0399440e707.html ├── install │ ├── README.md │ ├── editor.md │ ├── elm.md │ └── images │ │ ├── editor.png │ │ └── terminal.png ├── interop │ ├── README.md │ ├── custom_elements.md │ ├── flags.md │ ├── limits.md │ └── ports.md ├── next_steps.md ├── optimization │ ├── README.md │ ├── asset_size.md │ ├── diagrams │ │ ├── diff.svg │ │ ├── dom.svg │ │ ├── everything.svg │ │ ├── lazy.svg │ │ ├── patch.svg │ │ ├── render.svg │ │ └── vdom.svg │ ├── keyed.md │ └── lazy.md ├── robots.txt ├── styles │ └── website.css ├── types │ ├── README.md │ ├── custom_types.md │ ├── pattern_matching.md │ ├── reading_types.md │ └── type_aliases.md └── webapps │ ├── README.md │ ├── modules.md │ ├── navigation.md │ ├── structure.md │ └── url_parsing.md ├── docs ├── CNAME ├── about_translation.html ├── appendix │ ├── function_types.html │ ├── types_as_bits.html │ └── types_as_sets.html ├── architecture │ ├── buttons.html │ ├── buttons.svg │ ├── forms.html │ ├── hints.mp4 │ ├── index.html │ ├── text_fields.html │ └── try.png ├── core_language.html ├── effects │ ├── diagrams │ │ ├── debug.svg │ │ ├── element.svg │ │ ├── int.svg │ │ ├── sandbox.svg │ │ └── string.svg │ ├── http.html │ ├── index.html │ ├── json.html │ ├── random.html │ └── time.html ├── error_handling │ ├── index.html │ ├── maybe.html │ └── result.html ├── get_started.html ├── gitbook │ ├── fonts │ │ └── fontawesome │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ ├── gitbook-plugin-elm-repl │ │ └── repl.js │ ├── gitbook-plugin-fontsettings │ │ ├── fontsettings.js │ │ └── website.css │ ├── gitbook-plugin-ga │ │ └── plugin.js │ ├── gitbook-plugin-highlight │ │ ├── ebook.css │ │ └── website.css │ ├── gitbook-plugin-lunr │ │ ├── lunr.min.js │ │ └── search-lunr.js │ ├── gitbook-plugin-search │ │ ├── lunr.min.js │ │ ├── search-engine.js │ │ ├── search.css │ │ └── search.js │ ├── gitbook.js │ ├── images │ │ ├── apple-touch-icon-precomposed-152.png │ │ └── favicon.ico │ ├── style.css │ └── theme.js ├── google0dc2a0399440e707.html ├── index.html ├── install │ ├── editor.html │ ├── elm.html │ ├── images │ │ ├── editor.png │ │ └── terminal.png │ ├── index.html │ └── terminal.html ├── interop │ ├── custom_elements.html │ ├── flags.html │ ├── index.html │ ├── json.html │ ├── limits.html │ └── ports.html ├── next_steps.html ├── optimization │ ├── asset_size.html │ ├── diagrams │ │ ├── diff.svg │ │ ├── dom.svg │ │ ├── everything.svg │ │ ├── lazy.svg │ │ ├── patch.svg │ │ ├── render.svg │ │ └── vdom.svg │ ├── index.html │ ├── keyed.html │ └── lazy.html ├── reuse │ └── modules.html ├── robots.txt ├── search_index.json ├── sitemap.xml ├── styles │ └── website.css ├── types │ ├── custom_types.html │ ├── index.html │ ├── pattern_matching.html │ ├── reading_types.html │ ├── type_aliases.html │ └── union_types.html └── webapps │ ├── index.html │ ├── modules.html │ ├── navigation.html │ ├── structure.html │ └── url_parsing.html ├── favicon.ico ├── package-lock.json ├── package.json ├── redirects.json ├── repl ├── .gitignore ├── README.md ├── assets │ └── repl.js ├── elm.json ├── index.js ├── package-lock.json ├── package.json ├── src │ ├── Error.elm │ ├── Flags.elm │ └── Repl.elm └── templates │ └── wrapper.txt ├── script └── diff_evancz_guide.sh ├── test.html └── tool └── pretranslate ├── index.js └── package.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | jobs: 4 | build-and-push: 5 | docker: 6 | - image: circleci/node 7 | steps: 8 | - checkout 9 | - add_ssh_keys: 10 | fingerprints: 11 | - "8f:1e:89:48:d4:ed:92:4c:23:c0:f3:e3:c1:74:c5:28" 12 | - run: 13 | name: install dependencies 14 | command: | 15 | npm i 16 | npm run install 17 | - run: 18 | name: build gitbook 19 | command: npm run build 20 | - run: 21 | name: git config 22 | command: | 23 | git config --global user.email "elmdocci@elm-lang.jp" 24 | git config --global user.name "ElmDocCI" 25 | - run: 26 | name: commit changes 27 | command: | 28 | git add docs 29 | git commit -m 'Update docs [skip ci]' 30 | - run: 31 | name: push changes 32 | command: git push origin master 33 | 34 | workflows: 35 | version: 2 36 | main: 37 | jobs: 38 | - build-and-push: 39 | filters: 40 | branches: 41 | only: master 42 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | PRを出す時は以下の内容をご確認ください。 2 | 3 | - [ ] できるだけ他の場所で使われている訳語にあわせる 4 | 5 | [対訳表](https://github.com/elm-jp/guide/blob/master/book/about_translation.md)をご参照ください。 6 | もし対訳表にまだ記載されていない訳語であれば、対訳表に追記していただけると助かります。 7 | 8 | - [ ] 原文をコメントアウトしてその直下に訳を記入する 9 | - [ ] 事前に `npm start` で正しくレンダリングできていることを確認する 10 | - [ ] 翻訳の方針について[翻訳について](https://github.com/elm-jp/guide/blob/master/book/about_translation.md)を確認した 11 | 12 | This PR closes #XX (対応するissue番号に変えてください) 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | elm-stuff 3 | _book 4 | 5 | 6 | ### https://raw.github.com/github/gitignore/65cdade87324774700104eee79dec1e7b91d56d7/Node.gitignore 7 | 8 | # Logs 9 | logs 10 | *.log 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | 15 | # Runtime data 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | 21 | # Directory for instrumented libs generated by jscoverage/JSCover 22 | lib-cov 23 | 24 | # Coverage directory used by tools like istanbul 25 | coverage 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Dependency directories 43 | node_modules/ 44 | jspm_packages/ 45 | 46 | # TypeScript v1 declaration files 47 | typings/ 48 | 49 | # Optional npm cache directory 50 | .npm 51 | 52 | # Optional eslint cache 53 | .eslintcache 54 | 55 | # Optional REPL history 56 | .node_repl_history 57 | 58 | # Output of 'npm pack' 59 | *.tgz 60 | 61 | # Yarn Integrity file 62 | .yarn-integrity 63 | 64 | # dotenv environment variables file 65 | .env 66 | 67 | # parcel-bundler cache (https://parceljs.org/) 68 | .cache 69 | 70 | # next.js build output 71 | .next 72 | 73 | # nuxt.js build output 74 | .nuxt 75 | 76 | # vuepress build output 77 | .vuepress/dist 78 | 79 | # Serverless directories 80 | .serverless 81 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: generic 3 | cache: 4 | timeout: 360 5 | jobs: 6 | include: 7 | - stage: check diff evancz/guide.elm-lang.org 8 | if: branch = master AND type IN (cron) 9 | script: ./script/diff_evancz_guide.sh 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Japanese translation of guide.elm-lang.org 2 | 3 | [Original version](https://github.com/evancz/guide.elm-lang.org/) 4 | 5 | guide.elm-lang.org 日本語化プロジェクト 6 | 7 | たまに大元のプロジェクトの変更をマージします。 8 | 9 | ## 翻訳に貢献する 10 | 11 | え? 貢献してくれるんですか?! 12 | It's super helpful! 13 | 14 | 現状では本家の最新版と翻訳版のバージョンが一致しているので、あらたに翻訳していただくものはありません。 15 | 代わりに「ここはちょっと日本語としてわかりにくいなぁ」とか「説明が足りない気がする」みたいなのがあれば、ぜひ改善のご提案をいただけると嬉しいです! 16 | 17 | ### レビュアーとして貢献する 18 | 19 | 他の方が翻訳した内容をレビューしていただける方も大募集です! 20 | ご都合の良いときにマージ前のプルリクに対して「もしかしたらここはこうしたらもっとわかりやすくなるかも!」みたいなコメントをつけていただくだけです。 21 | 翻訳作業もレビュアーとしての参加もとてもとてもありがたいです! 22 | 23 | ### 翻訳のやり方(ページまるごとの場合) 24 | 25 | 新しく追加されてまったく翻訳されていないページの翻訳方法です。 26 | 27 | `./book` 以下のファイルの英語の原文をコメントアウトして、その下に日本語を記入していきます。 28 | [サンプル](https://github.com/elm-jp/guide/pull/1) 29 | 30 | ```bash 31 | $ npx pretranslate ./book/your_file_to_translate 32 | ``` 33 | 34 | を実行することで、自動的に対象ファイルをパラグラフごとにコメントアウトし、さらに `./book/about_translation.md` の対訳表にしたがって文中に出てくる用語の標準的な対訳を付記してくれます。 35 | 36 | 対訳表自体は手動で更新が必要です。重要そうな単語を訳した際に都度対訳表に追加してください。 37 | 38 | ### 翻訳のやり方(TODOがついてるとこ) 39 | 40 | 既存のページのコンテンツが変わった場合に、`` とコメントをつけて英語のままになっているところがあります。 41 | こういうところの翻訳をして、`` を削除してください。 42 | 43 | ### 翻訳の方針 44 | 45 | 翻訳の方針については[翻訳について](https://github.com/elm-jp/guide/blob/master/book/about_translation.md)を事前にご確認ください。 46 | 47 | ### 翻訳しようと決めたら 48 | 49 | せっかく翻訳していただいたのに、実は同時に他の人が同じところを翻訳していて先にPRを出されちゃったらすごくもったいないですよね? 50 | それを防ぐためにまず対応する issue を探して「これを担当します」とコメントするか、権限がある方は自分を assign してください。 51 | 他の人が「お、これは作業中だな」と気づくのでオススメです! 52 | 53 | また、こちらは任意ですが 54 | 55 | ```bash 56 | $ git checkout -b ${your_branch_name} 57 | $ git commit --allow-empty -m 'Empty commit' 58 | $ git push origin ${your_branch_name} 59 | ``` 60 | 61 | のように空のコミットでブランチをプッシュして、「[WIP] interop/flags.md」 みたいなタイトルのPRを作っても良いでしょう。 62 | 63 | ## ローカル環境で確認する 64 | 65 | まず下記のコマンドで依存するプログラムをインストールします。 66 | (ついでにページ埋め込み型 repl 用のソースをコンパイルしたりいろいろします) 67 | 68 | ```bash 69 | $ npm i && npm run postinstall 70 | ``` 71 | 72 | 下記のコマンドで開発サーバーが立ち上がります。 73 | 74 | ```bash 75 | $ npm start 76 | ... 77 | ... 78 | Starting server ... 79 | Serving book on http://localhost:4000 80 | ``` 81 | 82 | `http://localhost:4000` にアクセスすることで表示の確認ができます。 83 | 84 | ## 本番環境へのデプロイ 85 | 86 | いまはCIが自動でやっていますが、念のため記載しておきます。 87 | 88 | ```bash 89 | $ git checkout master 90 | $ npm run build 91 | $ git add docs && git commit -m 'Update docs' && git push origin master 92 | ``` 93 | 94 | ## 原文の更新に追従する 95 | 96 | 原文も更新されているので、ときどき更新に追従しないといけません。 97 | 98 | 原文に追従する際は、`git` のちからを借りて基本的に以下のフローにそって手作業でがんばります。 99 | 100 | 1. 事前にEvanの元リポジトリを別の `remote` として登録しておく 101 | 102 | ``` 103 | $ git remote add evan github:evancz/guide.elm-lang.org.git 104 | $ git remote -v 105 | evan github:evancz/guide.elm-lang.org.git (fetch) 106 | evan github:evancz/guide.elm-lang.org.git (push) 107 | origin github:elm-jp/guide.git (fetch) 108 | origin github:elm-jp/guide.git (push) 109 | ``` 110 | 111 | 2. 最新の `evan/origin` をfetchして日本語版のmasterにマージしたブランチを作成する 112 | 113 | ``` 114 | $ git checkout master 115 | $ git pull origin master 116 | $ git fetch evan 117 | $ git checkout -b merge-evan 118 | $ git merge evan/master 119 | ``` 120 | 121 | この段階でめっちゃコンフリクトが起きるので頑張ってうんしょうんしょと解決する。 122 | 事前に[どこが変更されているか](https://guide.elm-lang.jp/about_translation.html#%E5%8E%9F%E6%96%87%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3)を確認しておくと、変なマージをしてしまうのを防げます。 123 | 124 | typoやちょっとした変更であればこの場で変更を翻訳に反映させてしまいますが、大きな変更の場合は変更部分のみ原文に置き換え、 125 | 上部に `` と記載しておきます。 126 | あとで誰かがそこの翻訳をしてくれることでしょう。 127 | 128 | 例: 129 | 130 | ``` 131 | 134 | 135 | ここの文章は特に変わりなく昔からあるものです。 136 | 137 | 140 | 141 | 142 | This sentence is inserted anew. 143 | 144 | ``` 145 | 146 | マージ後に、`about_translation.md` の「 翻訳がベースとしているバージョンと英語版の最新バージョンとの差分」のところのURLを最新のものに変更してください。 147 | -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "An Introduction to Elm", 3 | "description": "Learn the basics of Elm. Build applications. Learn functional programming.", 4 | "author": "Evan Czaplicki", 5 | "language": "ja", 6 | "root": "book", 7 | "plugins": ["youtube","elm-repl","bulk-redirect","ga","sitemap","-sharing"], 8 | "pluginsConfig": { 9 | "bulk-redirect": { 10 | "basepath": "/", 11 | "redirectsFile": "redirects.json" 12 | }, 13 | "sitemap": { 14 | "hostname": "https://guide.elm-lang.jp/" 15 | }, 16 | "ga": { 17 | "token": "UA-131798240-1" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /book/CNAME: -------------------------------------------------------------------------------- 1 | guide.elm-lang.jp -------------------------------------------------------------------------------- /book/README.md: -------------------------------------------------------------------------------- 1 | 4 | # Elm について (はじめに) 5 | 6 | 9 | **Elm は JavaScript にコンパイルできる関数型プログラミング言語です。** ウェブサイトやウェブアプリケーションを作るのに役立ちます。Elm はシンプルであること、簡単に使えること、高品質であることを大切にしています。 10 | 11 | 18 | このガイドは以下のことを目指します。 19 | 20 | - Elm によるプログラミングの基礎を身に着けてもらうこと 21 | - **The Elm Architecture** を使ってインタラクティブなアプリケーションを作る方法をお見せすること 22 | - あらゆる言語で使える法則やパターンを重視すること 23 | 24 | 27 | 最終的にはあなたには Elm を使って素晴らしいウェブアプリをただ作れるようになるだけでなく、Elm をうまく使えるようになるための核となるアイディアやパターンを理解してもらえればと思います。 28 | 29 | 32 | Elm に対して様子見の立場である方も、Elm をちょっと試してみて実際に何かプロジェクトで使ってみると JavaScript のコードがいままでよりもうまく書けるようになっているはずです。 Elm で得られた知見はいろんなところで簡単に役立てることができます。 33 | 34 | 37 | 38 | ## Elm を知るためのサンプルコード 39 | 40 | 43 | 以下のコードは、数をインクリメント(+1)したりデクリメント(-1)したりする小さなプログラムです。 44 | 45 | ```elm 46 | import Browser 47 | import Html exposing (Html, button, div, text) 48 | import Html.Events exposing (onClick) 49 | 50 | main = 51 | Browser.sandbox { init = 0, update = update, view = view } 52 | 53 | type Msg = Increment | Decrement 54 | 55 | update msg model = 56 | case msg of 57 | Increment -> 58 | model + 1 59 | 60 | Decrement -> 61 | model - 1 62 | 63 | view model = 64 | div [] 65 | [ button [ onClick Decrement ] [ text "-" ] 66 | , div [] [ text (String.fromInt model) ] 67 | , button [ onClick Increment ] [ text "+" ] 68 | ] 69 | ``` 70 | 71 | 76 | [こちらの](https://elm-lang.org/examples/buttons)オンラインエディターで試してください。 77 | 78 | このコードは、はじめはきっと見慣れないものでしょうから、どんなことをしているかをこのあとすぐに説明します! 79 | 80 | 83 | ## なぜ関数型*言語*を採用しているか 84 | 85 | 93 | 関数型*スタイル*でプログラミングすることで、いくらかの恩恵を受けられますが、Elmのような関数型*言語*でしか得られないものがあります。 94 | 95 | - 実用上ランタイムエラーがでない 96 | - とてもわかりやすい親切なエラーメッセージ 97 | - 信頼性の高いリファクタリング 98 | - すべてのElmパッケージは自動的にセマンティックバージョニングが強制されている 99 | 100 | 103 | JSのライブラリだけではこれらすべてを保証できないでしょう。ですが言語自体の設計によって保証できるようになります!これらが保証されているおかげで、今までこんなにも**自信**を持ってプログラミングできたことはない、と言うことがElmプログラマーには珍しくありません。自信を持って素早く機能を追加したり、数千行をリファクタリングできるようになります。それでも、何か大事なところを見落とす心配はないのです! 104 | 105 | 108 | 作者のEvanはElmを簡単に学んで使いはじめられるように多大な注力をしているので、Elmを少し試してみてぜひあなたの感想を教えてください。 109 | (訳注: elm-jpでは日本語でElmについてやりとりできるdiscordを用意していますので、ぜひ[招待リンク](https://discordapp.com/invite/4j2MxCg)から参加して感想をお聞かせください) 110 | 111 | Elmによって楽しく新鮮な感動を覚えていただけると幸いです。 112 | -------------------------------------------------------------------------------- /book/SUMMARY.md: -------------------------------------------------------------------------------- 1 | 4 | # 目次 5 | 6 | 49 | * [翻訳について](about_translation.md) 50 | * [はじめに](README.md) 51 | * [言語の基礎](core_language.md) 52 | * [The Elm Architecture](architecture/README.md) 53 | * [ボタン](architecture/buttons.md) 54 | * [テキストフィールド](architecture/text_fields.md) 55 | * [フォーム](architecture/forms.md) 56 | * [型](types/README.md) 57 | * [型を読む](types/reading_types.md) 58 | * [型エイリアス](types/type_aliases.md) 59 | * [カスタム型](types/custom_types.md) 60 | * [パターンマッチ](types/pattern_matching.md) 61 | * [エラーハンドリング](error_handling/README.md) 62 | * [Maybe](error_handling/maybe.md) 63 | * [Result](error_handling/result.md) 64 | * [コマンドとサブスクリプション](effects/README.md) 65 | * [HTTP](effects/http.md) 66 | * [JSON](effects/json.md) 67 | * [Random](effects/random.md) 68 | * [Time](effects/time.md) 69 | * [インストール](install/README.md) 70 | * [コードエディター](install/editor.md) 71 | * [Elm](install/elm.md) 72 | * [JavaScriptとの相互運用](interop/README.md) 73 | * [フラグ](interop/flags.md) 74 | * [ポート](interop/ports.md) 75 | * [カスタムエレメンツ](interop/custom_elements.md) 76 | * [制限事項](interop/limits.md) 77 | * [Webアプリケーション](webapps/README.md) 78 | * [ナビゲーションする](webapps/navigation.md) 79 | * [URLをパースする](webapps/url_parsing.md) 80 | * [モジュール](webapps/modules.md) 81 | * [モジュールの構造化](webapps/structure.md) 82 | * [最適化](optimization/README.md) 83 | * [Html.lazy](optimization/lazy.md) 84 | * [Html.keyed](optimization/keyed.md) 85 | * [アセットサイズ縮小化](optimization/asset_size.md) 86 | * [次への一歩](next_steps.md) 87 | * 付録 88 | * [集合としての型](appendix/types_as_sets.md) 89 | * [型のビット表現](appendix/types_as_bits.md) 90 | * [関数の型](appendix/function_types.md) 91 | -------------------------------------------------------------------------------- /book/about_translation.md: -------------------------------------------------------------------------------- 1 | # 翻訳について 2 | 3 | この翻訳はElmの[公式ガイド](https://guide.elm-lang.org/)の内容を元に、[Elm-jpコミュニティ](https://elm-lang.jp)のメンバーによって翻訳されたものです。 4 | 5 | 入門コンテンツという性質上、この翻訳は原文に厳密なことよりも「日本語として自然で理解しやすい文章であること」「Evanが伝えたいことが原文以上に伝わりやすいようにすること」を心がけています。 6 | そのため、一部情報を足して意訳されているところもありますが、Elm-jpコミュニティによるレビューを経ているためElmの実態や原文でEvanが言わんとしていることとズレていたりすることはないはずです。 7 | 8 | ただ、やはり原著者でありElm自体の作者であるEvanの「肉声」を知りたいのであれば原著をお読みいただくことをお勧めします。 9 | 10 | ## 原文のバージョン 11 | 12 | この翻訳はできる限り英語版の更新に追従するように努めていますが、ボランティアで運営されているため更新が追いつかないこともあります。 13 | [翻訳がベースとしているバージョンと英語版の最新バージョンとの差分](https://github.com/evancz/guide.elm-lang.org/compare/a6030f9968724629c374b936c552d2b8d2b30f31...master)をご確認ください。 14 | 15 | "There isn’t anything to compare." と表示されていれば翻訳が最新の英語版に対応していることを意味します。 16 | 17 | ## 翻訳に貢献するには 18 | 19 | Elm guide の翻訳に貢献してくださる方を募集しています。 20 | がっつりした翻訳作業だけでなく、この日本語版を読んでいる中で「ここの日本語の意味がわからない」と思った部分をご報告いただくだけでもとてもありがたいです。 21 | Elm guide は初学者の方にも分かることを重視したドキュメントなので、「自分のElmに関する知識が足りないからだ」と思わずに、「自分がわからないということは他の初学者もわからないに違いない」と圧倒的他責精神で [githubリポジトリのissue](https://github.com/elm-jp/guide/issues) としてどんどんご報告ください。 22 | 23 | 翻訳への貢献に関するより詳しい話は[githubリポジトリ](https://github.com/elm-jp/guide/#readme)をご参照ください。 24 | 25 | ## カタカナ語の採用基準について 26 | 27 | 英単語をそのままカタカナにしたいわゆる「カタカナ語」は、以下の基準で採用しています。 28 | 29 | * 日本語訳が浸透している用語はカタカナ語にしない 30 | * 日本語訳よりもカタカナ語が十分に浸透していてグーグラビリティなども高い場合は無理に日本語訳をせずにカタカナ表記にする 31 | * カタカナ語としても日本語としてもあまり浸透しておらず、パッと見で意味が分かる日本語訳もない場合はカタカナ語を推奨する 32 | 33 | ## 訳語対応表 34 | 35 | この翻訳プロジェクトで使う訳語と元の英単語の対応を表に表しました。 36 | 学習にお役立てください。 37 | 38 | 51 | 52 | 53 | | 訳語 | 原文 | 54 | |:-----------------:|:---------------:| 55 | | 型エイリアス | type alias | 56 | | オブジェクト指向 | object oriented | 57 | | テキストフィールド| text field | 58 | | カスタム型 | custom type | 59 | | パターンマッチ | pattern match | 60 | | 相互運用 | interop | 61 | | カスタムエレメンツ| custom element | 62 | | パース | parsing | 63 | | パースする | parse | 64 | | バリアント | variant | 65 | | パターンマッチ | pattern matching | 66 | | 補助関数 | helper function | 67 | | アセット | asset | 68 | | ミニファイ | minify | 69 | | コマンド | Command | 70 | | サブスクリプション | Subscription | 71 | | 型注釈 | type annotation | 72 | | タプル | tuple | 73 | | レコード | record | 74 | | レコードコンストラクター | record constructor | 75 | | 無名関数 | anonymous function | 76 | | 予約語 | keyword | 77 | | 構造的部分型 | structural typing | 78 | | 制約付き型変数 | constrained type variable | 79 | | 部分関数 | partial function | 80 | | 属性 | attribute | 81 | | ハンドラー | handler | 82 | | インタラクティブ | interactive | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /book/architecture/README.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | # The Elm Architecture 6 | 7 | 10 | 11 | The Elm Architecture は、ウェブアプリケーションやゲームのような、対話的なプログラムを設計するためのパターンです。 12 | 13 | 16 | 17 | このアーキテクチャは、Elmの歴史の中から自然に生まれてきました。誰かがこれを「発明した」というより、コードの中にこの基本的なパターンが常にあることを初期のElmプログラマが発見したということです。示し合わせたわけでもないのに、誰でもコードをよりよく設計できるパターンが現れてくるなんて、なんだかちょっと不気味ですね! 18 | 19 | 22 | 23 | そして、The Elm Architecture はElmでは簡単ですが、どんなフロントエンドプロジェクトにおいても便利なものです。実のところReduxのようなプロジェクトはThe Elm Architecture に着想を得て作られたものなので、このパターンの派生をすでに見たことがある人もいるかもしれません。もしまだ実際のプロジェクトでElmを使うことができないとしても、Elmを使いこのパターンを修得することで得るものは多いでしょう。 24 | 25 | 26 | 29 | 30 | ## 基本的なパターン 31 | 32 | 35 | 36 | Elm のプログラムが動く仕組みを図にすると、こんな風になります。 37 | 38 | 41 | 42 | ![The Elm Architectureの図](buttons.svg) 43 | 44 | 47 | 48 | Elm が画面に表示するためのHTMLを出力し、コンピュータは画面の中で起きたこと、例えば「ボタンがクリックされたよ!」というようなメッセージを Elm へ送り返します。 49 | 50 | 53 | 54 | さて、Elm プログラムの中では何が起きているのでしょうか? Elm では、プログラムは必ず3つのパーツに分解できます。 55 | 56 | 61 | 62 | * **Model** — アプリケーションの状態 63 | * **View** — 状態を HTML に変換する方法 64 | * **Update** — メッセージを使って状態を更新する方法 65 | 66 | 69 | 70 | この3つのコンセプトこそ、**The Elm Architecture** の核心なのです。 71 | 72 | 75 | 76 | 次の節からは、ボタンやテキストフィールドといったユーザー入力を例にして、The Elm Architecture の使い方を見ていきます。これらの例を見れば、The Elm Architecture のコンセプトをしっかりと理解できるはずです! 77 | 78 | 79 | 82 | 83 | ## 本書を読み進めるためにあたって 84 | 85 | 92 | 93 | この章に出てくる例は、どれもオンラインエディタで閲覧、編集することができます。 94 | 95 | [![オンラインエディタ](try.png)](https://elm-lang.org/try) 96 | 97 | エディタの画面では、左上にヒントが表示されています。 98 | 99 | 102 | 103 | 106 | 107 | なにかわからないことがあったときは、忘れずにヒントを見てみましょう! 108 | -------------------------------------------------------------------------------- /book/architecture/checkboxes.md: -------------------------------------------------------------------------------- 1 | # Checkboxes 2 | 3 | --- 4 | #### Follow along in the [online editor](https://elm-lang.org/examples/checkboxes). 5 | --- 6 | 7 | If you are coming from JavaScript, you may be wondering **“where are my components?”** and “how do I do parent-child communication between them?” A great deal of time and effort is spent on these questions in JavaScript, but it just works different in Elm. **We do not think in terms of components. Instead, we focus on functions.** It is a functional language after all! 8 | 9 | TODO transition 10 | 11 | Your app will probably have some options people can mess with. If something happens, should you send them an email notification? If they come across a video, should it start playing by itself? That kind of thing. So you will need to create some HTML like this: 12 | 13 | ```html 14 |
15 | 16 | 17 | 18 |
19 | ``` 20 | 21 | That will let people toggle the checkboxes, and using `