[elm-discuss] Implementing websocket-based protocol - lessons learned

2017-05-22 Thread Christophe de Vienne
Hi everyone, Last week I coded a NATS [1] client, which is a PUB/SUB messaging system, in Elm [2]. It was very instructive and the result is pretty satisfying so far. Along the way I learned a few things that might be of use for others wanting to do this kind of client. * The WebSocket API is a

[elm-discuss] Re: Implementing websocket-based protocol - lessons learned

2017-05-22 Thread 'Rupert Smith' via Elm Discuss
On Monday, May 22, 2017 at 8:46:14 AM UTC+1, Christophe de Vienne wrote: > > * not being an effect module has clear pros : > - we can rely on other effect modules (in my case: WebSocket and > Random) > > * Being an effect module would allow a much simpler and natural API. > But then we

Re: [elm-discuss] Re: Implementing websocket-based protocol - lessons learned

2017-05-22 Thread Christophe de Vienne
I should have had a better look at what elmq allowed indeed. That said until elmq (or something equivalent) is published on package.elm-lang.org, we get a non-publishable package. I will make some tests with now that the plain version is working properly. Thanks! Christophe Le 22/05/2017 à 16:

[elm-discuss] Idris holes - Thoughts for Elm?

2017-05-22 Thread W. Brian Gourlie
For the uninitiated, Idris is a pure functional language with a cutting-edge type system. However, this is not another "We should make Elm's type system more advanced by introducing X." Rather, I ran across a feature in Idris that seems like it would fit

Re: [elm-discuss] Idris holes - Thoughts for Elm?

2017-05-22 Thread Witold Szczerba
I think it looks like a good idea. When I am adding new a feature, very often I have such a "holes", implementation details, which I do not want to code at the time of introduction, because I am not sure the final result of my changes. So, in order to make compiler happy, I am improvising with some

Re: [elm-discuss] Idris holes - Thoughts for Elm?

2017-05-22 Thread Zachary Kessin
totally agree, it would also make it easier to have your editor fill in the code for me Lets say you have a type like this type Direction = North|South|East | West move: Pos -> Direction -> Pos move pos dir = case dir of North -> ?rhs South -> ?rhs etc What I would like is to write "c

Re: [elm-discuss] Idris holes - Thoughts for Elm?

2017-05-22 Thread Aaron VonderHaar
I think you could easily experiment with this style of development without any syntax changes: ``` module Holes exposing (hole) hole : String -> a hole name = Debug.crash ("unfilled hole: " ++ name) ``` and replace elm-make with: ``` #!/bin/bash set -ex elm-make "$@" echo "Type Checking S

Re: [elm-discuss] Idris holes - Thoughts for Elm?

2017-05-22 Thread Aaron VonderHaar
If you haven't seen it already, https://atom.io/packages/elmjutsu has support for creating case statement scaffolds (search the README for "Insert case/of") On Mon, May 22, 2017 at 10:06 PM, Zachary Kessin wrote: > totally agree, it would also make it easier to have your editor fill in > the cod