ultramagnetic's Avatar

ultramagnetic

@ultramagn3tic

Lead Developer at Scott Logic by day, Architecturally curious, techno freak by night. Creator of Higher-Kinded-J https://higher-kinded-j.github.io #higher-kinded-j #hkj #java #scala #functionalprogramming Views are frequently my own

29
Followers
134
Following
54
Posts
20.01.2025
Joined
Posts Following

Latest posts by ultramagnetic @ultramagn3tic

Preview
Release VStream: Lazy Streaming on Virtual Threads Β· higher-kinded-j/higher-kinded-j Overview This release introduces VStream, a lazy pull-based streaming type built on virtual threads with full HKT integration, adds four core resilience patterns with Effect Path integration, exten...

What if #Java had Haskell style streaming + production resilience patterns, all composable through higher-kinded types?

Higher-Kinded-J 0.3.6: VStream (lazy pipelines on virtual threads) + Circuit Breaker, Bulkhead, Retry & Saga

github.com/higher-kinded-j/higher-kinded-j/releases/tag/v0.3.6

07.03.2026 12:58 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Its learning to be more like human devs that struggle with these things

26.02.2026 12:54 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Introduction to Higher-Kinded-J - Higher-Kinded-J: Composable Effects and Advanced Optics for Java The most comprehensive functional programming library for Java. Unify error handling, optional values, and immutable data navigation with the Effect Path API and Focus DSL. Features advanced optics wi...

#Higher-Kinded-J uses #JavaPoet powered annotation processors eliminating boilerplate in #Java. Annotate a record with @GenerateLenses and get type-safe lenses, prisms, and traversals generated at compile time without runtime cost, just clean source code. higher-kinded-j.github.io/latest/home....

18.02.2026 21:07 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Functional Optics for Modern Java - Part 6 In the series finale, we move from theory to practice to ask when functional patterns actually pay for themselves. We break down Higher-Kinded-J’s architecture to demonstrate what β€˜Java-native’ FP loo...

Functional programming in Java shouldn't feel like fighting the language.

In the series finale, we look at "Higher-Kinded-J" in practice:
βœ… A 3-layer architecture for pragmatism
βœ… Spring Boot integration
βœ… Knowing when to use it

It's time for a "Java-native" FP
blog.scottlogic.com/2026/02/12/m...

12.02.2026 22:44 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Functional Optics for Modern Java - Part 6 In the series finale, we move from theory to practice to ask when functional patterns actually pay for themselves. We break down Higher-Kinded-J’s architecture to demonstrate what β€˜Java-native’ FP loo...

Functional programming in Java shouldn't feel like fighting the language.

In the series finale, we look at "Higher-Kinded-J" in practice:
βœ… A 3-layer architecture for pragmatism
βœ… Spring Boot integration
βœ… Knowing when to use it

It's time for a "Java-native" FP
blog.scottlogic.com/2026/02/12/m...

12.02.2026 22:44 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Functional Optics for Modern Java - Part 5 A unique feature of Higher-Kinded-J is uniting Optics with Effects in a fluent api. In Part 5 we dive into effect polymorphism and how effects structure our code with Higher-Kinded-J's Effect Path API...

Uniting Optics with Effects in a modern fluent Java api. In Part 5 we dive into effect polymorphism and how effects structure our code with Higher-Kinded-J's Effect Path API.

#Java #FunctionalProgramming #Optics #Effects #Programming #OpenSource

blog.scottlogic.com/2026/02/09/e...

09.02.2026 09:01 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Functional Optics for Modern Java - Part 4 This time we examine how the Focus DSL lets you express complex tree traversals and optimisations in fluent, composable chains; turning verbose recursion into declarative paths like .departments().each().employees().each().salary().

Part 4: Traversals & Pattern Rewrites.
Turn verbose tree recursion into declarative, composable paths:

.departments().each().employees().each().salary()

We build a complete expression optimiser using the Focus DSL.

blog.scottlogic.com/2026/01/30/t...

