5 ms·
We need HKT. F#. Cmon... I love F# but seriosly...
by fromscala11 10y ago
We need HKT. F#. Cmon... I love F# but seriosly...
- TIHan 10y agoDo we really need them?
- justneedvodka 10y agoNo. There's a difference between needs and wants.
- seanparsons 10y agoWell if you don't think a modern FP language needs higher kinded types you probably do need vodka.
- KurtMueller 10y agoWhat's hkt?
- thijsvandien 10y agoHigher-Kinded Types "With higher-kinded types [...] type operators can be parameterized by other type operators. Java doesn’t support higher-kinded types, but, if it did, you would be able to write something like this:" class GraphSearch<T> { T<Node> frontier; } Source: https://www.stephanboyer.com/post/115/higher-rank-and-higher-kinded-types https://www.stephanboyer.com/post/115/higher-rank-and-higher...
- Rickasaurus 10y agoWe're working on Type Classes. It seems like HKTs (or anything like them) are going to be hard without diverging in a huge way from the rest of the .NET ecosystem.
- KirinDave 10y agoI really think Type Classes will address 90% of what people want without requiring deep hackery. The solutions we have with class dispatch right now are workable but awkward.
- jhomedall 10y agoThat's fantastic news! I currently use Scala for most of my personal development, but having type classes would make F# attractive enough for me to switch over. I much prefer the cleaner syntax of F#. Losing HKT would be a shame, but that's a trade-off I would be willing to make.
- willtim 10y agoScala has never properly supported HKTs though. When I last tried it, there were multiple open issues, e.g. the partial application of type parameters. So I really don't buy the argument that Scala scores a point over F# due to HKTs. If you want HKTs, use Haskell.
- daxfohl 10y agoIt scores at least 0.7 points though. That said, it loses points elsewhere (as do all languages).
- daxfohl 10y agoI'm curious, will Type Classes enable http://www.sparxeng.com/blog/software/an-example-of-what-higher-kinded-types-could-make-possible-in-c http://www.sparxeng.com/blog/software/an-example-of-what-hig... without needing HKT?
- tpetricek 10y agoNot only we do not need HKT, we also do not need Profunctor Optics.
- purity_resigns 10y agoThey're a great way to massively slow down both your build and runtime by an order of magnitude. I work with Purescript on a daily basis and don't see it as anything other than an anti-feature that allows for masturbatory FP.
- KirinDave 10y agoF# and its spirit animal OCaml are really great precisely because of this attitude. They're really good at saying "No" to things that offer at best incremental improvements at the cost of significant complexity. "Profunctor Optics" is a great example. Cool paper, but no thanks.
- runT1ME 10y agoHigher kinded types reduce complexity in the same way generics reduce code complexity. If you think one makes things simpler but not the other, I would assume you're not familiar with it? Do you have examples of why it would add significant complexity? I use them constantly and it really simplifies my code a lot! Also, I don't believe 'profunctor optics' is a paper, I think it's just one (interesting) implementation of optics, which are useful in any language that encourages immutability.
- KirinDave 10y agoThe complexity that HKT brings to F# is not just conceptual. It needs to exist in the CLR which will bring implementation tradeoffs. "Cool paper but no thanks" is a saying for when people come to you with an extremely new technique and want you to incorporate it at the language level with very little proofing in the field. "Profunctor optics" is the a description of how profunctors encode lenses and similar structures. I am aware. I also think that technique can cook in Haskell land for a few more years before non-research projects should uptake it.
- phillipcarter 10y agoAwkward person who was in the video here The issue you're looking for (since an ask for HKTs typically means that Typeclasses are the ideal feature) is here: https://github.com/fsharp/fslang-suggestions/issues/243 https://github.com/fsharp/fslang-suggestions/issues/243 Please leave opinions, commentary, and vote if this is something you want! F# language design is done completely in the open, including motivation for features. Thanks!