Re: [elm-discuss] Listening to messages from different modules on an update

2016-11-14 Thread Peter Damoc
There used to be a "nesting" set of examples in The Elm Architecture but
lately this approach has been discouraged.

What you describe here is a kind of decomposition into components.

It is recommended that you have one model and you decompose the
functionality of update & view using regular functions.

If you want to see how this used to be done, take a look at the old
CounterPair example:
https://github.com/pdamoc/elm-architecture-tutorial/blob/master/examples/2/CounterPair.elm

Please note that this code is obsolete.




On Mon, Nov 14, 2016 at 4:43 PM, Tim Bezhashvyly 
wrote:

> I just started digging into Elm so quite possible that my question has a
> conceptual problem. Please let me know if so.
>
> I have a module A which is asynchronously reading data from JSON. Module A
> among other things exposes `getJson` function. As the read is processing
> data asynchronously it can not just return data structure but returning
> it's Msg type instead which is:
>
> type Msg
>   = FetchSucceed (Maybe Jobs)
>   | FetchFail Http.Error
>
> Now if module B imports module A it can call `getJson` method but it will
> only trigger  initial call and then has to listen to `FetchSucceed`:
>
> update : A.Msg -> A -> (A, Cmd A.Msg)
> update msg model =
>   case msg of
>   FetchSucceed a ->
>   (A a, Cmd.none)
>
>   FetchFail _ ->
>   (model, Cmd.none)
>
> My question is if module B has it's own command how does `update` function
> combines listening to commands from both modules?
>
> Thanks.
>
> --
> 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 options, visit https://groups.google.com/d/optout.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] New implementation of elm arrays available on elm-package

2016-11-14 Thread Robin Heggelund Hansen
Version 1.0.0 of the new elm array implementation is now available on 
elm-package. 

If you have elm 0.18 you can easily try it out by doing the following:

1) install the package with `elm package install 
Skinney/elm-array-exploration`
2) Use the correct namespace, `import Array.Hamt as Array` instead of 
`import Array`.
3) You're now using new elm arrays :)

The most important part of the new implementation is that it's more stable. 
All the known issues with the core arrays should be fixed in this 
implementation. That being said, it could very well be the case this 
implementation has other bugs.

I would love for people to try this out :)

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] elm-http-builder 4.0.0

2016-11-14 Thread Luke Westby
Hi friends!

I published elm-http-builder 4.0.0 just now for 0.18

There are a bunch of changes so I'm sharing the release notes below. Any 
longer-form concerns, share them here. If you'd like direct help, jump into 
the #http channel in slack .

Thanks!
Luke


*Release notes:*


A lot has happened since 3.0.0! The API is smaller, and more focused and 
I'm excited about that. In particular, BodyReader and its friends have been
removed. Since this is the official upgrade for Elm 0.18, the new 
elm-lang/http package has a lot of influence. The new Http package includes 
a much more cohesive experience for declaring expectations of response 
bodies. See the Http.Expect type in elm-lang/http 
. 
This feature is even reminiscent of BodyReader!


Since we have this as a part of the platform now, all of the BodyReader-related 
features are gone. For these you'll just "use the platform", as they say, 
and make use of withExpect in your builder pipelines. In the future we may 
include fancier, custom Expect formulations for your convenience.


Secondly, you'll now have the option to convert a RequestBuilder a into an 
Http.Request 
a or send it directly using HttpBuilder.send, which has the same signature 
as Http.send. This helps to keep your builder pipelines clean while also 
leaving you the option to get out an Http.Request if you need. Long story 
short, HttpBuilder is *just* about building requests, just like when it 
started out. The platform covers the rest.


Here's the list of all changes:


