Can you show an explicit comparative example of what you mean in OCaml? Curious how it’s different.
Conversation
Sure.
(* map : ('a -> 'b) -> 'a list -> 'b list
*)
let rec map f xs =
match xs with
| [] -> []
| x :: xs -> f x :: map f xs
(* mapUC : (('a -> 'b * 'a list) -> 'b list
*)
let rec mapUC (f, xs) =
match xs with
| [] -> []
| x :: xs -> f x :: mapUC (f, xs)
3
See here: twitter.com/reasonml/statu
Emphasis: it's a syntax change, the type system is untouched and there's no syntax ambiguity
1
1
Yup. It’s still rooted in LC just like OCaml is. It’s just that the syntax makes LC more familiar. The semantics have not changed in the slightest. The AST hasn’t even changed - only the concrete syntax has.
1
1
It's just very weird and confusing that the concrete syntax has changed in a way that makes it harder to grok the actual semantics of what is going on. I get there are problems with currying, but this is just going to confuse the situation even more. 😫
1
2
Have you thought about having a transitional Reason syntax for beginners, then encourage people to move to the more transparently curried version as they get a handle on things?
1
1
🤦♂️ - so how does one write tuples now? Is the syntax overloaded with function abstraction?
1
Oh dear…
Well I guess it remains to be seen whether the folks start hating it after the initial honeymoon period. How easy is it to explain `(f(x) >> f())` to people? (using Elm/F# composition operators /w tupled args here)
There's some annoyance after "honeymoon" period, but it's mostly about additional parens being hard to track with eyes - no complaints related to semantics.
1
We'll reduce the number of parens we print to mitigate that issue and then reevaluate how many problems the tuples being (like, this) still cause.
1
Show replies




