[elm-discuss] Performance in Elm - Comparing Elm, React, Angular, and Ember

2016-08-30 Thread Pete Vilter
Good stuff! I'm doing React at work these days and having some hard-to-understand perf problems. Elm's immutable data structures and `lazy` are so nice :) -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop

[elm-discuss] Re: Get drag drop user interface to work in the Chrome browser with touch

2016-08-30 Thread OvermindDL1
> But they don't do me any good because I believe I need to do an e.preventDefault() or e.stopPropagation() or both. but I don't know how to do that from elm or even from inside the elm-lang/mouse code. You can't, currently, being able to conditionally do a preventDefault or stopPropagation on

[elm-discuss] Re: Get drag drop user interface to work in the Chrome browser with touch

2016-08-30 Thread Jonathan Duncan
I found a javascript hack to trigger mouse event for the first touch. http://stackoverflow.com/questions/8058699/drag-drop-on-mobile-devices-using-some-code-that-translates-event-code-included It does what I need to do even though it would've been nice to do it directly in Elm. Le lundi 29

[elm-discuss] Re: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-30 Thread Dmitry Utkin
Josh, this is great! Thanks for this idea Textfield.onInput <| ProjectMsg' << SetNewProjectName On Monday, August 29, 2016 at 11:03:12 PM UTC+3, Josh Adams wrote: > > Here's what I've been working on. The recent git history is all about > refactoring. Haven't introduced 'sub-components with

Re: [elm-discuss] Re: Performance in Elm - Comparing Elm, React, Angular, and Ember

2016-08-30 Thread Nick H
No, I think in this context "naive" means not optimized, implemented in the most straightforward way. On Tue, Aug 30, 2016 at 10:53 AM, suttlecommakevin < suttlecommake...@gmail.com> wrote: > Nice work! > > Side note: is "naive" meant to be "native"? Noticed it in the screenshot > as well. > > >

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread Janis Voigtländer
Depends on the operating system. And should be answered at https://www.haskell.org/downloads. For what seems to be your specific situation (OS X with Homebrew), the commit discussion you linked to contains a comment that appears to answer the question:

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread suttlecommakevin
Right, and how does one obtain GHC 7.10? On Tuesday, August 30, 2016 at 1:51:50 PM UTC-4, Janis Voigtländer wrote: > > GHC 7.10.x + whatever cabal comes with that + Elm 0.17.1 > > 2016-08-30 19:44 GMT+02:00 suttlecommakevin >: > >> Thanks. I still am not able to

[elm-discuss] Re: Performance in Elm - Comparing Elm, React, Angular, and Ember

2016-08-30 Thread suttlecommakevin
Nice work! Side note: is "naive" meant to be "native"? Noticed it in the screenshot as well. On Tuesday, August 30, 2016 at 10:53:29 AM UTC-4, Evan wrote: > > Finally finished the blog post on performance > ! > > With 0.17, I had to

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread suttlecommakevin
Thanks. I still am not able to contribute to elm-lang.org without a proper set up. In order to develop, how *exactly *should and which versions of, elm, ghc, and cabal be installed most reliably? On Tuesday, August 30, 2016 at 1:39:07 PM UTC-4, Janis Voigtländer wrote: > > I tried 0.16,

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread Janis Voigtländer
I tried 0.16, because that’s what’s in the README*. Others have been scolded for not reading the instructions closely. In all fairness, the README of https://github.com/elm-lang/elm-lang.org says to use 0.17, not 0.16. ​ 2016-08-30 19:30 GMT+02:00 suttlecommakevin :

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread suttlecommakevin
- Yes, 8.0.1 as Richard pointed out in that commit. - I tried 0.16, because that's what's in the README*. Others have been scolded for not reading the instructions closely. - Yes, I also tried 0.17.1, and that failed as well. For me, what is needed is a more explicit set of

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread suttlecommakevin
I'm on Mac. I installed *ghc* via brew cask install haskell-platform. It's not clear where or how to obtain GHC < 8.0.1 reliably or consistently. https://github.com/elm-lang/elm-platform/commit/f46c95cf826651c56cf11388148df4406a834ee8 On Tuesday, August 30, 2016 at 12:49:38 PM UTC-4, Joey

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread Joey Eremondi
@suttlecommakevin Are you trying to use Elm from Hackage, or the Elm platform? Hackage elm is woefully out of date. On Tue, Aug 30, 2016 at 9:38 AM, Janis Voigtländer < janis.voigtlaen...@gmail.com> wrote: > You don't feel like telling us which GHC version you are trying to do this > with? > >

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread Janis Voigtländer
You don't feel like telling us which GHC version you are trying to do this with? 2016-08-30 18:11 GMT+02:00 suttlecommakevin : > I get missing deps, but because of conflicts that were rejected. > > https://gist.github.com/kevinSuttle/a867b0d2048f6f6c6f646964061ec3c1 >

[elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread suttlecommakevin
I get missing deps, but because of conflicts that were rejected. https://gist.github.com/kevinSuttle/a867b0d2048f6f6c6f646964061ec3c1 On Thursday, August 14, 2014 at 11:19:13 PM UTC-4, Evan Cameron wrote: > > I've installed elm on arch using a cabal sandbox and the cabal install > methods.

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Vincent Jousse
I didn't but it's a very good idea :-) Do you see a way to overcome the cursor position problem with that approach? Le mardi 30 août 2016 17:16:21 UTC+2, Peter Damoc a écrit : > > It makes perfect sense. > > Have you thought about putting contenteditable on each individual span? > This should

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Peter Damoc
It makes perfect sense. Have you thought about putting contenteditable on each individual span? This should allow for single word editing and for individual double clicks. On Tue, Aug 30, 2016 at 5:43 PM, Vincent Jousse wrote: > I mainly need double click events. I'm doing

[elm-discuss] Re: Get drag drop user interface to work in the Chrome browser with touch

2016-08-30 Thread OvermindDL1
The way `elm-lang/mouse` works is by using the `elm-lang/dom` library at: http://package.elm-lang.org/packages/elm-lang/dom/latest That gives you the window context that you can register 'event handlers' on, thus you can use it to register your own window-wide events, such as the touch

[elm-discuss] Performance in Elm - Comparing Elm, React, Angular, and Ember

2016-08-30 Thread Evan
Finally finished the blog post on performance ! With 0.17, I had to rewrite our virtual DOM implementation from scratch, and the new one is way faster. So if you are using 0.17, your code is already using the new implementation :D -- You

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Peter Damoc
Well, it was a naive approach. ^_^ As for events inside the contenteditable div, I have no idea but what kind of events do you want to handle in this kind of a scenario? On Tue, Aug 30, 2016 at 5:11 PM, Vincent Jousse wrote: > Thanks, but I would not say that it's

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Peter Damoc
For the record, the working version looks like this: import Html exposing (..) import Html.Attributes exposing (..) import Html.App exposing (beginnerProgram) import Html.Events exposing (on) import Json.Encode as JE import Json.Decode as JD exposing ((:=), Decoder) main = beginnerProgram {

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Peter Damoc
Aaron, You are right, of course. I somehow expected that to work due to mixing in my mind the event object with the source of the event. My bad. :) On Tue, Aug 30, 2016 at 4:42 PM, Aaron VonderHaar wrote: > Peter, I'd guess the decoder in your onChange is failing,

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Aaron VonderHaar
Peter, I'd guess the decoder in your onChange is failing, causing the event not to send a Msg. The decoder is going to get an event object, not a DOM node, which is probably why decoding an "innerHTML" property is failing. (Did your comment mean that your event handler does work for

[elm-discuss] Re: Design of Large Elm apps

2016-08-30 Thread Erik Lott
@JoshAdams has been kind enough to share a simple single level SPA example on another thread that might be of use to some folks arriving here. Here's what I've been working on. The recent git history is all about > refactoring. Haven't introduced 'sub-components with state' or w/e and >