Removals
   
   - url: use withQueryParams instead to add query params to your url
   - withBody: use one of the more specific with*Body functions instead
   - withMultipartBody: string multipart bodies are the only type supported 
   by elm-lang/httpcurrently, sojust use withMultipartStringBody instead
   - withMimeType: the first parameter to withStringBody will set your MIME 
   type automatically. Alternatively, set a header with withHeader
   - withCacheBuster: since we're giving up control of the send process, we 
   can't chain on a Task to get the current time
   - withZeroStatusAllowed: we don't control the send process. You can 
   handle this yourself under the Http.BadStatus error when you deal with 
   errors in your send msg tagger.
   - BodyReader: see intro
   - stringReader: see intro
   - jsonReader: see intro
   - unitReader: see intro
   - Error: since we don't control the send process we don't need this
   - Response: same as Error
   - toSettings: Http.Settings doesn't exist anymore, it was moved under 
   Http.Request
   - Request: since we expect you'll need to import Http now anyway, you 
   can just import this from Http
   - Settings: see toSettings

Breaking Changes
   
   - RequestBuilder -> RequestBuilder a, where the type parameter is the 
   expected type of the returned payload.
   - get, post, etc. return RequestBuilder (). The default is to make no 
   attempt to decode anything, so it is (). You can use withExpect to 
   attach an Http.Expect MyType, which will turn it into a RequestBuilder 
   MyType.
   - toRequest returns an Http.Request a
   - send wraps Http.send, read up on it to see how it works 
   .

Additions
   
   - withExpect: attach an Http.Expect to the request
   - withQueryParams: decorate the URL with query params

A sincere thank you to @evancz , @rtfeldman 
, @bogdanp , and 
@knewter  for time and discussions that helped 
me make the decisions that led to these changes!


And a shoutout to @prikhi  for taking the time 
to update the existing API for 0.18 and publishing it as 
priki/elm-http-builder 
.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Anyone using Firebase 3.0 with Elm 0.17?

2016-11-14 Thread David James
I would also be happy to test and contribute to an Elm 0.18 update to 
ElmFire.

On Sunday, October 23, 2016 at 6:14:13 PM UTC-7, Scott Mueller wrote:
>
> Just a friendly bump and vote for Elm 0.18 and Firebase 3.0 support... 
> Also happy to help with this.
>
> On Wednesday, August 17, 2016 at 4:29:49 AM UTC-7, Thomas Weiser wrote:
>>
>> I have sketched an API for an effect manager module and will discuss it 
>> soon with you all. 
>>
>> First I will target Firebase's existing realtime database and 
>> authentication API before switching to Firebase 3.0 and its new 
>> authentication API. I have not looked into Firebase's new storage API 
>> yet. 
>>
>> Sorry for the long delay. Time is very limited atm. Will be better from 
>> September onwards. 
>>
>>
>> On 17.08.2016 09:29, Corey Trampe wrote: 
>> > I've been watching ElmFire for the 0.17 update 
>> > , and Firebase 3.x 
>> > support , but I 
>> > guess Thomas Weiser hasn't had time to work on it. (And I'm not here 
>> > to complain about free software! Thanks, Thomas, for sharing your good 
>> > work.) 
>> > 
>> > But in the meantime... is anyone using Firebase 3.x with Elm 0.17? 
>> > 
>> > Are you using ports, or a custom effect manager? 
>> > 
>> > How's it working out? Can you share what you've learned? 
>> > 
>> > ( I need the new API for Storage 
>> > . ) 
>> > 
>> > Thanks! 
>>
>

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: What do you think about Eve?

2016-11-14 Thread Kasey Speakman
The literate programming part and IDE seem pretty compelling. However the 
language itself looks to be another imperative, mutation 
-based language.

The language is pretty brilliant. It's really a database programming model, 
but the "database" also allows effects/functions/etc to be saved as data. 
For instance, in the commit docs  an 
example saves an http request and then also saves a listener for when it 
completes. Seems like something a DBA might feel comfortable programming 
with.

In the end, I think Elm's refactor-ability (due to user code being purely 
functional and immutable) is a crucial attribute that Eve does not match. 
And someone could conceivably design an IDE for literate programming on top 
of existing languages like Elm.

But that's just from skimming through the docs and examples.