#Java #FunctionalProgramming #Optics #JVM

30.01.2026 14:27 πŸ‘ 3 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Functional Optics for Modern Java - Part 3 In Part 3 we are focusing on building an Abstract Syntax Tree (AST) for an expression language using Java 25 features and Higher-Kinded-J. We will create a complete expression language with parsing, type checking, optimisation, and interpretation that is type-safe, immutable, and easy to transform.

In Part 3 we build an Abstract Syntax Tree for an Expression Language using latest #Java and #Higher-Kinded-J #FunctionalProgramming #DOP
blog.scottlogic.com/2026/01/23/a...

23.01.2026 14:09 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Functional Optics for Modern Java - Part 2 We continue the series by diving deeper into the three core optics - lenses for product types, prisms for sum types, and traversals for collections.

In Pt2 we dive deeper into the core optics for manipulating nested data in #Java. #FunctionalProgramming blog.scottlogic.com/2026/01/16/o...

16.01.2026 15:45 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Thanks. Part 2 will be out next week

11.01.2026 10:50 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
JavaScript (No, Not That One): Modern Automation with Java Discover how modern Java has evolved into a powerful scripting language, eliminating boilerplate and enabling instant execution for automation tasks

Just published a new article on using #Java for scripting β˜•
If you’ve ever wanted to automate something quickly but didn’t feel like fighting with Bash or Python syntax… Java might be a better option than you think.

Shebangs, single-file execution, @jbang.dev and more πŸ‘‡
πŸ‘‰ tinyurl.com/h3xskenf

09.01.2026 08:17 πŸ‘ 14 πŸ” 7 πŸ’¬ 0 πŸ“Œ 2
Preview
Functional Optics for Modern Java - Part 1 Java 25 embraces immutability with records and pattern matching. When it comes to deeply nested data then pattern matching solves reading, but provides no help for writing.

This is the first of me new blog series on Functional Optics for Modern Java. We start off with The Immutability Gap: Why Java Records Need Optics blog.scottlogic.com/2026/01/09/j...
#Java #FunctionalProgramming #Optics

09.01.2026 15:24 πŸ‘ 2 πŸ” 2 πŸ’¬ 1 πŸ“Œ 0
Preview
What is Algebraic about Algebraic Effects? Compositionality can be much more than just an interface between two objects or functions. It can be a set of laws.

Algebra is the power of constraint! What is Algebraic about Algebraic Effects? share.google/a6jZSPgGQpEu...

06.01.2026 00:01 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Higher-Kinded-J 0.3.0 released!

New Effect Path API brings railway-oriented programming to Java:

Composable error handling that reads just like the business logic it represents.

Path.maybe(findUser(id))
    .toEitherPath(() -> UserNotFound)
    .via(this::validateOrder)
    .map(this::createOrder)

βœ“ 17+ Composable Path types: EitherPath, TryPath, ValidationPath...
βœ“  Unified map/via/recover across all effects with .via() and .recover()
βœ“ Focus DSL bridges effects + optics
βœ“ Spring Boot 4.0 auto-configuration
βœ“ Examples and Tutorials

One vocabulary. Clean pipelines. Errors that compose.
https://higher-kinded-j.github.io/v0.3.0/effect/ch_intro.html

Higher-Kinded-J 0.3.0 released! New Effect Path API brings railway-oriented programming to Java: Composable error handling that reads just like the business logic it represents. Path.maybe(findUser(id)) .toEitherPath(() -> UserNotFound) .via(this::validateOrder) .map(this::createOrder) βœ“ 17+ Composable Path types: EitherPath, TryPath, ValidationPath... βœ“ Unified map/via/recover across all effects with .via() and .recover() βœ“ Focus DSL bridges effects + optics βœ“ Spring Boot 4.0 auto-configuration βœ“ Examples and Tutorials One vocabulary. Clean pipelines. Errors that compose. https://higher-kinded-j.github.io/v0.3.0/effect/ch_intro.html

