Skip to content

Instantly share code, notes, and snippets.

View Pitometsu's full-sized avatar
🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅

Yuriy Pitomets Pitometsu

🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅
View GitHub Profile
@NaeosPsy
NaeosPsy / job.md
Last active July 25, 2019 19:57
Serokell is hiring Nix DevOps Engineers

tl;dr Serokell is hiring Nix DevOps Engineers

Hi! We’re Serokell – a company with about 30 Haskellers working on a bunch of blockchain-related projects (like Cardano or TeachMePlease). We are hiring SREs and a Head of IT Operations that can work with Nix (yay Nix!) and know some Haskell. The job is fully remote.

A bit more about us

@anandabits
anandabits / HKT.swift
Last active December 25, 2023 00:57
Emulating HKT in Swift
// This example shows how higher-kinded types can be emulated in Swift today.
// It acheives correct typing at the cost of some boilerplate, manual lifting and an existential representation.
// The technique below was directly inspired by the paper Lightweight Higher-Kinded Polymorphism
// by Jeremy Yallop and Leo White found at http://ocamllabs.io/higher/lightweight-higher-kinded-polymorphism.pdf
/// `ConstructorTag` represents a type constructor.
/// `Argument` represents an argument to the type constructor.
struct Apply<ConstructorTag, Argument> {
/// An existential containing a value of `Constructor<Argument>`
/// Where `Constructor` is the type constructor represented by `ConstructorTag`
@benshine
benshine / Model01 Keyboard01 config
Last active December 7, 2017 05:23
@keyboardio Model01 config for programer dvorak
See https://github.com/benshine/Model01-Firmware/blob/master/Model01-Firmware.ino for the current version.
@zmactep
zmactep / encodings.md
Created August 20, 2017 13:08
Number encodings

Alternative to the Church, Scott and Parigot encodings of data on the Lambda Calculus.

When it comes to encoding data on the pure λ-calculus (without complex extensions such as ADTs), there are 3 widely used approaches.

Church Encoding

The Church Encoding, which represents data structures as their folds. Using Caramel’s syntax, the natural number 3 is, for example. represented as:

0 c0 = (f x -> x)
1 c1 = (f x -> (f x))
2 c2 = (f x -&gt; (f (f x)))
@n4to4
n4to4 / circe_shapes.scala
Last active August 2, 2019 11:18
coproduct json = circe + shapeless
// https://stackoverflow.com/questions/44309520/my-coproduct-encoding-is-ambiguous
import io.circe._, io.circe.generic.semiauto._
import io.circe.shapes._, io.circe.syntax._
import shapeless._, shapeless.union._, shapeless.syntax.singleton._
object Main extends App {
object model {
case class A(a: String)
case class B(a: String, i: Int)
@maestrow
maestrow / post.md
Last active April 16, 2025 04:24
Теория категорий в программировании
@lexi-lambda
lexi-lambda / Main.hs
Last active December 21, 2024 10:20
Minimal Haskell implementation of Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Language.HigherRank.Main
( Expr(..)
, EVar(..)
, Type(..)
, TVar(..)
, TEVar(..)
, runInfer
) where
@bbarker
bbarker / scala_debugging_tricks.md
Last active July 13, 2021 17:30
SBT and JVM Debugging tricks

IntelliJ and recursive data structures

You may need to override toString on any recursive or deeply-nested data structure, since IntelliJ will ask the Java Debugger (JDB) to call toString all the time. This will blow up your memory.

Remote debugging

Useful for any number of reasons: testing on a different OS, using lots of memory/cpu resources you don't have locally, etc.

See an Intellij / IDEA guide for background.

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@Icelandjack
Icelandjack / Constraints.org
Last active April 2, 2024 20:22
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.