On Monday, November 14, 2016 at 5:21:44 PM UTC-6, Erkal Selman wrote:
>
> I wonder, what the elm community thinks about Eve: http://witheve.com/ ?
> Here is the syntax reference: 
> https://witheve.github.io/assets/docs/SyntaxReference.pdf
>
> I think that this language/architecture is worth to look at.
> It has many similarities with elm.
> But it is more like logic programming. (Is this the logic programming of 
> the future?)
>
> I was following this project from far and I had the impression that he 
> (Chris Granger) was doing some kind of excel.
> But now I see that they can do flappy bird in eve: 
> http://play.witheve.com/#/examples/flappy.eve
> That is exciting!
>
> Is there something similar to Eve?
> It really looks like something new.
>
> My main question: 
> What do you think, are advantages and disadvantages of Eve, if you compare 
> it with Elm.
>

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] What do you think about Eve?

2016-11-14 Thread Erkal Selman
I wonder, what the elm community thinks about Eve: http://witheve.com/ ?
Here is the syntax 
reference: https://witheve.github.io/assets/docs/SyntaxReference.pdf

I think that this language/architecture is worth to look at.
It has many similarities with elm.
But it is more like logic programming. (Is this the logic programming of 
the future?)

I was following this project from far and I had the impression that he 
(Chris Granger) was doing some kind of excel.
But now I see that they can do flappy bird in 
eve: http://play.witheve.com/#/examples/flappy.eve
That is exciting!

Is there something similar to Eve?
It really looks like something new.

My main question: 
What do you think, are advantages and disadvantages of Eve, if you compare 
it with Elm.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-14 Thread Joey Eremondi
It's also worth mentioning that adding syntax for something usually
indicates that it's a "core" feature.

In C-like languages, looping from integers in a range is the key iteration
structure. But in Elm, fold and map are much more important. So having
special syntax could give beginners the idea that [..] is a primary
iteration tool, when it actually comes up in relatively few cases.

On Mon, Nov 14, 2016 at 3:13 PM, Francesco Orsenigo <
francesco.orsen...@gmail.com> wrote:

> Yup.
> It is just not used often enough to warrant special syntax.
>
> On Tue, Nov 15, 2016 at 10:09 AM, Witold Szczerba
>  wrote:
> > I think List.range is just fine. No need for special syntax and strange
> > function names like ".." (hard to browse, find online, etc.).
> >
> > On Mon, Nov 14, 2016 at 10:29 PM, أحمد حبنكة 
> > wrote:
> >>
> >> What do you think about my suggestion in previous reply ? replacing
> >> List.range with List.(..) operator ?
> >>
> >>
> >> بتاريخ الاثنين، 14 نوفمبر، 2016 2:43:49 ص UTC+2، كتب Max Goldstein:
> >>>
> >>> Sometimes it's useful to pass arguments to List.range and have it be
> >>> empty when a > b.
> >>>
> >>> Perhaps there should be List.rangeWithStep 5 1 -1 to solve your
> problem.
> >>
> >> --
> >> 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 options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "Elm Discuss" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/elm-discuss/z8t8u2f3iWk/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > elm-discuss+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 options, visit https://groups.google.com/d/optout.
>

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-14 Thread Francesco Orsenigo
Yup.
It is just not used often enough to warrant special syntax.

On Tue, Nov 15, 2016 at 10:09 AM, Witold Szczerba
 wrote:
> I think List.range is just fine. No need for special syntax and strange
> function names like ".." (hard to browse, find online, etc.).
>
> On Mon, Nov 14, 2016 at 10:29 PM, أحمد حبنكة 
> wrote:
>>
>> What do you think about my suggestion in previous reply ? replacing
>> List.range with List.(..) operator ?
>>
>>
>> بتاريخ الاثنين، 14 نوفمبر، 2016 2:43:49 ص UTC+2، كتب Max Goldstein:
>>>
>>> Sometimes it's useful to pass arguments to List.range and have it be
>>> empty when a > b.
>>>
>>> Perhaps there should be List.rangeWithStep 5 1 -1 to solve your problem.
>>
>> --
>> 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 options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/z8t8u2f3iWk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-14 Thread Witold Szczerba
I think List.range is just fine. No need for special syntax and strange
function names like ".." (hard to browse, find online, etc.).

