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
{-# Language DataKinds #-} | |
{-# Language GADTs #-} | |
{-# Language KindSignatures #-} | |
{-# Language NoImplicitPrelude #-} | |
{-# Language StandaloneDeriving #-} | |
{-# Language TypeFamilies #-} | |
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} | |
module Vect where |
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 StackExpr where | |
data Instr | |
= Const Integer | |
| Add | |
| Sub | |
| Mul | |
| Neg | |
| Abs | |
| Sig |
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.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.*; | |
// Scott encoding of a Haskell's Maybe | |
interface Maybe<T> { | |
<R> R match(Supplier<R> nothing, Function<T, R> just); |

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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Videogram</title> | |
<style>html,body{margin:0;height:100%;}</style> | |
</head> | |
<body> | |
<video src="https://dl11.webmfiles.org/big-buck-bunny_trailer.webm" style="display:none" autoplay loop></video> | |
<script defer> |
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 Data.Maybe (catMaybes) | |
import qualified Data.Set as Set | |
(|>) = flip ($) | |
between :: Ord a => a -> (a, a) -> Bool | |
between x (a, b) = a <= x && x <= b | |
class Clamp a where | |
clampedBy :: a -> (a, a) -> a |
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 Control.Monad (guard, when) | |
import Data.Array (Array, (!), (//), bounds, listArray) | |
import System.Console.ANSI | |
import System.IO (stdin, hReady) | |
import System.Random | |
import System.Timeout (timeout) | |
import Debug.Trace | |
data Pos | |
= Pos |
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.company; | |
import java.util.Optional; | |
import java.util.function.Function; | |
class Validity { } | |
class Valid extends Validity { } |
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
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
import Control.Arrow | |
import Control.Monad | |
import Data.Array | |
import Data.Function | |
import Data.List | |
import Data.Maybe | |
import System.Environment |