[elm-discuss] Re: http "middleware" options

2016-10-12 Thread Fa Qing
I understand, and appreciate the suggestion. But I'm looking for a more generic solution here. I can't work around cookie restraints in all of my use cases, unfortunately (maybe using an auth token as an example was bad idea). Think about that problem of handling http errors at the root level

Re: [elm-discuss] Re: Teaching children Elm

2016-10-12 Thread Tanya Bouman
No, we don't have any video recordings of our sessions. Tanya On Monday, October 10, 2016 at 4:18:37 AM UTC-4, Fedor Nezhivoi wrote: > > Thank you for your answers. > > @Javis, do you have any plans of having an English translation? > > @Tanya, do you have any video recordings of your sessions?

Re: [elm-discuss] http "middleware" options

2016-10-12 Thread Fa Qing
Somehow at that point it seems like we have effectively given up on a clean architecture though. We extracted out our API layer (or at least our transport layer), yet we're still having to take both inputs and return values and pass them through (every) unrelated entity that calls the API

Re: [elm-discuss] Re: Function equality again

2016-10-12 Thread Mark Hamburg
I gather there has been trepidation about implementing an equatable built in "type class" akin to the existing "comparable", but I agree that if the plan is never to support function comparison, then equatable seems to be necessary if Elm is to live up to its "no runtime errors" goal. As for

[elm-discuss] elm-google-geocoding - An Elm interface to the Google Geocoding API

2016-10-12 Thread Sasha Voynow
http://package.elm-lang.org/packages/labzero/elm-google-geocoding/latest https://github.com/labzero/elm-google-geocoding Bugs, PRs, comments, API design suggestions extremely welcome! -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To

[elm-discuss] Proper want to detach Elm from DOM node embedded in

2016-10-12 Thread kanishka azimi
I grabbed the Elm DOM node and set innerHTML to empty. Is that correct? Should I be grabbing the parent of the Elm node and erasing the Elm node and adding it back to the DOM? Is there anything else I need to do to reverse the "embed" action? I know this isn't typical. I am trying to keep my

[elm-discuss] Re: Function equality again

2016-10-12 Thread Zinggi
I also think that comparing functions should just compare them by reference, this should cover the most common cases. Another possible solution: What about a compile time error? Is this possible? On Wednesday, 12 October 2016 18:48:12 UTC+2, Mark Hamburg wrote: > > As discussed elsewhere, the

[elm-discuss] Re: Pure Elm contenteditable rich text editor

2016-10-12 Thread RGBboy
You should read this article to see why existing solutions generally do not work very well: https://medium.engineering/why-contenteditable-is-terrible-122d8a40e480 I am pretty sure draft.js has a good underlying data model that copes with mapping to the DOM well. Perhaps looking into how that

[elm-discuss] Re: Function equality again

2016-10-12 Thread James Wilson
I basically agree - something as basic as using an equality test should not have any chance to cause a runtime error in any case; in the case of functions it should be based on referential equality, which I think does the right thing in any sane case. On Wednesday, 12 October 2016 17:48:12

[elm-discuss] Re: Function equality again

2016-10-12 Thread Kasey Speakman
So what's the specific case where you need to verify function reference equality? I suspect that needing this is a symptom of some other problem. On Wednesday, October 12, 2016 at 11:48:12 AM UTC-5, Mark Hamburg wrote: > > As discussed elsewhere, the runtime exception related to function

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-12 Thread Peter Damoc
On Wed, Oct 12, 2016 at 6:57 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > This limitation means you can't have UI elements defined outside of a > component affect its state. Suppose you had a video component and a video > control bar compnent, you could not make

Re: [elm-discuss] http "middleware" options

2016-10-12 Thread Peter Damoc
On Wed, Oct 12, 2016 at 6:50 PM, Fa Qing wrote: > Goal > [AppRoot] -> [UsersPage] --> ask api for users, and upon success, > 1. send the UsersFetchSuccess message (attaching the users); so far so > good, but then also I need to... > 2. replace the token by sending the

Element continuity (was Re: [elm-discuss] Re: Html.Keyed)

2016-10-12 Thread Mark Hamburg
On Oct 11, 2016, at 1:09 PM, OvermindDL1 wrote: > > And as for cocoa, unlike the DOM anytime something like, say a checkbox is > checked, cocoa sends a message to the application to handle the change, if > unhandled then no update would happen... and the app would be

Re: [elm-discuss] http "middleware" options

