Skip to content

Instantly share code, notes, and snippets.

#lang lazy
(define g
(lambda (f)
(lambda (n)
(if (= n 0)
1
(* n (f (- n 1)))))))
(define f
@jiamo
jiamo / SimpleEval.hs
Created January 30, 2021 13:39
Try to make a same type definition for mutually eval add expr
module SimpleEval where
import Prelude hiding (odd, even)
import Data.Dynamic
data Expr = Val Int | Add Expr Expr
data Cont = HALT | EVAL Expr Cont | ADD Int Cont
eval :: Expr -> Int
@jiamo
jiamo / adventofcode_2021_day8.py
Last active December 10, 2021 01:40
adventofcode-2021-day8
import os
"""
0: 1: 2: 3: 4:
aaaa .... aaaa aaaa ....
b c . c . c . c b c
b c . c . c . c b c
.... .... dddd dddd dddd
e f . f e . . f . f