Re:F* – An ML-like functional programming language aimed at ...
by Peaker on Monday October 30, 2017 @09:49AM
(#15584946)
C++ and Scala don't really have dependent typing, but rather a single feature that is typical of dependent typing. That is: type-level values of any type.
[ Parent
| on HN ]
Re:F* – An ML-like functional programming language aimed at ...
by johncolanduoni on Wednesday November 01, 2017 @08:41PM
(#15606873)
Both Scala and C++ have a set of type-system features that when combined allow you create functions whose return type can depend on the value of the passed argument. For a good step by step of how to do this in Scala see here[1], and a (unfortunately less in depth) C++ example is here[2].
[1]: http://gigiigig.github.io/tlp-step-by-step/dependent-types.h...
[2]: https://www.reddit.com/r/cpp/comments/2tilfw/dependent_typin...
Re:F* – An ML-like functional programming language aimed at ...
by Peaker on Sunday November 05, 2017 @04:18AM
(#15628776)
I am not familiar enough with Scala, but the C++ example certainly does not seem like dependent types.
Which function in there do you consider to have a return type that depends on the value of the input?