2016-10-12 Thread Wouter In t Velt
Personally, I like the setup for as it is used in the time tracker SPA example (here) . They have a separate file (Util.elm) with the following function: cmdForRoute : Model -> List (Cmd Msg) (This function is called inside

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-12 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 12, 2016 at 1:55:02 PM UTC+1, Peter Damoc wrote: > > I did however became aware of a big limitation to this approach: ports. > > ports seam to be needed in order to implement triggering events in order > to communicate with the outside of the component. > I'll have to

Re: [elm-discuss] http "middleware" options

2016-10-12 Thread Peter Damoc
On Wed, Oct 12, 2016 at 4:13 PM, Fa Qing wrote: > I'm just curious how everybody approaches their API service layer in > complex applications. > > Right now, I have a shared API module that I call from various > elements/pages/components/children... in a pretty flat

[elm-discuss] http "middleware" options

2016-10-12 Thread Fa Qing
I'm just curious how everybody approaches their API service layer in complex applications. Right now, I have a shared API module that I call from various elements/pages/components/children... in a pretty flat architecture. That module abstracts out the common request composition, etc. What I

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-12 Thread Peter Damoc
Needing to set state on a component feels like an anti-pattern. I did however became aware of a big limitation to this approach: ports. ports seam to be needed in order to implement triggering events in order to communicate with the outside of the component. This limits the usefulness of the

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-12 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 11, 2016 at 11:07:46 AM UTC+1, Rupert Smith wrote: > > On Monday, October 10, 2016 at 10:40:25 PM UTC+1, Peter Damoc wrote: >> >> Now, the next challenge is to figure a way to declare all this in Elm and >> automate as much as possible the process of creating the custom

Re: [elm-discuss] Pattern matching on aliased types

2016-10-12 Thread Wouter In t Velt
Op dinsdag 11 oktober 2016 23:35:27 UTC+2 schreef Duane Johnson: > > toString is a bit magical in Elm, and can convert any type to a string. > Also note that if you apply toString to something that is already a String, it will add double quotes at the start and end. -- You received this

[elm-discuss] Re: Another documentation item I think is needed

2016-10-12 Thread Wouter In t Velt
Op dinsdag 11 oktober 2016 23:36:49 UTC+2 schreef J. E. Marca: > > On first read I laughed out loud --- I don't know what <| does, and it > seems a random application of head and drop. Reading closer, it *is* > straightforward as you say... drop first n items (one based count), then > get the

Re: [elm-discuss] control structure

2016-10-12 Thread Eduardo Cuducos
Hi Patricia, Elm, as a functional language, doesn't have for and while as declarative languages. There a lot of paradigms to have in mind: the sort of problem loops address in declarative languages usually is addressed with recursion in Elm and other functional languages (as Duane said). IMHO a

[elm-discuss] Re: Html.Keyed

2016-10-12 Thread Max Froumentin
Thanks OvermindDL1, that's very helpful. I now understand it's down to the lack of two-way binding. Makes sense. Wouldn't it be useful to use a change of id attribute as a change of key? On Tuesday, October 11, 2016 at 6:11:15 PM UTC+1, OvermindDL1 wrote: > > The ticked checkbox is because the

[elm-discuss] Re: Subscribe to a model value then call update function when condition is met

2016-10-12 Thread Wouter In t Velt
Op woensdag 12 oktober 2016 06:17:37 UTC+2 schreef hoang...@gmail.com: > > But if I do it this way, it's gonna return both the player's move and the > AI's move at the same time. What I want to have is that the game displays > the player's move THEN call minimax function on current model and

Re: [elm-discuss] control structure

2016-10-12 Thread Duane Johnson
Recursion is the basic principle on which repetition is based in functional languages like Elm. However, in most cases, recursion is not needed for day to day programming, because functions such as List.map and List.foldr will accept functions, and repeat the application of the passed-in function

[elm-discuss] Extracting and Injecting headers in an Http service helper/module

2016-10-12 Thread Fa Qing
I need to extract a header when an http response comes in, and inject a header when a request goes out. These headers are not specific to the lower level pages/modules/components/children... I have an API module that formats requests, checks responses, extracts headers, etc. Currently I pass

[elm-discuss] Html/Svg -> String for data:-URI download?

2016-10-12 Thread Alexander Klink
Hi, in elm-lsystems (see http://0x90.eu/ls/ and https://git.alech.de/alech/elm-lsystems/), I render an inline SVG. I would like the user to be able to download this SVG, for example by providing a link to a data:-URI of the content. For this, I would need a function that converts the given Svg

[elm-discuss] control structure

2016-10-12 Thread Patricia Nicole Benedicto
hi can i ask what is the repetiton control structucture of this programming languages? -- 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