[elm-discuss] Re: http.post gives BadResponse 415 "Unsupported Media Type"

2016-07-01 Thread danneu
You can use `Http.send` with a custom request object to set arbitrary headers. Here's an example that send an application/json POST request. judgeImage : Judgement -> Image -> Cmd Msg judgeImage judgement image = let url = "http://localhost:3000/id/"; ++ (toString image.id) ++ "/judge"

[elm-discuss] Re: I dislike the names of certain standard library functions.

2016-07-13 Thread danneu
I think it does more harm to redefine existing functions like `take` and `drop` which exist in other languages. Instead, it always seems better to introduce new names or reuse existing ones. Elm does seem to have an issue with not only an ultra-conservative standard library but also an inconsis

[elm-discuss] Re: Trouble initializing input with value

2017-08-06 Thread danneu
I'm back with Elm today after a year long break, so I'm out of touch with any of its idiosyncrasies. But in an effort to remember how to use Elm, I made a toy app with the ol `List (Id, String)` of input fields that uses `Html.programWithFlags` to initialize the model from localStorage. Then I