The new Effect Path API in Higher-Kinded-J
A single API to Unify Effects and Optics in Java.

No more nested if-checks, scattered try-catch. Just clean, flat pipelines.

find out more: higher-kinded-j.github.io/v0.3.0/effec...

#Java #Effects #Optics #FunctionalProgramming #Spring #Higher-Kinded-J

04.01.2026 16:52 πŸ‘ 3 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
The Categorical Solutions Architect: Viewing Architecture Through the Lens of Category Theory β€” Ibrahim Cesar Category theory isn't abstract nonsenseβ€”it's the formal language for the problems Solutions Architects already face. Part 1 of a series on applying mathematical foundations to real architectural challenges.

This is very interesting and thought provoking series relating software architecture to category theory ibrahimcesar.cloud/blog/categor...

27.12.2025 12:01 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

garciat.com/posts/java-t... This is excellent. Really interesting post with lots pearls to digest. I had been thinking a lot about similar things around embedded kind system for checking bounds. #java #hkt #fp

12.12.2025 00:06 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
- πŸ“¦ Simple record definitions with @GenerateFocus annotation
- πŸ”— Fluent method chaining: .hq().city().set(...)
- πŸ”„ Immutable updates that return new objects
- πŸ“‹ Collection traversal with .each().getAll()
- ✨ Bulk transformations with .modifyAll()


```java
// Define your immutable data
@GenerateFocus
record Company(String name, Address hq) {}
@GenerateFocus
record Address(String city, List<String> phones) {}

Company acme = new Company("Acme", new Address("London", List.of("555-1234", "444-4321")));

// Navigate & modify deep nested data with a fluent DSL
Company updated = CompanyFocus.hq()         // Focus on headquarters
    .city()                                  // Then the city
    .set("Newcastle", acme);                    // Immutably update

// Traverse collections effortlessly
List<String> allPhones = CompanyFocus.hq()
    .phones()
    .each()                                  // Focus on each phone
    .getAll(acme);                           // β†’ ["555-1234","444-4321"]

// Transform all elements at once
Company withAreaCode = CompanyFocus.hq()
    .phones()
    .each()
    .modifyAll(p -> "+44-" + p, acme);        // β†’ phones: ["+44-555-1234", "+44-444-4321"]
```

- πŸ“¦ Simple record definitions with @GenerateFocus annotation - πŸ”— Fluent method chaining: .hq().city().set(...) - πŸ”„ Immutable updates that return new objects - πŸ“‹ Collection traversal with .each().getAll() - ✨ Bulk transformations with .modifyAll() ```java // Define your immutable data @GenerateFocus record Company(String name, Address hq) {} @GenerateFocus record Address(String city, List<String> phones) {} Company acme = new Company("Acme", new Address("London", List.of("555-1234", "444-4321"))); // Navigate & modify deep nested data with a fluent DSL Company updated = CompanyFocus.hq() // Focus on headquarters .city() // Then the city .set("Newcastle", acme); // Immutably update // Traverse collections effortlessly List<String> allPhones = CompanyFocus.hq() .phones() .each() // Focus on each phone .getAll(acme); // β†’ ["555-1234","444-4321"] // Transform all elements at once Company withAreaCode = CompanyFocus.hq() .phones() .each() .modifyAll(p -> "+44-" + p, acme); // β†’ phones: ["+44-555-1234", "+44-444-4321"] ```

The new Focus DSL in Higher-Kinded-J makes working with deeply nested records a breeze.

check it out: higher-kinded-j.github.io/latest/optic...

#Java #FunctionalProgramming

10.12.2025 21:28 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Focus DSL - Higher-Kinded Types and Optics for Java Explore Higher-Kinded Types (HKTs) and Optcs in Java with the Higher-Kinded-J library. Learn about Functors, Applicatives, Monads, Transformers, practical functional patterns, and how to write cleaner...

🎯 New: Focus DSL for Higher-Kinded-J!

Type-safe, fluent optics for nested data:

