diff options
author | Eduardo Julian | 2015-09-07 01:33:53 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-09-07 01:33:53 -0400 |
commit | 08584c8d9a462ce0bd3ffb6d9535ecb3f7043289 (patch) | |
tree | 7e8355c804c26c0232620a67f7c1054151ee21aa /source | |
parent | 77aae538ed0d128e291292b5defe80967d181be9 (diff) |
- Type checking of polymorphic functions now relies on ExT types to guarantee that type-variables don't unify to anything, instead of relying on VarT types.
- Fixed some bugs in the standard library due to improper behavior of the type-checker.
- The analysis and pattern-matching code for records now reuses that of tuples.
Diffstat (limited to '')
-rw-r--r-- | source/lux/codata/state.lux | 3 | ||||
-rw-r--r-- | source/lux/meta/syntax.lux | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/lux/codata/state.lux b/source/lux/codata/state.lux index ec0a6bf63..de7220a45 100644 --- a/source/lux/codata/state.lux +++ b/source/lux/codata/state.lux @@ -12,7 +12,8 @@ (-> s (, s a))) ## [Structures] -(defstruct #export State/Functor (Functor State) +(defstruct #export State/Functor (All [s] + (Functor (State s))) (def (map f ma) (lambda [state] (let [[state' a] (ma state)] diff --git a/source/lux/meta/syntax.lux b/source/lux/meta/syntax.lux index ee5a37d53..4ee3163b0 100644 --- a/source/lux/meta/syntax.lux +++ b/source/lux/meta/syntax.lux @@ -183,13 +183,14 @@ (def #export (|^ p1 p2 tokens) (All [a b] - (-> (Parser a) (Parser b) (Parser (Either b)))) + (-> (Parser a) (Parser b) (Parser (Either a b)))) (case (p1 tokens) (#;Some [tokens' x1]) (#;Some [tokens' (#;Left x1)]) #;None (run-parser (do Parser/Monad [x2 p2] (wrap (#;Right x2))) - tokens))) + tokens) + )) (def #export (||^ ps tokens) (All [a] |