Re: [elm-discuss] Distinguishing HTTP error codes

2017-12-03 Thread Peter Damoc
Are you able to confirm in the developer console or Postman or some other tool that you are actually getting a 401 from the server? I'm getting 400 and 401 just fine from my servers and Elm is encoding them just fine as a BadStatus. On Sun, Dec 3, 2017 at 5:36 AM, Michal Blazejczyk <

Re: [elm-discuss] How to enforce Elm to recreate HTML tags instead of reusing existing tags?

2017-11-27 Thread Peter Damoc
Use Html.Keyed for managing the troublesome kids. Here is your example adapted based on your feedback that it is the age field that's the problem. https://ellie-app.com/czbx9WRyDa1/0 On Mon, Nov 27, 2017 at 7:12 PM, Kadzuya OKAMOTO wrote: > Here is an example app to

Re: [elm-discuss] Expanding competence

2017-11-07 Thread Peter Damoc
Hi David, I think you already know everything you need to know. Just attempt to do it and if you get into trouble the community will assist you. For a multi-user app you also need a backend and since Elm does not have an official backend story, you will need to switch to another language. I

Re: [elm-discuss] What build system do you prefer for Elm?

2017-10-31 Thread Peter Damoc
Consider using npm as a build system https://css-tricks.com/why-npm-scripts/ The main advantage is that you can control everything easier. The main disadvantage I guess is that it might get complicated for complex scenarios. On Tue, Oct 31, 2017 at 4:18 PM, 'Rupert Smith' via Elm Discuss <

Re: [elm-discuss] The NumPy for Elm

2017-10-31 Thread Peter Damoc
Hi Fran, I would be interested in seeing performance benchmarks agains NumPy. I'm expecting NumElm to be worse but I'm curious how much worse it is. :) In any case, congrats for creating this! On Tue, Oct 31, 2017 at 2:32 PM, Francisco Ramos wrote: > Today I'm

Re: [elm-discuss] Re: Is Elm going stale?

2017-10-27 Thread Peter Damoc
On Thu, Oct 26, 2017 at 8:50 PM, Brian Hicks wrote: > > Even if the language were not being actively developed (which it is) the > community is thriving and I would hope makes the investment in using the > language worthwhile. :) > If one learns a language for some toy

Re: [elm-discuss] Is Elm going stale?

2017-10-27 Thread Peter Damoc
On Thu, Oct 26, 2017 at 8:11 PM, LondonTokyo wrote: > Its now been a year since the last Elm release, and there has been no > updates in Github for 3 months, as far as I can see. > Last update in the dev branch of the core was about an hour ago. The master branch

Re: [elm-discuss] Re: ELM = JAVASCRIPT REINVENTED (PART 1)

2017-10-25 Thread Peter Damoc
Reality is prickly-goo and gooey-prickles . Elm sins by seeing reality too much from a prickly point of view. You can call this opinionated but if it is taken to an extreme, you get the symptoms typical to a prickly system, the main one being the

Re: [elm-discuss] Elm Logo vs Dynegy Logo

2017-09-15 Thread Peter Damoc
The Elm logo is a tangram . I guess there are multiple businesses that either use it or used it. :) On Fri, Sep 15, 2017 at 5:07 PM, David Zwerdling wrote: > This is probably OT, but can anyone talk about the fact that the Dynegy

Re: [elm-discuss] Elm with one message

2017-09-05 Thread Peter Damoc
On Tue, Sep 5, 2017 at 10:02 AM, Vlad GURDIGA wrote: > In my app I have a large data entry form where initial fields determine > which subsequent fields will be. It’s my understanding that every change to > the model should be its own message. So far I have 50 fields in total

Re: [elm-discuss] Re: Elm as templating engine

2017-09-04 Thread Peter Damoc
On Sun, Sep 3, 2017 at 11:07 AM, Birowsky wrote: > Unfortunately, it just adds `=""`. You can't see it in the dev tools > because the browser strips it away. > Fortunately that is OK as it is implicitly equivalent to what you want:

Re: [elm-discuss] Elm with one message

2017-09-01 Thread Peter Damoc
On Fri, Sep 1, 2017 at 9:38 AM, Vlad GURDIGA wrote: > Oh wow! This looks super cool! 邏 > > …and it seems this would also cover for the issue that Peter mentioned > : > this gives me the ability to have a

Re: [elm-discuss] Javascript interop width timing

2017-08-31 Thread Peter Damoc
Here is the watch example modified to have an effect in a place of the DOM that's outside of Elm's control: https://ellie-app.com/4b3rFVGCK32a1/0 On Wed, Aug 30, 2017 at 10:57 PM, wrote: > Hello guys, > I'm involved in developing a interactive animation for