CompanyFocus.headquarters().city()
.modify(String::toUpperCase, company);

Add @GenerateFocus to records. IDE autocomplete included!

πŸ”— higher-kinded-j.github.io/latest/optic...

#Java #FunctionalProgramming

09.12.2025 21:38 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

There is also #SpringSecurity integration and #Actuator integration examples on the website. Really interested to hear feedback from #Spring developers.

01.12.2025 22:12 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Spring Boot Integration - Higher-Kinded Types and Optics for Java Explore Higher-Kinded Types (HKTs) and Optcs in Java with the Higher-Kinded-J library. Learn about Functors, Applicatives, Monads, Transformers, practical functional patterns, and how to write cleaner, more composable Java code for your projects using Optics.

Higher-Kinded-J v0.2.3 is out!

Now with Spring Boot starter support - just add dependency:
- Either, Validated, EitherT as controller return types
- Automatic JSON serialisation
- Type-safe error handling REST

higher-kinded-j.github.io/latest/sprin...

#Java
#SpringBoot
#FunctionalProgramming

01.12.2025 21:52 πŸ‘ 2 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0
Preview
Java 25: The β€˜No-Boilerplate’ Era Begins – amritpandey.io

I would say "Less-Boilerplate" might be more accurate. Some welcome improvements though. amritpandey.io/java-25-the-...

28.11.2025 12:20 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
A New Bridge Links the Strange Math of Infinity to Computer Science | Quanta Magazine Descriptive set theorists study the niche mathematics of infinity. Now, they’ve shown that their problems can be rewritten in the concrete language of algorithms.

It's amazing how much maths distills to solving a colouring in problem. I knew all that time spent at first school colouring in was important.
www.quantamagazine.org/a-new-bridge...

26.11.2025 10:28 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Free - Higher-Kinded Types and Optics for Java Explore Higher-Kinded Types (HKTs) and Optcs in Java with the Higher-Kinded-J library. Learn about Functors, Applicatives, Monads, Transformers, practical functional patterns, and how to write cleaner, more composable Java code for your projects using Optics.

Practical Free monads in Java

higher-kinded-j shows you how to:
β€’ Build composable DSLs
β€’ Transformations as interpreters
β€’ Stack-safe (10k+ ops verified)
β€’ Test effectful code purely

Complete guide:
higher-kinded-j.github.io/monads/free_...

#Java #FunctionalProgramming #Monads #AdvancedJava

23.11.2025 14:41 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
0 o a o
Β© What's New in Higher-Kinded-J 0.2.0
Massive Optics Expansion
This release dramatically expands the optics library with 6 new optic types and dozens of utility classes:
+ Fold, Getter, Setter: New fundamental optic types for read-only queries, single-element access, and write-only modifications
+ Indexed Optics: Position-aware transformations with IndexedTraversal , IndexedFold ,and IndexedLens
+ Filtered Traversals: Compose predicates directly into optic chains with filtered() and filterBy()
+ Limiting Traversals: Focus on specific portions of lists with taking() , dropping() , takingwhile() , slicing() , etc.
+ PartsOf: Transform all focused elements as a single list with operations like sorted() , reversed() , distinct()
+ Fluent API: New operator-style API with Free Monad DSL for building composable optic programs with multiple interpreters
New Functional Programming Primitives
+ FreeMonad: Build domain-specific languages (DSLs) with stack-safe execution and multiple interpreters
+ Trampoline: Stack-safe recursion support for tail-call optimization
+ Const Functor: Phantom type parameter support for advanced type-level programming
+ Alternative Type Class: Choice and failure operations for applicative functors
Enhanced Type Classes
+ Monoid: New methods ( firstOptional() , lastOptional() , maximum() , minimum() ) and instances (Long, Double)
+ Monad: Added flatMap2-5 for sequencing multiple monadic values with effectful combining functions

0 o a o Β© What's New in Higher-Kinded-J 0.2.0 Massive Optics Expansion This release dramatically expands the optics library with 6 new optic types and dozens of utility classes: + Fold, Getter, Setter: New fundamental optic types for read-only queries, single-element access, and write-only modifications + Indexed Optics: Position-aware transformations with IndexedTraversal , IndexedFold ,and IndexedLens + Filtered Traversals: Compose predicates directly into optic chains with filtered() and filterBy() + Limiting Traversals: Focus on specific portions of lists with taking() , dropping() , takingwhile() , slicing() , etc. + PartsOf: Transform all focused elements as a single list with operations like sorted() , reversed() , distinct() + Fluent API: New operator-style API with Free Monad DSL for building composable optic programs with multiple interpreters New Functional Programming Primitives + FreeMonad: Build domain-specific languages (DSLs) with stack-safe execution and multiple interpreters + Trampoline: Stack-safe recursion support for tail-call optimization + Const Functor: Phantom type parameter support for advanced type-level programming + Alternative Type Class: Choice and failure operations for applicative functors Enhanced Type Classes + Monoid: New methods ( firstOptional() , lastOptional() , maximum() , minimum() ) and instances (Long, Double) + Monad: Added flatMap2-5 for sequencing multiple monadic values with effectful combining functions

Six new Composable Optics and a FreeMonad DSL all in the latest #higher-kinded-j release

check it out higher-kinded-j.github.io/optics/optic...

#Java #FunctionalProgramming #Monads #Optics

21.11.2025 17:54 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Bifunctor - Higher-Kinded Types and Optics for Java Explore Higher-Kinded Types (HKTs) and Optcs in Java with the Higher-Kinded-J library. Learn about Functors, Applicatives, Monads, Transformers, practical functional patterns, and how to write cleaner, more composable Java code for your projects using Optics.

πŸŽ‰ New in higher-kinded-j: Bifunctor support!

Transform both sides of your data structures with bimap, first, and second operations.
✨ Use with Either, Tuple2, Validated, and Writer
✨ Type-safe
✨ Law-verified
higher-kinded-j.github.io/functional/b...

#Java #FunctionalProgramming #TypeSafety

15.11.2025 12:08 πŸ‘ 4 πŸ” 2 πŸ’¬ 0 πŸ“Œ 1
Preview
Selective - Higher-Kinded Types and Optics for Java Explore Higher-Kinded Types (HKTs) and Optcs in Java with the Higher-Kinded-J library. Learn about Functors, Applicatives, Monads, Transformers, practical functional patterns, and how to write cleaner...

πŸš€ New Selective support in latest #higher-kinded-j releaseπŸš€
Bringing the power of conditional effects to #Java use Selective with
* Either<E, *>
* Maybe
* Optional
* List
* IO
* Reader<R, *>
* Id
* Validated<E, *>
Find out more: higher-kinded-j.github.io/functional/s...

14.11.2025 09:30 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Nice post. Lots of interesting applications of this with profunctor adapter patterns.

21.09.2025 07:17 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Understanding Contramap

Understanding Contramap

blog.rhetoricalmusings.com/posts/contra...

20.09.2025 23:03 πŸ‘ 3 πŸ” 1 πŸ’¬ 1 πŸ“Œ 1
Preview
Profunctor - Higher-Kinded Types and Optics for Java Explore Higher-Kinded Types (HKTs) and Optcs in Java with the Higher-Kinded-J library. Learn about Functors, Applicatives, Monads, Transformers, practical functional patterns, and how to write cleaner...

πŸš€ New Higher-Kinded-J 0.1.8 πŸš€
✨ Protofunctors - Transform both inputs & outputs of your functions with dimap, lmap, rmap
πŸ” Protofunctor enhanced Optics - Lens, Prism, Traversal & Iso for immutable data manipulation
Checkout the hkj-book higher-kinded-j.github.io/functional/p...
#Java #FP #Optics

10.09.2025 16:11 πŸ‘ 2 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0
Post image

Original post: mastodon.scot/@Wen/1151514...

05.09.2025 22:15 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0