Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE RankNTypes #-}
module Symbolic where
data Expr
= Var -- x
| Lit Double
| BinOp BinOp Expr Expr
| UnaOp UnaOp Expr
deriving (Show, Eq)
package example.playground.ufuture;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.SettableFuture;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import java.util.concurrent.CompletableFuture;
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Mandala</title>
<style type="text/css">
html, body {
overflow: hidden;
width: 100%;
@Garciat
Garciat / di.py
Last active April 27, 2021 19:33
import inspect
from typing import Any, Dict, Iterable, List, get_type_hints
def linearize_type_hierarchy(root: type) -> Iterable[type]:
if root is object:
return
yield root
for node in inspect.getclasstree([root]):
if isinstance(node, tuple):
package example.playground;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.With;
import java.lang.reflect.Constructor;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.Arrays;
<body style="margin:0"></body>
<script src="https://gbrlgrct.com/gists/07d74ba686ce04eccb11faa44f2ae229/functional.js"></script>
<script>
'use strict';
/* Init */
const SPACEW = document.body.clientWidth;
const SPACEH = document.body.clientHeight;
package example.playground.parsec;
import lombok.EqualsAndHashCode;
import lombok.Value;
import lombok.val;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
{-# Language GADTs #-}
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
import Control.Monad
---
class Rel a where
type Delta a :: *
from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Awaitable, Generic, Generator, Iterable, \
List, Tuple, TypeVar, cast
###
T = TypeVar('T')
R = TypeVar('R')
package com.uber.playground;
import lombok.NonNull;
import lombok.SneakyThrows;
import lombok.Value;
import org.jetbrains.annotations.Nullable;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.InvocationTargetException;