Re: [elm-discuss] Elm with one message

2017-08-27 Thread Peter Damoc
On Sun, Aug 27, 2017 at 11:15 AM, Vlad GURDIGA wrote: > > You basically have to computer all the possible future states of the app. >> > > Not sure what you mean here. Could you please expand, or maybe point to an > example in the code? 樂 > Let's simply the problem space and

Re: [elm-discuss] Elm with one message

2017-08-24 Thread Peter Damoc
On of the key recommendations of Elm Architecture is to have your messages be just data. Your approach is somewhat similar to the approach of elm-sortable-table (except for the Cmds and Subs). Without using Cmds and/or Subs it is an interesting approach if you use it for managing very small

Re: [elm-discuss] More pattern matching

2017-08-22 Thread Peter Damoc
I don't know about elegant but one way to implement something like fizzBuzz would be: https://ellie-app.com/469wMYcvrZ3a1/0 Of course, this assumes that you have a lot of patterns and not the 4 in fizzBuzz If evaluating all the branches is too expensive you can use functions like this:

Re: [elm-discuss] Embedding the same view multiple times on a page

2017-08-15 Thread Peter Damoc
On Tue, Aug 15, 2017 at 11:21 PM, Anthony Naddeo wrote: > Assuming I get that to work, what does embed actually do? Is each instance > totally isolated? Does the elm runtime bootstrap itself each time? To share > state, we'll have to use ports? > To my understanding,

Re: [elm-discuss] Json file size

2017-08-11 Thread Peter Damoc
Use the dictionary as a JS service. You can load the dictionary in JS and use ports to interrogate it. https://ellie-app.com/3Z8hSkXxxBGa1/0 If you like to live dangerously you can also use Kernel code to interrogate the JS dictionary datastructure synchronously. Since the dictionary is fixed,

Re: [elm-discuss] Elm `reusable views`

2017-08-03 Thread Peter Damoc
> > Mark > > On Thu, Aug 3, 2017 at 3:53 AM Peter Damoc <pda...@gmail.com> wrote: > >> You could try to use MutationObservers to ferry that information in Elm: >> https://ellie-app.com/3VFHVxMsW2ya1/0 >> >> Unfortunately, I don't know enough about them to

Re: [elm-discuss] Elm `reusable views`

2017-08-03 Thread Peter Damoc
You could try to use MutationObservers to ferry that information in Elm: https://ellie-app.com/3VFHVxMsW2ya1/0 Unfortunately, I don't know enough about them to provide a solution that would actually monitors their resizing but maybe someone else could. On Thu, Aug 3, 2017 at 11:43 AM, enetsee

Re: [elm-discuss] Can we get a patch release of elm-lang/core?

2017-07-30 Thread Peter Damoc
On Sun, Jul 30, 2017 at 4:13 PM, Filip Haglund wrote: > I'm currently blocked on this bug https://github.com/elm-lang/core/commit/ > 8e885c9bd4a7556ee039e2f53bbb3a1555d0243e#diff- > de88ec52111a9d7bd82177e4654bb0f0R449 . It's been fixed months ago, but > there's no patch

Re: [elm-discuss] Best practices for designing models in the Elm Architecture - lean or rich?

2017-07-25 Thread Peter Damoc
Keep derived data in the model if it makes sense to keep derived data in the model. If you have an expensive function that runs and computes a derived value and you would have to call frequently this function in your view, then by all means, computer the derived value in update and save it in the

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-25 Thread Peter Damoc
On Tue, Jul 25, 2017 at 3:32 AM, Erik Simmler wrote: > That said, what if we flip the question around? Given that we have > facilities for encapsulation (unexposed types), what would we gain by > adding a new set of concepts around mixing data/logic and syntactic sugar > in the

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-25 Thread Peter Damoc
On Mon, Jul 24, 2017 at 8:50 PM, Dave Ford wrote: > A lot of my early work was centered around UIs which made heavy use of >> inheritance and mutation. >> > I really don't think this is related to the original question. The > original question was not about inheritance or

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-23 Thread Peter Damoc
On Sun, Jul 23, 2017 at 1:39 AM, Dave Ford wrote: > > It's not that OOP is bad, but it encourages mutation >> > OOP does not encourage nor discourage mutation. Java, Kotlin, Scala and > OCAML all *allow* mutation. Kotlin, an OO language that I use a lot, > actually

Re: [elm-discuss] main : Program Never Model Msg -- What does it mean?

