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
#lang typed/racket | |
(require/typed racket/base [list (All (a) Float)]) | |
(* 3.3 list) |
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
#lang typed/racket | |
(define-type (Even A) (U Null (Pairof A (Odd A)))) | |
(define-type (Odd A) (Pairof A (Even A))) | |
(: even-lst (Even Integer)) | |
(define even-lst '(1 2 3 4)) | |
(: odd-lst (Odd Integer)) | |
(define odd-lst '(1 2 3)) |
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
default-load-handler: cannot open module file | |
module path: #<path:/home/asumu/plt/racket-tmp/collects/racket/match/match.rkt> | |
path: /home/asumu/plt/racket-tmp/collects/racket/match/compiled/match_rkt.zo | |
system error: No such file or directory; errno=2 | |
context...: | |
standard-module-name-resolver | |
/home/asumu/plt/racket-tmp/collects/racket/match/match.rkt: [traversing imports] | |
/home/asumu/plt/racket-tmp/collects/racket/match.rkt: [traversing imports] | |
/home/asumu/plt/racket-tmp/collects/compiler/cm.rkt:372:0: compile-zo* | |
/home/asumu/plt/racket-tmp/collects/compiler/cm.rkt:579:26 |
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
$ racket -I typed/racket | |
Welcome to Racket v5.3.4.12. | |
-> (require typed/framework) | |
-> (require typed/racket/gui) | |
-> ((inst canvas:wide-snip-mixin #:row (init [parent (Instance Dialog%)] [editor (Instance Text:Basic%)])) editor-canvas%) | |
; wide-snip-mixin: argument class does not implement interface | |
; argument: #<class:editor-canvas%> | |
; interface name: #<interface:basic<%>> | |
; [,bt for context] |
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
raco setup: undeclared dependency detected | |
for package: "optimization-coach" | |
on packages: | |
"drracket" | |
"gui-lib" | |
"images" | |
"sandbox-lib" | |
"string-constants-lib" | |
"typed-racket-lib" | |
"unstable-list-lib" |
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
-> (set-first (set-add s (lambda (x) 3))) | |
; s: broke its contract | |
; promised a procedure that accepts 1 mandatory argument without any keywords | |
; produced: 2 | |
; in: the range of | |
; a disjunct of | |
; the set-first method of | |
; the range of | |
; a disjunct of | |
; the set-add method of |
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
-> (set-member? s 3) | |
; s: contract violation | |
; expected a procedure that accepts 1 mandatory argument without any keywords | |
; given: 3 | |
; in: the 2nd argument of | |
; method set-member? with contract (-> set? (-> number? number?) | |
; boolean?) | |
; (set/c (-> number? number?)) | |
; contract from: (definition s) | |
; blaming: top-level |
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
;; goes in .racketrc | |
(define current-cow-flags (make-parameter "")) | |
(define old-print (current-print)) | |
(define (print-with-cowsay val [port (current-output-port)]) | |
(define output (with-output-to-string (thunk (old-print val)))) | |
(when (not (string=? "" output)) | |
(match-define | |
(list in _ _ _ _) | |
(process (format "cowsay ~a \"~a\"" (current-cow-flags) output))) | |
(display (port->string in) port))) |
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
<samth> my experience is that the internal definition context stages of grief are: | |
<samth> (1) what are these int-def-ctx arguments? | |
<samth> (2) this stuff makes no sense | |
<samth> (3) why is it so imperative? | |
<samth> (4) i can't think of a better way | |
<samth> (5) i am ryan culpepper |
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
#lang racket/base | |
(require racket/generic | |
#;racket/set | |
(except-in racket/set in-set)) | |
(struct foo () | |
#:methods gen:set | |
[(define/generic gin-set in-set) | |
(define (in-set set) 0)]) |