[elm-discuss] Re: Feature Request: Code Generation/ Macro System

2016-08-30 Thread 杨博
I thought a macro system should be a foundation of an extensible language. For example, Binding.scala on Scala.js implemented a reactive web framework based on some monads

Re: [elm-discuss] A more concrete question about API design

2016-08-30 Thread Erik Lott
> > As a newbie, I struggle to grasp whether I should tap into the Cmd module, > and if so, how to do that. If by "tap into the Cmd module" you mean messing around with the Native Cmd code, or creating your own effects manager, than no, don't reach for that - it's not necessary to solve your

[elm-discuss] Re: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-30 Thread Erik Lott
> > @Erik Lott, did you mean: > view : Msg -> Msg -> Int -> Html Msg > Or did I miss something? Yeah, just a typo. Thanks for catching that. On Tuesday, August 30, 2016 at 5:27:06 AM UTC-4, Wouter In t Velt wrote: > > @Erik Lott, did you mean: > > view : Msg -> Msg -> Int -> Html Msg

Re: [elm-discuss] A more concrete question about API design

2016-08-30 Thread Alessandro Mencarini
On Friday, August 26, 2016 at 9:38:23 PM UTC+1, Nick H wrote: > > So I agree that Cmd itself is not suitable for this more complex version > of the queue problem. But that's fine. If you feel that the way Elm is > being presented, that it is encouraging (or pressuring?) us to solve every >

Re: [elm-discuss] Do the counters in the Guide teach us a wrong scaling approach?

2016-08-30 Thread Mark Hamburg
On Aug 30, 2016, at 12:42 AM, Peter Damoc wrote: > > There is an old Zen saying: > Flat is better than nested. > > This means that if you have a choice, prefer the flat one. It doesn't mean > that everything should be flat but that flat should be preferred. Nested may,

Re: [elm-discuss] onClick and Json decoders in elm-sortable-table

2016-08-30 Thread Janis Voigtländer
Actually, the situation is more subtle. On the one hand, the two definitions onClick : String -> Bool -> (State -> msg) -> Attribute msgonClick name isReversed toMsg = Html.Events.on "click" <| Json.map toMsg <| Json.object2 State (Json.succeed name) (Json.succeed isReversed) and onClick

Re: [elm-discuss] Elm and contenteditable

2016-08-30 Thread Peter Damoc
I've tried a naive implementation in Elm but, for some reason, it doesn't work (events are not fired for divs that have content editable) import Html exposing (..) import Html.Attributes exposing (..) import Html.App exposing (beginnerProgram) import Html.Events exposing (on) import Json.Encode

[elm-discuss] Re: Server Side Rendering with Node

2016-08-30 Thread Robert S
Thanks Matthew for info and good starting points. Here are results of my research, maybe someone will be looking for it as me :) https://github.com/eeue56/elm-static-site - this repo currently uses elm 0.16. There is a call with 'renderer' which can't be provided in 0.17. I've managed to

[elm-discuss] Re: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-30 Thread Wouter In t Velt
@Erik Lott, did you mean: view : Msg -> Msg -> Int -> Html Msg Or did I miss something? @Peter Damoc, yeah the flat solution would be simpler (I actually did do a flat counter list before separating out the CounterView ;). -- You received this message because you are subscribed to the

[elm-discuss] Elm and contenteditable

2016-08-30 Thread Vincent Jousse
Hello, I'm writing an application where the user needs to edit some HTML content. When I first wrote this application in JS, I was using some contenteditable fields to do so. How should I handle this with Elm? My problem is that if I set a div with contenteditable=true in elm, and that the

Re: [elm-discuss] Do the counters in the Guide teach us a wrong scaling approach?

2016-08-30 Thread Peter Damoc
On Sun, Aug 28, 2016 at 2:02 PM, Wouter In t Velt wrote: > Curious to learn what everyone here thinks: > Do the multiple counters example teach us a wrong scaling approach? Or it > it just my react-flux instinct getting in the way? Or did I interpret the > examples in