-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic stack traces #261
base: main
Are you sure you want to change the base?
basic stack traces #261
Changes from all commits
999c03b
ec34f78
be37a99
7a02cd8
32ef01d
9b38a38
9f55d30
7ff632f
7b7eb4a
7c6e14f
c88fa00
695b50e
dae9ffe
416912c
53381ce
b733155
b8d30c1
cc73f7f
cc5cbb2
c8b2b6c
7562faa
e722823
4ebb066
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#<closure> : (Syntax → Syntax) | ||
#<closure> : (Syntax → (Syntax → (Syntax → (Macro Syntax)))) | ||
#<closure> : (Syntax → (Syntax → (Syntax → (Macro Syntax)))) | ||
#<closure> : ∀(α : *). (α → α) | ||
#<contract> : (Syntax → Syntax) | ||
#<arg> : (Syntax → (Syntax → (Syntax → (Macro Syntax)))) | ||
#<args> : (Syntax → (Syntax → (Syntax → (Macro Syntax)))) | ||
#<x> : ∀(α : *). (α → α) | ||
(true) : Bool |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#<closure> : ∀(α : *). (Syntax → α) | ||
#<msg> : ∀(α : *). (Syntax → α) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
(in (cons "hello" (in (cons "world" (in (nil)))))) : (Fix (ListF String)) | ||
(in (cons "hello" (in (cons "world" (in (nil)))))) : (Fix (ListF String)) | ||
(in (succ (in (succ (in (zero)))))) : (Fix NatF) | ||
#<closure> : ∀(α : *) (β : *). ((α → β) → ((Fix (ListF α)) → (Fix (ListF β)))) | ||
#<f> : ∀(α : *) (β : *). ((α → β) → ((Fix (ListF α)) → (Fix (ListF β)))) | ||
(in (cons (in (succ (in (succ (in (zero)))))) | ||
(in (cons (in (succ (in (succ (in (succ (in (zero)))))))) | ||
(in (nil)))))) : (Fix (ListF (Fix NatF))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
(of-unit #<IO action>) : (OfUnit IO) | ||
(of-unit #<closure>) : (OfUnit (→ Unit)) | ||
(of-unit #<x>) : (OfUnit (→ Unit)) | ||
(of-unit (just (unit))) : (OfUnit Maybe) | ||
(of-unit (pair (unit) (unit))) : (OfUnit (Pair Unit)) | ||
(of-unit-unit #<closure>) : (OfUnitUnit (→)) | ||
(of-unit-unit #<closure>) : (OfUnitUnit (→)) | ||
(of-unit-unit #<x>) : (OfUnitUnit (→)) | ||
(of-unit-unit #<x>) : (OfUnitUnit (→)) | ||
(of-unit-unit (pair (unit) (unit))) : (OfUnitUnit Pair) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
42 : Integer | ||
4 : Integer | ||
"4!" : String | ||
#<closure> : (Integer → Integer) | ||
#<x> : (Integer → Integer) | ||
"31!" : String |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#<closure> : ∀(α : *). (α → α) | ||
#<closure> : ∀(α : (* → *)) (β : *) (γ : *). ((Functor α β γ) → ((β → γ) → ((α β) → (α γ)))) | ||
(applicative (functor #<closure>) #<closure> #<closure>) : ∀(α : *) (β : *). (Applicative Macro α β) | ||
#<closure> : ∀(α : (* → *)) (β : *) (γ : *). ((Applicative α β γ) → (β → (α β))) | ||
#<closure> : ∀(α : (* → *)) (β : *) (γ : *). | ||
#<x> : ∀(α : *). (α → α) | ||
#<inst> : ∀(α : (* → *)) (β : *) (γ : *). ((Functor α β γ) → ((β → γ) → ((α β) → (α γ)))) | ||
(applicative (functor #<f>) #<x> #<fun>) : ∀(α : *) (β : *). (Applicative Macro α β) | ||
#<inst> : ∀(α : (* → *)) (β : *) (γ : *). ((Applicative α β γ) → (β → (α β))) | ||
#<inst> : ∀(α : (* → *)) (β : *) (γ : *). | ||
((Applicative α β γ) → ((α (β → γ)) → ((α β) → (α γ)))) | ||
(just "applicative notation") : (Maybe String) | ||
(nothing) : (Maybe String) | ||
(just "applicative notation") : (Maybe String) | ||
(nothing) : (Maybe String) | ||
#<closure> : ∀(α : (* → *)) (β : *) (γ : *). | ||
#<inst> : ∀(α : (* → *)) (β : *) (γ : *). | ||
((Monad α β γ) → ((α β) → ((β → (α γ)) → (α γ)))) | ||
(just "hey") : (Maybe String) | ||
(just "hey") : (Maybe String) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Unknown: #[bad-lexical-env.kl:3.24-3.25]<y> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#lang kernel | ||
|
||
(define f (lambda (ff) y)) | ||
(define g (lambda (y) (f))) | ||
|
||
(example (g 2)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
Error at phase p0: error.kl:3.18-3.34: "It went wrong." | ||
Error at phase p0: | ||
error.kl:3.18-3.34: "It went wrong." | ||
stack trace: | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
User error; no such file: "/home/doyougnu/programming/klister/examples/non-examples/stack-traces/[email protected]:1735135986" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Error at phase p0: | ||
error-in-arg.kl:5.24-5.27: bad | ||
stack trace: | ||
---- with function #<thing> | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#lang "prelude.kl" | ||
|
||
(define fail (lambda (thing) (+ thing 1))) | ||
|
||
(example (fail (error 'bad))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Error at phase p0: | ||
error-in-bind-head.kl:3.29-3.30: e | ||
stack trace: | ||
---- in pure macro | ||
---- in bind macro head | ||
λx. pure x | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#lang "prelude.kl" | ||
|
||
(example (>>= (pure (error 'e)) (lambda (x) (pure x)))) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pure #[error-in-bind-tail.kl:4.15-4.28]<hello-go-boom> >>= #<x> : ∀(α : *). (Macro α) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#lang "prelude.kl" | ||
|
||
(example | ||
(>>= (pure 'hello-go-boom) | ||
(lambda (x) | ||
(>>= (pure x) | ||
-- TODO: why doesn't this work? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a strange error indeed! |
||
(lambda (y) (error y)))))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Error at phase p0: | ||
error-in-case-constructor.kl:12.20-12.31: Im-an-error | ||
stack trace: | ||
---- in data case pattern: l | ||
---- Halt |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,15 @@ | ||||||||||||||
#lang "prelude.kl" | ||||||||||||||
|
||||||||||||||
(import "lambda-case.kl") | ||||||||||||||
|
||||||||||||||
(datatype (Alphabet) | ||||||||||||||
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l) (m) (n) | ||||||||||||||
(o) (p) (q) (r) (s) (t) (u) (v) (x) (y) (z) (æ) (ø) (å)) | ||||||||||||||
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing letter 'w' to the Alphabet datatype. The Alphabet datatype is missing the letter 'w' in the sequence between 'v' and 'x'. Apply this diff to add the missing letter: (datatype (Alphabet)
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l) (m) (n)
- (o) (p) (q) (r) (s) (t) (u) (v) (x) (y) (z) (æ) (ø) (å))
+ (o) (p) (q) (r) (s) (t) (u) (v) (w) (x) (y) (z) (æ) (ø) (å)) 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
(define fail | ||||||||||||||
(lambda (thing) | ||||||||||||||
(case thing | ||||||||||||||
[(l) (error 'Im-an-error)] | ||||||||||||||
[(else the-other) the-other]))) | ||||||||||||||
|
||||||||||||||
(example (fail (l))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Unknown: #[error-in-cons-head.kl:8.6-8.9]<car> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#lang "prelude.kl" | ||
|
||
(import "lambda-case.kl") | ||
|
||
-- TODO: DYG: how to test the pairs? | ||
(define fail | ||
(lambda (thing) | ||
(car '(1 2 'something-else)))) | ||
|
||
(example (fail 3)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Error at phase p0: | ||
error-in-constructor.kl:17.45-17.56: Im-an-error | ||
stack trace: | ||
---- in constructor pair | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really nice! |
||
in field 2 | ||
---- in let #[error-in-constructor.kl:17.22-17.24]<go> | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#lang "prelude.kl" | ||
|
||
(import "lambda-case.kl") | ||
|
||
(datatype (Pair A B) | ||
(pair A B)) | ||
|
||
(define fst | ||
(lambda-case | ||
[(pair x _) x])) | ||
|
||
(define snd | ||
(lambda-case | ||
[(pair _ y) y])) | ||
|
||
(define fail (lambda (thing) | ||
(let (go (pair thing (error 'Im-an-error))) | ||
go))) | ||
|
||
(example (fail 23)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Error at phase p0: | ||
error-in-let.kl:4.42-4.53: Im-an-error | ||
stack trace: | ||
---- with function #<bir> | ||
---- in let #[error-in-let.kl:4.22-4.24]<go> | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#lang "prelude.kl" | ||
|
||
(define fail (lambda (thing) | ||
(let (go (+ thing (error 'Im-an-error))) | ||
go))) | ||
|
||
(example (fail 23)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Error at phase p0: | ||
error-in-list.kl:7.27-7.38: Im-an-error | ||
stack trace: | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#lang "prelude.kl" | ||
|
||
(import "defun.kl") | ||
(import "list.kl") | ||
|
||
(define thing 'nothing) | ||
(define the-error (error 'Im-an-error)) | ||
|
||
(defun fail (thing) (+ 1 thing)) | ||
|
||
-- TODO: DYG: how to test | ||
-- (example `(list-syntax (,thing (fail the-error) ()) thing)) | ||
(example `('a 'b ,the-error)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Error at phase p0: | ||
error-in-pure-macro.kl:3.24-3.38: surprise-error | ||
stack trace: | ||
---- in pure macro | ||
---- Halt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#lang "prelude.kl" | ||
|
||
(example (pure (error 'surprise-error))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Type mismatch at in-arg-error.kl:5.23-5.38. Expected Syntax but got String |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#lang "prelude.kl" | ||
|
||
(define fail (lambda (something) (+ something 1))) | ||
|
||
(example (fail (error "in-arg-error!"))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#[prelude-test.kl:3.18-3.19]<a> : Syntax | ||
#<closure> : ∀(α : *) (β : *). ((α → β) → (α → β)) | ||
#<closure> : ∀(α : *). (α → α) | ||
#<closure> : ∀(α : *). (α → α) | ||
#<g> : ∀(α : *) (β : *). ((α → β) → (α → β)) | ||
#<x> : ∀(α : *). (α → α) | ||
#<x> : ∀(α : *). (α → α) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#[product-type.kl:12.23-12.24]<a> : Syntax | ||
#<closure> : ∀(α : *) (β : *). ((× α β) → α) | ||
#<x> : ∀(α : *) (β : *). ((× α β) → α) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(nothing) : ∀(α : *). (Maybe α) | ||
(just #[unknown-type.kl:24.33-24.37]<here>) : (Maybe Syntax) | ||
(just #<closure>) : ∀(α : *). (Maybe (α → α)) | ||
(pair (just #<closure>) (nothing)) : ∀(α : *). (Pair (Maybe (α → α)) (Maybe (α → α))) | ||
(just #<x>) : ∀(α : *). (Maybe (α → α)) | ||
(pair (just #<x>) (nothing)) : ∀(α : *). (Pair (Maybe (α → α)) (Maybe (α → α))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline!