Skip to content

Instantly share code, notes, and snippets.

View bobhaffner's full-sized avatar

Bob Haffner bobhaffner

View GitHub Profile
@jayhutfles
jayhutfles / gist:ac60fd87e686dd8f82a3
Last active January 1, 2024 22:08
Scala implementation of a finite permutation group
import scala.language.implicitConversions
import scala.language.postfixOps
sealed trait Permutation[+A]
case object Id extends Permutation[Nothing]
case class Mapping[A](mappings: Map[A, A]) extends Permutation[A]
object Permutation {
def id = Id