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
def curried_f(x, y=None, z=None): | |
def f(x, y, z): return x**3 + y**2 + z | |
if y is not None and z is not None: | |
return f(x, y, z) | |
if y is not None: | |
return lambda z: f(x, y, z) | |
return lambda y, z=None: f(x, y, z) if (y is not None and z is not None) else (lambda z: f(x, y, z)) |
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
data Tree a = EmptyTree | |
| Node a (Tree a) (Tree a) | |
deriving (Eq, Ord, Show) | |
simpleTree :: Tree Int | |
simpleTree = Node 1 (Node 2 EmptyTree EmptyTree) | |
(Node 3 EmptyTree EmptyTree) | |
tree1 :: Tree Int |
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
{- Based on Miran Lipovaca's RPN solver from LYAH. -} | |
import Control.Monad (forever) | |
apply :: String -> [Double] -> [Double] | |
apply "*" (x:y:ys) = (x * y):ys | |
apply "+" (x:y:ys) = (x + y):ys | |
apply "-" (x:y:ys) = (x - y):ys | |
apply "/" (x:y:ys) = (x / y):ys | |
apply "exp" (x:y:ys) = (x ** y):ys |
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
all: | |
pdflatex paper.tex | |
bib: | |
latex paper.tex && bibtex paper.aux && latex paper.tex && pdflatex paper.tex | |
clean: | |
rm -f paper.pdf | |
rm -f paper.aux | |
rm -f paper.log |
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
(define-fun is-prob ((r Real)) Bool (and (>= r 0) (<= r 1))) | |
(define-fun equi ((a Real) (b Real) (c Real) (d Real) (r Real) (s Real)) Real | |
(+ (* r s a) (* r (- 1 s) b) (* (- 1 r) s c) (* (- 1 r) (- 1 s) d))) | |
(assert | |
(forall ((x1 Real) (y1 Real) (w1 Real) (z1 Real) | |
(x2 Real) (y2 Real) (w2 Real) (z2 Real)) | |
(exists ((r Real) (s Real)) | |
(=> |
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
structure Regex = | |
struct | |
datatype regexp = | |
Zero | |
| One | |
| Char of char | |
| Times of regexp * regexp | |
| Plus of regexp * regexp | |
| Star of regexp |
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
concrete CityTur of City = open Prelude in { | |
flags | |
lexer=bind; | |
param | |
WowelType = Front | Back; | |
DefAccCase = OnlyI WowelType | SoftenCons WowelType | InsertY WowelType; | |
lincat | |
Phrase = Str; |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDB/ThJZfpaHI337U5cq56ydyg8PuoYUYfxgRkbHTIq24JLO49x6YxsyaFL2cqHZwmzLMuMQrGtOlznnc+Ud88ni6nfgHX1zztNNFZ6EzUXsEKIXqqmuQEGXWg1pLuMMRjB6qaG781K3Lrd3yjmXA8+f5/+3aLAv85cy+tVeZsF8dyAhyBq75wLj1E2kNfBcqBbZkGek4UgzSL/9MqgtTQp9vWAPpR+d8RznIf79iZo0sPmNyW0nOzPFJiMbOcbN8fEChPQv3xGM7AWzdCxY+hGlnqk/Ki3b4+7rmZ5a+j+NqLogmMABeSwwdmDzWRvUKt/yzsZ9KNAfJqZTCTfChNd tosun2@illinois.edu |
OlderNewer