[elm-discuss] How are deeply nested records updated or what alternatives are typically used?

2016-08-01 Thread Austin B
Hi, I come from an OOP background and trying to make the leap to keeping all state in a single immutable data store, which has shown to be amazing as long as the system is small, but I am having trouble scaling up to anything beyond a toy app. One big challenge is trying to update nested

Re: [elm-discuss] Elm Records as a platform-agnostic data type?

2016-08-01 Thread Joey Eremondi
I'm not sure this is a great idea. Syntax-wise, Elm records aren't different that much from JSON. But in terms of semantics, they can store any Elm value, which includes functions and other things that can't be serialized well. At the end of the day, an Elm record is just a mapping from names to

Re: [elm-discuss] Equality Error Undecidable

2016-08-01 Thread Mark Hamburg
I think I'm going to revise my stance on how this issue should be handled. I am now gong to argue that function equality should be handled via object identity — i.e., two closures constructed at different times are necessarily unequal. What this breaks is referential transparency and more

Re: [elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread Nick H
I may have oversold it there at the end :-P, but I have been doing some major refactoring lately and am very pleased with the results so far. Please keep sharing your experiences! On Mon, Aug 1, 2016 at 8:49 AM, Ryan W wrote: > Doing pagination in the view after the case

[elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread OvermindDL1
As another way to think about this, and I am unsure how Elm'ish this is (but it is very functional), you could invert your lists into being functions, then pass in commands to operate on the internal lists. This is how some functional list implementations are developed especially when missing

Re: [elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread Ryan W
I was thinking I might want List.take and List.drop for pagination purposes but in seems like the easiest way in this particular case is to do all that generic list manipulation ahead of time when I have the plain lists, before I add the types. But if dynamic pagination was a hard requirement then

[elm-discuss] Re: Using Elm with jQuery (ports)

2016-08-01 Thread OvermindDL1
For future note, the Elm DOM is not created until the view function is run for the first time, which happens after init, which happens sometime 'after' the elm app creation. Always use callbacks to synch things, never assume any timing (my `cmd_delay` call I use heavily for such

Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-01 Thread Nick H
I think the compiler would be far exceeding its job description if it was trying to identify the language of every string! This sounds like it would be better as part of a separate validation tool. And of course, there's no telling when (if?!) string interpolation gets added to the language.

Re: [elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread Nick H
I don't mean to gloss over the fact that the length function you had to write is a little verbose. But I don't think there are a lot of other operations that would be applicable to every type of list in ThingList. For instance, folding and mapping wouldn't work, because the fold/map function would

Re: [elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread Nick H
The semantics are relevant because we want to avoid an XY scenario , which tend to come up a lot on this mailing list. Rest assured, Soren is only asking because he wants you to get the best help possible. :-) It sounds to me like the approach you describe in the OP is

Re: [elm-discuss] Compiler fails on port module name in sub-directory

2016-08-01 Thread Gábor Varga
That's what I wanted to do :) thanks for pointing me in the right way! Here it is with a link to a sample: https://github.com/elm-lang/error-message-catalog/issues/147 On Monday, August 1, 2016 at 12:28:05 PM UTC+2, Janis Voigtländer wrote: > > I would rather call it a very bad compiler error

[elm-discuss] How to decode JSON object with more than 8 fields?

2016-08-01 Thread Petr Huřťák
For 8 fields or less I can do import Json.Decode as Decode exposing ((:=)) collectionDecoder : Decode.Decoder (List Test) collectionDecoder = Decode.list (Decode.object8 Test ("id" := Decode.int) ... ) How to decode JSON object with more than 8

Re: [elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread Søren Debois
I meant, what are you trying to model? What's the /actual/ application you're doing? -- Søren Debois Sent with Airmail Den 1. august 2016 kl. 13.20.47, ryan1...@gmail.com (ryan1...@gmail.com) skrev: > Records, where each type has a different set of fields. > > On Aug 1, 2016, at 4:08 AM,

Re: [elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread debois
What actually goes in the lists? (As opposed to Foo, Bar etc.) -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more

[elm-discuss] Re: Using Elm with jQuery (ports)

2016-08-01 Thread Matic Zavadlal
Created ready event, which is triggered via Elm port and works! It's similar to jQuery ready event. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[elm-discuss] Re: Using Elm with jQuery (ports)

2016-08-01 Thread Matic Zavadlal
Created ready event which is triggered via Elm port and works fine. Similar to jQuery ready function. Dne ponedeljek, 01. avgust 2016 10.02.14 UTC+2 je oseba Matic Zavadlal napisala: > > HI! > > I want to use tags-input widget which attaches some attributes to certain > element in my body. >

[elm-discuss] Re: Is there a better way to structure my List types?

2016-08-01 Thread Wouter In t Velt
How about this? type Thing = Foo | Bar | Baz type ThingList = List Thing That way, you can simply do: List.length ThingList -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails

Re: [elm-discuss] Re: elm first impressions (and frustrations)

2016-08-01 Thread John Orford
> Just imagine a workflow where you change one model working in the front end and the compiler throws and error that the back-end does not implement what you need. +1 On Mon, 1 Aug 2016 at 09:57 Peter Damoc wrote: > Zach, > > Of course being backend agnostic is an amazing

[elm-discuss] Using Elm with jQuery (ports)

2016-08-01 Thread Matic Zavadlal
HI! I want to use tags-input widget which attaches some attributes to certain element in my body. The idea is to create normal input field on the elm side and later implement additional functionality via ports. So my approach is to load compiled Elm-js code and later once site loads

Re: [elm-discuss] Re: elm first impressions (and frustrations)

2016-08-01 Thread Peter Damoc
Zach, Of course being backend agnostic is an amazing thing. That being said, I would love to have a backend that could be implemented in Elm and one full-stack solution that has perfect impedance match. This way, the data models can be shared between the backend and the front-end and with a

Re: [elm-discuss] "I know what I'm doing"-syntax and helpful error messages for string interpolation

2016-08-01 Thread Zachary Kessin
I dislike the idea of any syntax that will let me do something dumb and let me "Fix it later" because that generally never happens Zach ᐧ On Sun, Jul 31, 2016 at 11:15 PM, Filip Haglund wrote: > Keeping with the helpfullness of the compiler, having warnings when doing

Re: [elm-discuss] Re: elm first impressions (and frustrations)

2016-08-01 Thread Zachary Kessin
I think that being backend agnostic was / is a good choice. When I started SquareTarget http://squaretarget.rocks I was able to reach for Erlang/OTP and WebMachine on the backend, which is a stack that I know well and I know how it performs under stress etc. Others have used Ruby, Elixir or

Re: [elm-discuss] Re: elm first impressions (and frustrations)

2016-08-01 Thread Peter Damoc
Hi Neil, Few comments on the issues you've raised: 1. Elm plans to go to the server side too. There are already proof-of-concept that allows one to use Elm server-side and with the advent of 0.18 (next version) we might see official support for that. Also, one could use something like Horizon