Skip to content

Instantly share code, notes, and snippets.

View ericpony's full-sized avatar

ericpony ericpony

  • University of Oxford
  • Oxford
View GitHub Profile
@xmlking
xmlking / Enum.es6.js
Last active June 25, 2019 18:09
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;
@noelwelsh
noelwelsh / FreeInvariantMonoidal.scala
Last active January 12, 2016 17:04 — forked from Fristi/FreeInvariantMonoidal.scala
Free version of Invariant functor type class + Monoidal type class
package nl.mdj
import cats.arrow.NaturalTransformation
import cats.functor.Invariant
import cats._
import cats.syntax.all._
import scala.language.higherKinds
sealed abstract class FreeInvariant[F[_], A] extends Product with Serializable {