workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
<@Nickole> Elm replaces the node, there shouldn't be any wrapper node like you say
2019-03-13T11:55:02.996300
Nana
elmlang
general
interesting design choice by elm there :’)
2019-03-13T11:55:02.996400
Danika
elmlang
general
<@Nickole> example: <https://ellie-app.com/4XZp2FCXWgva1> there's no extra node there
2019-03-13T11:56:44.998000
Nana
elmlang
general
Yes, it used to work fine in 0.18. But probably I will have to solve it in Elm in `Main.view`. I was just curious if anybody faced the same problem.
2019-03-13T11:56:47.998200
Nickole
elmlang
general
it used to work differently. People complained, and suggested it be changed. It was changed. People complain that it works the way people suggested. :shrug:
2019-03-13T11:57:00.998400
Huong
elmlang
general
I think the change that Elm takes over ‘&lt;body&gt;’ came up a couple of times since 0.19 came out.
2019-03-13T11:57:20.999200
Timika
elmlang
general
<@Nickole> why you wanna keep it? Can you pass it via flags and keep it in the state?
2019-03-13T11:57:34.999500
Daysi
elmlang
general
<@Nana> Hm, looks good. I tried it before but probably did something a little bit different. Thanks.
2019-03-13T11:58:50.000600
Nickole
elmlang
general
<@Daysi> I’m operating with whole element later when I need to add another element after it and I don’t want to use `getElementById` again.
2019-03-13T12:00:23.002400
Nickole
elmlang
general
I wonder why Elm doesn't namespace union-type-constructors so that `type Bla = Blubb String` becomes `Bla.Blubb "a string"` later on in the same module...
2019-03-13T12:01:09.002500
Daysi
elmlang
general
in other cases on the other hand, union-type-labels *are* encapsulated: `exposing Bla(Blubb)`
2019-03-13T12:02:10.002700
Daysi
elmlang
general
I’m not particularly opinionated either way, what were the original complains?
2019-03-13T12:03:22.003500
Danika
elmlang
general
can you store a reference to the Element on first call to `getElementById` and use this reference later?
2019-03-13T12:03:26.003800
Daysi
elmlang
general
I tried it and I had it wrapped it the extra `div`: ``` &lt;div data-elm-hot="true"&gt;&lt;div id="root"&gt; ELM &lt;/div&gt;&lt;/div&gt; ```
2019-03-13T12:04:02.004100
Nickole
elmlang
general
mostly "redundant nesting" and the inability to have a clean dom structure - instead, the entire app would always live inside a single `div`
2019-03-13T12:04:11.004300
Huong
elmlang
general
I believe som people did not want to have a wrapping element for aesthetic reasons.
2019-03-13T12:04:19.004600
Jin
elmlang
general
which you'd embed in a div
2019-03-13T12:04:28.005100
Huong
elmlang
general
so 2 divs really :smile:
2019-03-13T12:04:37.005300
Huong
elmlang
general
Reasonable enough I suppose!
2019-03-13T12:05:12.006200
Danika
elmlang
general
None
2019-03-13T12:05:26.006400
Daysi
elmlang
general
<@Daysi> But I’m still working wit this element in JS and not in Elm so I would like to avoid sending it back and forth.
2019-03-13T12:05:30.006800
Nickole
elmlang
general
Namespacing only ever happens by module (or alias), it mostly keeps the language a little simpler. But I really wouldn't worry about creating a module just for a type and a bunch of functions that only work on that type. I saw you referenced life of a file earlier - that talk also encourages developing modules around types, which I feel might be relevant here
2019-03-13T12:05:59.006900
Huong
elmlang
general
Yes, I do it exactly like this. Then I initialize Elm there but the element lose the `id` so when I want to use the `node` again, it cannott be found.
2019-03-13T12:07:58.007500
Nickole
elmlang
general
why would you need id if you already have a reference to `node`?
2019-03-13T12:08:32.007700
Daysi
elmlang
general
Elm replaces the node
2019-03-13T12:08:42.007900
Danika
elmlang
general
oh
2019-03-13T12:08:52.008100
Daysi
elmlang
general
I see
2019-03-13T12:08:54.008300
Daysi
elmlang
general
that's unfortunate
2019-03-13T12:09:00.008500
Daysi
elmlang
general
ah that's because of elm-hot-webpack-loader
2019-03-13T12:09:11.008800
Nana
elmlang
general
it's only during development
2019-03-13T12:09:21.009000
Nana
elmlang
general
has `app` a memeber which references the node?
2019-03-13T12:09:46.009200
Daysi
elmlang
general
<@Daysi> I’m sorry, but how do you mean that?
2019-03-13T12:12:51.009400
Nickole
elmlang
general
<@Nickole> what about that?
2019-03-13T12:12:59.009600
Daysi
elmlang
general
Hm,, but I need to append and remove the after element multiple times later so it won’t work then.
2019-03-13T12:15:29.010000
Nickole
elmlang
general
I mean if `app` has a property which points to `node` (or the updated version of it).
2019-03-13T12:15:30.010200
Daysi
elmlang
general
no problem. `appendChild` returns the reference to the appended child :slightly_smiling_face:
2019-03-13T12:17:02.010400
Daysi
elmlang
general
so you can store it and do stuff with it later (like removing it)
2019-03-13T12:17:26.010600
Daysi
elmlang
general
just write `const appended = parent.appendChild(document.createElement("div"));` and you can use `appended` later
2019-03-13T12:18:16.010800
Daysi
elmlang
general
e.g. `appended.remove()`
2019-03-13T12:18:52.011000
Daysi
elmlang
general
so you think it might be suitable to create modules for the types?
2019-03-13T12:19:56.011200
Daysi
elmlang
general
<@Huong>
2019-03-13T12:20:14.011400
Daysi
elmlang
general
It might be, if it helps getting the constraints you need without running into shadowing issues :thumbsup:
2019-03-13T12:21:54.011600
Huong
elmlang
general
might be a good option here. Thanks! :slightly_smiling_face:
2019-03-13T12:22:16.011800
Daysi
elmlang
general
One more question re. Parser: is there an idiomatic way to pass data or state downward? For instance, if I'm parsing a 'let' type structure, I might make a symbol table entry when I see a name, raising an error if the name is already in the symbol table. Or is Parser purely for generating an AST and that level of semantic check happens afterward?
2019-03-13T13:17:38.012100
Dede
elmlang
general
Is this the right place to post a compiler error message? ```elm: Map.!: given key is not an element in the map CallStack (from HasCallStack): error, called at libraries/containers/Data/Map/Internal.hs:603:17 in containers-0.5.10.2:Data.Map.Internal ```
2019-03-13T14:49:03.012800
Kymberly
elmlang
general
I've got it narrowed down to a conversion from `List` to `Array`
2019-03-13T14:49:20.013200
Kymberly
elmlang
general
this is a known issue that in most cases is solved by not using the `--debug` flag.
2019-03-13T14:50:28.013600
Virgie
elmlang
general
ah ok
2019-03-13T14:50:32.013900
Kymberly
elmlang
general
the actual issue is using a module that exposes a type alias of an unexposed type. Many packages do this.
2019-03-13T14:51:21.014900
Virgie
elmlang
general
oh yikes - ok, so if I access Array as `Array.Array` will I be better off?
2019-03-13T14:51:46.015400
Kymberly
elmlang
general
no, only if you don't actually import `Array` will it work. which is unrealistic for any decently sized project
2019-03-13T14:52:39.016100
Virgie
elmlang
general
if not `Array` specifically one of your dependencies will probably do this
2019-03-13T14:53:13.016500
Virgie
elmlang
general
k - so just avoid --debug for now then
2019-03-13T14:53:39.016800
Kymberly
elmlang
general
It could be done in the parser, though in general you wouldn't want to do that. Doing that kind of analysis on the ast makes it easier to report (multiple) errors
2019-03-13T14:58:04.017000
Huong
elmlang
general
Fair.
2019-03-13T14:58:18.017200
Dede
elmlang
general
Since asking the question I realized andThen could be used to push data along.
2019-03-13T14:58:31.017400
Dede
elmlang
general
Exactly :thumbsup:
2019-03-13T14:59:11.017600
Huong
elmlang
general
Nice.
2019-03-13T15:09:44.017800
Dede
elmlang
general
I applaud your continued efforts with proper parsing.
2019-03-13T15:10:37.018000
Leoma
elmlang
general
I'm actually just putting down my pen.
2019-03-13T15:10:51.018200
Dede
elmlang
general
ha
2019-03-13T15:10:57.018400
Leoma
elmlang
general
My conclusion from working with Elm parser is that you actually need two passes. (And this isn't Elm parser's fault.) You can reasonably use Elm parser to turn the input into a list of tokens TEXT, WHITESPACE, OPENBOLD, OPENITALIC, CLOSEBOLD, CLOSEITALIC. But then you need a second pass over that list, with the ability to modify it, to properly apply the tolerant markup semantics.
2019-03-13T15:11:49.018600
Dede
elmlang
general
I think you could probably work the two phases together within the parser. Not sure how much it's worth it.
2019-03-13T15:15:05.018800
Dede
elmlang
general
I'm curious -- do your regexps backtrack?
2019-03-13T15:15:14.019000
Dede
elmlang
general
They did, but, JS regexp backtracking isn’t implemented across all major browsers. So I did a hack where I capture (pre-match)(actual-match)(post-match) then hold on to the sub-match I want.
2019-03-13T15:17:19.019200
Leoma
elmlang
general
Wheee.
2019-03-13T15:17:39.019400
Dede
elmlang
general
I don't think you need two passes with elm/parser, see my previous Ellie example (I just reverse all the lists after because everything is built in reverse, but this could be improved): <https://elmlang.slack.com/archives/C0CJ3SBBM/p1552431350900400?thread_ts=1552246033.736000&amp;cid=C0CJ3SBBM> <https://ellie-app.com/4XGvnPg32fYa1> This is O(n) (the size of the input). I didn't handle white spaces though, but I doubt this compromises the one pass.
2019-03-13T15:17:45.019600
Velia
elmlang
general
You're targetting a simpler grammar there, I think.
2019-03-13T15:20:38.020000
Dede
elmlang
general
Nesting isn't supposed to be permitted.
2019-03-13T15:20:44.020200
Dede
elmlang
general
I allow/support nesting like `/italic and *bold*/`
2019-03-13T15:21:42.020400
Leoma
elmlang
general
Right, but you want `/hello /world/ there/` to render as /hello _world_ there/ right?
2019-03-13T15:22:15.020600
Dede
elmlang
general
I suspect I’m O(n^2) but with native regexp it’s plenty fast for reasonable documents.
2019-03-13T15:22:30.020900
Leoma
elmlang
general
At least, that would be the most markdown-ish behavior.
2019-03-13T15:22:55.021100
Dede
elmlang
general
So, once you “open” a style, we just look for a closing tag. So in that case the `hello /world`would be italic
2019-03-13T15:23:37.021300
Leoma
elmlang
general
&gt; You're targetting a simpler grammar there, I think. I support nesting too though.
2019-03-13T15:23:58.021500
Velia
elmlang
general
Perhaps I took markdown too literally as a target.
2019-03-13T15:24:13.021700
Dede
elmlang
general
*this *is* markdown*
2019-03-13T15:24:21.021900
Dede
elmlang
general
`*this *is* markdown*`
2019-03-13T15:24:35.022100
Dede
elmlang
general
It doesn't nest.
2019-03-13T15:24:38.022300
Dede
elmlang
general
Excuse me, it doesn't nest within a single style.
2019-03-13T15:24:54.022600
Dede
elmlang
general
You can nest italics w/in bold and soforth.
2019-03-13T15:24:59.022800
Dede
elmlang
general
But only the innermost opening/closing tags for a style are applied, the rest are rendered as literals.
2019-03-13T15:25:14.023000
Dede
elmlang
general
Although looking at this Ellie, I do see much more intelligent use of andThen than I had done.
2019-03-13T15:27:04.023200
Dede
elmlang
general
Maybe just 15 more minutes :wink:
2019-03-13T15:27:10.023400
Dede
elmlang
general
Nesting is harder than not nesting.
2019-03-13T15:27:13.023600
Velia
elmlang
general
And I believe <@Leoma> wanted nesting. Anyway this was an interesting exercise, and I may need it later. It's great if you implemented what you wanted, your rules are likely more user friendly than mines.
2019-03-13T15:35:15.023800
Velia
elmlang
general
Nothing I've done is fully usable.
2019-03-13T15:36:42.024000
Dede
elmlang
general
This has been an excuse for me to learn something about Elm parser.
2019-03-13T15:37:59.024200
Dede
elmlang
general
Thanks for sharing your implementation.
2019-03-13T15:38:19.024400
Dede
elmlang
general
<https://elmlang.slack.com/archives/C0CJ3SBBM/p1552504950020900?thread_ts=1552246033.736000&amp;cid=C0CJ3SBBM> I suspect you are O(input size^complexity of the input) , whatever that means, but this can go high and it's typical of regexs (very hard to evaluate the complexity once you have several nested ones). This might be enough for your use case though (at first, as users love to abuse features).
2019-03-13T15:46:04.024700
Velia
elmlang
general
Anyway, what's great with SPA/Elm is that all CPU is taken from the client, so it matters a lot less than server side computing, as long as interactivity is reasonable.
2019-03-13T16:02:14.025900
Velia
elmlang
general
Also to be fair, I may not be O(n) as I omitted the lists operations from the complexity, but this might not change much the result given the operations I do.
2019-03-13T16:17:10.026300
Velia
elmlang
general
is elm being actively worked on?
2019-03-13T16:51:42.027300
Kellee
elmlang
general
Yes
2019-03-13T16:51:48.027500
Danika
elmlang
general
Trying to convince my team to try it out for a project. They saw that the releases have slowed down and there hasn’t been that much work on core. Is there a roadmap or even a good blog post that would be alleviate some of this concern?
2019-03-13T16:53:08.028600
Kellee
elmlang
general
yea, the roadmap <https://github.com/elm/projects/blob/master/roadmap.md> is that there is no timeline
2019-03-13T16:54:30.029400
Virgie
elmlang
general
Elm has a particularly slow development rate
2019-03-13T16:54:40.029700
Kris
elmlang
general
It’s of course ongoing, but that’s what it is
2019-03-13T16:54:56.030300
Kris
elmlang
general
on the other hand, it is pretty great right now, and absolutely will continue going. Not having new features and releases (that you now have to update to) every couple of months can actually be seen as a feature
2019-03-13T16:56:06.031500
Virgie
elmlang
general
I think a sign of the pace might be that the roadmap is still pointing to 0.19 as the next version. :wink:
2019-03-13T17:18:16.032300
Rochell