On Mon, Nov 14, 2016 at 10:29 PM, أحمد حبنكة 
wrote:

> What do you think about my suggestion in previous reply ? replacing
> List.range with List.(..) operator ?
>
>
> بتاريخ الاثنين، 14 نوفمبر، 2016 2:43:49 ص UTC+2، كتب Max Goldstein:
>>
>> Sometimes it's useful to pass arguments to List.range and have it be
>> empty when a > b.
>>
>> Perhaps there should be *List.rangeWithStep 5 1 -1* to solve your
>> problem.
>>
> --
> 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 options, visit https://groups.google.com/d/optout.
>

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-14 Thread أحمد حبنكة
What do you think about my suggestion in previous reply ? replacing 
List.range with List.(..) operator ?

بتاريخ الاثنين، 14 نوفمبر، 2016 2:43:49 ص UTC+2، كتب Max Goldstein:
>
> Sometimes it's useful to pass arguments to List.range and have it be empty 
> when a > b.
>
> Perhaps there should be *List.rangeWithStep 5 1 -1* to solve your problem.
>

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-14 Thread أحمد حبنكة
hmmm I agree, if we want to make it a function though then we can replace 
the `List.range` function with `..` operator and construct ranges like this 
`1..2` (no need for brackets)

This is how it's done in ruby and it's a function :) , the range syntax 
removal is acceptable in this situation but replacing it with `List.range 1 
5` seems liitle bad for me

As for floating points we could remove support for them altogether as I 
don't think anyone would use it anyway, if intervals are needed then a data 
structure other than lists is going to be better.

بتاريخ الأحد، 13 نوفمبر، 2016 9:04:52 م UTC+2، كتب Robin Heggelund Hansen:
>
> Fixing the docs could of course be done, and you're right, it's not 
> something that's hard to understand. However, the question you should be 
> asking is "is there any reason why range isn't  a function to begin with?"
>
> søndag 13. november 2016 16.58.32 UTC+1 skrev أحمد حبنكة følgende:
>>
>>
>>
>> بتاريخ الأحد، 13 نوفمبر، 2016 1:53:05 ص UTC+2، كتب أحمد حبنكة:
>>>
>>> I was reading the elm-dev list and I knew that elm 0.18 removed the 
>>> range syntax, so code like this : 
>>> [2..3]
>>> won't work anymore.
>>>
>>> I want to know what are the foundations behind this decision ?
>>> hmmm if it is "can't find it in the documentation" then fix the 
>>> documentation, when the documentation is unfixable for this feature I think 
>>> it may be better to remove it, was this the case ?  
>>>
>>
>> The syntax of ranges is not specific to haskell, ruby and some other 
>> languages implement it.  
>>
>> Now for the fact that most new coders ask "what's this" or "how do I make 
>> a range" maybe the problem lies in the docs not in the feature itself.  
>>
>> still if it is confusing for most beginners then I agree it's probably 
>> better to remove it although I find hard to believe that this feature is 
>> hard to understand !! 
>>
>

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: How to decode a recursive JSON from a port?

2016-11-14 Thread Brian Hicks
I had to do this myself recently. The general solution is that for any 
recursive definition you have to have a lambda between the definition and 
it's use.

