Live data from Hacker News

The Untouched Goldmine of F#

rm4n0s.github.io

1–10 of 58 posts

Re: The Untouched Goldmine of F#

#4
> only Odin, F#, OCaml and Zig have [Tagged Unions or Discriminated Unions]

The good old missing sum type story.

Don't Rust, Haskell, Elm, Kotlin (with sealed classes), etc also have them?

Re: The Untouched Goldmine of F#

#5
post #2

F# secret superpower that no one has discovered for 30 years, and it will change its popularity in enterprise software.

I like TST. We use it in our code (FP'ish Kotlin).

But I also like stack traces, as they show me call-stack to the point the error happened. Something TST does not always show: different call-stacks can result in the same (or very similar) TST-stack.

Re: The Untouched Goldmine of F#

#7
post #3

I really like F#, but I really miss having a full fledged f#-native ORM

No you dont. Sorry for the blunt answer.

ORMs are a bad idea, even when using OO langs: they make the simple queries slightly simpler (`Users.getById(id: Long)`), they do not help you for hard queries (ORM-using codebases of size usually have hard-SQL-queries "in strings").

Most users of FP langs know this and hence will not even try to implement ORMs.

Look into jOOQ, LINQ-method-syntax (or whatever it is called, without the funny SQLish syntactic sugar), SQLDelight or sqlx for non-ORM options that improve embedding SQL in general purpose langs.

Re: The Untouched Goldmine of F#

#8
> It may not have the information on the filename or the line of code like the ordinary stack traces, but these are useless information anyway.

That is the weirdest and most crazy thing I've read in years.

Re: The Untouched Goldmine of F#

#10

This is really about making stack traces easier to understand.

I dont think so, TST and stacktraces are different.

Stacktraces show me call-stack to the point the error happened. Something TST does not always show: different call-stacks can result in the same (or very similar) TST-stacks.

It is possible to return the stacktrace as part of the TST error (not just an error message but also a stacktrace).

Post reply on HN