How do I handle POST response

main :: Effect Unit
main = do
  resp <-
    ( A.post AR.json ("http://localhost:3000" <> "/api/list-files")
        ( Just
            ( ARQB.json
                ( fetchingFilePostToJson
                    ({ pwd: "/home/jacek/", show_hidden: false })
                )

            )
        )

    )

Is the above part OK? How do I show the response and do something with it?

I decided to give up on PureScript. At least for now.

It is not a language for me.

I managed to quit PureScript only for a day.

It compiles now, but in the wrong context. I need to modify it, so it works with halogen or flame.

I hope that one day I will benefit from the type system, but now it seems it wants to destroy my sanity, so I need to progress very slowly.

I managed to compile and write my instances for show.

But why is it so hard?

It took me days to notice I had the wrong type of json. Type system was sending me down the wrong path.

Finally, I retrieve the data and show it in a crude way on the page. But is it worth it? I have still to see the benefit of the type system in a practical setting.

How long did you struggle before you were productive?

Should I learn TypeScript instead? Or maybe both?

That is why such languages are not popular and mainstream, it is hard for most people, people are lazy and weak, do not be like people and you’ll be rewarded eventually. -)

2 Likes

Agreed. I’m an actual Labrador retriever at a keyboard and even I have powered through and stuck with Purescript.

There’s simply no other game in town.

Can you be more specific? I got stuck yesterday on a silly error. I spotted the solution, not by reading the error message or nonexistent documentation, but by staring at my code on the next day.

I cannot imagine having the luxury of leaving a problem at the back of my mind until it clicks. So how long should I persist and why?

I am lazy and weak, but what would be the reward? I like the aesthetic beauty of the language. But I did not move to a problem where I could see for myself the real pros and cons.

I do understand that with programming languages, people have different concepts of truth. Sifting through the confusion is not easy. I have given up on PureScript at least 3 times. Should I persist just to annoy those condescending TypeScript people?