Your example 1 does this in the decoder with the call to `lazy`. Example 2 
doesn't, so it fails. I've heard (but haven't checked) that the compiler 
will catch this in 0.18.

I also wrote about my 
case: 
https://www.brianthicks.com/post/2016/11/07/happy-little-trees-decoding-recursive-data-structures-in-elm/

On Wednesday, October 5, 2016 at 5:19:32 PM UTC-5, Wil C wrote:
>
> Ok, figured it out for one of two ways. Posted here for future confused 
> people doing recursive data structures.
>
> I've read 
> https://github.com/elm-lang/elm-compiler/blob/0.17.1/hints/recursive-alias.md#obvious-but-kind-of-annoying
> and there's two ways of putting it together. The first way is to make the 
> node a type. The second way is to make the node a type alias (and the 
> recursion a type). I only figured it out for the first 
>
> 1) When node is a type.
>
> type Node = Node {
> name : String
>   , children : List Node
>   }
>
> fromJson : Json.Value -> Result String Node
> fromJson json =
>   decodeValue nodeDecoder json
>
> nodeByNameChildren : String -> List Node -> Node
> nodeByNameChildren name children =
>   Node { name = name, children = children }
>
> nodeDecoder : Decoder Node
> nodeDecoder =
>   object2 nodeByNameChildren
> ("name" := string)
> ("children" := list (lazy (\_ -> nodeDecoder)))
>
> However, like the link above says, it's a bit annoying to have the type 
> annotation 
> 
>  
> that you need to break out of every time you need to update the record.
>
> 2) When node is a type alias
>
> In this case, the model would be:
>
> type alias Node = {
> name : String
>   , children : Children
>   }
>
> type Children =
>   Children (List Node)
>
> nodeDecoder : Decoder Node
> nodeDecoder =
>   object2 Node
> ("name" := string)
> ("children" := childrenDecoder)
>
> childrenDecoder : Decoder Children
> childrenDecoder =
>   ???
>
> The childrenDecoder was what I couldn't figure out. The closest I came was:
>
> childrenDecoder : Decoder Children
> childrenDecoder =
>   customDecoder
> (Json.list nodeDecoder)
> (\children -> Result.Ok <| Children children)
>
> But this resulted in the decoder erroring out because there were undefined 
> decoders in the chain. I think it's probably because I don't really 
> understand customDecoder. If anyone can shed light on this second way, I'd 
> appreciate learning about it. Thanks!
>
> Wil
>
>
>
> On Wednesday, October 5, 2016 at 11:42:22 AM UTC-7, Janis Voigtländer 
> wrote:
>>
>>
>> 2016-10-05 20:38 GMT+02:00 Wil Chung :
>>
>>> I feel like I'm not getting exactly what to do in the case of a 
>>> recursive model.
>>>
>>
>> This is what you are to do in that case: 
>> http://package.elm-lang.org/packages/elm-community/json-extra/1.1.0/Json-Decode-Extra#lazy
>>  
>>
>

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] 0.18 Below the Hood

2016-11-14 Thread John Orford
Can anyone add to the headline features in the blog?

*http://elm-lang.org/blog/the-perfect-bug-report
*

Just want to geek out, but too lazy to follow / look at Elm dev.

Happy Elm Day.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Update Delay

2016-11-14 Thread OvermindDL1
Simplifying is a wonderful way to bug-hunt, one of my go-to methods.  :-)


On Sunday, November 13, 2016 at 2:28:00 PM UTC-7, John Orford wrote:
>
> My mistake! I was querying the previous list of strings rather than the 
> updated one. Good exercise though, simplifying helped me find the bug
> On Sun, 13 Nov 2016 at 19:48, John Orford  > wrote:
>
>> I have attached a simple example.
>>
>> I have a model with a field called 'currentQueryTips'.
>>
>> A list is filtered using the current query string, coming through an 
>> input field.
>>
>> If you run the test you will see that the view is always one step behind 
>> the input.
>>
>> In a previous iteration, I had the query filter function in the view and 
>> everything worked well.
>>
>> As I said before though, I think I did this more elegantly a few months 
>> ago, trying to remember how...
>>
>> Any help is appreciated!
>>
>>
>>
>>
>> On Thu, 10 Nov 2016 at 16:51 OvermindDL1 > > wrote:
>>
>>> Not something I've ever experienced and of which should be fairly 
>>> impossible.
>>>
>>> Do you have a simple reproduceable test-case that we can play with?
>>>
>>>
>>> On Thursday, November 10, 2016 at 8:43:30 AM UTC-7, John Orford wrote:

 I have fallen into this trap a few times,

 1) I update my model

 2) The View doesn't change

 3) Some other action occurs

 4) My view changes with the first update

 My view is one step behind.

 I have fixed this before a few times (been a while ago).

 And rather than tinkering, I thought I would ask what the canonical 
 solution is.

 It's a simple mistake, but suspect common also, might help others.

