Live data from Hacker News

What's New in F# 4.1? [video]

channel9.msdn.com

1–10 of 65 posts

Re: What's New in F# 4.1? [video]

#9
post #7

Wait what, doing this as an alias type ProductId = ProductId of int Meant it allocated an instance on the heap for it before 4.1? Wow.

That isn't actually an alias. That is constructing a single-case discriminated union. DUs are compiled into classes and have a few things automatic equality.

Generally speaking, it's better to use Units of Measure[0] when you want some compile-time semantics around numeric literals, as these don't incur the performance penalty of creating a class.

[0]: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/lang...

Re: What's New in F# 4.1? [video]

#10

We need HKT. F#. Cmon... I love F# but seriosly...

What's hkt?

Higher-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 frontier;
  }
Source: https://www.stephanboyer.com/post/115/higher-rank-and-higher...
Post reply on HN