Skip to content

Instantly share code, notes, and snippets.

View yisraelU's full-sized avatar

Yisrael Union yisraelU

  • Disney Streaming
View GitHub Profile

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!


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yisraelU
yisraelU / Parametricity.md
Created June 5, 2025 14:44 — forked from jbgi/Parametricity.md
Why I love parametricity

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:

  1. the free theorems help me reason about code: given parametricity, I know what a function can do and cannot do, based only on its type signature. Eg. given an unconstrained type variable, any value of this type that appears in positive position (output)

Integers

// `Tuple[Natural, Natural]`
case class Integer(pos: Natural, neg: Natural) { self =>
  def unary_- = copy(neg, pos)
  def + (that: Integer): Integer = Integer(self.pos + that.pos, self.neg + that.neg)
  def - (that: Integer): Integer = this + (-that)
  def * (that: Integer): Integer = Integer(
@yisraelU
yisraelU / JavaClassFileVersion.md
Created May 8, 2025 16:29 — forked from boaglio/JavaClassFileVersion.md
Java class file version

Aquele erro

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).

@yisraelU
yisraelU / Bool.scala
Created September 29, 2023 01:55 — forked from Baccata/Bool.scala
Implementation of typelevel booleans and integers using type projections
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,
package net.degoes.zio
trait Sql {
type ColumnName
type TableName
sealed trait Table[+A]
/**
* (SELECT *, "foo", table.a + table.b AS sum... FROM table WHERE cond) UNION (SELECT ... FROM table)