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

2017-05-08 Thread OvermindDL1
OCaml has a set of extension points. You can write OCaml code, add it to an extension point (`derived` is precisely the use case of this) and it receives the AST of the expression and can transform it or add new code or whatever as you wish. Like a very common one for auto-json conversion

Re: [elm-discuss] elm-css with type classes (a response to the Elm Town podcast)

2017-04-27 Thread OvermindDL1
ules would require that a type passed to > something that was expecting a union type needs to cover a subset of that > union type. Case statements would be used to do the discrimination. > > The potentially interesting things that come out of something like this > are that one could imagine a

Re: [elm-discuss] elm-css with type classes (a response to the Elm Town podcast)

2017-04-27 Thread OvermindDL1
Actually this sounds to exactly like the use-case for OCaml's Polymorphic Variants. In OCaml you could easily use just `Hidden for both of your examples, fully type checked, type safe, etc... etc... Polymorphic Variants are just global Variants that are unnamed. A function can take a

[elm-discuss] Re: Google Places and Elm / Identifying when Elm is mounted

2017-04-04 Thread OvermindDL1
Elm creates nodes on a screen re-draw, so it does not create and edit nodes all the time but only when the browser needs it to for the updated state. The 'safest' thing is to wait for *2* iterations of requestAnimationFrame, 1 will 'sometimes' work but it depends on the ordering (register yours

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

2017-02-17 Thread OvermindDL1
Hehe, happens to us all. ^.^ On Friday, February 17, 2017 at 11:54:47 AM UTC-7, Rex van der Spuy wrote: > > Oops!! Ignore the error above! > It works now completely!!! > > I just had another stray Debug.crash in my code that I had forgotten about > so I removed it. > > Thanks so much Peter, I

[elm-discuss] Re: Seeking feedback: What Elm and Rust teach us about the future

2017-02-10 Thread OvermindDL1
That is just because Rust has a fairly powerful (but incomplete) macro system, that is not something that would really belong in Elm. ^.^ On Friday, February 10, 2017 at 11:19:49 AM UTC-7, Kasey Speakman wrote: > > Largest paint point for me in Elm is not mentioned: JSON. Rust appears to >

[elm-discuss] Re: Possible performance bug when using SVG xlink:href?

2017-02-09 Thread OvermindDL1
uary 9, 2017 at 1:07:27 AM UTC+9, OvermindDL1 wrote: >> >> It is not strictly be design (that might be a bug if you can come up with >> a simple descriptive example that we can copy into elm-try or so), but it >> is easy to work-around. >> > > Did you try my gi

[elm-discuss] Re: Possible performance bug when using SVG xlink:href?

2017-02-08 Thread OvermindDL1
It is not strictly be design (that might be a bug if you can come up with a simple descriptive example that we can copy into elm-try or so), but it is easy to work-around. What I do is make just an integer (some primitive value), and just increment it whenever the view should be updated (gotta

[elm-discuss] Re: Fire an event when a div changes size?

2017-01-31 Thread OvermindDL1
Yeah that is hard to do in Elm, best method would be to get the CSS to do it for you if at all possible, else fall back to a port. On Tuesday, January 31, 2017 at 9:54:16 AM UTC-7, Rupert Smith wrote: > > > > On Tuesday, January 31, 2017 at 4:32:47 PM UTC, OvermindDL1 wrote: &g

[elm-discuss] Re: Fire an event when a div changes size?

2017-01-31 Thread OvermindDL1
Probably the easier way would be to just get its new size when its content changes, you can Json.Decode it out of a custom event if you can somehow get it to fire an event, any event (a port, or just grab it from the port?). Would it not be easiest to finagle the CSS to do what you want

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-25 Thread OvermindDL1
: > > > > On Wednesday, 25 January 2017 22:25:39 UTC+7, OvermindDL1 wrote: >> >> Sent too soon. >> >> Also, uglify is a minimizer, it does a *lot* more than tree shaking. >> >> >> On Wednesday, January 25, 2017 at 8:25:10 AM UTC-7, OvermindDL1 wrote: >

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-25 Thread OvermindDL1
Sent too soon. Also, uglify is a minimizer, it does a *lot* more than tree shaking. On Wednesday, January 25, 2017 at 8:25:10 AM UTC-7, OvermindDL1 wrote: > > Tree Shaking as implemented by Brunch and Webpack default setups at least > only prune based on if a module is accessed or n

[elm-discuss] Re: Html.Attributes.none

2017-01-24 Thread OvermindDL1
Yes, for precisely the same usage. It is much easier to swap between something and `none` then it it to do list building with if conditions. I made my own by using a dummy attribute name that should 'never be used' (*cough*) of "nonenonenone". A side effect is the vdom checking is a little

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-24 Thread OvermindDL1
typeclasses or HKT's). :-) On Monday, January 23, 2017 at 6:41:55 PM UTC-7, GordonBGood wrote: > > On Tuesday, 24 January 2017 01:26:49 UTC+7, OvermindDL1 wrote: >> >> Bucklescript de-curries as much as possible, however you can also force >> it in the type system explicitly

[elm-discuss] Re: Techniques for text input in elm-lang/svg

2017-01-23 Thread OvermindDL1
Might be easier to let them click on an element and you pop out an 'attributes' pane of it or something, that way they can edit the caption in there or potentially other editable attributes that you may add over time too? On Monday, January 23, 2017 at 2:55:01 PM UTC-7, Eelco Hoekema wrote: >

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-23 Thread OvermindDL1
On Monday, January 23, 2017 at 10:52:12 AM UTC-7, GordonBGood wrote: > > I think everyone hangs around this and other Elm discussion forums because > we love the Elm concept of a simple functional language that promises to > eliminate the need to deal with JavaScript; but unfortunately, due to

[elm-discuss] Re: Elm doesn't seem to do do TCO in my case. Bug?

2017-01-20 Thread OvermindDL1
On Friday, January 20, 2017 at 11:17:32 AM UTC-7, mrbackend (Roy Brokvam) wrote: > > Consider: > type Nat > = Zero > | Succ Nat > > > nat : Int -> Nat > nat n = > nat_ n Zero > > > nat_ : Int -> Nat -> Nat > nat_ n curr = > if n <= 0 then > curr > else > nat_

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-18 Thread OvermindDL1
ay use things like this: https://github.com/OvermindDL1/bucklescript-testing/blob/master/src/web_node.ml (and ignore the polyfill at the bottom, I later converted that to pure OCaml/Bucklescript as well) -- You received this message because you are subscribed to the Google Groups "Elm Discuss

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-17 Thread OvermindDL1
On Saturday, January 14, 2017 at 3:13:40 PM UTC-7, GordonBGood wrote: > > I saw that over on elm-dev, but haven't tried it because compilation speed > isn't a problem for the Elm code I have written so far. The only reason I > brought it up is OvermindDL1's comment > <https:/

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-13 Thread OvermindDL1
Form example at http://elm-lang.org/examples/form? Here is the same thing in OCaml: https://github.com/OvermindDL1/bucklescript-testing/blob/master/src/main_form.ml 'Almost' identical, and some of the non-identical parts are just minor API changes in this example. But yes, translating Elm to OCaml/Buc

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-13 Thread OvermindDL1
On Friday, January 13, 2017 at 8:40:07 AM UTC-7, Rupert Smith wrote: > > All that this would take would be to write an Elm parser into the first > stage of the OCaml pipeline? You'd also need to compile the Native modules, > is there already some way to feed them into the Ocaml pipeline? >

Re: [elm-discuss] Re: Emphasizing /r/elm more

2017-01-13 Thread OvermindDL1
I'd still not recommend reddit, it has no mailing list support. Here or Discourse both act well as a forum (though discourse more so) and as a mailing list both, so either works. On Friday, January 13, 2017 at 12:34:47 AM UTC-7, Håkon Rossebø wrote: > > I would also prefer a solution like

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-13 Thread OvermindDL1
C-7, GordonBGood wrote: > > On Thursday, 12 January 2017 22:42:05 UTC+7, OvermindDL1 wrote: >> >> On Wednesday, January 11, 2017 at 10:43:11 PM UTC-7, GordonBGood wrote: >>> >>> On your advice, I've reread the ReasonML documents as I got mislead by >>> lo

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-12 Thread OvermindDL1
On Wednesday, January 11, 2017 at 10:43:11 PM UTC-7, GordonBGood wrote: > > On your advice, I've reread the ReasonML documents as I got mislead by > looking at ReasonML/Rebel and that is at too early a stage for me to > consider (also support for BuckleScript is currently broken). I liked the

Re: [elm-discuss] Cannot find module "String"...

2017-01-10 Thread OvermindDL1
On Tuesday, January 10, 2017 at 11:10:31 AM UTC-7, Rex van der Spuy wrote: > > On Tuesday, January 10, 2017 at 9:35:16 AM UTC-5, Peter Damoc wrote: >> >> Have you tried deleting ~/.elm ? >> > > Thanks Peter, I've just done this based on your suggestion but the effect > is the same. > Maybe I

[elm-discuss] Re: Task.perform in 0.18?

2017-01-06 Thread OvermindDL1
Ahh, see that there, the return type of `Scroll.toTop` is `Task.Task Dom.Error ()`, this in this case also change `Task.perform` to `Task.attempt`. :-) On Friday, January 6, 2017 at 1:59:06 PM UTC-7, Rex van der Spuy wrote: > > Thanks Overmind! > > I've done as you suggested and removed one

[elm-discuss] Re: Task.perform in 0.18?

2017-01-06 Thread OvermindDL1
Task.perform now takes a task that cannot fail (hence the 'Never' in its type). So I have no clue what your Scroll.toTop call returns as a type, but if it cannot fail (Never on the error condition type) then just remove one of your `(always NoOp)` calls, else change `Task.perform` call into

[elm-discuss] Re: Same code generated by BuckleScriptRe: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-03 Thread OvermindDL1
grams taking multiple minutes (or potentially hours on more complex programs that use a lot of HKT's). But near every decision of OCaml's syntax was designed to make for a *very* fast compiler (and elm was modeled as a mix of OCaml and Haskell syntax, see https://github.com/OvermindDL1/bucklescrip

Re: [elm-discuss] Re: Stance on native APIs for 0.18?

2016-12-08 Thread OvermindDL1
`opaque type DBConnection` perhaps would be the common way to write such a type that can only be passed in and passed out but not created. On Thursday, December 8, 2016 at 11:28:22 AM UTC-7, Mark Hamburg wrote: > > I was talking about this further with my coworkers and we more or less > agreed

[elm-discuss] Re: Race condition in textareas?

2016-12-07 Thread OvermindDL1
Elm does not use Shady DOM nor Shadow DOM, so that would be unrelated unless you are using the Shady or Shadow DOM's outside of elm but within the elm application. For note, updating the defaultValue will only update the textarea if the textarea is destroyed and recreated, updating the value

[elm-discuss] Re: Error Repository?

2016-12-06 Thread OvermindDL1
https://github.com/elm-lang/error-message-catalog is the place to report needing better error messages. It is generally best to talk about it here first. When reporting there be sure it does not already exist in another issue (even if closed one as issues can be aggregated together). On

[elm-discuss] Re: Why the change in Program type for 0.18?

2016-12-05 Thread OvermindDL1
Because the prior type could not do inference and type passing based on the model and msg type of the program, now it can. On Monday, December 5, 2016 at 3:49:33 PM UTC-7, Rupert Smith wrote: > > I'm curious to know, can anyone explain? Why was the Program type changed > from: > > Program

[elm-discuss] Re: Help with migrating to the new elm-lang/http.

2016-11-30 Thread OvermindDL1
`withCredentials` is a normal Javascript AJAX argument, it means to pass credential information to the remote server if you are connecting to a remote server; without it then credentials are not passed, which is better for security but without it you may not be able to access things without

Re: [elm-discuss] What is the motivation for using google groups?

2016-11-26 Thread OvermindDL1
Another +1 for reddit here, I don't use the mailing list aspects of things but for one who does reddit would be a -1, but there are so many aggregators for reddit that I've no doubt a mailing list thing is made by someone or a hundred. On Saturday, November 26, 2016 at 12:09:40 AM UTC-7,

Re: [elm-discuss] What is the motivation for using google groups?

2016-11-25 Thread OvermindDL1
found out how apple's client was broken). What else is there? On Friday, November 25, 2016 at 5:46:43 PM UTC-7, Hassan Schroeder wrote: > > On Fri, Nov 25, 2016 at 4:17 PM, OvermindDL1 <overm...@gmail.com > > wrote: > > The Elixir forum (which has an Elm section if a

[elm-discuss] Re: Using Navigation - is Events.onWithOptions required?

2016-11-25 Thread OvermindDL1
I actually prefer to have anchor tags around the document but have a top level catch that stops page movements to url's I whitelist and instead just redirects navigation (which then updates other parts of the app), seems the most simple, but it is definitely not wrapped up in an easy way in elm

Re: [elm-discuss] Can Javascript to start Elm app be attached per page?

2016-11-22 Thread OvermindDL1
blog post that points to a frozen branch > that might help others. It’s here: > > http://blog.roundingpegs.com/phoenix-elm-and-multiple-single-page-apps/ > > > On Nov 21, 2016, at 11:43 AM, OvermindDL1 <overm...@gmail.com > > wrote: > > A few things (as I

[elm-discuss] Re: Tell me how to teach Web Apps

2016-11-22 Thread OvermindDL1
I teach languages but not web programming specifically. I'd might recommend Elixir as a good back-end server software to program in. It is easily one of the language that are the most fun to program in, although it is not statically typed, it is fully functional. I happen to use Elixir on

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

2016-11-21 Thread OvermindDL1
Date.now would not be a functional call that way (returning the same output for the same input) thus that could not work (without hacks like native modules, but that would also break reproduceability). By making it an effect it can just return a request to get the actual date. On Monday,

Re: [elm-discuss] Unpublishing a package

2016-11-21 Thread OvermindDL1
There is always this: https://github.com/gdotdesign/elm-github-install Install via: ```sh npm install -g elm-github-install ``` With this usage: ```json # elm-package.json { ... "dependencies": { ... "githubUser/repoName": "desiredVersion <= v < someLargerNumber",

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread OvermindDL1
I highly doubt it would ever be changed, but I significantly prefer the OCaml style Some/None to Haskell's Just/Nothing as well. Although `Thing` and `NoThing` could by funny and descriptive both. ^.^ On Monday, November 21, 2016 at 10:48:11 AM UTC-7, Will White wrote: > > I remember being

[elm-discuss] Re: Can Javascript to start Elm app be attached per page?

2016-11-21 Thread OvermindDL1
A few things (as I do use elm with phoenix): 1. Make sure the script tag is loaded before you load a page specific call like require or so (my script sends a 'js-loaded' event when done that my pages can listen to if it is not already sent, a simple function in the head can simplify that to a

Re: [elm-discuss] Can't install native package using elm-github-install

2016-11-18 Thread OvermindDL1
On Friday, November 18, 2016 at 5:18:27 AM UTC-7, Rupert Smith wrote: > > I found using a port to enable global communication with the Auth module > from anywhere in my application (any time you get a 401 or 403 you invoke > 'unauthed') to be quite convenient. Perhaps I might find a better

Re: [elm-discuss] 0.18 Below the Hood

2016-11-15 Thread OvermindDL1
On Tuesday, November 15, 2016 at 9:30:23 AM UTC-7, Max Goldstein wrote: > > My impression is that it's a Haskell extension that's very commonly used. > In the process of upgrading, I uncommented some signatures only for the > compiler to tell me that they are incorrect, so this feature has been

Re: [elm-discuss] 0.18 Below the Hood

2016-11-15 Thread OvermindDL1
On Tuesday, November 15, 2016 at 8:57:30 AM UTC-7, John Orford wrote: > > let-bound values can be given type annotations that reference type > variables from the top level > > that's v thoughtful actually, I hadn't heard that before, just local > variables in any case, makes a lot of sense for

Re: [elm-discuss] Re: Update Delay

2016-11-14 Thread OvermindDL1
ore though, I think I did this more elegantly a few months >> ago, trying to remember how... >> >> Any help is appreciated! >> >> >> >> >> On Thu, 10 Nov 2016 at 16:51 OvermindDL1 <overm...@gmail.com >> > wrote: >> >>> Not somethin

[elm-discuss] Re: Update Delay

2016-11-10 Thread OvermindDL1
Not something I've ever experienced and of which should be fairly impossible. Do you have a simple reproduceable test-case that we can play with? On Thursday, November 10, 2016 at 8:43:30 AM UTC-7, John Orford wrote: > > I have fallen into this trap a few times, > > 1) I update my model > > 2)

[elm-discuss] Re: How to better integrate Elm with webcomponents?

2016-11-10 Thread OvermindDL1
it creates. :-) Elm could definitely become a fantastic webcomponent library. :-) On Thursday, November 10, 2016 at 4:11:14 AM UTC-7, Rupert Smith wrote: > > On Wednesday, November 9, 2016 at 4:02:42 PM UTC, OvermindDL1 wrote: > > In my opinion Elm really needs to have a smooth

[elm-discuss] Re: Correct use of port subscriptions in a submodule reused multiple times?

2016-11-10 Thread OvermindDL1
Definitely recommend simplifying it yep. :-) Ports, in my opinion, should only ever go in one, fully-functional module (I have it in a `Ports.elm` in my projects) that all things should share through it. The global top-level update call should feel free to delegate messages around. On

Re: [elm-discuss] Re: Convincing my team that Elm isn't just going to die like CoffeeScript

2016-11-09 Thread OvermindDL1
Indeed, React is more of a stop-gap before full webcomponent support is out in browsers. And nowadays with webcomponents.js emulating webcomponents on about everything 'fairly' decently (although some slowly, which libraries like Polymer smooth out) it is becoming less interesting. In my

[elm-discuss] Re: Correct use of port subscriptions in a submodule reused multiple times?

2016-11-08 Thread OvermindDL1
That is expected. Generally you'd have a uniquely named port per module unless they really do all need to get the message. It might be better if you describe what you are trying to accomplish instead of how to accomplish it? :-) On Tuesday, November 8, 2016 at 10:19:37 AM UTC-7, Matthieu

[elm-discuss] Re: Feldmans talk about impossible states

2016-11-04 Thread OvermindDL1
Ah yeah, as an example say you have a list of messages, a message being a record, if you add a new message to the 'end' of the list then every-single-message-list-cell will be recreated, although not the message records themselves, that is because Elm is functional and a List is a Cons List.

[elm-discuss] Re: Feldmans talk about impossible states

2016-11-04 Thread OvermindDL1
Everything inside it is still reused. Back to the struct if you do something like: ```elm { model | something = blah } ``` It is making a new model struct, but all the things in its keys other than 'something' are re-used. And actually something should be re-used too if `blah` is just `blah =

[elm-discuss] Re: Showing sub views dynamically

2016-11-04 Thread OvermindDL1
I am unable to load https://guide.elm-lang.org/types/union_types.html due to a broken certificate chain error for the site (the certificate itself is fine, but its chain to the parents is broken), what is up? As for your question, it looks fine, but are you wondering about it not being more

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

2016-11-03 Thread OvermindDL1
I did precisely the same style in https://github.com/OvermindDL1/elm-jsphoenix too, to minimize the duplication of work (which also increased by elm removing the ability to extend record types into a new type, and lacking the ability to move Dict's across, so those two things still add some

Re: [elm-discuss] Re: Newbie - which build tool

2016-10-28 Thread OvermindDL1
out needing a page reload, etc... On Friday, October 28, 2016 at 9:24:13 AM UTC-6, Colin Yates wrote: > > Thanks OvermindDL1 - I did see a blog post about brunch but I kinda > skimmed over it as it didn't look that mainstream. Thanks again. > > On 28 October 2016 at 16:21,

[elm-discuss] Re: Newbie - which build tool

2016-10-28 Thread OvermindDL1
I use brunch for all of the above except `executes any test`, of which I just use `npm test` for that. Simple, significantly faster than webpack (though both will be bound by elm's slow compiling speed if that is all it is really handling). On Friday, October 28, 2016 at 7:19:59 AM UTC-6,

[elm-discuss] Re: Is there any way to use a type instead of a string for the value of an option

2016-10-26 Thread OvermindDL1
That sounds like a typeclass or a HPT, neither of which are in Elm (yet?). Passing in manual serialization/deserialization functions is easy to do though. :-) On Wednesday, October 26, 2016 at 10:32:18 AM UTC-6, Martin Cerny wrote: > > I think this points to a more general use case. I think

[elm-discuss] Re: Is there any way to use a type instead of a string for the value of an option

2016-10-25 Thread OvermindDL1
`option` is supposed to match to the html , thus only strings, any marshalling you will need to perform yourself, such as by, for example, wrapping up option into something like `optionMyType t = option [ value (myTypeSerialize t) ]` or so for ease of use. :-) On Tuesday, October 25, 2016 at

[elm-discuss] Re: Pre-requisites for learning Elm?

2016-10-24 Thread OvermindDL1
That is a very good point, you can make a lot of cool things in pure elm, I whipped up an incremental clicker in an hour a few days ago when I was screwing around, dead simple. ^.^ On Monday, October 24, 2016 at 4:44:53 PM UTC-6, joseph ni wrote: > > Hey Razi, > > That sounds great! I wish I

[elm-discuss] Re: Pre-requisites for learning Elm?

2016-10-23 Thread OvermindDL1
Elm is definitely a front-end language for javascript so it does assume at least a little prior experience, at least with html/css and how they work if not javascript (depending on what you need to do). The class does not have those pre-requisites first? Is it Elm specific or just a generic

[elm-discuss] Re: More on external "components"

2016-10-22 Thread OvermindDL1
Elm's VirtualDom has such a thing just for that: https://github.com/elm-lang/virtual-dom/blob/master/src/Native/VirtualDom.js#L88-L98 However, it is only accessible via 'native' code javascript, thus you'd have to make a native module, which if that is fine for you... I also have no clue if

[elm-discuss] Re: How to preventDefault on keyup of a specific key?

2016-10-21 Thread OvermindDL1
On-going conversation about how to handle that (in my opinion an `onWithOptions` should not 'take' options but rather should return them along with the message as a tuple, but it does not function that way currently). The current work-around is to use ports (register your event listener in

[elm-discuss] Re: Demo project that fails Google Closure Advanced Optimizations

2016-10-20 Thread OvermindDL1
I know it fails on our large Elm project at work, we have to run with standard optimizations of the Google Closure compiler, but I did not research in to far since generated code is not code that I control and I needed to get things done. If I get time I'll try to run it again and get some

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-20 Thread OvermindDL1
On Thursday, October 20, 2016 at 3:55:45 AM UTC-6, Rupert Smith wrote: > > 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 documentatio

[elm-discuss] Re: why no more primes on 0.18 ?

2016-10-20 Thread OvermindDL1
On Wednesday, October 19, 2016 at 7:39:25 PM UTC-6, Nathan Schultz wrote: > > Primes I'll miss for convenience, like when naming an inner tail-recursion > function to distinguish it from its wrapper. But it's not a big deal. > The convention for that in a few other languages is the name 'aux',

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread OvermindDL1
On Wednesday, October 19, 2016 at 10:58:17 AM UTC-6, Peter Damoc wrote: > > On Wed, Oct 19, 2016 at 3:02 PM, John Orford > wrote: > >> Commas beginning lines etc. >> >> Perhaps not idiomatic in Python or JS, but new good ideas rarely are : ) >> >> > I think I've answered too

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread OvermindDL1
On Wednesday, October 19, 2016 at 9:58:07 AM UTC-6, Rupert Smith wrote: > > 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 ho

Re: [elm-discuss] How to write function that updates arbitrary element of a record

2016-10-19 Thread OvermindDL1
For note, if you are updating the view with the content, so if a person types "1w" then you do not store the update so it is still just "1" and you update the input with that so it becomes 1 as well, then a warning that sometimes the cursor jumps to the start when the user types fast. Not an

[elm-discuss] Re: OT: Elm Style formatting for other languages?

2016-10-19 Thread OvermindDL1
Not uncommon in many functional languages. I've seen it done in Haskell and OCaml as a couple of examples that pop straight to mind. On Wednesday, October 19, 2016 at 6:02:19 AM UTC-6, John Orford wrote: > > The standard elm code style is v nice - anyone know whether you can > /similar/

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread OvermindDL1
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 would not be generically useful to release. But yes, I am a fan of GraphQL. I

[elm-discuss] Re: Standard practices for dynamic extension/plugins in Elm?

2016-10-18 Thread OvermindDL1
On Monday, October 17, 2016 at 6:07:45 PM UTC-6, Mario T. Lanza wrote: > > 1) due-dates: installing and activating this plugin causes a due date > field to be added to the Todo model. The interface still provides only the > text input field for providing the next "What needs to be done?" entry.

[elm-discuss] Re: Offtopic Choo Framework

2016-10-17 Thread OvermindDL1
Cool little library, but the main thing that makes me use Elm is not TEA, but rather the functional language. Having types removes entire classes of bugs and immutability makes it easy to reason about a program flow. It is just too easy to break both of those aspects in Javascript, even with

[elm-discuss] Re: Catching error in fullscreen/App.programWithFlags

2016-10-15 Thread OvermindDL1
You will not be able to do that as Elm has its own scheduler that uses `setTimeout(0, ...)` to do the event loops, including the very first init, and that errors causes that event loop to die. I'd probably recommend changing your flags to handle this case differently or you might be able to

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

2016-10-15 Thread OvermindDL1
On Wednesday, October 12, 2016 at 5:32:09 AM UTC-6, Max Froumentin wrote: > > 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? > Yep, addi

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

2016-10-11 Thread OvermindDL1
This is also what I do for a CMS'ish style of interface in something at work, using elm-markdown to render a real-time view of what is being created. Even pre-markdown back in decades past I still opted two have two panes, one where (at the time) html was put in, and the other showing the

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

2016-10-11 Thread OvermindDL1
dentity — the diff the vdoms approach can have its own serious > surprises. > > On Oct 11, 2016, at 10:11 AM, OvermindDL1 <overm...@gmail.com > > wrote: > > The ticked checkbox is because the user ticked it, it is some of the > implicit DOM state. When the view changed

Re: [elm-discuss] Re: How important is Html.Lazy to performance?

2016-10-11 Thread OvermindDL1
, 2016 at 11:52:35 AM UTC-6, Mark Hamburg wrote: > > Interesting. I can understand using a sentinel to force re-rendering but > I'm curious as to how your model or view was structured such that it could > inhibit re-rendering via laziness. > > Mark > > On Oct 11, 2016,

[elm-discuss] Re: Html.Keyed

2016-10-11 Thread OvermindDL1
The ticked checkbox is because the user ticked it, it is some of the implicit DOM state. When the view changed to remove a checkbox but it still had another one after, since they were not keyed it just did a 'diff' between states. The vdom has no information on any implicit state in the

[elm-discuss] Re: How important is Html.Lazy to performance?

2016-10-11 Thread OvermindDL1
Personally I've known it to help very little (keyed is usually more appropriate), but there have been a few times where it saves significant processing, but at those places I ended up setting it up with a 'sentry' value in a model (just an integer) that I incremented every time I wanted that

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

2016-10-10 Thread OvermindDL1
59 UTC+7 Thứ Ba, ngày 11 tháng 10 năm 2016, OvermindDL1 đã viết: >> >> Most callbacks in a browser, such as the timeout used for Time, is >> throttled to 4ms and behaves strangely below 16ms, if you want to execute >> as fast as possible then you should use an AnimationFr

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

2016-10-10 Thread OvermindDL1
hen > Time.every millisecond AIMove > > > Vào 23:54:21 UTC+7 Thứ Hai, ngày 10 tháng 10 năm 2016, OvermindDL1 đã viết: >> >> The example he put above is fine: :) >> ``` >> subscriptions : Model -> Sub Msg >> subscriptions model = >> if (game

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

2016-10-10 Thread OvermindDL1
ew to Elm and javascript. > > Vào 23:45:45 UTC+7 Thứ Hai, ngày 10 tháng 10 năm 2016, OvermindDL1 đã viết: >> >> Yep, just call it from the subscriptions callback then. >> >> >> On Monday, October 10, 2016 at 10:36:58 AM UTC-6, hoang...@gmail.com >>

[elm-discuss] Elm benchmark

2016-10-03 Thread OvermindDL1
On the elm blog post that was posted recently: http://elm-lang.org/blog/blazing-fast-html-round-two The benchmark linked at: https://evancz.github.io/react-angular-ember-elm-performance-comparison/ I've repeatedly had results like this in Chrome:

[elm-discuss] Re: Simple Fade In/Out effect?

2016-10-03 Thread OvermindDL1
You can also do it via pure CSS via the 'transition' property, just have the old fade out at like 1s time and the new fade in starting at the 1s time (or 1.001s to prevent a flicker in some browsers) while flipping display:none at the 1s mark (or just deleting it then entirely). A method I

[elm-discuss] Re: elm-make behavior different between localhost dev and production

2016-10-03 Thread OvermindDL1
Should I submit an issue ticket on getting a warning or error when > compiling when the name of module doesn't match with filename? > > Wil > > On Thursday, September 29, 2016 at 2:40:04 PM UTC-7, OvermindDL1 wrote: >> >> Not really, exrm is pretty easy (I've not mi

Re: [elm-discuss] I made Elm crash runtime...

2016-10-03 Thread OvermindDL1
As a comparison, this is how OCaml handles the same issue. OCaml uses built namespaces, meaning you can only use what was defined before you first of all, and if you want something to be able to refer to itself or something later on then you need to mark it explicitly ``` let v = v + 1 ```

[elm-discuss] Re: elm-make behavior different between localhost dev and production

2016-09-29 Thread OvermindDL1
on > how to package it up in exrm/distillery and throw it on heroku? > > > Wil > > > > On Thursday, September 29, 2016 at 7:19:31 AM UTC-7, OvermindDL1 wrote: >> >> Hmm, I use the same type of setup with the same type of arguments as you >> though I've not tried her

Re: [elm-discuss] About `programWithFlags` naming

2016-09-29 Thread OvermindDL1
On Thursday, September 29, 2016 at 8:31:57 AM UTC-6, Bobby Priambodo wrote: > > I don't know if the use case (giving data to Elm app on init) is common > enough to justify doing that, though. > It has been so far for me, but still that is why I suggest having it default to some nil value like

[elm-discuss] Re: elm-make behavior different between localhost dev and production

2016-09-29 Thread OvermindDL1
Hmm, I use the same type of setup with the same type of arguments as you though I've not tried heroku. Is the elm version between your dev machine and heroku the same? It looks like you might be using phoenix, you really should be generating a production output of all files on your dev server

Re: [elm-discuss] About `programWithFlags` naming

2016-09-29 Thread OvermindDL1
I'd personally use `programWithArgs`, or just `program` and bake flags in, defaulting to an empty tuple or some other nil type or so that comes from javascript's `undefined`. Like define init via `init () = { blah model }` for the 'no argument' case, that way it accepts 'undefined' from

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

2016-09-28 Thread OvermindDL1
On Wednesday, September 28, 2016 at 12:49:26 PM UTC-6, Rupert Smith wrote: > > That is, the .elm files are all within /src/elm but in sub-directories > underneath that. > Yep, exactly that but it is `/web/elm` for me, I have only one file per 'application' (since I have multiple main entrance

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

2016-09-28 Thread OvermindDL1
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 is in elm-package.json, the root directory of all your elm source, mine for example

Re: [elm-discuss] Structuring a simple App

2016-09-22 Thread OvermindDL1
I would still like to find a good way to structure messages. I'm up to 146 in the base Msg type, and it is not flat, by counting it seems that I have 6 message types that just hold another message type for something further down, which average in size from 2 for 1 of them, 4 for 3 of them, 8

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

2016-09-22 Thread OvermindDL1
her, do you pay the > price of having the standard library twice in your code? > > > On Thu, Sep 22, 2016 at 11:34 AM, OvermindDL1 <overmind...@gmail.com> wrote: >> >> On Thursday, September 22, 2016 at 9:17:47 AM UTC-6, Rupert Smith wrote: >>> >>> On Thur

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

2016-09-22 Thread OvermindDL1
On Thursday, September 22, 2016 at 9:17:47 AM UTC-6, Rupert Smith wrote: > > 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. >

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

2016-09-22 Thread OvermindDL1
You can compile multiple main files together and they will share a code-base, standard library, and all such. On Thursday, September 22, 2016 at 8:01:58 AM UTC-6, Rupert Smith wrote: > > On Wednesday, September 21, 2016 at 10:59:00 PM UTC+1, John Mayer wrote: >> >> I also posit that

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

2016-09-20 Thread OvermindDL1
SCSS helps 'some' of the CSS woes at least. I keep my CSS outside of elm and in SCSS and it works decently(ish). On Tuesday, September 20, 2016 at 7:20:32 AM UTC-6, Rupert Smith wrote: > > On Monday, September 19, 2016 at 6:18:33 PM UTC+1, Rex van der Spuy wrote: >> >> CSS is hell-on-wheels:

[elm-discuss] Re: Upgrading 0.16 `Effects.task <| Task.succeed` to 0.17

2016-09-15 Thread OvermindDL1
I'm not from 0.16, but here is how I send a message to myself, I have this in a Helpers module: ```elm cmd_from_msg : msg -> Cmd msg cmd_from_msg msg = Task.perform (\_ -> Debug.crash "This cannot fail") identity (Task.succeed msg) ``` Which would turn your code into this if I understand

[elm-discuss] Re: Permission denied: Elm package install

2016-09-14 Thread OvermindDL1
Based on your command line I'd say Windows (I use Win10 at work sadly, endless issue, purely linux user at home). I've had the same experiences, I've ended up doing all of these, which fix about 95% of the issues (NTFS, however, is unfixable). 1. Have the anti-virus ignore that directory tree,

  1   2   3   >