# pattern matching

Published articles for pattern matching.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Diablo II, римские стратегии и Prince of Persia: что фронтенду стоит перенять у геймдева

DevFeed: [Diablo II, римские стратегии и Prince of Persia: что фронтенду стоит перенять у геймдева](<https://devfeed.tech/articles/diablo-ii-prince-of-persia-42171.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/kaspersky/articles/1078628/>)

Author: vostrik ("Лаборатория Касперского")

Published: 2026-09-17T15:12:10Z

Content type: tutorial

Language: ru

Sources: ["Лаборатория Касперского" RU](<https://devfeed.tech/sources/ru-2.md>)

Topics: [фронтенд](<https://devfeed.tech/topics/tag-39f0c170b680.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [modern web development](<https://devfeed.tech/topics/modern-web-development.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [Computer science](<https://devfeed.tech/topics/computer-science.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [frontend-554bf61ea815](<https://devfeed.tech/tags/frontend-554bf61ea815.md>), [holyjs](<https://devfeed.tech/tags/holyjs.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [tag-39f0c170b680](<https://devfeed.tech/tags/tag-39f0c170b680.md>), [tag-68e701e78517](<https://devfeed.tech/tags/tag-68e701e78517.md>)

### AI overview

This article explains how frontend developers can adapt engineering practices from game development, including isolated test environments, contracts and mocks, declarative rules, finite-state machines, event-driven design, pattern matching, behavior trees, and separating business logic from presentation.

### Source excerpt

В Diablo II характеристики навыков хранятся в обычных текстовых файлах, поэтому для изменения баланса игру не нужно пересобирать. В Prince of Persia 1989 года поведение персонажа описано через состояния и переходы, а в градостроительных стратегиях сборщик налогов сам выбирает следующее действие по набору правил. Игры давно решили многие задачи, с которыми фронтенд разбирается до сих пор. В этой статье я покажу, какие инженерные подходы из геймдева можно перенести в веб-разработку и что это дает на практике. Речь пойдет о контрактах и моках, конечных автоматах, событийной модели, pattern matching и деревьях поведения. Читать далее

## Waiting for PostgreSQL 19 - SQL Property Graph Queries (SQL/PGQ)

DevFeed: [Waiting for PostgreSQL 19 - SQL Property Graph Queries (SQL/PGQ)](<https://devfeed.tech/articles/waiting-for-postgresql-19-sql-property-graph-queries-sql-pgq-33693.md>)

Original publisher: [Read original article](<https://www.depesz.com/2026/07/31/waiting-for-postgresql-19-sql-property-graph-queries-sql-pgq/>)

Author: depesz

Published: 2026-07-31T16:57:44Z

Content type: opinion

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>), [function](<https://devfeed.tech/topics/function.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>)

Tags: [function](<https://devfeed.tech/tags/function.md>), [graph](<https://devfeed.tech/tags/graph.md>), [graphs](<https://devfeed.tech/tags/graphs.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [pg19](<https://devfeed.tech/tags/pg19.md>), [pgq](<https://devfeed.tech/tags/pgq.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [property](<https://devfeed.tech/tags/property.md>), [sql](<https://devfeed.tech/tags/sql.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [waiting](<https://devfeed.tech/tags/waiting.md>)

### AI overview

The article discusses PostgreSQL's SQL/PGQ implementation for property graph queries, including GRAPH_TABLE, graph pattern matching, and related DDL commands. It notes that the change was later rolled back and expresses the author's uncertainty about the practical benefits and usability of the syntax.

### Source excerpt

Important update This change has been rolled back. Discussion can be found here. On 16th of March 2026, Peter Eisentraut committed patch: SQL Property Graph Queries (SQL/PGQ) Implementation of SQL property graph queries, according to SQL/PGQ standard (ISO/IEC 9075-16:2023). This adds: - GRAPH_TABLE table function for graph pattern matching - DDL commands ... Continue reading "Waiting for PostgreSQL 19 - SQL Property Graph Queries (SQL/PGQ)"

## The Philosophy of Machine Learning, or: What Comes After Hegel?

DevFeed: [The Philosophy of Machine Learning, or: What Comes After Hegel?](<https://devfeed.tech/articles/the-philosophy-of-machine-learning-or-what-comes-after-hegel-40130.md>)

Original publisher: [Read original article](<https://korbonits.com/blog/2026-04-09-the-philosophy-of-machine-learning-or-what-comes-after-hegel/>)

Published: 2026-04-09T00:00:00Z

Content type: opinion

Language: en

Sources: [Alex Korbonits](<https://devfeed.tech/sources/alex-korbonits.md>)

Topics: [Automated reasoning](<https://devfeed.tech/topics/automated-reasoning.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [LLMs](<https://devfeed.tech/topics/llms.md>), [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [automated-reasoning](<https://devfeed.tech/tags/automated-reasoning.md>), [conditional-probability](<https://devfeed.tech/tags/conditional-probability.md>), [llms](<https://devfeed.tech/tags/llms.md>), [logic](<https://devfeed.tech/tags/logic.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>)

### AI overview

This opinion essay compares large language models with Kant's distinction between a priori structures and a posteriori experience. It argues that LLMs learn patterns from human text but lack reliable logical scaffolding, and presents automated reasoning systems such as SMT solvers and theorem provers as a possible complement.

### Source excerpt

A notebook entry that maps AI paradigms onto the history of Western philosophy -- from scholasticism to Hegel -- and asks what comes next when the current moment exhausts itself.

## Nice and Naughty Cases of Pattern Matching

DevFeed: [Nice and Naughty Cases of Pattern Matching](<https://devfeed.tech/articles/nice-and-naughty-cases-of-pattern-matching-23025.md>)

Original publisher: [Read original article](<https://www.javaadvent.com/2025/12/nice-and-naughty-cases-of-pattern-matching.html>)

Author: Cay Horstmann

Published: 2025-12-08T02:02:26Z

Content type: article

Language: en

Sources: [Java Advent Calendar](<https://devfeed.tech/sources/java-advent-calendar.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [2025](<https://devfeed.tech/tags/2025.md>), [article](<https://devfeed.tech/tags/article.md>), [enums](<https://devfeed.tech/tags/enums.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [expression](<https://devfeed.tech/tags/expression.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [java-language](<https://devfeed.tech/tags/java-language.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [statement](<https://devfeed.tech/tags/statement.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

This article examines Java pattern matching in switch and instanceof, explaining when it fits data-oriented programming, when it becomes an antipattern, and how it interacts with legacy behavior. It uses sealed interfaces, records, enums, and JSON values to illustrate exhaustive pattern matching.

### Source excerpt

Since Java 14, the Java switch and instanceof statements have been enhanced, in multiple phases, to support pattern matching and a "data-oriented" programming style. In this article, I explore when this programming style is beneficial, and why. I look at the sweet spot of perfect pattern usage, absolute antipatterns where it should not be used, [...] The post Nice and Naughty Cases of Pattern Matching appeared first on JVM Advent.

## Type conversion in Java - an alternative proposal for primitive type patterns

DevFeed: [Type conversion in Java - an alternative proposal for primitive type patterns](<https://devfeed.tech/articles/type-conversion-in-java-an-alternative-proposal-for-primitive-type-patterns-22013.md>)

Original publisher: [Read original article](<http://blog.joda.org/2025/10/type-conversion-in-java-alternative.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2025-10-15T06:09:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>), [Exception](<https://devfeed.tech/topics/exception.md>)

Tags: [exception](<https://devfeed.tech/tags/exception.md>), [java](<https://devfeed.tech/tags/java.md>), [javaideas](<https://devfeed.tech/tags/javaideas.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [safety](<https://devfeed.tech/tags/safety.md>)

### AI overview

The article proposes an alternative to Java's primitive type patterns in JEP 507. It distinguishes type checks from primitive type conversions and introduces type conversion casts and patterns, including a cast that throws an exception when a conversion would lose information.

### Source excerpt

A lot of good work has been done by the core Java team on patterns, providing new ways to explore data. The latest extension, in JEP 507, is the idea that primitive type patterns should be supported. Today I'm publishing an alternative approach. Primitive Types in Patterns, instanceof, and switch The current proposal is as follows: long val = createLong(); int i = (int) val; // cast long to int, potentially silently losing information switch (val) { case int j -> IO.println("Long fits in an int"); case long v -> IO.println("Long does not fit in an int"); }; I like the idea of being able to tell if a long value fits into an int without loss. But I hate the syntax. The key problem is that type patterns check the supertype/subtype relationship, and int is not a subtype of long. The result is code that doesn't seem to make sense. The official explanation is based on the notion that develoeprs use instanceof String before a cast to String all the time. Thus a parallel can be drawn to have an instanceof int before a cast to int. Effectively the aim is to extend the meaning of type patterns to cover primitive type casts, which are type conversions, not type checks. I know I am not alone in finding this argument weak, and in finding the proposed syntax highly confusing. But it took a while, and an 8 page document, to figure out exactly why. Type conversion in Java In response to the JEP and subsequent discussions, I have written up a detailed proposal for type conversion casts and type conversion patterns. These allow developers to more clearly express the difference between type checks (that check the supertype/subtype relationship) and type conversions (where primitive types are changed to a different type). The big idea is to introduce a new kind of cast, the type conversion cast that operates like a standard primitive type cast, but throws an exception when the conversion would be lossy. long val = createLong(); int i = (int) val; // cast long to int, potentially losing

## Transitioning from C and C++ to Rust: A Beginner's Guide

DevFeed: [Transitioning from C and C++ to Rust: A Beginner's Guide](<https://devfeed.tech/articles/transitioning-from-c-and-c-to-rust-a-beginner-s-guide-22268.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/10/transitioning-from-c-and-c++-to-rust.html>)

Published: 2024-10-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [C](<https://devfeed.tech/topics/c.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [beginner](<https://devfeed.tech/tags/beginner.md>), [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [c-plus-plus-to-rust](<https://devfeed.tech/tags/c-plus-plus-to-rust.md>), [c-to-rust](<https://devfeed.tech/tags/c-to-rust.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [enums](<https://devfeed.tech/tags/enums.md>), [generics](<https://devfeed.tech/tags/generics.md>), [guide](<https://devfeed.tech/tags/guide.md>), [memory-management](<https://devfeed.tech/tags/memory-management.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [migrating-from-c-plus-plus-to-rust](<https://devfeed.tech/tags/migrating-from-c-plus-plus-to-rust.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [pointers](<https://devfeed.tech/tags/pointers.md>), [runtime-errors](<https://devfeed.tech/tags/runtime-errors.md>), [rust](<https://devfeed.tech/tags/rust.md>), [rust-for-c-developers](<https://devfeed.tech/tags/rust-for-c-developers.md>), [rust-for-c-plus-plus-programmers](<https://devfeed.tech/tags/rust-for-c-plus-plus-programmers.md>), [rust-programming](<https://devfeed.tech/tags/rust-programming.md>), [transitioning-from-c-and-c-plus-plus-to-rust-guide](<https://devfeed.tech/tags/transitioning-from-c-and-c-plus-plus-to-rust-guide.md>), [transitioning-from-c-and-c-plus-plus-to-rust-tutorial](<https://devfeed.tech/tags/transitioning-from-c-and-c-plus-plus-to-rust-tutorial.md>), [transitioning-to-rust](<https://devfeed.tech/tags/transitioning-to-rust.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

A beginner's guide to transitioning from C and C++ to Rust, focusing on Rust's ownership and borrowing model, compile-time memory-safety checks, and type-system features such as enums, pattern matching, and generics.

### Source excerpt

Introduction: As you embark on the journey from C or C++ to Rust, you'll discover a world of exciting possibilities. Rust's emphasis on safety, concurrency, and performance can significantly enhance your programming toolkit. This beginner's guide on transitioning from C and C++ to Rust will provide a structured approach to making that transition, addressing essential concepts and practical applications. Let's dive in! Step 1: Understanding Rust's Ownership Model Concept Overview: Rust's ownership model is its most distinctive feature. Unlike C and C++, where you have pointers and manual memory management, Rust uses a system of ownership with rules that the compiler checks at compile time.

## How Entropix Uses Entropy and Varentropy in Language-Model Sampling

DevFeed: [How Entropix Uses Entropy and Varentropy in Language-Model Sampling](<https://devfeed.tech/articles/what-is-entropix-doing-33440.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2024/10/10/entropix>)

Published: 2024-10-10T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [math](<https://devfeed.tech/topics/math.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [code](<https://devfeed.tech/tags/code.md>), [llms](<https://devfeed.tech/tags/llms.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>)

### AI overview

The article examines Entropix, an open-source project that changes the sampling step of small language models using entropy and varentropy signals. It explains sampling, pattern matching, and how these signals may steer generation toward lower-entropy choices, while noting that the details remain unclear.

### Source excerpt

Entropix has been getting a ton of buzz lately. With all the hype, it's hard to tell if there's anything real that's worth paying attention to.

## Pattern match Optional in Java 21

DevFeed: [Pattern match Optional in Java 21](<https://devfeed.tech/articles/pattern-match-optional-in-java-21-22012.md>)

Original publisher: [Read original article](<http://blog.joda.org/2024/02/pattern-match-optional-in-java-21.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2024-02-20T09:19:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [java](<https://devfeed.tech/tags/java.md>), [java21](<https://devfeed.tech/tags/java21.md>), [null](<https://devfeed.tech/tags/null.md>), [optional](<https://devfeed.tech/tags/optional.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>)

### AI overview

This article presents a rarely useful technique for pattern matching an Optional in Java 21 by converting its value with orElse(null) and testing it with instanceof. It discusses functional Optional methods, an iterable helper, limitations in Java 17, and a possible use in long if-else chains.

### Source excerpt

I'm going to describe a trick to get pattern patching on Optional in Java 21, but one you'll probably never actually use. Using Optional As of Java 21, Pattern matching in Java allows us to check a value against a type like an instanceof with a new variable being declared of the correct type. Pattern matching can handle simple types and the deconstruction of records. But pattern matching of arbitrary classes like Optional is not yet supported. (Work to support pattern match methods is ongoing). In normal code, the best way to use Optional is with one of the functional methods: var addressOpt = findAddress(personId); var addressStr = addressOpt .map(address -> address.format()) .orElse("No address available"); This works well in most cases. But sometimes you want to use the Optional with a return statement. This results in code using get() like this: var addressOpt = findAddress(personId); if (addressOpt.isPresent()) { // early return if address found return addressOpt.get().format(); } // lots of other code to handle case when address not found One way to improve this is to write a simple method: /** * Converts an optional to an iterable for use in the for-each statement. * * @param &ltlT> the type of optional element * @param optional the optional * @return an iterable representation of the optional */ public static &ltlT> Iterable&ltlT> inOptional(Optional&ltlT> optional) { return optional.isPresent() ? List.of(optional.get()): List.of(); } Which allows the following neat form: for (var address : inOptional(findAddress(personId))) { // early return if address found return address.format(); } // lots of other code to handle case when address not found This is a great approach providing that you don't need an else branch. Using Optional with Pattern matching With Java 21 and pattern matching we have a new way to do this! if (findAddress(personId).orElse(null) instanceof Address address) { // early return if address found return address.format(); } else { // lots of

## Class Modifiers in Dart: Sealed, Interface, Base

DevFeed: [Class Modifiers in Dart: Sealed, Interface, Base](<https://devfeed.tech/articles/class-modifiers-in-dart-sealed-interface-base-23989.md>)

Original publisher: [Read original article](<https://quickbirdstudios.com/blog/flutter-dart-class-modifiers/>)

Author: Marvin März

Published: 2023-06-23T11:29:43Z

Content type: tutorial

Language: en

Sources: [QuickBird Studios Blog](<https://devfeed.tech/sources/quickbird-studios-blog.md>)

Topics: [Dart](<https://devfeed.tech/topics/dart.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [dart](<https://devfeed.tech/tags/dart.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [oop](<https://devfeed.tech/tags/oop.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [post](<https://devfeed.tech/tags/post.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>)

### AI overview

This tutorial explains Dart 3 class modifiers, including the newly introduced sealed, interface, final, and base modifiers and changes to existing modifiers. It describes how modifiers control whether classes can be extended, mixed in, constructed, or implemented, and discusses their practical use cases.

### Source excerpt

With Dart 3 the class modifiers sealed, interface, final and base were introduced into the Dart language. They also updated how existing ones work. In this article, we show you why this change was made and how those new modifiers work. The post Class Modifiers in Dart: Sealed, Interface, Base appeared first on QuickBird Studios.

## Migrating to Dart 3 and null safety

DevFeed: [Migrating to Dart 3 and null safety](<https://devfeed.tech/articles/migrating-to-dart-3-and-null-safety-31882.md>)

Original publisher: [Read original article](<https://okmanideep.me/migrating-to-dart-3-and-null-safety/>)

Author: Manideep Polireddi

Published: 2023-05-12T17:00:00Z

Content type: tutorial

Language: en

Sources: [@okmanideep](<https://devfeed.tech/sources/okmanideep.md>)

Topics: [Dart](<https://devfeed.tech/topics/dart.md>), [Flutter](<https://devfeed.tech/topics/flutter.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [Script](<https://devfeed.tech/topics/script.md>), [Tech Debt](<https://devfeed.tech/topics/tech-debt.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>)

Tags: [dart](<https://devfeed.tech/tags/dart.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [migrate](<https://devfeed.tech/tags/migrate.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [script](<https://devfeed.tech/tags/script.md>), [tech-debt](<https://devfeed.tech/tags/tech-debt.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>)

### AI overview

A practical guide to gradually migrating an existing Flutter codebase to Dart 3 and sound null safety. It describes adding null-safety markers, using pull-request checks to guide incremental conversion, identifying untouched files for migration, and handling large difficult files as technical debt.

### Source excerpt

Dart 3 is here, but we cannot adopt it unless our entire codebase is null safe. Here are few strategies we have been using to slowly migrate our codebase

## Bean Machine Retrospective, part 9

DevFeed: [Bean Machine Retrospective, part 9](<https://devfeed.tech/articles/bean-machine-retrospective-part-9-38667.md>)

Original publisher: [Read original article](<https://ericlippert.com/2023/03/21/bean-machine-retrospective-part-9/>)

Author: ericlippert

Published: 2023-03-21T18:34:38Z

Content type: opinion

Language: en

Sources: [Eric Lippert](<https://devfeed.tech/sources/eric-lippert.md>)

Topics: [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [Python](<https://devfeed.tech/topics/python.md>), [function](<https://devfeed.tech/topics/function.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [class](<https://devfeed.tech/topics/class.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [F#](<https://devfeed.tech/topics/fsharp.md>), [Scala](<https://devfeed.tech/topics/scala.md>)

Tags: [debugging](<https://devfeed.tech/tags/debugging.md>), [function](<https://devfeed.tech/tags/function.md>), [object](<https://devfeed.tech/tags/object.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [python](<https://devfeed.tech/tags/python.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

### AI overview

This retrospective describes implementing concise pattern matching in Python, where patterns are represented as predicates and can return structured failure information for debugging. It also develops a type discipline and combinators for matching values, types, lists, and object attributes.

### Source excerpt

I wanted to implement concise "pattern matching" in Python, a language which unlike C#, F#, Scala, and so on, does not have any pattern matching built in. Logically a pattern is just a predicate: a function which takes a value ... Continue reading ->

## Pattern matching on error codes

DevFeed: [Pattern matching on error codes](<https://devfeed.tech/articles/pattern-matching-on-error-codes-21719.md>)

Original publisher: [Read original article](<https://oleb.net/2023/catch-error-code/>)

Author: Ole Begemann

Published: 2023-02-27T19:32:22Z

Content type: article

Language: en

Sources: [Ole Begemann](<https://devfeed.tech/sources/ole-begemann.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Code](<https://devfeed.tech/topics/code.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [operator](<https://devfeed.tech/tags/operator.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [swift](<https://devfeed.tech/tags/swift.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

This article explains why Swift allows concise pattern matching against Foundation error codes. Foundation overloads the ~= operator to compare error values with error codes, rather than relying on special compiler behavior. The technique applies to CocoaError, URLError, POSIXError, and MachError.

### Source excerpt

Foundation overloads the pattern matching operator ~= to enable matching against error codes in catch clauses. catch clauses in Swift support pattern matching, using the same patterns you'd use in a case clause inside a switch or in an if case ... statement. For example, to handle a file-not-found error you might write: import Foundation do { let fileURL = URL(filePath: "/abc") // non-existent file let data = try Data(contentsOf: fileURL) } catch let error as CocoaError where error.code == .fileReadNoSuchFile { print("File doesn't exist") } catch { print("Other error: \(error)") } This binds a value of type CocoaError to the variable error and then uses a where clause to check the specific error code. However, if you don't need access to the complete error instance, there's a shorter way to write this, matching directly against the error code: let data = try Data(contentsOf: fileURL) - } catch let error as CocoaError where error.code == .fileReadNoSuchFile { + } catch CocoaError.fileReadNoSuchFile { print("File doesn't exist") Foundation overloads ~= I was wondering why this shorter syntax works. Is there some special compiler magic for pattern matching against error codes of NSError instances? Turns out: no, the answer is much simpler. Foundation includes an overload for the pattern matching operator ~= that matches error values against error codes.1 The implementation looks something like this: public func ~= (code: CocoaError.Code, error: any Error) -> Bool { guard let error = error as? CocoaError else { return false } return error.code == code } The actual code in Foundation is a little more complex because it goes through a hidden protocol named _ErrorCodeProtocol, but that's not important. You can check out the code in the Foundation repository: Darwin version, swift-corelibs-foundation version. This matching on error codes is available for CocoaError, URLError, POSIXError, and MachError (and possibly more types in other Apple frameworks, I haven't checked). I w

## 3.17.0 Release with Computed Columns, Audit Columns, Pattern Matching, Reactive Transactions and Kotlin Coroutine Support

DevFeed: [3.17.0 Release with Computed Columns, Audit Columns, Pattern Matching, Reactive Transactions and Kotlin Coroutine Support](<https://devfeed.tech/articles/3-17-0-release-with-computed-columns-audit-columns-pattern-matching-reactive-transactions-and-kotlin-coroutine-support-28926.md>)

Original publisher: [Read original article](<https://blog.jooq.org/3-17-0-release-with-computed-columns-audit-columns-pattern-matching-reactive-transactions-and-kotlin-coroutine-support/>)

Author: lukaseder

Published: 2022-06-22T15:15:05Z

Content type: release

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [releases](<https://devfeed.tech/topics/releases.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>)

Tags: [audit-columns](<https://devfeed.tech/tags/audit-columns.md>), [client-side-computed-columns](<https://devfeed.tech/tags/client-side-computed-columns.md>), [computed-columns](<https://devfeed.tech/tags/computed-columns.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [implicit-join](<https://devfeed.tech/tags/implicit-join.md>), [java-17](<https://devfeed.tech/tags/java-17.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-3-17](<https://devfeed.tech/tags/jooq-3-17.md>), [jooq-development](<https://devfeed.tech/tags/jooq-development.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [r2dbc](<https://devfeed.tech/tags/r2dbc.md>), [reactive-programming](<https://devfeed.tech/tags/reactive-programming.md>), [reactive-transactions](<https://devfeed.tech/tags/reactive-transactions.md>), [release](<https://devfeed.tech/tags/release.md>), [release-notes](<https://devfeed.tech/tags/release-notes.md>), [sql](<https://devfeed.tech/tags/sql.md>), [stored](<https://devfeed.tech/tags/stored.md>), [stored-computed-column](<https://devfeed.tech/tags/stored-computed-column.md>), [udt](<https://devfeed.tech/tags/udt.md>), [virtual](<https://devfeed.tech/tags/virtual.md>), [virtual-computed-column](<https://devfeed.tech/tags/virtual-computed-column.md>)

### AI overview

The jOOQ 3.17.0 release adds client-side computed columns for read and write operations, audit columns, pattern-matching SQL transformations, and more implicit JOIN capabilities. It also sets Java 17 as the baseline for the Open Source Edition while commercial distributions continue supporting Java 8 and 11.

### Source excerpt

This release contiues the work from previous releases around more sophisticated SQL transformation capabilities, including: Client side computed columns for both read and write operations Audit columns Pattern matching SQL transformations More implicit JOIN capabilities Client side computed columns A ground breaking new core feature available in all commercial distributions isthe new client side computed ... Continue reading 3.17.0 Release with Computed Columns, Audit Columns, Pattern Matching, Reactive Transactions and Kotlin Coroutine Support ->

## Haskell 101 Lecture Notes

DevFeed: [Haskell 101 Lecture Notes](<https://devfeed.tech/articles/haskell-101-lecture-notes-27923.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/lectures/2022-05-04-lecture.html>)

Published: 2022-05-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [function](<https://devfeed.tech/tags/function.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>)

### AI overview

Haskell 101 lecture notes introducing functions, function abstraction and application, expressions, values, types, algebraic data types, construction and deconstruction, pattern matching, polymorphism, and type constructors.

### Source excerpt

Contents 1 Functions, Computations: Abstraction and application 2 Expressions, Values, Types 3 ADTs, Construction, Deconstruction 4 Polymorphism 5 Non-nullary type constructors, Kinds 1 Functions, Computations: Abstraction and application What is a function? f(x) = 4x + 2? And what's function application? f(x) = 4x + 2 f(5) = ? In mathematics, function application is the act of applying a function to an argument from its domain so as to obtain the corresponding value from its range. In this sense, function application can be thought of as the opposite of function abstraction. In functional programming languages, computations are based on function abstraction and application. An abstraction, a.k.a a function, is denoted through the lambda notation (\x -> ...). An application, a.k.a function application, is denoted by juxtaposition: an expression followed by another expression represents the application of the first expression to the following one. f = \x -> 4 * x + 2 -- `f` is an abstraction f 5 -- application of `f` to `5` 2 Expressions, Values, Types Haskell is a purely functional programming language. As such, all computations are done via the evaluation of expressions (syntactic terms) to yield values (abstract entities that we regard as answers). Every value has an associated type (intuitively, we can think of types as sets of values). 5 :: Integer 'a' :: Char inc :: Integer -> Integer [1,2,3] :: [Integer] ('b', 4) :: (Char, Int) sum [1,2,3] :: Integer inc 5 :: Integer sum :: [Integer] -> Integer The :: can be read "has type". All expression evaluate to a value, and all values have types, which means all expressions have types too. Above are some of the common types. Which of the following are expressions, and which are values? What are the types of the expressions? product [1,2,3] product [1,2,3] They are all expressions, and only the first two are values. The first one is a function abstraction, which is a value, the second one is a value constructed with the

## Advent of Kotlin Solutions

DevFeed: [Advent of Kotlin Solutions](<https://devfeed.tech/articles/advent-of-kotlin-solutions-39189.md>)

Original publisher: [Read original article](<https://kt.academy/article/advent-2021-solutions>)

Published: 2022-01-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [clustering](<https://devfeed.tech/topics/clustering.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [clustering](<https://devfeed.tech/tags/clustering.md>), [json](<https://devfeed.tech/tags/json.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [recursion](<https://devfeed.tech/tags/recursion.md>), [sealed-class](<https://devfeed.tech/tags/sealed-class.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article presents Kotlin solutions for Advent of Kotlin 2021 exercises, including JSON stringification, generating well-formed parentheses, tree algorithms, and k-means clustering. It discusses recursion, sealed classes, smart casting, and Kotlin functions used in the solutions.

### Source excerpt

Solutions to the Advent of Kotlin!

## Row pattern recognition with MATCH\_RECOGNIZE

DevFeed: [Row pattern recognition with MATCH\_RECOGNIZE](<https://devfeed.tech/articles/row-pattern-recognition-with-match-recognize-8664.md>)

Original publisher: [Read original article](<https://trino.io/blog/2021/05/19/row_pattern_matching.html>)

Author: Kasia Findeisen (kasiafi)

Published: 2021-05-19T00:00:00Z

Content type: article

Language: en

Sources: [Trino Blog](<https://devfeed.tech/sources/trino-blog.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [blog-post](<https://devfeed.tech/tags/blog-post.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [sql](<https://devfeed.tech/tags/sql.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [trends](<https://devfeed.tech/tags/trends.md>)

### AI overview

This blog post introduces SQL row pattern matching with MATCH_RECOGNIZE, supported by Trino since version 356. It explains how regular-expression-like patterns can match sequences of table rows and produce detailed or summary information for later query processing.

### Source excerpt

The MATCH_RECOGNIZE syntax was introduced in the latest SQL specification of 2016. It is a super powerful tool for analyzing trends in your data. We are proud to announce that Trino supports this great feature since version 356. With MATCH_RECOGNIZE, you can define a pattern using the well-known regular expression syntax, and match it to a set of rows. Upon finding a matching row sequence, you can retrieve all kinds of detailed or summary information about the match, and pass it on to be processed by the subsequent parts of your query. This is a new level of what a pure SQL statement can do. This blog post gives you a taste of row pattern matching capabilities, and a quick overview of the MATCH_RECOGNIZE syntax.

## Sealed goodies coming in Kotlin 1.5

DevFeed: [Sealed goodies coming in Kotlin 1.5](<https://devfeed.tech/articles/sealed-goodies-coming-in-kotlin-1-5-27082.md>)

Original publisher: [Read original article](<https://zsmb.co/sealed-goodies-coming-in-kotlin-1-5/>)

Author: Márton Braun

Published: 2021-01-19T14:00:00Z

Content type: article

Language: en

Sources: [zsmb.co](<https://devfeed.tech/sources/zsmb-co.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [classes](<https://devfeed.tech/tags/classes.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [marton-braun](<https://devfeed.tech/tags/marton-braun.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [preview](<https://devfeed.tech/tags/preview.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-classes](<https://devfeed.tech/tags/sealed-classes.md>), [zsmb](<https://devfeed.tech/tags/zsmb.md>), [zsmb-co](<https://devfeed.tech/tags/zsmb-co.md>), [zsmb13](<https://devfeed.tech/tags/zsmb13.md>), [zsmbco](<https://devfeed.tech/tags/zsmbco.md>)

### AI overview

This article explains Kotlin sealed classes and previews planned Kotlin 1.5 improvements, including relaxed inheritance restrictions and the introduction of sealed interfaces. It also discusses interoperability with newer Java sealed constructs.

### Source excerpt

Kotlin 1.5 will bring exciting new features, among them improvements to sealed classes and an introduction of sealed interfaces. Let's take a look at what that will look like!

## PostgreSQL Data Types: Text Processing

DevFeed: [PostgreSQL Data Types: Text Processing](<https://devfeed.tech/articles/postgresql-data-types-text-processing-34594.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2018/04/postgresql-data-types-text-processing/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2018-04-11T21:15:42Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [CSV](<https://devfeed.tech/topics/csv.md>)

Tags: [csv](<https://devfeed.tech/tags/csv.md>), [dataset](<https://devfeed.tech/tags/dataset.md>), [functions](<https://devfeed.tech/tags/functions.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [processing](<https://devfeed.tech/tags/processing.md>), [regexp](<https://devfeed.tech/tags/regexp.md>), [regular](<https://devfeed.tech/tags/regular.md>), [text](<https://devfeed.tech/tags/text.md>)

### AI overview

This tutorial introduces PostgreSQL text-processing functions and operators, including string functions, aggregates, regular expressions, and regexp_split_to_table(). It also discusses text and varchar data types and demonstrates processing comma-separated and hierarchical values in a CSV dataset.

### Source excerpt

Continuing our series of PostgreSQL Data Types today we're going to introduce some of the PostgreSQL text processing functions. There's a very rich set of PostgreSQL functions to process text -- you can find them all in the string functions and operators documentation chapter -- with functions such as overlay(), substring(), position() or trim(). Or aggregates such as string_agg(). There are also regular expression functions, including the very powerful regexp_split_to_table(). In this article we see practical example putting them in practice.

## Rust: What I learnt so far

DevFeed: [Rust: What I learnt so far](<https://devfeed.tech/articles/rust-what-i-learnt-so-far-35463.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/rust-what-i-learnt-so-far/>)

Author: Graham King

Published: 2013-04-26T21:58:13Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [networking](<https://devfeed.tech/topics/networking.md>)

Tags: [beginners](<https://devfeed.tech/tags/beginners.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [guide](<https://devfeed.tech/tags/guide.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [rust](<https://devfeed.tech/tags/rust.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

A hands-on introduction to Rust covering installation, functions, compilation, variables, memory management, loops, file I/O, error handling, generics, pattern matching, networking, structs, SQLite, pointers, and multi-file projects. The article is based on an early Rust release and is explicitly marked as outdated for learning Rust.

### Source excerpt

"From Rust rookie to pro: A comprehensive guide for beginners"

## Seven Languages in Seven Weeks: Erlang

DevFeed: [Seven Languages in Seven Weeks: Erlang](<https://devfeed.tech/articles/seven-languages-in-seven-weeks-erlang-37840.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/seven-languages-in-seven-weeks-erlang/>)

Author: Carlos Alexandro Becker

Published: 2012-12-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [Erlang](<https://devfeed.tech/topics/erlang.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [function](<https://devfeed.tech/topics/function.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [Processes](<https://devfeed.tech/topics/processes.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [erlang](<https://devfeed.tech/tags/erlang.md>), [function](<https://devfeed.tech/tags/function.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [process](<https://devfeed.tech/tags/process.md>), [recursion](<https://devfeed.tech/tags/recursion.md>)

### AI overview

A beginner documents working through Erlang exercises from "Seven Languages in Seven Weeks," covering recursion, pattern matching, list comprehensions, regular expressions, concurrency, process monitoring, and process restarts. The author notes that some solutions may contain errors while learning the language.

### Source excerpt

So, I just bought "Seven Languages in Seven Weeks". I've read the Ruby chapter, not a big deal at all, so I skipped it. I also skip Io, Prolog and Scala (for now), and then, fall in Erlang!

## One Thing I Learned From F# (Nulls Are Bad)

DevFeed: [One Thing I Learned From F# (Nulls Are Bad)](<https://devfeed.tech/articles/one-thing-i-learned-from-f-nulls-are-bad-33390.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2012/02/29/one-thing-i-learned-from-f-nulls-are>)

Published: 2012-02-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [F#](<https://devfeed.tech/topics/fsharp.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [exceptions](<https://devfeed.tech/topics/exceptions.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [OCaml](<https://devfeed.tech/topics/ocaml.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [f-sharp](<https://devfeed.tech/tags/f-sharp.md>), [functional](<https://devfeed.tech/tags/functional.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

The author reflects on learning F# while contributing to VsVim, highlighting pattern matching, discriminated unions, and F#'s option types. The article argues that using None and Some instead of null can make invalid states explicit and reduce null-related bugs.

### Source excerpt

Recently I started contributing to VsVim, a Visual Studio plugin that emulates Vim. When he was starting the project, Jared Parsons decided to write the bulk of it in F#. He did this mostly as a chance to learn a new language but also because it's a solid first class alternative to C#. For instance, F#'s features like pattern matching and discriminated unions are a natural fit for state machines like Vim.This is my first experience with a truly functional language. For those who aren't familiar with F#, it's essentially OCaml.NET (the F# book uses OCaml for it's markup syntax), but also draws roots from Haskell. It's a big mind shift from imperative and pure object oriented languages, but one I'd definitely recommend to any developer who wants to be better.Since I've been working on VsVim, I've been using F# in my spare time but C# in my regular day job. The longer I use F# the more I want C# to do what F# does. The biggest example is how F# handles nulls.In C# (and Ruby, Python, and any imperative language) most values can be null, and null is a natural state for a variable to be in. In fact (partly due to SQL), null is used whenever a value is empty or doesn't exist yet. In C# and Java, null is the default value for any member reference, you don't even need to explicitly initialize it. As a result, you often end up with a lot of null pointer exceptions due to sloppy programming. After all, it's kind of hard to remember to check for null every time you use a variable.In F#, nothing is null (that's not entirely true, but in it's natural state it's true enough). Typically you'll use options instead of null. For instance, if you have a function that fails to find or calculate something you might return null in imperative languages (and the actual value if successful). However, in F# you use an option type and return None on failure and Some value on success.Here, every time you call find(kittens) you get back an option type. This type isn't a string, so you can't just