This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module type GrammarFactory = { | |
| module Typ: { | |
| type t; | |
| }; | |
| module Exp: { | |
| type t; | |
| }; | |
| module Pat: { | |
| type t; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Util; | |
| [@deriving (show({with_path: false}), sexp, yojson)] | |
| type deferral_position_t = | |
| | InAp | |
| | OutsideAp; | |
| [@deriving (show({with_path: false}), sexp, yojson)] | |
| type any('e, 't, 'tp, 'r, 'a, 'p) = | |
| | Exp('e) | |
| | Pat('p) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Util | |
| module type Grammar = sig | |
| type typ [@@deriving sexp, show] | |
| type exp [@@deriving sexp, show] | |
| end | |
| module Typ (G : Grammar) = struct | |
| type t = | |
| | Int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module type Grammar = { | |
| type typ; | |
| type exp; | |
| }; | |
| module Typ = (G: Grammar) => { | |
| type t = | |
| | Int | |
| | Float | |
| | Bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Slack Variety Pack | |
| Unfilter | |
| Somebody's Gotta Win with Tara Palmeri | |
| A Life Well Wasted | |
| Behind The Tech with Kevin Scott | |
| Self-hosted Web | |
| The Tim Ferriss Show | |
| Newton's Law | |
| TED Radio Hour | |
| Work, Life, and RV Podcast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.jnape.palatable.lambda; | |
| import com.jnape.palatable.lambda.adt.hlist.HList; | |
| import com.jnape.palatable.lambda.functions.builtin.fn3.ZipWith; | |
| import com.jnape.palatable.lambda.monoid.builtin.Join; | |
| import java.util.List; | |
| import static com.jnape.palatable.lambda.adt.hlist.HList.nil; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.Date; | |
| public record Dog(String name, Date birthdate) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TransactionExample { | |
| public static void main(String[] args) { | |
| Transactor<IO<?>, Unit, String> transactor = new Transactor<>() { | |
| @Override | |
| public <A> IO<Either<String, A>> runTransactional(Transactional<IO<?>, String, Unit, A> transactional) { | |
| Unit connection = UNIT; | |
| return IO.io(() -> System.out.println("Starting Transaction")) | |
| .discardL(transactional.run(connection) | |
| .<IO<Either<String, A>>>coerce() | |
| .flatMap(e -> e.match(s -> IO.io(() -> System.err.printf("Rolling back transaction due to %s%n", s)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public sealed interface Failable<A> extends CoProduct2<List<String>, A, Failable<A>>, Monad<A, Failable<?>> { | |
| @Override | |
| default <B> Failable<B> flatMap(Fn1<? super A, ? extends Monad<B, Failable<?>>> fn1) { | |
| return match(Failed::new, fn1.fmap(Monad::coerce)); | |
| } | |
| @Override | |
| default <B> Failable<B> pure(B b) { | |
| return new Success<>(b); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Person<F extends MonadRec<?, F>> { | |
| MonadRec<Integer, F> age; | |
| MonadRec<String, F> name; | |
| public Person(MonadRec<Integer, F> age, MonadRec<String, F> name) { | |
| this.age = age; | |
| this.name = name; | |
| } | |
| public static Person<ReaderT<String, Either<String, ?>, ?>> personValidation() { |
NewerOlder