[elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-20 Thread Alex Barry
Here's my take. In C++ (Or Java, what-have-you), you could have something like this: class Square { private float size; Square(float size) { this.size = size; } void size(float size) { this.size = size; } float size(void) { return this.size; } float

[elm-discuss] Re: Decoding json from incoming websocket packets

2017-07-10 Thread Alex Barry
If you control the sender and are guaranteed to get some messages exceeding the websocket limit (which I'm assuming is 4500 bytes) is to either send multiple smaller updates, or assign some sort of message id and prepend it to each chunk. Another option you can do (if you can't control the

[elm-discuss] Re: Is there an Elm window.print()?

2017-07-08 Thread Alex Barry
Also to expand on why I used an empty tuple - Elm, from my understanding, will cache the call if it just returns a Bool, because it ends up looking like a constant. I don't know if, as a result, Elm will actually execute the function a second time, or if it will just return the boolean value

[elm-discuss] Re: Is there an Elm window.print()?

2017-07-08 Thread Alex Barry
Is there a good reason *not* to use a port for this? The difficultly level is very low, and t's a single js function call. Also, don't even consider a native module at all. The general consensus is that native code isn't meant for the general Elm population, because it has the ability to

Re: [elm-discuss] Re: Divide by zero?

2017-02-18 Thread Alex Barry
upert Smith' via Elm Discuss" < elm-discuss@googlegroups.com> wrote: On Saturday, February 18, 2017 at 11:23:01 PM UTC, Alex Barry wrote: > > I think for integer division, it has to return 0 because infinity is > expressed as a float. I'm going to agree with Erkal, though, yo

Re: [elm-discuss] Re: Divide by zero?

2017-02-18 Thread Alex Barry
I think for integer division, it has to return 0 because infinity is expressed as a float. I'm going to agree with Erkal, though, you definitely don't want to wrap all your math statements in a maybe or result type, that would make most code considerably more verbose. On Sat, Feb 18, 2017 at 5:38

Re: [elm-discuss] How do you discard an Html message?

2017-01-27 Thread Alex Barry
Type Msg = ... | NoOp msg update msg model = case msg of NoOp _ -> ( model, Cmd.none ) That should do the trick for you. You might want a better message name. Also, why discard the message? On Fri, Jan 27, 2017 at 10:45 AM, 'Rupert Smith' via Elm Discuss <

Re: [elm-discuss] Re: What do you think about Types/State/View split?

2017-01-25 Thread Alex Barry
Just to pipe in with my experience, I'm working on a medium sized project with a lot of inter-related data between my modules, which is dictated by a database structure. We started the project as a single file elm project, but the code was starting to get unmanageable, so we broke it out into