Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 9:27:58 AM UTC+1, Rupert Smith wrote: > > On Tuesday, October 25, 2016 at 8:08:11 AM UTC+1, Peter Damoc wrote: >> >> Browsers can provide a trusted environment through the use of https. This >> is what Gmail and Facebook and all other webapps are doing. >> > >

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 8:08:11 AM UTC+1, Peter Damoc wrote: > > Why not just freeze dry your entire application state to some key/value >> store (on every update), then you have a simple way to rehydrate the whole >> application after a period of inactivity? >> > > This is not an option

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 8:08:11 AM UTC+1, Peter Damoc wrote: > > Browsers can provide a trusted environment through the use of https. This > is what Gmail and Facebook and all other webapps are doing. > What I mean is, there is nothing to stop whoever is running your application from

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-24 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 7:19:05 PM UTC+1, John Kelly wrote: > > I'm sorry to link drop, but I've been doing a bit of work on a library to > remove some of the boilerplate when writing client code for a REST API. The > library is currently locked in / specific to what is called

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-24 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 7:19:05 PM UTC+1, John Kelly wrote: > > I'm sorry to link drop, but I've been doing a bit of work on a library to > remove some of the boilerplate when writing client code for a REST API. The > library is currently locked in / specific to what is called

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-24 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 24, 2016 at 1:17:30 AM UTC+1, John Kelly wrote: > > I'm coming to the sad realization that an api like this is simply not > possible: > > ``` > session = > resource "sessions" > { id = int "id" > , speaker_id = int "speaker_id" > , start_time =

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-24 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 3:12:57 PM UTC+1, Robin Heggelund Hansen wrote: > > In Elm 0.18, primes are being removed as valid characters in a > variable/function name. The reason being, which I whole heartedly agree > with, that removing primes will incentivize people to write proper

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-20 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 8:23:46 PM UTC+1, OvermindDL1 wrote: > > Absinthe handles all the nasty parts of GraphQL though, the combining of > queries, the real-time type documentation generation, etc... etc... > What database do you use? Is it always a SQL database or can Absinthe work

[elm-discuss] Re: Atom Editor Race Condition (elm-format on save)

2016-10-20 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 9:39:44 AM UTC+1, Duane Johnson wrote: > > I have my Atom Editor configured with the following plugins: > - atom-beautify > - language-elm > - linter > - linter-elm-make > > The atom-beautify plugin is configured to "Beautify On Save". Normally, > after I save an

Re: [elm-discuss] Why aren't doc PRs merged?

2016-10-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 18, 2016 at 11:17:41 PM UTC+1, Shump wrote: > > I believe there already is a "community edition" over at > https://www.elm-tutorial.org/en/ Does anybody know if pull requests are being incorporated for elm-lang.org? In particular, as a newbie I have noticed that the syntax

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 4:39:00 PM UTC+1, OvermindDL1 wrote: > > I've been using absinthe on the server side and I am able to control > access permissions quite well for GraphQL hosting, though I am using a > custom permission library that ties to our local LDAP server so that code >

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 2:05:11 PM UTC+1, Rupert Smith wrote: > > On Wednesday, October 19, 2016 at 12:41:08 PM UTC+1, Austin Bingham wrote: >> >> I don't think I follow your logic. If my task produced a batch Cmd >> somehow (I'm not even sure how I would do that) >> > > You need to

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 12:41:08 PM UTC+1, Austin Bingham wrote: > > I don't think I follow your logic. If my task produced a batch Cmd somehow > (I'm not even sure how I would do that) > You need to figure out how to do that. Look at the type signature of Cmd.batch - hint, it returns

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 9:54:44 AM UTC+1, Peter Damoc wrote: > > *The problem * > > I know how to implement a REST API and interrogate that API from Elm but > that *seams very low level. * > > I was curious about a language abstraction that would isolate my Elm > program from the

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 10:51:16 AM UTC+1, Austin Bingham wrote: > > Is there a way to make Task.perform produce a batched "Cmd msg" on success > (or failure, for that matter)? I've got a case where, on success, I want to > send out more than one Msg, but because the success handler

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

2016-10-17 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 17, 2016 at 10:29:52 AM UTC+1, Rupert Smith wrote: > > On Friday, October 14, 2016 at 2:50:44 PM UTC+1, Peter Damoc wrote: >> >> On Fri, Oct 14, 2016 at 1:35 PM, 'Rupert Smith' via Elm Discuss < >> elm-d...@googlegroups.com> wrote: >> &g

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