2017-07-21 Thread Peter Damoc
The main is a *value* of type `Program Never Model Msg`, it is not a function. The 3 types after Program, (Never, Model and Msg) are the arguments of the type in the same way that String is an argument for List in `List String` You can read that as "a Program that does not take any flags (Never)

Re: [elm-discuss] Systemic problem in Object Oriented languages

2017-07-20 Thread Peter Damoc
On Thu, Jul 20, 2017 at 12:49 PM, Christophe de Vienne < christo...@cdevienne.info> wrote: > > Well, it is more an intuition after more than 20 years of coding that an > elaborated opinion. > > But the first thing that comes to my mind is the resulting complexity, > and often confusion. I find

Re: [elm-discuss] Systemic problem in Object Oriented languages

2017-07-20 Thread Peter Damoc
On Thu, Jul 20, 2017 at 11:52 AM, Dave Ford <df...@smart-soft.com> wrote: > On Thu, Jul 20, 2017 at 4:14 AM, Peter Damoc <pda...@gmail.com> wrote: > >> "this" is associated with mutation. Elm is an immutable language. >> > > I don't think that

Re: [elm-discuss] Systemic problem in Object Oriented languages

2017-07-20 Thread Peter Damoc
"this" is associated with mutation. Elm is an immutable language. In theory, one could have immutable objects where data and logic are grouped together. The best expression I've seen so far is the FauxO system in Gary Bernhardt's Boundaries talk. Something like this would constitute a

Re: [elm-discuss] ADT: How to know whether two values have the same constructor?

2017-07-19 Thread Peter Damoc
On Wed, Jul 19, 2017 at 9:24 PM, David Andrews wrote: > Another downside I can think of is that it can only tell you if two values > have constructors with the same name. If the same name is used in multiple > files, they will appear to be equal. > If you use raw toString,

Re: [elm-discuss] ADT: How to know whether two values have the same constructor?

2017-07-18 Thread Peter Damoc
I cannot think of any other drawback right now. Maybe with more information about the context where this is needed a better option can be found. I'm actually curious what is the use case that prompted this request as it has a very XYproblem feel to it. On Tue, Jul 18, 2017 at 9:03 PM,

Re: [elm-discuss] ADT: How to know whether two values have the same constructor?

2017-07-18 Thread Peter Damoc
In theory you could use the inspection offered by toString: sameConstructor : a -> a -> Bool sameConstructor first second = case ( String.words (toString first), String.words (toString second) ) of ( a :: _, b :: _ ) -> a == b _ -> False That being

Re: [elm-discuss] licensing?

2017-07-05 Thread Peter Damoc
I'm not a lawyer but every elm package has a license declaration in elm-packages.json. It defaults to BSD3 which is a very permissive license. I guess it could be argued that by stating that in elm-package.json, you are placing your code under that license. I do think that this should be treated

Re: [elm-discuss] Re: State of CSS in Elm

2017-07-04 Thread Peter Damoc
On Mon, Jul 3, 2017 at 6:59 PM, Greg Coladarci wrote: > A year later, I've just discovered this thread as I am new to the Elm > world and was interested in how others solved for the styling side of > things. > > In the spirit of trying to figure out how Elm can help solve

Re: [elm-discuss] Local third-party packages

2017-07-04 Thread Peter Damoc
On Mon, Jul 3, 2017 at 4:15 PM, Jens Egholm wrote: > Just a thought; shouldn't this be available through native Elm package > management? > > NO! This kind of unsafe use of code is and should forever be discouraged. I have dabbled in Native code and the main lesson from my

Re: [elm-discuss] elm-package.json hierarchy?

