-
Notifications
You must be signed in to change notification settings - Fork 28
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
UCS tracking issue #151
Comments
|
:NewParser
:NewDefs
module Nil
class Cons[A](head: A, tail: Cons[A] | Nil)
//│ module Nil()
//│ class Cons[A](head: A, tail: Cons[A] | Nil)
// FIXME
fun filtermap(f, xs) = if xs is
Nil then Nil
Cons(y, ys) and f(ys) is
false then filtermap(f, ys)
true then Cons(y, filtermap(f, ys))
[true, z] then Cons(y, filtermap(f, ys))
//│ ╔══[ERROR] identifier not found: ys
//│ ║ l.26: Cons(y, ys) and f(ys) is
//│ ╙── ^^
//│ ╔══[ERROR] Type mismatch in application:
//│ ║ l.26: Cons(y, ys) and f(ys) is
//│ ║ ^^^^^^^^
//│ ║ l.27: false then filtermap(f, ys)
//│ ║ ^^^^^^^^^
//│ ╟── reference of type `false` is not an instance of type `number`
//│ ║ l.27: false then filtermap(f, ys)
//│ ╙── ^^^^^
//│ ╔══[ERROR] Type mismatch in application:
//│ ║ l.26: Cons(y, ys) and f(ys) is
//│ ║ ^^^^^^^^
//│ ║ l.27: false then filtermap(f, ys)
//│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//│ ║ l.28: true then Cons(y, filtermap(f, ys))
//│ ║ ^^^^^^^^
//│ ╟── reference of type `true` is not an instance of type `number`
//│ ║ l.28: true then Cons(y, filtermap(f, ys))
//│ ╙── ^^^^
//│ ╔══[ERROR] type identifier not found: Tuple#2
//│ ╙──
//│ fun filtermap: ((error | Cons['A] | Nil) -> number & (Cons['A] | Nil) -> error, Cons['A0] | Nil,) -> (Cons['A1] | Nil | error)
//│ where
//│ 'A := 'A0
//│ 'A0 <: nothing
//│ Code generation encountered an error:
//│ unknown match case: Tuple#2
module True
module False
//│ module True()
//│ module False()
class Pair[A, B](lhs: A, rhs: B)
//│ class Pair[A, B](lhs: A, rhs: B)
fun filtermap(f, xs) = if xs is
Nil then Nil
Cons(y, ys) then if f(y) is
True then filtermap(f, ys)
False then Cons(y, filtermap(f, ys))
Pair(True, z) then Cons(z, filtermap(f, ys))
//│ fun filtermap: ('head -> (False | Pair[anything, 'A] | True), Cons['head] | Nil,) -> (Cons['A] | Nil)
//│ where
//│ 'head <: 'A |
|
|
|
|
|
Issue to track the parts of the UCS implementation that are still incomplete or wrong – please update with more cases as you find them.
Translation
PreTyper
#194 and we will support advanced tuple patterns, for example, splice tuple patterns, in the near future.PreTyper
#194 and we will implement this feature in the near future.Locations
Track scrutinee locations with. (Note: it was removed in new desugarer.)Scrutinee.Source
No location reported in:
Reporting
is
test has a single patternThough maybe we shouldn't warn when it's conjuncted with other things, as then the
is
may be used to bind expressions, as inif xs is x :: xs and mapPartition(f, xs) is (as, bs) and ...
The text was updated successfully, but these errors were encountered: