Comment

Comment by shortrounddev2

My main gripe with ML variants is the poor syntax around async (F#). For networked (web) applications, you begin to find that many or most of your functions are async, and wrapping them in computation blocks which come with their own internal syntax that eliminates a lot of the elegance of ML and makes your code look more imperative often feels like it defeats the purpose of the language.

In F#

    let Foo =
        async {
            let! data = getData() |> Async.AwaitTask
            return data.value
        }
Is this the best they can do? C# just has

    async Task<Data> Foo() =>
        (await getData()).value;
Ive always wanted ML syntax like this:

    let async Foo =
        let data = await getData
        data.value
I just dont write a ton of pure functions which have no I/O dependencies

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton