[elm-discuss] Re: Record update syntax

2016-08-13 Thread Robin Heggelund Hansen
All I really want is: ```elm { model.something | more = 42 } ``` søndag 14. august 2016 02.49.07 UTC+2 skrev OvermindDL1 følgende: > > Just a passing idea to perhaps help give ideas for better methods: > > > Updating a nested record is a bit convoluted as something like: > ```elm > let >

[elm-discuss] Re: More thorough side-effect isolation

2016-08-13 Thread Kasey Speakman
So, I made a Gist of the helper stuff which splits Facts and Acts. I call the helper Factor... (Fact or Act ~=> Factor). There is a subsequent comment with an example program explaining the helper's usage. -- You received

[elm-discuss] Record update syntax

2016-08-13 Thread OvermindDL1
Just a passing idea to perhaps help give ideas for better methods: Updating a nested record is a bit convoluted as something like: ```elm let something = model.something in { model | something = { something | more = 42 } } ``` Excepting the let/in part because Elm does not support an

[elm-discuss] Re: How do I write an elm-check producer for a recursive data structure?

2016-08-13 Thread Max Goldstein
@John Yes, elm-check was deprecated earlier this will. You almost certainly have an old version of the elm-test shell utility; "elm test --version" should yield 0.17.1. If it doesn't, npm uninstall -g elm-test npm install -g elm-test "elm test init" will create the directory *tests* which will

[elm-discuss] Re: Trying to create a nested components that calls a js interop port

2016-08-13 Thread Jonathan Duncan
Thank you for helping me find that. I put the lift in a PlatformHelpers.elm file. Then I added a function to my JsInterop.State which curries the lift function liftMe : ({ a | jsInterop : Model } -> Model -> { a | jsInterop : Model }) -> (Msg -> b) -> Msg -> { a | jsInterop

[elm-discuss] Re: Trying to create a nested components that calls a js interop port

2016-08-13 Thread OvermindDL1
`elm-mdl` I think calls it `lift`, but is the same pattern. It is the pattern that matters, not the name. :-) For example, look in the `elm-mdl` demo, it has a Primary message called 'Mdl' (you could call it anything of course), and that 'Mdl' message is passed in to almost all of `elm-mdl`'s

[elm-discuss] Re: Trying to create a nested components that calls a js interop port

2016-08-13 Thread Jonathan Duncan
Thank you OvermindDL1, that was helpful. I like your first idea of destructing the tuple. That looks a lot better. I like how your second example looks, is so short and simple which is what I was looking for. But I believe that it implies that the inner component needs to know about the

[elm-discuss] Websocket.send return type?

2016-08-13 Thread Ben Burdette
I'm looking at the websockets example here: http://elm-lang.org/examples/websockets According to the source (https://github.com/elm-lang/websocket/blob/1.0.1/src/WebSocket.elm), it looks like the type of Websocket.send is (String->String->Cmd msg), and in the update ftn of the websocket

[elm-discuss] Task ports: A proposal to make it easier to integrate JS with Elm.

2016-08-13 Thread James Wilson
The problem ports as they stand are fundamentally incompatible with Tasks. Being backed by Cmd's, they are harder to compose. A frustration of mine is that often we are directed to "just use ports" when a proper interface to some native API is not yet available, but this leads to our Msg types

Re: [elm-discuss] Re: share-elm.com seems to be down?

2016-08-13 Thread Duane Johnson
Can confirm (it's down for me as well). On Fri, Aug 12, 2016 at 10:00 PM, Carlos De la Guardia wrote: > Seems to be down again? > > On Wednesday, March 4, 2015 at 10:52:25 PM UTC-8, Janis Voigtländer wrote: >> >> Or something like that. I get a "502 Bad Gateway" error. >> >>

[elm-discuss] Re: How do I write an elm-check producer for a recursive data structure?

2016-08-13 Thread John Watson
Max, I'm getting frustrated in trying to use the npm-installed elm-test TestRunner. Whereas with version 1.1.0 of elm-test and elm-check, to run my tests I could just use: main = ElmTest.runSuite (Check.Test.evidenceToTest evidence) it's not at all clear to me what I need to do

Re: [elm-discuss] Re: Design of Large Elm apps

2016-08-13 Thread Rex van der Spuy
Thanks so much Richard, that's absolutely fascinating! The way that I've been building my current generation of Elm apps has been modelled on the Counter/Pair example. So it's not uncommon for me to have apps with nested M/V/U models 3 levels deep (For example, a "page" containing a "panel"

[elm-discuss] Re: How do I write an elm-check producer for a recursive data structure?

2016-08-13 Thread John Watson
Many thanks for the replies, Max and Janis. Yes - exactly - I wanted some sort of size combinator, couldn't find one and just experimented to see what would happen. It would be lovely to have this built in to Fuzz. Max - many thanks for pointing out Fuzz - I wasn't aware of it. I see that

Re: [elm-discuss] Re: Design of Large Elm apps

2016-08-13 Thread Richard Feldman
> > Are you suggesting that each self-contained Elm "app" ("page", "game" > etc.) should only have one Model/View/Update and avoid using nested modules > for sub-components? Yeah - do you mean that something like the nested counter example from the Elm > Archtecture guide is a bad idea?

[elm-discuss] Re: Design question: using Dict, List with index, or Array (or something I'm not aware of)

2016-08-13 Thread Ian Mackenzie
My initial reaction is also #3. I think it's totally sensible to do a bit of transformation when serializing/deserializing, and more important to optimize your model for its use in view and update. On Friday, 12 August 2016 23:03:34 UTC+10, Robert Walter wrote: > > Hello, > > following