This file contains 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
nums = [ | |
(lambda f, x: x), | |
(lambda f, x: f(x)), | |
(lambda f, x: f(f(x))), | |
] | |
result = 0 | |
calls = [] | |
def f(x): |
This file contains 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
class sym: | |
def __init__(self, name): | |
self.name = name | |
def __str__(self): | |
return f":{self.name}" | |
def builtin_func(name): | |
def inner(f): |
This file contains 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
from ast import ( | |
NodeTransformer, | |
arguments, | |
arg, | |
Lambda, | |
parse, | |
In, | |
Call, | |
Expression, | |
fix_missing_locations, |
This file contains 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 sys | |
from sly import Lexer, Parser # type: ignore | |
from collections.abc import Iterable | |
# lamb -> LAMB ID DOT term | |
# lamb -> appl | |
# appl -> appl term | |
# appl -> term | |
# term -> LPAR lamb RPAR | |
# term -> ID |
This file contains 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 sys | |
from sly import Lexer, Parser | |
from collections.abc import Iterable | |
# lamb -> LAMB ID DOT term | |
# lamb -> appl | |
# appl -> appl term | |
# appl -> term | |
# term -> LPAR lamb RPAR | |
# term -> ID |
This file contains 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
eval((λx.x) 1) | |
eval((λx.x)) | |
eval(1) | |
appl((λx.1), 1) => 1 | |
eval((λx.(λy.x)) 1 2) | |
eval((λx.(λy.x)) 1) | |
eval((λx.(λy.x))) | |
eval(1) | |
appl((λx.(λy.1)), 1) => (λy.1) |
This file contains 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
#!/Users/gecko/code/deployment/minsible | |
- debug: |
This file contains 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
#!/bin/sh | |
# | |
# Wrapper over ansible include tasks to make simple executable playbooks | |
# example https://gist.github.com/e39284344e3fd29b3202571678b6a343 | |
task="${PWD}/$1" | |
ansible localhost -m include_tasks -a file=$task -c local -i /dev/null |
This file contains 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
using System; | |
namespace hello | |
{ | |
// A typed primitive it narrows the type of primitive | |
class TypedPrim<T> | |
{ | |
public T Value { get; set; } | |
public static implicit operator T(TypedPrim<T> v) => v.Value; | |
public static explicit operator TypedPrim<T>(T v) => new TypedPrim<T>() { Value = v }; |
This file contains 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
from typing import * | |
import re | |
Result = Tuple[str, Any] | |
Parser = Callable[[str], Result] | |
class ParseError(Exception): | |
pass |