Stephen Chang
6cb15a06da
code cleanup
2016-04-13 15:14:57 -04:00
Stephen Chang
8a36c7962b
revise extra-info to handle mutually recursive datatypes
...
- define extra-info as a separate macro whose input is the types
in the tycon
- extra-info in main tycon is just the name of the extra-info macro
- extra-info macro is expanded only when extra-info is requested
- naturally handles additional tyvar substs in the types
- breaks the recursion to avoid inf loops for recursive and mutually recursive
datatypes
- enables simplification of direct recursive datatypes
- no longer need subst-special
- performance is much improved (okasaki: ~1min, was ~4min)
2016-04-13 14:00:20 -04:00
Stephen Chang
5c3d0edb5e
remove unneeded type annotations in okasaki tests
2016-04-11 16:09:40 -04:00
ben
0bd1962650
[bg] add Okasaki data structures
...
- all queues: batched, bankers, physicists, hood-melvile, bootstrapped, implicit
- deques: bankers, simple catenable
- random access lists: binary, skew, alt binary
- upcoming: heaps, sets, finite maps
- excluded: catenable lists and deques
2016-04-11 15:17:41 -04:00
Stephen Chang
26a2699d48
fix match expected-type propagation to non-datatype clauses
...
- closes #8
2016-04-11 14:53:45 -04:00
Stephen Chang
2a9005a31d
remove spurious type annotations in tests
...
- not needed bc rackunit-typechecking now adds expected-type
2016-04-11 14:22:35 -04:00
Stephen Chang
fdf902121e
fix more stx-parse err msgs; and other err msgs
...
- all tests now passing
2016-04-11 14:01:24 -04:00
Stephen Chang
ced8a1affc
add trees-tests file
2016-04-11 13:56:54 -04:00
Stephen Chang
73e59ddec7
workaround syntax-parse error msg regressions
...
- just throw explicit type-error exn instead of relying on #:fail-when etc
- run-all-tests passing
2016-04-06 17:15:20 -04:00
Stephen Chang
01a0bb28a7
improve rackunit-typechecking
...
- speed up by eliminating duplicate expansion in check-type
- use given type annotation as expected-type
- eliminates unneeded type annotations
2016-04-06 17:10:46 -04:00
Stephen Chang
1167407cfe
fix type constructor arity err causing inf loop
...
- lambda now supports (implicit) polymorphic type annotations
- (unrelated to this commit) many tests seem to be failing due to a
slight change in err msg
2016-04-05 10:55:02 -04:00
Stephen Chang
a0f4d9e3a9
eliminate dup expansion of some args in mlish #%app
2016-04-05 00:14:43 -04:00
Stephen Chang
33e17dd282
mlish code cleanup
...
- datatype constructors use same mechanisms as #%app
- eliminates duplication of inference and instantiation code
- #%app's handling of expected type is no longer separate from unification
of argument types
- eliminates redundant expansions
- speeds up tests ~10-20sec
- fn args are still possibly double-expanded
2016-04-04 19:07:36 -04:00
Stephen Chang
8731401318
start match2 exhaustiveness checking; nested checks not quite working
2016-04-01 17:08:48 -04:00
Stephen Chang
d5435eb71b
fix match2 bug with nested user-defined datatypes
2016-03-30 23:25:24 -04:00
Stephen Chang
e9290629da
fix a few err msg issues
...
- add working monad example
- closes #7
2016-03-30 16:12:11 -04:00
Stephen Chang
d881d988c2
fix and enhance match2
...
- compiles to racket match patterns (but still typechecks)
- supports nested patterns
- no exhastiveness checking
- no parens required for root pattern
(except for comma tup stx)
- support _ else case
- always no parens for 0-arity constructors
- both user-defined and built-in (like nil)
- alternative :: cons stx
- alternative comma --- (x,y,z) --- tuple stx
- requires at least 1 comma to detect
- see examples in match2.mlish
2016-03-30 13:51:22 -04:00
Stephen Chang
fca145bbd7
start match2, with support for nested matches --- dont use yet
2016-03-29 17:14:47 -04:00
Stephen Chang
ab1703e2d6
refactor match; add match support for built-in lists
...
- remove some redundant expansions
2016-03-29 13:55:21 -04:00
Stephen Chang
512d3fb378
update bg/README
2016-03-29 12:34:46 -04:00
Stephen Chang
6815bd9127
fix some file extensions for mlish tests
2016-03-28 19:37:23 -04:00
Stephen Chang
2da260d1f9
refactor mlish tests; parallize run-all-mlish-tests somewhat
2016-03-28 19:30:22 -04:00
Stephen Chang
05969628ff
add another polyrecur example
2016-03-28 17:51:23 -04:00
Stephen Chang
92b1f8ec45
add implicitqueue tests to polyrecur.mlish
2016-03-28 17:26:30 -04:00
Stephen Chang
5e1d3f1e22
mlish: suppot polymorphic recursion
2016-03-28 17:11:38 -04:00
Stephen Chang
e9a4a9f1dd
add bens tests to run-all-mlish
2016-03-23 18:33:19 -04:00
Stephen Chang
cdd169381f
Merge branch 'mlish-examples' of bitbucket.org:stchang/macrotypes
2016-03-23 13:31:12 -04:00
Stephen Chang
06bed29150
add small test to result.mlish
2016-03-23 11:59:24 -04:00
ben
7dca7d4966
[bg] lambda calculus interpreter
2016-03-23 01:25:26 -04:00
ben
05df033790
[bg] huffman trees
2016-03-23 01:25:22 -04:00
ben
04e1cb701f
[bg] more lists, sorting, CPS
2016-03-22 21:25:12 -04:00
ben
41968efaea
[bg] starter functions
2016-03-21 23:48:57 -04:00
Stephen Chang
ea3ed2a762
add result.mlish to run-all-mlish-tests
2016-03-21 00:17:27 -04:00
AlexKnauth
0bc592240d
add read-tree example
2016-03-21 00:07:20 -04:00
AlexKnauth
9332309160
propagate expected type through lambda
...
fixes https://bitbucket.org/stchang/macrotypes/issues/4
2016-03-18 23:25:44 -04:00
Stephen Chang
6f48690446
define-type-alias supports type constructors
2016-03-18 20:57:02 -04:00
Stephen Chang
4a44e51b80
fix bug using expected type of id constructors, eg nil
2016-03-18 17:11:47 -04:00
Stephen Chang
09d04cd4c0
mlish: clean up cond so else is not handled separately
2016-03-18 12:34:31 -04:00
Stephen Chang
c89aa1be19
fix expected-ty propagation in cond else; closes #3
2016-03-18 11:57:46 -04:00
Stephen Chang
7f593b52c8
add more inst.mlish tests
2016-03-17 19:22:05 -04:00
Stephen Chang
b65c4adc94
use expected type to help infer instantiation of an app
2016-03-17 19:03:02 -04:00
Stephen Chang
47fe5ae232
allow explicit tyvars in fn def: workaround for inferred poly fn type with wrong arg order
2016-03-17 16:44:56 -04:00
Stephen Chang
8369574812
fix stlc+effect; add check-props testing form
2016-03-14 01:29:46 -04:00
Stephen Chang
6a85e06719
fix let to check expected type against body
...
- other conditionals probably need this fix
2016-03-10 17:09:28 -05:00
AlexKnauth
2e259163aa
add find-min/max
2016-03-10 16:35:57 -05:00
Stephen Chang
f4979c9e58
fix mlish tests to use ->/test -- all tests passing
2016-03-10 16:23:00 -05:00
Stephen Chang
b8e3ad1602
fix bug with tyvar computation
...
- define separate ->/test constructor that computes tyvars
and -> does not because it may be nested
(see "try" fn in alex.mlish)
- add alex.mlish tests
- other mlish tests still broken --- need to use ->/text
2016-03-10 16:16:52 -05:00
AlexKnauth
db1da5ae20
implement find example
2016-03-10 14:30:43 -05:00
AlexKnauth
fe494c6ad3
fix another srcloc
2016-03-10 10:26:50 -05:00
AlexKnauth
f19eafcd8f
propagate srcloc to check-equal? form
2016-03-10 10:15:24 -05:00