Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
2025-08-20 Original post.
2025-08-24 I'd like to refine the terminology used. The pattern demonstrated here is most accurately described as "polymorphism over effects, (using Higher-Kinded Types)".
It's important to distinguish this from other related concepts. Although it bears a strong resemblance to the Tagless Final pattern, this approach is distinct, and as a tight (not vendor free) integration with Kyo. Furthermore, please note that it is not "Effect Polymorphism," which is an alternate and less precise phrasing.
Thanks a lot to all of you for the valuable feedback!
2025-08-20 Original post.
2025-08-24 I'd like to refine the terminology used. The pattern demonstrated here is most accurately described as "polymorphism over effects, (using Higher-Kinded Types)".
It's important to distinguish this from other related concepts. Although it bears a strong resemblance to the Tagless Final pattern, this approach is distinct, and as a tight (not vendor free) integration with Kyo. Furthermore, please note that it is not "Effect Polymorphism," which is an alternate and less precise phrasing.
Thanks a lot to all of you for the valuable feedback!
I try to write code that is "maximally polymorphic" to the extent that I am sufficiently familiar with the concepts involved and that I am confident of being able to efficiently explain my code to co-workers if needed.
I started to use generics in Java to improve reuse of the libraries I wrote at work, but as I was growing a better understanding of types, parametricity and theorems for free, other compelling reasons became prominent:
Class has been compiled by a more recent version of the Java Environment (class file version 61.0),
this version of the Java Runtime only recognizes class file versions up to 55.0.
É quando compilamos com Java 17 (class file version 61.0) e tentamos executar com Java 11 (class file version 55.0).
| package baccata | |
| /** | |
| * Inspired from Grant Beaty's Scunits | |
| */ | |
| trait Bool { | |
| type branch[B,T <: B, E <: B] <: B // typelevel if-then-else | |
| type not <: Bool | |
| type or[R <: Bool] <: Bool | |
| type and[R <: Bool] <: Bool |
| /* | |
| * Copyright 2020-2021 Typelevel | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| package smithy4s.cats | |
| import cats.Show | |
| import cats.implicits.toContravariantOps | |
| import smithy4s.schema.{ | |
| Alt, | |
| CollectionTag, | |
| EnumValue, | |
| Field, | |
| Primitive, |