2017-07-03 Thread Peter Damoc
It is advisable to have elm-packages.json` in specialty folders like `examples` or `tests` Those folders might require packages that you don't want to add as dependencies to the main `elm-packages.json` On Mon, Jul 3, 2017 at 9:12 PM, Raoul Duke wrote: > Is there very often a

Re: [elm-discuss] Making useless HTML Attributes impossible

2017-07-01 Thread Peter Damoc
On Sat, Jul 1, 2017 at 9:35 PM, wrote: > It's been some time that I'm thinking about type checking HTML Attributes > to ensure at compile time that useless attributes can't be set on HTML. For > instance, it makes no sense to set Html.Attributes.src to an h1 title. >

Re: [elm-discuss] Newbie program not working correctly

2017-06-23 Thread Peter Damoc
Hi Casper, Just force an empty value when the age is 0 Like this: https://ellie-app.com/3yrgPqxp52ha1/0 On Fri, Jun 23, 2017 at 12:08 PM, Casper Bollen wrote: > I wrote a small program as a newbie project in Elm: https://ellie-app.com/ > 3ynWqjPcP87a1/0. > > In this program

Re: [elm-discuss] Re: The way forward for Elm Arrays

2017-06-12 Thread Peter Damoc
On Mon, Jun 12, 2017 at 8:08 AM, Evan wrote: > Syntax > > I was formerly somewhat keen on having special syntax for other > collections. For example, OCaml allows you to say [| 1, 2, 3 |] to create > an array. Hassan made a really nice proposal >

Re: [elm-discuss] explain how Task works

2017-06-09 Thread Peter Damoc
Process.sleep time is creating a Task that will be running for the duration of the time and then produce an empty tuple. Task.andThen is taking this produced task and after it finishes it calls the provided function (always <| Task.succeed msg) (always <| Task.succeed msg) is equivalent to (\_

Re: [elm-discuss] What is the Elm equivalent of a Data Specification Language (EDN in Closure, ADTs, etc)?

2017-06-09 Thread Peter Damoc
Hi Gaurav and welcome to Elm! Your intuition is correct, you should emphasize understanding the basic data structures and build something with them. If you have a concrete problem you are trying to solve you will be focusing on finding the solution. Without a concrete problem is tempting to go

Re: [elm-discuss] Add css classes to existing html nodes

2017-06-08 Thread Peter Damoc
Hi Eike and welcome to Elm. You could add some kind of a class to the div that's holding the markdown generated html and use that as a selector. If you need something more complex than that, you might need to use html inside the markdown Here is how to do both:

Re: [elm-discuss] Adding CSS produced by a view function to the document's

2017-06-06 Thread Peter Damoc
It seams that you have driven yourself into a corner because of a series of choices that you made with your code architecture. The best way forward is to refactor you code so that you decouple the style from the view. You should be able to get both of them from the model independently. Once

Re: [elm-discuss] Platform.Cmd.batch executes commands in reverse order

2017-05-12 Thread Peter Damoc
On Fri, May 12, 2017 at 8:07 PM, Frank Bonetti wrote: > > Imagine for a second that the first task takes 2 seconds the second task > 1 second and the third 500ms. They finish in reverse order. If you want > their result immediately after they finish, the results will

Re: [elm-discuss] Platform.Cmd.batch executes commands in reverse order

2017-05-12 Thread Peter Damoc
On Fri, May 12, 2017 at 7:33 PM, Frank Bonetti wrote: > Also, to the best of my knowledge, the only way to execute Tasks > concurrently and independently is to use Cmd.batch. > Yes. But you cannot have concurrency and guaranteed ordering in the same time without some

Re: [elm-discuss] Platform.Cmd.batch executes commands in reverse order

2017-05-12 Thread Peter Damoc
Here are two approaches to just adding the texts (I'm assuming some interface where you want to send a series of messages one after the other and having the user seeing them arrive one after the other with some delay between them) with subscriptions: https://ellie-app.com/39PpTzWp5y3a1/0 without

Re: [elm-discuss] Platform.Cmd.batch executes commands in reverse order

2017-05-12 Thread Peter Damoc
The execution of a Cmd.batch list of commands has not ordering guarantee. What you see is an artifact and you should not treat it as a predictable way of execution. The way to think about a Cmd.batch is that they will get executed and you will eventually get a reply. If you need a list of tasks

Re: [elm-discuss] Tour of an open-source 4,000 LoC Elm SPA

2017-05-08 Thread Peter Damoc
another advantage to a build system (webpack) is that you could create a `docs` folder where to output the current build, mount that folder to be used by the project as its Github Pages root and link it from the README.md. -- There is NO FATE, we are the creators. blog: http://damoc.ro/ --

Re: [elm-discuss] Tour of an open-source 4,000 LoC Elm SPA

2017-05-08 Thread Peter Damoc
First, thank you so much for taking time from your already busy schedule to solve this for the community! I think it is an amazingly useful project as it short-circuits a lot of the potentially time-hungry decisions. Can you comment on why you did not use the elm-webpack-loader? I'm trying to

Re: [elm-discuss] List of all members of a union type

2017-05-03 Thread Peter Damoc
On Wed, May 3, 2017 at 7:00 PM, Charles Scalfani wrote: > Adding this to the language feels like how other languages evolve, which > is haphazardly. > > I rather see a more general solution to this problem via some type of > constraint-based type. For example, imagine you

Re: [elm-discuss] List of all members of a union type

2017-05-03 Thread Peter Damoc
On Wed, May 3, 2017 at 6:17 PM, Max Goldstein wrote: > Building on Charles, how would this handle recursive union types? This can be handled as a convention at compiler level. A new restricted type variable could be created, let's call it "enumerable" and only

Re: [elm-discuss] List of all members of a union type

2017-05-02 Thread Peter Damoc
On Wed, May 3, 2017 at 6:56 AM, Joey Eremondi wrote: > The problem is, this would only work when all the constructors had 0 > arguments , or arguments of the same type. Otherwise, what would the type > of such a list be? > But if we would have a function like:

Re: [elm-discuss] Re: Moving on

2017-04-27 Thread Peter Damoc
On Thu, Apr 27, 2017 at 1:48 PM, Rehno Lindeque wrote: > > This grey list would be backed by a clear process of getting things on the >> list that would include a checklist of mandatory things. >> This checklist would be like a rule list and breaking any of the rule >>

Re: [elm-discuss] Re: Moving on

2017-04-27 Thread Peter Damoc
On Thu, Apr 27, 2017 at 12:59 PM, Wojciech Piekutowski < w.piekutow...@gmail.com> wrote: > Peter, did you mean https://github.com/gdotdesign/elm-github-install for > installing packages with missing Web APIs? > No. elm-github-install allows for too much freedom. What I had in mind was more

Re: [elm-discuss] Re: Scaling Elm

2017-04-26 Thread Peter Damoc
On Wed, Apr 26, 2017 at 7:13 PM, Dwayne Crooks wrote: > How about writing an Elm front-end for https://github.com/ > gothinkster/realworld. > This is what I'm actually contemplating right now. I'll explore it some more next week. -- There is NO FATE, we are the

Re: [elm-discuss] Re: Moving on

2017-04-25 Thread Peter Damoc
On Wed, Apr 26, 2017 at 5:17 AM, John Orford wrote: > My 2c on above... > > 1) web components - once they're a standard they will be a must. > > Perhaps they feel like a necessity now (I am sold) but they're still in a > flux, browsers support bits and pieces, some things

Re: [elm-discuss] Re: Moving on

2017-04-25 Thread Peter Damoc
On Tue, Apr 25, 2017 at 7:42 PM, Eirik Sletteberg wrote: > Since you mention pitch forks... > Maybe there's a potential for an Elm fork. > There are so many unexplored options that don't need any kind of fork of Elm. Reaching for something as drastic as a fork of the

Re: [elm-discuss] Unexpected error when parsing what seems to be reasonable code (Bug in parser maybe?)

2017-04-23 Thread Peter Damoc
On Sat, Apr 22, 2017 at 11:50 AM, Dwayne Crooks wrote: > However, if I update the let bindings as follows: > > let >> defaultViewConfig = Rating.defaultViewConfig >> ratingViewConfig = >> { defaultViewConfig | readOnly = model.readOnly }

Re: [elm-discuss] Optimisation in Elm

2017-04-23 Thread Peter Damoc
Hi Ana, 1. Elm is fast because it use a very fast implementation of a virtual dom. 2. Elm compiler outputs JavaScript so all the low level memory concerns are handled by the JavaScript VM, not by Elm 3. No, Cmds do not influence the purity of Elm. If a function returns Cmds, it will always return

Re: [elm-discuss] Looking for a better way to use `andThen` chains (and other beginner questions)

2017-04-23 Thread Peter Damoc
On Sat, Apr 22, 2017 at 12:37 AM, Stefan Matthias Aust wrote: > > *My first question*: Is there any way to create a constrained type like > "something that has a `no` field? > > Right now, I have a lot of nearly identical code like this: > > findStar : StarNo -> Game -> Maybe

Re: [elm-discuss] Re: Comments on the TEA Components package

2017-04-19 Thread Peter Damoc
On Wed, Apr 19, 2017 at 11:19 PM, Yosuke Torii wrote: > I'm curious what makes it sound that way, since as you noted, that is not >> the point I'm making. >> > > I don't know if others feels like me or not. But at least for me, "no > components" sounds a bit confusing (it is

[elm-discuss] Scaling Elm

2017-04-19 Thread Peter Damoc
Hello community, Scaling Elm apps seams to be a recurring topic. I was wondering if maybe we could negotiate a minimal set of functionality, something similar to ToDoMVC, that could be implemented using different approaches to explore what could be the best way to structure the code. What

Re: [elm-discuss] Re: Comments on the TEA Components package

2017-04-19 Thread Peter Damoc
so, the Model-View-Update triplet *is NOT* the wrong unit of composition for Elm applications? :) Don't you see how people starting up with Elm could get confused by this kind of messages? On Wed, Apr 19, 2017 at 10:03 AM, Richard Feldman < richard.t.feld...@gmail.com> wrote: > > How do you

Re: [elm-discuss] Re: Comments on the TEA Components package

2017-04-19 Thread Peter Damoc
On Wed, Apr 19, 2017 at 9:19 AM, Richard Feldman < richard.t.feld...@gmail.com> wrote: > My point that there's a simple way to scale Elm applications by > abstracting at the function level has gone uncontested for awhile in this > thread. I think at this point I've said my piece and might as well

Re: [elm-discuss] Re: Comments on the TEA Components package

2017-04-18 Thread Peter Damoc
On Wed, Apr 19, 2017 at 2:58 AM, Richard Feldman < richard.t.feld...@gmail.com> wrote: > > "Everything ought to have the same API" is a much harder claim to defend. > It sounds wrong at face value, and I haven't seen any evidence (in this > thread or elsewhere) to convince me that it's a wise goal

Re: [elm-discuss] Is there a way to get a compile-time error when a field is added to a record type but its corresponding JSON encoder is not?

2017-04-07 Thread Peter Damoc
To my understanding, the only way to add that kind of safety is to implement a build plugin that analyzes your encoders. The encoder code is perfectly valid because you might not want to encode everything from a record so, Elm will allow you to do that just like it will allow you to name those

Re: [elm-discuss] Re: elmvm (Elm Version Manager)

2017-04-06 Thread Peter Damoc
On Thu, Apr 6, 2017 at 3:43 PM, Eirik Sletteberg wrote: > None of these tools are mentioned in the Elm documentation. It only points > to installers and the npm module. Exactly my point. There needs to be a better advertising of the ecosystem both in terms of tools

Re: [elm-discuss] Re: elmvm (Elm Version Manager)

2017-04-06 Thread Peter Damoc
On Thu, Apr 6, 2017 at 2:00 PM, Richard Wood wrote: > Very healthy having competing options in the ecosystem > :) > > No, this is against Elm philosophy as I understand it. Elm aims to have one, excellent option rather than a plethora of slightly different libraries/tools.

Re: [elm-discuss] Bug report (Undefined is not a function!)

2017-03-29 Thread Peter Damoc
If you want a SSCCE, here it is: https://ellie-app.com/M5sydznVwXa1/0 This is what you might be doing (the equivalent, of course). On Wed, Mar 29, 2017 at 9:32 AM, Mark Hamburg wrote: > I've now seen something like this a few times. The last time I tried to > build an

Re: [elm-discuss] Cmd.map

2017-03-28 Thread Peter Damoc
If you have a series of pages that each has Cmds and you have these pages unified under one app, you need to lift each page Cmd to become an app Cmd. There used to be a nesting architecture where this was demonstrated but now that's been dropped in favor of the Config approach. On Wed, Mar 29,

Re: [elm-discuss] Elm webcomponents for microservice front-end

2017-03-28 Thread Peter Damoc
5/08/09/including-front- > end-web-components-into-microservices/ > http://techblog.scout24.com/2016/01/unexpected-solution- > microservices-ui-composition/ > https://medium.com/@clifcunn/nodeconf-eu-29dd3ed500ec > > > > On Tuesday, March 28, 2017 at 8:58:22 AM UTC+2, Peter D

Re: [elm-discuss] Elm webcomponents for microservice front-end

2017-03-28 Thread Peter Damoc
On Tue, Mar 28, 2017 at 9:26 AM, Charles-Edouard Cady < charlesedouardc...@gmail.com> wrote: > I'm composing a single-page application from several microservices > back-ends. Each back-end should render a part of the page. > > Right now I'm considering using webcomponents: > > - main page is in

Re: [elm-discuss] Web components vs. Native

2017-03-23 Thread Peter Damoc
On Thu, Mar 23, 2017 at 9:33 AM, Maxwell Gurewitz wrote: > > > You will be able to use a web component ONLY in the view will be as pure > as it is right now. > > Unless I'm misunderstanding you, I'm pretty sure this isn't true. > Wonderful! Maybe you can help me with an

Re: [elm-discuss] Web components vs. Native

2017-03-22 Thread Peter Damoc
To my understanding there is no promotion of the web components as a standard way of interacting with JS. They are mentioned as a way of encapsulating complex JS that might fail. In other words, one could use some complex widget (like google-maps) and get some functionality into their elm app

Re: [elm-discuss] Publishing Elm package that depends on web components

2017-03-15 Thread Peter Damoc
I don't see why not. Just make sure you document properly the running environment. To give you an idea, you situation is similar to `elm-mdl` that depends on the material design CSS being loaded in order to look properly. On Wed, Mar 15, 2017 at 5:34 PM, 'Jonas Schürmann' via Elm Discuss <

Re: [elm-discuss] Uncaught TypeError with a value obtained from a decoder

2017-03-14 Thread Peter Damoc
Looks like you hit on this issue: https://github.com/elm-lang/core/issues/444 Have you tried switching to a different implementation? http://package.elm-lang.org/packages/Skinney/elm-array-exploration/2.0.2 On Tue, Mar 14, 2017 at 12:35 PM, Matthieu Pizenberg < matthieu.pizenb...@gmail.com>

Re: [elm-discuss] Uncaught TypeError with a value obtained from a decoder

2017-03-14 Thread Peter Damoc
Can you produce a SSCCE with this error? Are you using any 3rd-party Native code? On Tue, Mar 14, 2017 at 9:13 AM, Matthieu Pizenberg < matthieu.pizenb...@gmail.com> wrote: > Hi, this morning I got into a weird bug with a value obtained from a > decoder. I got elm code

Re: [elm-discuss] Unsafe mechanism

2017-03-13 Thread Peter Damoc
On Mon, Mar 13, 2017 at 11:06 AM, Oliver Searle-Barnes wrote: > What do you think, does this offer a practical route to a greater number > of pure Elm integration libraries? > I seriously doubt it. The practical route is actually joining forces. It is using multiple pairs of

Re: [elm-discuss] Re: elm + reactive programming

2017-03-10 Thread Peter Damoc
On Fri, Mar 10, 2017 at 7:51 PM, Mark Hamburg wrote: > What it feels like one wants to write but can't is the function: > > throttle : Float -> Sub msg -> Sub msg > I think you might be able to do this kind of thing in an Effects Manager. -- There is NO FATE, we are

Re: [elm-discuss] Get a simple string from file or htto

2017-03-10 Thread Peter Damoc
If you have web server serving you the html file, you can use something like `Http.getString "/a.txt"` to request the contents of that file. On Fri, Mar 10, 2017 at 4:16 PM, Márton Szabó wrote: > Hi, > > I am quite new to elm, and I have a noob question. I need the

Re: [elm-discuss] 1st newbie question - how to decompose the unwieldy Msg and Update

2017-03-09 Thread Peter Damoc
Alex, There used to be a documented way of decomposing apps into components by nesting the model, update and view of the components into the main model, update and view. This lead to a lot of debates about inter-components communication and communication between children and parents. The

Re: [elm-discuss] Multiple views sharing the same state?

2017-03-03 Thread Peter Damoc
On Fri, Mar 3, 2017 at 10:40 PM, Eirik Sletteberg wrote: > Yes, flags works on startup, but it won't work so well after incremental > updates, will it? > > I guess ports is an option (unless you use union types, which makes that > hard, see the other thread) but I'm a

Re: [elm-discuss] Re: Sending tagged unions through ports

2017-03-03 Thread Peter Damoc
On Fri, Mar 3, 2017 at 6:18 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Friday, March 3, 2017 at 3:29:34 PM UTC, Peter Damoc wrote: >> >> It makes sense to focus on other issues that are more important BUT, >> people are having enoug

Re: [elm-discuss] Multiple views sharing the same state?

2017-03-03 Thread Peter Damoc
You can pass the common information to the individual Elm components as flags. You could also wire the components by connecting their ports in such a way that one component could push state and that state be sent to the rest of the components. On Fri, Mar 3, 2017 at 3:56 PM, Eirik Sletteberg

Re: [elm-discuss] Re: Sending tagged unions through ports

2017-03-03 Thread Peter Damoc
On Fri, Mar 3, 2017 at 4:38 PM, Brian Hicks wrote: > It makes sense (at least to me) that this isn't supported. Elm has a much > different type system than JavaScript. > I respectfully disagree. It makes sense to focus on other issues that are more important BUT, people

Re: [elm-discuss] Sending tagged unions through ports

2017-03-03 Thread Peter Damoc
On Fri, Mar 3, 2017 at 3:08 PM, Eirik Sletteberg wrote: > An example use case for this would be when gradually porting an existing > Redux-based app to Elm. > One could rewrite state handling from Redux into Elm updaters/messages, > and wrap the Elm app's main updater,

Re: [elm-discuss] can't understand compiler error

2017-02-22 Thread Peter Damoc
In Elm you don't have statements, only expressions and the if model.flag == True then expression was not completed. It needs the else branch You cannot update the model in the view, only in update. On Wed, Feb 22, 2017 at 8:08 PM, Anurup Mitra wrote: > Hello! > >

Re: [elm-discuss] How can you find out why JSON decoding failed?

2017-02-17 Thread Peter Damoc
What does Json.Decode.decodeValue returns? Can you share some code? On Fri, Feb 17, 2017 at 7:09 PM, Rex van der Spuy wrote: > Yes - how would I get the Err result? > > -- > You received this message because you are subscribed to the Google Groups > "Elm Discuss"

Re: [elm-discuss] How can you find out why JSON decoding failed?

2017-02-17 Thread Peter Damoc
Where is it failing silently? Are you calling Json.Decode.decodeValue and not getting an Err? On Fri, Feb 17, 2017 at 6:34 PM, Rex van der Spuy wrote: > Hi Everyone! > > I'm trying to decode some JSON from localStorage. > I'm able to load the JSON into my Elm app but

Re: [elm-discuss] Community version of the elm guide gitbook?

2017-02-17 Thread Peter Damoc
Is it elm-tutorial by any chance? https://www.elm-tutorial.org/en/01-foundations/06-type-aliases.html On Fri, Feb 17, 2017 at 5:51 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > I seem to recall there is a community version of this that is more open to > accepting

Re: [elm-discuss] Building a Store without boilerplate

2017-01-30 Thread Peter Damoc
On Mon, Jan 30, 2017 at 12:17 PM, Oliver Searle-Barnes wrote: > # Building a Store without boilerplate > I don't think that's possible. Elm is a static language and what you seam to want is dynamic behavior. The practical way to solve this is to ferry type information and

Re: [elm-discuss] Local third-party packages

2017-01-29 Thread Peter Damoc
On Mon, Jan 30, 2017 at 8:48 AM, Lyle Kopnicky wrote: > So I wonder if I can use elm-package to install a package from another > directory, so hopefully the references will work out right? > elm-package does not support that BUT, elm-github-install

Re: [elm-discuss] I wish ELM could just be used in the browser

2017-01-29 Thread Peter Damoc
On Sun, Jan 29, 2017 at 4:40 AM, Wyatt Benno wrote: > Thanks all! I still do not see why ELM can never be compiled directly in > the browser. A V8 engine compiler for ELM? > After all it becomes JavaScript right? > There is an experimental compiler that does just that:

Re: [elm-discuss] I wish ELM could just be used in the browser

2017-01-28 Thread Peter Damoc
Elm was designed to help with reliability and maintainability of large scale apps. If it is a toy app or if reliability and maintainability are not important enough, other technologies are more appropriate. It depends on what you want to optimize on. If however reliability and maintainability

Re: [elm-discuss] Re: Using Elm on the server (full stack Elm webapps )

2017-01-27 Thread Peter Damoc
On Fri, Jan 27, 2017 at 4:51 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Friday, January 27, 2017 at 10:15:49 AM UTC, Rupert Smith wrote: >> >> I think what is missing is DB access. >> > > What would be even cooler is if you didn't need to worry about the >

Re: [elm-discuss] Re: Using Elm on the server (full stack Elm webapps )

2017-01-26 Thread Peter Damoc
On Thu, Jan 26, 2017 at 6:40 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > Still, its a long way from there to a full stack... > > Every journey has to start somewhere. Can you share a set of requirements for a full-stack? Like, how would a checklist for your must

[elm-discuss] Using Elm on the server (full stack Elm webapps )

2017-01-26 Thread Peter Damoc
Hello community, I thought that using elm on the backend would be hard but it turns out that it is easy. I took the websockets example and turned it into a stand alone webapp. https://github.com/pdamoc/elm-sapling The approach that I used is to describe an API between the client and the server.

Re: [elm-discuss] Module / Payload Splitting - Such a thing?

2017-01-26 Thread Peter Damoc
On Thu, Jan 26, 2017 at 5:00 PM, Dave Rapin wrote: > Just wondering if there's a good approach for this in Elm? Is there a way > to split framework code & app code, or are we stuck with adding 100k to our > payload every time we iterate? > > This is being worked on right now and

Re: [elm-discuss] Super-unimportant request for Google Closure Compiler.js compatibility

2017-01-26 Thread Peter Damoc
You need the --assume_function_wrapper flag. Also, if you have more troubles you could also drop the compilation level to SIMPLE. The difference should be no larger than few kb in gzipped form. It is worth mentioning that at such small sizes, even the unminified output gzips to very tiny sizes.

Re: [elm-discuss] Composing Things in Elm

2017-01-25 Thread Peter Damoc
On Wed, Jan 25, 2017 at 8:17 AM, Maksim Demin wrote: > Thanks for the response, it totally works, and I definitely think it is > cleaner than having to Html.map everything! I am still trying to fully > understand what is going on, pretty new to Elm. I kinda get what you are

  1   2   3   4   >