2016-10-17 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 14, 2016 at 2:50:44 PM UTC+1, Peter Damoc wrote: > > On Fri, Oct 14, 2016 at 1:35 PM, 'Rupert Smith' via Elm Discuss < > elm-d...@googlegroups.com > wrote: > >> 1. Build some support into the Elm compiler for webcomponents. >> > > There

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

2016-10-14 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 11, 2016 at 11:21:05 AM UTC+1, Rupert Smith wrote: > > I'm interested in expanding on the counter example to add more complexity > - and I have a component in mind that will be useful to me - the listbox > that I was working with previously. > > The areas to add more

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

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 13, 2016 at 12:23:30 PM UTC+1, Rupert Smith wrote: > > Which is ok, but what I really want is for the listbox user to be able to > display more than just a string in the listbox, along these lines: > > root : Model -> Html Msg > root model = > listbox [ attrForSelect

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

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 13, 2016 at 2:17:50 AM UTC+1, Fa Qing wrote: > > The PageLevel is calling the service level for a command. We want > intermediate effects, before the final command. But we don't want to just > issue intermediate commands either, because the state that is reacting to > the

Re: [elm-discuss] Re: Html.Keyed

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 13, 2016 at 9:20:36 PM UTC+1, Rupert Smith wrote: > > On Tuesday, October 11, 2016 at 9:09:31 PM UTC+1, OvermindDL1 wrote: >> >> Remember, it is just a diffing algorithm, when it gets to that point of >> your vdom and it compares an old vdom node of, for example: >> ``` >>

Re: [elm-discuss] Re: Html.Keyed

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 11, 2016 at 9:09:31 PM UTC+1, OvermindDL1 wrote: > > Remember, it is just a diffing algorithm, when it gets to that point of > your vdom and it compares an old vdom node of, for example: > ``` > checkbox [ onClick (CheckToggle 42) ] [ text "Something" ] > ``` > and compares

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

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 12, 2016 at 1:34:32 PM UTC+1, Rupert Smith wrote: > > So there is an issue with being able to change the state of the component, > post initialization, from the consumer of the component. Because if there > is a port used to set state on the component... which component? >

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

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 11, 2016 at 11:21:05 AM UTC+1, Rupert Smith wrote: > > I'm interested in expanding on the counter example to add more complexity > - and I have a component in mind that will be useful to me - the listbox > that I was working with previously. > So I have a first pass at

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

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 13, 2016 at 9:33:18 AM UTC+1, Rupert Smith wrote: > > On Wednesday, October 12, 2016 at 5:34:36 PM UTC+1, Peter Damoc wrote: >> >> On Wed, Oct 12, 2016 at 6:57 PM, 'Rupert Smith' via Elm Discuss < >> elm-d...@googlegroups.com> wrote: >> >

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

2016-10-13 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 12, 2016 at 5:34:36 PM UTC+1, Peter Damoc wrote: > > On Wed, Oct 12, 2016 at 6:57 PM, 'Rupert Smith' via Elm Discuss < > elm-d...@googlegroups.com > wrote: > >> This limitation means you can't have UI elements defined outside of a >> component

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] 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] Re: Integrating Elm with Web Components / Polymer

2016-10-11 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 11:01:54 PM UTC+1, Richard Feldman wrote: > > Has anyone gotten anything doing really complicated DOM stuff (in > particular Google Maps comes to mind) working in Elm via web components? > > In theory it would Just Work, but in practice I always wonder... ;) > I

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

2016-10-11 Thread 'Rupert Smith' via Elm Discuss
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 components. > :) > I think rolling these Elm web components by hand should

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

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 3:38:13 PM UTC+1, Peter Damoc wrote: > > I have already tried doing this but have run into troubles: > > Here is the topic where I have the code and the problem: > https://groups.google.com/forum/#!topic/elm-discuss/QI6G6Pd5jPU > I think you just didn't get the

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

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 9:31:26 PM UTC+1, Rupert Smith wrote: > > > > On Monday, October 10, 2016 at 3:38:13 PM UTC+1, Peter Damoc wrote: >> >> I have already tried doing this but have run into troubles: >> >> Here is the topic where I have the code and the problem: >>

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

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 3:38:13 PM UTC+1, Peter Damoc wrote: > > I have already tried doing this but have run into troubles: > > Here is the topic where I have the code and the problem: > https://groups.google.com/forum/#!topic/elm-discuss/QI6G6Pd5jPU > I have found you can set it like

[elm-discuss] Re: Why does this not work via record intersection

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
Monday, October 10, 2016 at 5:09:39 AM UTC+1, Max Goldstein wrote: > > You need a rather non-obvious piece of syntax: > > make_xword : { a | rows : Int, cols : Int } -> Xword > > This basically means that the input is a record with rows and cols, and > any other fields. The origin of this syntax

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

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 2:20:57 PM UTC+1, Rupert Smith wrote: > > On Monday, October 10, 2016 at 2:14:55 PM UTC+1, Rupert Smith wrote: >> >> On Sunday, October 9, 2016 at 9:41:46 PM UTC+1, Peter Damoc wrote: >>> >>> The only thing that remained to be shown with code is how to implement a

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

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 2:14:55 PM UTC+1, Rupert Smith wrote: > > On Sunday, October 9, 2016 at 9:41:46 PM UTC+1, Peter Damoc wrote: >> >> The only thing that remained to be shown with code is how to implement a >> component in Elm and use it in Elm (yo, dawg style) . >> > > Like this: >

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

2016-10-10 Thread 'Rupert Smith' via Elm Discuss
On Saturday, October 8, 2016 at 10:29:27 PM UTC+1, Richard Feldman wrote: > > I'm catching up on this thread...so much impressive progress! :D > > It seems like: > >- registerElement is enough to get node "my-component" and on >"my-component-event" (with a custom decoder) working in Elm

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

2016-10-07 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 7, 2016 at 3:00:17 PM UTC+1, Peter Damoc wrote: > > > On Fri, Oct 7, 2016 at 4:41 PM, 'Rupert Smith' via Elm Discuss < > elm-d...@googlegroups.com > wrote: > >> customelements.io is all built on top of Polymer is it? >> >> Well, I got

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

2016-10-07 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 7, 2016 at 9:43:40 AM UTC+1, Peter Damoc wrote: > > Yes, we just need web-components, not polymer. Polymer is prividing some >> convenience to experiment with web components though. >> >>> Well... it's more than just convenience. If this gets really iron out > and Elm

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

2016-10-07 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 7, 2016 at 8:08:43 AM UTC+1, Peter Damoc wrote: > > I was thinking more in terms of having a way to define custom components > in Elm and then use them in Elm while avoiding to duplicate the runtime and > the rest of the core libraries. :) > Yes, so you can have internal

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

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 3:54:02 PM UTC+1, Peter Damoc wrote: > > Next challenge: how to implement Custom Elements in Elm. :) > > These examples cover a variety of different ways of working with elm and polymer together: https://github.com/kevinlebrun/elm-polymer This one, I think, is a

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

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 12:23:53 PM UTC+1, Peter Damoc wrote: > > This works for me in both Chrome and Firefox on OS X with > the 'webcomponents-lite.js' > > Thanks for solving this. > After some poking around and a severe lack of documentation on the part of Polymer, I have managed

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

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 12:07:15 PM UTC+1, Rupert Smith wrote: > > On Thursday, October 6, 2016 at 11:50:01 AM UTC+1, Rupert Smith wrote: >> >> On Thursday, October 6, 2016 at 11:14:46 AM UTC+1, Peter Damoc wrote: >>> >>> Custom elements also work decently when the custom element takes no

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

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 11:50:01 AM UTC+1, Rupert Smith wrote: > > On Thursday, October 6, 2016 at 11:14:46 AM UTC+1, Peter Damoc wrote: >> >> Custom elements also work decently when the custom element takes no >> children but if it does, it stops working. >> > > Rendering of keyed nodes

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

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 11:14:46 AM UTC+1, Peter Damoc wrote: > > Custom elements also work decently when the custom element takes no > children but if it does, it stops working. > Rendering of keyed nodes in the vdom is here:

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 4:59:17 PM UTC+1, Rupert Smith wrote: > > On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote: >> >> This is very interesting. >> Can you share some code so others can look at this? >> > > Its here: > >

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote: > > This is very interesting. > Can you share some code so others can look at this? > Its here: https://github.com/rupertlssmith/thesett_style_lab I have no idea how I hook into the events that it generates using 'on',

[elm-discuss] Re: Which text editor do you prefer for Elm?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 3:15:42 PM UTC+1, Kristo Koert wrote: > > I use spacemacs with the Elm layer > https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/elm > Looks interesting. That could tempt me back to emacs. -- You received this message because you are subscribed

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote: > > Polymers do not work like that. > Why do you say this, in relation to using a CDN to fetch the bits? Is it because you always use vulcanize to package the component lib up into your own customized version of it? There

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 3:32:21 PM UTC+1, Rupert Smith wrote: > > > > On Wednesday, October 5, 2016 at 3:28:31 PM UTC+1, Rupert Smith wrote: >> >> On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote: >>> >>> Polymers do not work like that. >>> For optimizing the size,

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 3:28:31 PM UTC+1, Rupert Smith wrote: > > On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote: >> >> Polymers do not work like that. >> For optimizing the size, see the links I posted in the previous comment. >> >> I have a personal

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote: > > Polymers do not work like that. > For optimizing the size, see the links I posted in the previous comment. > > I have a personal exploration of polymer that tried to minimize the output: >

[elm-discuss] Re: Which text editor do you prefer for Elm?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, August 10, 2016 at 11:47:34 AM UTC+1, Rupert Smith wrote: > > I'm trying the Elm emacs mode, but it is pretty bad. If I select and > indent a whole file for example all the import statements and statements > within a let .. in get indented +1 more level as you go down the list. >

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 11:44:35 AM UTC+1, Rupert Smith wrote: > > On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski > wrote: >> >> I took Peter’s gist as a basis and made a repo out of it: >> https://github.com/fredcy/elm-polymer-calendar >> > I am going to

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski wrote: > > I took Peter’s gist as a basis and made a repo out of it: > https://github.com/fredcy/elm-polymer-calendar > I am going to give this a go, as I need an MDL styles multi-select:

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 11:40:24 AM UTC+1, Rupert Smith wrote: > > On Wednesday, October 5, 2016 at 11:15:13 AM UTC+1, Wil C wrote: >> >> Hi all, >> >> Thanks again for all your help. And when I've asked questions last year. >> >> I have another question. Here's my situation. I want to

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

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 11:15:13 AM UTC+1, Wil C wrote: > > Hi all, > > Thanks again for all your help. And when I've asked questions last year. > > I have another question. Here's my situation. I want to pass a json from a > port, and decode the json into records. > > The recursive

[elm-discuss] Re: A convenience pattern around Http?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 4, 2016 at 5:54:01 PM UTC+1, Kasey Speakman wrote: > > Seems like this is trying to normalize operations to CRUD. I would be > careful of over-standardizing early. Because later you will likely have to > break those abstractions to implement new features. For example, the way

[elm-discuss] Underscores now allowed in repository URL.

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
I have this repo URL in my elm-package.json "repository": "https://github.com/rupertlssmith/thesett_style_lab.git;, But elm refuses to compile with that complaining about the underscores. Is is possible to override the package owner and name explicitly, rather than trying to extract them from

[elm-discuss] Re: A convenience pattern around Http?

2016-10-04 Thread 'Rupert Smith' via Elm Discuss
On Friday, September 30, 2016 at 2:37:35 PM UTC+1, Rupert Smith wrote: > > Firstly, I define a set of call-back functions which will be notified when > REST operations complete: > > callbacks : Account.Service.Callbacks Model Msg > callbacks = > { findAll = accountList > , findByExample =

[elm-discuss] Re: Is a decoder the right level of abstraction for parsing JSON?

2016-10-04 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 3, 2016 at 4:52:46 PM UTC+1, Kasey Speakman wrote: > > Coming from other languages, even back-end languages, decoding JSON just > isn't a thing. Even on the back-end, I will setup a reflection-based > deserializer with general error handling (e.g. Newtonsoft for .NET) and I'm

[elm-discuss] Re: Re-using validation checks on a form?

2016-10-04 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 3, 2016 at 11:05:45 PM UTC+1, Ian Mackenzie wrote: > > Looks about right to me, although I might be tempted to switch the order > of the first two arguments in checkAll - you can then use it as a > function which takes a list of model -> Bool functions and returns a new >

[elm-discuss] Re-using validation checks on a form?

2016-10-03 Thread 'Rupert Smith' via Elm Discuss
Hi, I need to put some validation checks on a form, things like if not (model.password1 == model.password2) then Textfield.error <| "Passwords do not match." but I will also need to re-use those checks to enable/disable the submit button. So I am thinking pull them out into functions:

[elm-discuss] Re: A convenience pattern around Http?

2016-09-30 Thread 'Rupert Smith' via Elm Discuss
On Friday, September 23, 2016 at 12:45:31 PM UTC+1, Rupert Smith wrote: > > I am wondering if all of this can be wrapped up in a more convenient > interface that the consumer of a REST service can make use of in a simpler > manner. > I now have this working and here is how it works. Firstly, I

[elm-discuss] Re: Routing, authentication etc. still on my 3rd Elm project.

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 12:26:17 PM UTC+1, Wouter In t Velt wrote: > > Very useful to read your experiences with Elm. I am in a more-or-less > similar point on the learning curve. > Small aside: The Elm Exts (extentions) package has a simple function > called catMaybes to filter out

[elm-discuss] Re: Is a decoder the right level of abstraction for parsing JSON?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 4:35:06 PM UTC+1, Rupert Smith wrote: > > I also have a little problem with the 'roles' encode to solve. At the > moment I have: > > , ( "roles" > , case model.roles of > Just roles -> > roles |> List.map

[elm-discuss] Re: Is a decoder the right level of abstraction for parsing JSON?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 4:25:25 PM UTC+1, Rupert Smith wrote: > > Some scnearios that would need to be covered: >> > I also have a little problem with the 'roles' encode to solve. At the moment I have: , ( "roles" , case model.roles of Just roles ->

[elm-discuss] Re: Can anyone get linter-elm-make working on Atom?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 3:19:01 PM UTC+1, Magnus Rundberget wrote: > > Have you tried running `elm-make src/elm/Main.elm --output /dev/null` on > your project ? > I did try that and noted that it fails. It succeeds during the grunt build when elm-make is invoked, because all of

[elm-discuss] Re: Can anyone get linter-elm-make working on Atom?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 28, 2016 at 4:42:32 PM UTC+1, OvermindDL1 wrote: > > (also get Atom's elmjutsu plugin, made by same person as linter-elm-make > and they work wonderfully together). > That looks very useful. Hopefully one day someone will add 'extract function' and 'inline function' auto

[elm-discuss] Re: Can anyone get linter-elm-make working on Atom?

2016-09-28 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 28, 2016 at 4:42:32 PM UTC+1, OvermindDL1 wrote: > > It works fine for me (also get Atom's elmjutsu plugin, made by same person > as linter-elm-make and they work wonderfully together). > > So first of all the src directory in elm-package.json should be as it > normally

[elm-discuss] Routing, authentication etc. still on my 3rd Elm project.

2016-09-28 Thread 'Rupert Smith' via Elm Discuss
So I have been sidetracked a bit learning how to handle REST calls in Elm and figuring out what help functions I can write around that to try and wrap up a service + boilerplate in a way that provides the simplest interface to a consumer of it. I have a screen that displays user accounts and

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

2016-09-28 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 28, 2016 at 11:55:06 AM UTC+1, Peter Damoc wrote: > > I looked at the entire dist folder as that was the actual result in my > perspective. 1MB index.html with about 700k extra JS (elm.js included) > Yes, it was not minified. > > The performance details are part of what

[elm-discuss] Can anyone get linter-elm-make working on Atom?

2016-09-28 Thread 'Rupert Smith' via Elm Discuss
My proejct structure is like this: / - elm-pacakge.json - /elm-stuff - /src - /elm - lots of elm files However, when running linter-elm-make it will say "Error, I cannot find module 'Log'" - perhaps a "source-directories" needs to be added to elm-package.json to locate it? So I try adding

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

2016-09-28 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 28, 2016 at 7:59:55 AM UTC+1, Peter Damoc wrote: > > I've tried your solution and at least I got to confirm a personal fear: > it's scary big. > 1.7MB might not seam much but... I'll be honest, I don't like artifacts > this big . > The inspector says that it will take

Re: [elm-discuss] Is the 'as' keyword officially part of Elm?

2016-09-27 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 27, 2016 at 3:28:30 PM UTC+1, Joey Eremondi wrote: > > A list of missing documentation would also be valuable. Not sure where the > right place to put it would be though. > Just have a thread on here to draw up a list of what is missing, then contribute to the elm-lang.org

[elm-discuss] Is the 'as' keyword officially part of Elm?

2016-09-27 Thread 'Rupert Smith' via Elm Discuss
As aluded to in Brian Marick's recent thread, there is an 'as' keyword which can be used to pattern match on a union type in within a function arguments, like this: animation ((DropsPerSecond raw) as dropsPerSecond) = … No mention of it in the syntax guide:

[elm-discuss] A convenience pattern around Http?

2016-09-23 Thread 'Rupert Smith' via Elm Discuss
Making a REST call from Elm and geting back the results is quite a complicated process. 1. Set up a Msg that the UI can trigger the request from. 2. Write a Task to perform the request. 3. In the update function turn that into a Cmd to make the request using Task.perform. 4. Set up Msgs to

[elm-discuss] Re: Modeling cross-references

2016-09-23 Thread 'Rupert Smith' via Elm Discuss
On Friday, September 23, 2016 at 9:44:47 AM UTC+1, Rupert Smith wrote: > > type Album = > Album { name : String, artists : Maybe List Artist } > | Reference String > > type Artist = > Artist { name : String, albums : Maybe List Album } > | Reference String > Would also make the ids

[elm-discuss] Re: Modeling cross-references

2016-09-23 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 22, 2016 at 11:24:38 PM UTC+1, Dénes Harmath wrote: > > in a typical model, there are cross-references: e.g. we have artists and > albums, and the album refers to its artist. How do we model this in Elm? A > possible approach is giving unique identifiers to objects and

Re: [elm-discuss] Elm, Objects and Components

2016-09-22 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 22, 2016 at 3:12:27 PM UTC+1, OvermindDL1 wrote: > > You can compile multiple main files together and they will share a > code-base, standard library, and all such. > I had not considered that - useful if you want to take a one page, one main approach rather than nested

Re: [elm-discuss] Elm, Objects and Components

2016-09-22 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 21, 2016 at 10:59:00 PM UTC+1, John Mayer wrote: > > I also posit that automatically generating a web component for every > top-level Elm app is isomorphic and maybe even superior interface to our > existing method of embedding Elm in native HTML pages, and could even >

[elm-discuss] Re: Http 401 Interceptor? My 3rd Elm Project - authentication

2016-09-22 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 21, 2016 at 3:02:51 PM UTC+1, Erik Lott wrote: > > Regarding the outmsg and translating types, you've got 2 options - you can > either keep the outmsg in the scope of the module, or you can pass the > outmsg to the update function from the upper level > Thanks for that,

Re: [elm-discuss] Re: Some questions about types.

2016-09-21 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 21, 2016 at 10:42:49 AM UTC+1, Janis Voigtländer wrote: > > This type is very special. The definition in Elm is solely a placeholder, > the actual implementation is in native code. You should not think further > about this trickery, assuming you want to program Elm, not

[elm-discuss] Re: 'comparable' recrods and union types?

2016-09-21 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 21, 2016 at 2:29:44 PM UTC+1, Rupert Smith wrote: > > There is an issue here noting that there is no way to make records or > union types 'comparable': > > https://github.com/elm-lang/elm-compiler/issues/774 > > Closed. Has this feature been implemented, or is it something

[elm-discuss] 'comparable' recrods and union types?

2016-09-21 Thread 'Rupert Smith' via Elm Discuss
There is an issue here noting that there is no way to make records or union types 'comparable': https://github.com/elm-lang/elm-compiler/issues/774 Closed. Has this feature been implemented, or is it something that is not on the radar? -- You received this message because you are subscribed

[elm-discuss] Re: Some questions about types.

2016-09-21 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:03:49 PM UTC+1, Rupert Smith wrote: > > The docs around the basics of syntax don't really cover this: > http://elm-lang.org/docs/syntax#type-annotations > In the module declaration for Task there is a 'where': effect module Task where { command = MyCmd }

[elm-discuss] Re: Some questions about types.

2016-09-21 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 4:25:42 PM UTC+1, Rupert Smith wrote: > > type Cmd msg = Cmd > I am still a bit perplexed by this. It is a parameterized type, but the parameter is thrown away and not used. I can only create one of them, since their is only one constructor. Given that, why

[elm-discuss] Re: Elm, Objects and Components

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 12:30:03 PM UTC+1, Gusztáv Szikszai wrote: > > Also maybe you don't know but I've created Elm-UI > just for the same reason: to quickly build stuff from the same components > just like Bootstrap. And it solves many of the problems that seems

Re: [elm-discuss] Re: Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 4:53:42 PM UTC+1, Janis Voigtländer wrote: > > So the definition of List might look like: > > type List a > = Nil > | Cons a (List a) > > That’s exactly how the definition of List would look like if it didn’t > have a native implementation. > > So it seems you

[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Monday, September 19, 2016 at 2:08:43 PM UTC+1, Peter Damoc wrote: > > I keep postponing this for a few weeks but today my partner decided to > stop the collaboration and I'll take advantage of this moment to write this > post mortem. > Di your 'collaboration' end because Elm turned out to

[elm-discuss] Re: Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
Some more questions about types. I just ran into the recursive 'type alias' issue: https://github.com/elm-lang/elm-compiler/blob/0.17.1/hints/recursive-alias.md which is clear enough. It seems a bit of a shame that some of this documentation is a bit buried away - it really feels like this

Re: [elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:37:29 PM UTC+1, Rupert Smith wrote: > > On Tuesday, September 20, 2016 at 2:08:31 PM UTC+1, Joey Eremondi wrote: >> >> Both int and float end up as a JS number at the end of the day, so >> definitely bounded. Defer to the JS spec? >> > >

Re: [elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:08:31 PM UTC+1, Joey Eremondi wrote: > > Both int and float end up as a JS number at the end of the day, so > definitely bounded. Defer to the JS spec? > http://www.w3schools.com/js/js_numbers.asp Says "Javascript numbers are always 64-bit floating point".

[elm-discuss] Re: Http 401 Interceptor? My 3rd Elm Project - authentication

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Sunday, September 18, 2016 at 9:33:14 PM UTC+1, Erik Lott wrote: > > I'm not sure what the outmessage package is that you linked to, but you > don't need a package to manage this. An outmsg is just a messge that is > returned from the update function, to notify the function caller of >

[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Monday, September 19, 2016 at 6:18:33 PM UTC+1, Rex van der Spuy wrote: > > CSS is hell-on-wheels: the most time I've spent debugging my Elm apps have > not been with my Elm code, but with the CSS. > > Hey, Elm Community, we've solved JavaScript now we need a real solution to > CSS! :) > I

[elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
Is Int unbounded? I mean is it a 'big integer' implementation as per ML, or is it 64-bit or soe other limit? What is the precision of a Float? Is it the same as 64-bit IEEE 754? Is there a 'big decimal' representation? The docs around the basics of syntax don't really cover this:

[elm-discuss] Re: Http 401 Interceptor? My 3rd Elm Project - authentication

2016-09-16 Thread 'Rupert Smith' via Elm Discuss
On Friday, September 16, 2016 at 6:07:42 PM UTC+1, Erik Lott wrote: > > Rupert, here is a high level overview of how we currently structure our > elm SPAs: > >1. Top layer: This layer manages routing, page changes, and page >resource loading, and current user state >2. Page layer:

[elm-discuss] Re: Http 401 Interceptor? My 3rd Elm Project - authentication

2016-09-16 Thread 'Rupert Smith' via Elm Discuss
On Friday, September 16, 2016 at 4:00:39 PM UTC+1, Rupert Smith wrote: > > > I just need to think about how to add functions to query the auth state on > this module too, as it would also be nice to be able to query that all over > the place too. Something like > So to solve this problem I came

[elm-discuss] Re: Http 401 Interceptor? My 3rd Elm Project - authentication

2016-09-16 Thread 'Rupert Smith' via Elm Discuss
On Friday, September 16, 2016 at 2:49:25 PM UTC+1, Rupert Smith wrote: > > I think I am going to try the solution from the "Inter-Component > Communication in 0.17" thread. Which is to create pairs of messaging ports. > The module I came with is below. I can import it anywhere and make use of

Re: [elm-discuss] Can you have a port that takes no args? What is its type?

2016-09-16 Thread 'Rupert Smith' via Elm Discuss
ri, Sep 16, 2016 at 7:13 AM, 'Rupert Smith' via Elm Discuss < > elm-d...@googlegroups.com > wrote: > >> port logout : Cmd msg >> >> yields: >> >> 13| port logout : Cmd msg >> ^ >> You are saying it should be: >> >

<    1   2   3   4   5   6   >