Re: [elm-discuss] Re: Current date (sorry for starting it again)

2016-11-22 Thread Tim Bezhashvyly
hDate: > > compare : Date -> Foo -> Bool > compare . > > filterFoos : List Foo -> Date -> List Foo > filterFoos foos date = >let > compareWithDate = compare date >in > List.filter compareWithDate foos > > > On Tue, 22 Nov 2016

[elm-discuss] Re: Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
Sorry, I'm still not sure how to pass a received date or model to comparison function. On Tuesday, November 22, 2016 at 3:41:07 AM UTC+1, Max Goldstein wrote: > > You can partially apply the comparison function to the current date before > passing it to List.filter. The trick is that you have

[elm-discuss] Re: Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
But how then to pull current date in the functions where it could not be passed? For example I want to List.filter comparing to current date but I can not pass additional parameters to comparison function. On Monday, November 21, 2016 at 8:33:55 PM UTC+1, Tim Bezhashvyly wrote: > > Makes

[elm-discuss] Re: Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
d also break reproduceability). By making it > an effect it can just return a request to get the actual date. > > > On Monday, November 21, 2016 at 12:29:09 PM UTC-7, Tim Bezhashvyly wrote: >> >> Sorry for starting it again but do I really need to do Task.perform just >> t

[elm-discuss] Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
Sorry for starting it again but do I really need to do Task.perform just to print current year just once? "Date.year Date.now" doesn't work as Date.now returns Task.Task x Date.Date. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To

Re: [elm-discuss] Issue a command after view update

2016-11-18 Thread Tim Bezhashvyly
In any case, if you want to render a google map on button click, the setup could be: > >- add a Msg called LoadButtonClicked or something, and add a button in >your view which triggers this (with onClick) >- in your update function, add a handler for LoadButtonClicked that >

[elm-discuss] Issue a command after view update

2016-11-17 Thread Tim Bezhashvyly
Let's say I want to render a Google Map on a button click. To do so I first need to render a markup and then send a message which will trigger JavaScript through post with map data. With "init" it would not be a problem as command passed to "init" is executed after view is already there. But

[elm-discuss] Re: Elm Jobs Board

2016-11-17 Thread Tim Bezhashvyly
https://stackoverflow.com/jobs On Sunday, July 31, 2016 at 1:34:40 PM UTC+2, Andre Bolle wrote: > > Is there a place where people can advertise and look for Elm jobs? > > Andre > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
me but I'm wondering if it is possible to capture root array node. On Wednesday, November 16, 2016 at 10:16:12 PM UTC+1, Peter Damoc wrote: > > > On Wed, Nov 16, 2016 at 10:50 PM, Tim Bezhashvyly <tim.bez...@gmail.com > > wrote: > >> Makes sense but doesn't change much: &

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
shows.json" decoderColl > |> Http.send handleRequest > > And second, you need a full URL for the "shows.json" not just a file name. > > > > > On Wed, Nov 16, 2016 at 10:26 PM, Tim Bezhashvyly <tim.bez...@gmail.com > > wrote: > >> Here

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
moving Http.toTask as that is not needed at all > there. > > triggerReadingFromJson = > Http.get "shows.json" decoderColl > |> Http.send handleRequest > > And second, you need a full URL for the "shows.json" not just a file name. > > > >

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
signatures, in > order for me to try to understand why do you get that specific compiler > error. > > What I provided has only two lines and should have worked (in theory). > If you have altered it in a way that somehow reintroduces Tasks back, I > need to see some code i

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
for trowing just an exception message but I'm really not sure how to proceed here. :( And thank you for all your support so far. On Wednesday, November 16, 2016 at 8:25:23 PM UTC+1, Peter Damoc wrote: > > > On Wed, Nov 16, 2016 at 8:19 PM, Tim Bezhashvyly <tim.bez...@gmail.com

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
do with it? I need somehow cast it to either MyType or Cmd, right? On Wednesday, November 16, 2016 at 3:23:13 PM UTC+1, Peter Damoc wrote: > > On Wed, Nov 16, 2016 at 4:05 PM, Tim Bezhashvyly <tim.bez...@gmail.com > > wrote: > >> Chained to Task.andThen and Task.onErro

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
u don't need Task.attempt. Just use > the regular Http.get and use the Cmds produced by it. > > If you need chaining, there is a `toTask` function that converts Requests > to Tasks > > > > On Wed, Nov 16, 2016 at 3:33 PM, Tim Bezhashvyly <tim.bez...@gmail.com > > wrote: &g

Re: [elm-discuss] Async requests in 0.18.0

2016-11-16 Thread Tim Bezhashvyly
RequestTask > > Alternatively, you could just have only one message that takes a Result > and handle each case in that message's part of the update as demonstrated > by the Http example: > http://elm-lang.org/examples/http > > > > > On Wed, Nov 16, 2016 at 3:05 PM, T

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

2016-11-15 Thread Tim Bezhashvyly
2016 at 3:50:36 PM UTC-7, Tim Bezhashvyly wrote: >> >> Thank you. Tried to apply it but my problem is that I'm trying to send >> initialize a request on init: >> >> init : ( Model, Cmd Msg ) >> init = >> ( { >> -- my model here >> } >>

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

2016-11-15 Thread Tim Bezhashvyly
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 <tim.bez...@gmail.com >