Programming Elixir
Elixirを使用した関数型プログラミングおよび並行処理の包括的なガイド。オブジェクト指向から関数型思考への移行、パターンマッチング、不変性、並行処理のためのアクターモデル、そしてOTPを活用した堅牢な分散システムの構築について解説します。
コース概要
📚 コンテンツ概要
エリクサーを用いた関数型および並行プログラミングの包括的なガイド。オブジェクト指向から関数型思考への移行、パターンマッチング、不変性、並行処理のためのアクターモデル、そしてOTPを活用した堅牢な分散システムの構築について扱います。
関数型プログラミングの美しさを通じて、耐障害性があり並行処理可能なシステムの構築の芸術を習得する。
著者: デイブ・トーマス
謝辞: ジョゼ・ヴァリム、コリー・ヘインズ、ブルース・テイト、ジェシカ・ケア、アントニー・イーデン、チャド・ファウラー、キン・シャイアー、キャナス・カニングハム、ポトマック・インデキシング
🎯 学習目標
- エリクサーのデータ変換モデルと従来の状態ベースのプログラミングとの違いを比較できる。
- インタラクティブなエリクサーシェル(IEx)を設定し、スクリプトやコンパイル経由でエリクサーコードを実行できる。
- マッチ演算子(
=)、ピン演算子(^)、ワイルドカード(_)を用いてデータを分解・検証できる。 - 不変性がパフォーマンスとメモリ管理に与える理論的・実践的な影響を説明できる。
- エリクサーの組み込み型(値型、システム型、コレクション型など)を識別し、活用できる。
- 変数スコープのルールと
with式を活用して、複雑なデータ変換を管理できる。 - 標準表記とキャプチャ表記(
&)の両方を使って無名関数を作成・呼び出しできる。 - パターンマッチングと再帰を使用して、モジュール内で名前付き関数を実装し、複雑なロジックを処理できる。
- ガード節とデフォルト引数を用いて関数の実行フローを制御できる。
- リストの分解と構築: ヘッド/テイルパターンマッチングを活用して、再帰的なリスト構造を走査・構築できる。
レッスン 共 10 课时 · 预计 30.0h
レッスン
Lesson
This lesson introduces Elixir as a functional language focused on data transformation, emphasizing the importance of immutability and the use of the pipe operator for clean, predictable code. Students will also learn how Elixir’s actor-based concurrency model uses isolated processes and message passing to ensure thread safety and system scalability.
This lesson introduces the functional paradigm of Elixir, focusing on the core concept of data immutability and the use of pattern matching over variable mutation. Students will learn how to perform data transformations to create new values rather than modifying existing ones, ensuring predictable and thread-safe code.
This lesson explores foundational functional programming in Elixir, focusing on anonymous and named functions, module encapsulation, and the use of the pipe operator for data transformation. Students will also learn to leverage pattern matching and the `with` expression to handle complex, multi-step logic safely and effectively.
AI019: Recursive Lists and Data Structures (Lesson 4) explores the recursive nature of linked lists in Elixir, focusing on head-tail decomposition and the implementation of custom recursive functions. Students will learn to identify base cases, utilize the cons operator, and apply recursive patterns to perform efficient list operations.
This lesson explores the differences between greedy processing with the Enum module and lazy processing with the Stream module in Elixir. Students will learn to implement the Enumerable protocol and apply these concepts to perform memory-efficient data transformations and advanced string processing.
This lesson explores advanced Elixir control flow, focusing on pattern matching with case expressions, guard clauses, and the use of the with construct for error handling. Students will also learn to manage project structures using Mix and improve code quality through professional tooling like Credo and Dialyzer.
This lesson explores how to maintain persistent state in Elixir using recursive functions and Tail-Call Optimization (TCO) to keep processes alive. Students will learn to manage process lifecycles, handle message passing, and implement deterministic communication patterns in concurrent systems.
This lesson explores the fundamentals of the Open Telecom Platform (OTP) in Elixir, focusing on how behaviors, supervision trees, and I/O messaging enable the creation of fault-tolerant, distributed applications. Students will learn to implement GenServers and leverage the Error Kernel philosophy to build robust systems that effectively manage process lifecycles and inter-node communication.
This lesson explores advanced OTP architectures and the Five-Question Framework to achieve high-reliability state management in Elixir. Students will learn to design robust supervision trees and distributed systems by systematically defining environment constraints, focal points, and fault-tolerance strategies.
This lesson explores Elixir’s metaprogramming capabilities, focusing on how the language's homoiconic nature allows source code to be treated as data via the Abstract Syntax Tree (AST). Students will learn to design extensible software using protocols and macros while evaluating how static analysis tools like Dialyzer provide type safety without sacrificing dynamic flexibility.