>>> -- 
>>> 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...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] How are you handling images references in Elm with Webpack?

2016-11-14 Thread Noah Hall
We solved this recently! You can checkout the loader here ->
https://github.com/NoRedInk/elm-assets-loader

The code lives in index.js. It's currently not fully released yet, but
some docs live here ->
https://github.com/NoRedInk/elm-assets-loader/blob/master/index.js#L3

On Mon, Nov 14, 2016 at 2:23 AM, Birowsky  wrote:
> I'm trying to make Elm work with images through Webpack.
>
> Here's my first struggle: http://stackoverflow.com/q/40580968/592641
>
> How do you configure Webpack to rename the images references in the compiled
> elm js with the appropriate hashes?
>
> Just.. how do you work with images and webpack? :}
>
> --
> 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 options, visit https://groups.google.com/d/optout.

-- 
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 options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: Convincing my team that Elm isn't just going to die like CoffeeScript

2016-11-14 Thread Brian Hicks
The comments here are great! There are even more in a previous thread on 
the 
topic: https://groups.google.com/d/msg/elm-discuss/BnvrQt0LIN4/GHE5HVMEAAAJ

On Saturday, November 5, 2016 at 5:01:42 PM UTC-5, Zacqary Adam Xeper wrote:
>
> Hey Elmos,
>
> I've finally gotten an opportunity to pitch Elm to my fairly large dev 
> team. I feel like I'm prepared to make the case for it against a lot of 
> objections: i.e. how will we learn yet another programming language, do we 
> really need something that never throws exceptions, etc. etc.
>
> The one thing I'm not really sure I'm prepared to answer is how I can be 
> sure that Elm isn't just another CoffeeScript or Dart, and in 2 or 3 years 
> we'll have an impossible time hiring anyone who knows how to use it because 
> everyone's going to go back to JavaScript.
>
> How do I convince Elm skeptics that this thing is here to stay? I can do a 
> great job of incorporating a small bit of Elm code into our stack to show 
> how great it is, but they won't even let me merge it into prod unless I can 
> make the case for its longevity.
>
>

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Correct use of port subscriptions in a submodule reused multiple times?

2016-11-14 Thread Wouter In t Velt
Op maandag 14 november 2016 02:24:16 UTC+1 schreef Witold Szczerba:
>
> Can you provide some real-life example of "moving away from components"? 
> That could be helpful…
>

Sure. My background is in React, where everything there is components too.
No examples of my own to share just yet. My app is very much "work in 
progress", and not yet clean enough to share I am afraid.

In the first version of my app (to plan homework), I would have e.g. an 
EditExam.elm file that contained its own Model, init, update, Msg and view.
And in my main.elm, I would import this module and integrate each of these 
into the main Model, init etc.
So basically, EditExam.elm was a "component". With the purpose of 
displaying an Exam, and allowing user to edit details.

When moving away from components, I created top-level files in my root 
directory:

   - Model.elm
   - Msg.elm
   - Update.elm
   - View.elm
   - Main.elm (which imports all of the above).

I copied the code bits from the component into each of these files. So for 
example:
type alias Model =
  { ...
  , exams : List Exam
  , currentExam : Exam
  }

type alias Exam =
  { subject : String
  , ...
  }

So the Exam type is the Model from the old EditExam.elm file.
Did the same for init, Msg, update, and view.

A (larger) real-life example that I use as a reference is the time-tracker 
SPA (here on github ). Which is a 
project as part of a DailyDrip  series.

A very good explanation (with simple examples) of non-component scaling in 
Elm is in the Official Guide here .
That explanation helped me a lot, along with the video's on sortable table 
linked there.

Hope this helps!

-- 
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 options, visit https://groups.google.com/d/optout.