workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
0.19 seems like the perfect time to get into Elm though, with the huge compile time improvements!
2019-03-13T17:21:29.034100
Nana
elmlang
general
I started with 0.19, and I'm enjoying it quite a bit at least. Though I'm pretty sure my SPA could use some structural improvement hehe.
2019-03-13T17:22:12.034700
Rochell
elmlang
general
But I'm learning!
2019-03-13T17:22:15.034900
Rochell
elmlang
general
Anyone played around with elm and gojs? Or maybe just canvas?
2019-03-13T17:22:41.035200
Kellee
elmlang
general
<@Kellee> for custom visualizations I would go with elm/svg or elm-visualizations rather than canvas. Shouldn't be a problem to interop with GoJS via ports
2019-03-13T17:38:50.036600
Nana
elmlang
general
<@Leoma>, whatever the mean, what is great also is how you got a WYSIWYG editor. Did you use an hidden input or a content editable?
2019-03-13T19:43:06.037500
Velia
elmlang
general
This is really cool :grinning:
2019-03-13T19:51:57.037700
Velia
elmlang
general
@translate
2019-03-13T21:37:10.038200
Latina
elmlang
general
Is anyone here familiar with `elm-ui`? How do I combine `Element.below` and `Element.onRight` to get something to display to the bottom right of another element?
2019-03-14T02:46:04.039200
Deane
elmlang
general
<@Deane> If you don't get answers here, try the <#C4F9NBLR1|elm-ui> channel :slightly_smiling_face:
2019-03-14T03:00:59.039600
Chaya
elmlang
general
oh ok, thanks!
2019-03-14T03:04:15.039800
Deane
elmlang
general
Hello! I need my app to handle URL queries, but I don't care about the path (I don't know where it will be deployed, so the URL path can be very different). Is there a way to use Url.Query.Parser while ignoring the path?
2019-03-14T04:05:35.041500
Dorsey
elmlang
general
Unrelated: huge, enthusiastic shout out to <@Virgie> for helping us at the workshop last friday. You are awesome!
2019-03-14T04:07:21.042700
Dorsey
elmlang
general
<@Dorsey> No you can’t unfortunately
2019-03-14T04:09:54.043500
Lea
elmlang
general
That what I thought :disappointed:
2019-03-14T04:10:09.043800
Dorsey
elmlang
general
<https://github.com/elm/url/issues/9>
2019-03-14T04:10:14.044100
Lea
elmlang
general
It’s not the first time it’s requested, another issue might be useful to show some interest in this :slightly_smiling_face:
2019-03-14T04:12:15.045100
Lea
elmlang
general
Yeah, for that I have a hack that gets up to 10 segmnts of a path in a `List String`. It goes like this: ``` variadic last = 10 |&gt; List.range 1 |&gt; List.foldl (\_ parser_ -&gt; Parser.oneOf [ parser_ , Parser.map (\parent child -&gt; case child of Content path -&gt; Content (parent :: path) _ -&gt; NotFound ) (Parser.string &lt;/&gt; parser_) ] ) last ```
2019-03-14T04:16:24.046900
Dorsey
elmlang
general
But in my current case I simply don't care about the path, so I was hoping I don't have to employ this spaghetti.
2019-03-14T04:17:15.047700
Dorsey
elmlang
general
If you really just don't care about the path at all, just set it to `"/"` in the `Url` you pass to the parser
2019-03-14T04:19:25.048600
Huong
elmlang
general
Haha, yeah! That's so obvious once you said it :face_palm:
2019-03-14T04:26:54.049500
Dorsey
elmlang
general
Good one!
2019-03-14T04:50:01.050400
Lea
elmlang
general
thanks so much! it was a lot of fun to talk to everyone
2019-03-14T05:11:05.050500
Virgie
elmlang
general
Anyone know if there's a spec of whitepaper or something for Elm? Feels like I've seen one before, but can't find it. Going to write a tech spec for another project, but want some inspo
2019-03-14T07:33:57.051900
Janna
elmlang
general
Glad to hear that. We will schedule the first monthly meeting soon. I'll keep you posted.
2019-03-14T07:34:14.052000
Dorsey
elmlang
general
Are you looking for Evan’s thesis? (<https://www.seas.harvard.edu/sites/default/files/files/archived/Czaplicki.pdf>)
2019-03-14T08:10:08.052500
Timika
elmlang
general
has anyone tried to update a pages metadata? any tips on best practices? javascript only solution? ports?
2019-03-14T08:27:05.053300
Selene
elmlang
general
We’ve used ports
2019-03-14T08:27:47.053700
Simon
elmlang
general
I have used ports as well: <https://github.com/olpeh/onkometrorikki/blob/8401b813e0e662e8e78435abb8dc1eb1be364cb2/src/index.js#L44-L77>
2019-03-14T08:45:03.053900
Shena
elmlang
general
Thanks <@Florencia> for the help a couple of weeks ago with the animated numbers. I ended up tweaking your solution a tiny bit but thank you for giving me a great starting point. :raised_hands:
2019-03-14T09:45:29.054300
Dorthey
elmlang
general
invite @translate
2019-03-14T10:13:49.055300
Latina
elmlang
general
@translate
2019-03-14T10:13:57.055600
Latina
elmlang
general
Can you share your solution? :smile:
2019-03-14T10:22:54.056400
Kris
elmlang
general
<@Dorthey> Exciting, and looking slick!
2019-03-14T10:44:14.057200
Florencia
elmlang
general
What is the status of sending Union types through ports? This issue was closed in favor of an issue moved to `elm-plans` but `elm-plans` is now deprecated, so it looks like this issue is no longer under discussion. <https://github.com/elm/compiler/issues/490> <https://github.com/elm-lang/elm-plans/issues>
2019-03-14T12:06:13.063100
Russel
elmlang
general
You can always push a `Value` though ports, encoding your types exactly as you want them to be encoded. IIRC, you cannot use non-primitives in ports in 0.19.
2019-03-14T12:13:16.063600
Timika
elmlang
general
Oh really? I think in guide it is mentioned that records are still supported
2019-03-14T12:14:16.063900
Lynne
elmlang
general
I cannot find a `Cmd` constructor:
2019-03-14T12:14:17.064100
Wendy
elmlang
general
how do i call first update after init?
2019-03-14T12:14:37.064200
Wendy
elmlang
general
:point_up: That can very well be. Good catch.
2019-03-14T12:14:42.064300
Timika
elmlang
general
I think I understand that point. So, maybe my architecture is non-idiomatic. Is it crazy to try to store an entire model in localStorage if I don’t want to reimplement Encode and Decode for the entire tree? Or maybe I’m making that a bigger deal than it has to be.
2019-03-14T12:15:16.064600
Russel
elmlang
general
It might be not crazy at all, depending on your requirements, but imagine that data in local storage got somehow corrupted. Having your own decoder you will manage it much better than Elm would
2019-03-14T12:16:50.064800
Lynne
elmlang
general
I mentioned this in <#C192T0Q1E|beginners>, In the answer credited here, it looks like in order to support JE/JD after adding 1 union type in their model type, they need to reimplement the entire record JD/JE <https://stackoverflow.com/questions/37999504/how-to-pass-union-types-through-elm-ports>
2019-03-14T12:17:19.065000
Russel
elmlang
general
In this case, they are looking at storing their model in localStorage through ports
2019-03-14T12:17:42.065300
Russel
elmlang
general
That's correct, here is the list of what is supported out of the box: <https://guide.elm-lang.org/interop/flags.html#verifying-flags>
2019-03-14T12:17:49.065500
Lynne
elmlang
general
For flags I think the consensus that `Value` is preferred for the reasons Sergey stated.
2019-03-14T12:17:57.065700
Timika
elmlang
general
It might be a huge undertaking to write encoders and decoders for you whole model, but with that you have the certainty that if your model somehow changes you have a way to provide backwards compat with old local storage versions of your model for example.
2019-03-14T12:19:49.066100
Timika
elmlang
general
Personally, I don’t want to worry renaming fields and stuff because it might break some public JSON API (like in your case)
2019-03-14T12:20:38.066400
Timika
elmlang
general
What I am saying: It requires some manual effort but you also gain something. :slightly_smiling_face:
2019-03-14T12:21:28.066600
Timika
elmlang
general
This sounds like an X Y problem, what are you trying to achieve with this? (If you really want to do this, you can simply call update within init, its a function like any other.)
2019-03-14T12:23:20.067800
Timika
elmlang
general
It sounds like it would be easier to reason about if I did not try to put a part of my model into local storage, and simply have my own `PersistentState` type which could be a record of `Maybe`s that I send over the ports for local storage and receive back through flags
2019-03-14T12:24:01.068000
Russel
elmlang
general
Mainly, I’d just need to have tokens stored for now
2019-03-14T12:24:42.068200
Russel
elmlang
general
If your whole model is not what you _really_ need to persist, this seems more reasonable.
2019-03-14T12:24:47.068400
Timika
elmlang
general
Thanks <@Timika>
2019-03-14T12:25:03.068700
Russel
elmlang
general
<https://ellie-app.com/4YsDM2LML9ja1>
2019-03-14T12:26:17.070000
Lynne
elmlang
general
Just tried out sending and receiving non-primitives :slightly_smiling_face:
2019-03-14T12:26:27.070400
Lynne
elmlang
general
Am I correct that sending port message from JS to Elm is a synchronous operation?
2019-03-14T12:26:37.070700
Frieda
elmlang
general
<@Lynne> I’ve seen this working, I think I was tripped up when attempting to use union types. But as <@Timika> pointed out, if your model structure changes or types get renamed, and you are relying on the default JD/JE implementations, then it could easily break compatibility. So, I settled on the idea of keeping only a small part of my state in LocalStorage which could be a record of maybe types, then I won’t have to reimplement JD/JE for that specific part of the app.
2019-03-14T12:29:52.071100
Russel
elmlang
general
How do i specify init that will call an update?
2019-03-14T12:30:31.071300
Wendy
elmlang
general
This may lead to some duplication in my model, or I will not store this state in my model and only use it as a flag
2019-03-14T12:30:53.071400
Russel
elmlang
general
Nah, I am not questioning what <@Timika> said (on contrary, I am fully supporting it). The Ellie was to check if the docs were up-to date because I got concerned about what <@Timika> said about dropped support for sending non-primitives to ports
2019-03-14T12:31:32.072100
Lynne
elmlang
general
calling `update` from `init` sounds like an attempted solution to a problem. There may be other, better solutions to that problem.
2019-03-14T12:31:42.072500
Huong
elmlang
general
Sadly, but sometimes docs are not saying true
2019-03-14T12:31:50.072600
Lynne
elmlang
general
Yup, i was wrong about that :smile:
2019-03-14T12:31:54.072800
Timika
elmlang
general
yes
2019-03-14T12:32:04.073000
Huong
elmlang
general
thank you
2019-03-14T12:32:22.073500
Frieda
elmlang
general
Is this knowledge about an implementation detail or part of the “spec”?
2019-03-14T12:33:53.074800
Timika
elmlang
general
<@Wendy> `update` is just a function which may modify model and produce a command. Init has same power as it can modify the model and produce a command. If you want to reuse some update model logic then you can extract the logic in a helper function and use the helper function in both init and update functions.
2019-03-14T12:34:33.075700
Frieda
elmlang
general
It was consciously changed in 0.19, to make it possible to pass certain things (like event data) through ports and react to those, which must (in many cases) happen synchronously
2019-03-14T12:35:29.075900
Huong
elmlang
general
I checked the source code briefly it all it does is just pure function calls.
2019-03-14T12:35:31.076100
Frieda
elmlang
general
so as far as I'm concerned, that's "spec", in the sense that it's not a coincidence
2019-03-14T12:36:08.076300
Huong
elmlang
general
Yeah, same for me. Thank you for elaborating this! :slightly_smiling_face:
2019-03-14T12:36:33.076500
Timika
elmlang
general
Agreed, that is super cool.
2019-03-14T13:16:53.076900
Dede
elmlang
general
For what it's worth, I did one last pass and made my markdown system work entirely within the Parser operation.
2019-03-14T13:17:16.077200
Dede
elmlang
general
There is no large-scale backtracking, although backtracking is used in tokenization. Most of it could be squeezed out if it were a performance issue.
2019-03-14T13:18:07.077500
Dede
elmlang
general
My completed homework assignment is here: <https://github.com/jhbrown94/elmish-minimarkdown>
2019-03-14T13:18:15.077700
Dede
elmlang
general
Now back to the primary project :wink:
2019-03-14T13:18:21.077900
Dede
elmlang
general
How to make two work days disappear :laughing:
2019-03-14T13:19:04.078100
Velia
elmlang
general
Oh yeah.
2019-03-14T13:19:23.078300
Dede
elmlang
general
Brainsnipe.
2019-03-14T13:19:25.078500
Dede
elmlang
general
But I had been looking for an excuse to learn Elm Parser.
2019-03-14T13:19:34.078700
Dede
elmlang
general
This will pay back I'm sure.
2019-03-14T13:20:00.078900
Velia
elmlang
general
:wink:
2019-03-14T13:20:05.079100
Dede
elmlang
general
All said and done, I think I still prefer parser-generator systems (e.g. Bison/Yacc) because the domain-specific language is so well tailored to parsing.
2019-03-14T13:20:30.079300
Dede
elmlang
general
<@Frieda> i ended up having let in init functions and gradually built the model structure. The function that was used in init model now can take model as the argument and i can refactor my code
2019-03-14T13:20:31.079500
Wendy
elmlang
general
(Also: I'll bet the regexp version wins for performance because it's probably a C implementation somewhere deep inside Node.)
2019-03-14T13:26:19.079700
Dede
elmlang
general
This ended up being v nice.
2019-03-14T14:44:30.080300
Jeanene
elmlang
general
For the purposes of validating whether somebody is 18, that constant-time check works well _enough_…and it provides a fairly clear/terse implementation IMO. Would love to know how to do it properly for leap years and whatnot, but I feel like this will check the vast majority…and if somebody fails a `is18` check, they can come back in a day or less and pass. :slightly_smiling_face:
2019-03-14T14:45:48.080500
Jeanene
elmlang
general
:slightly_smiling_face:
2019-03-14T15:45:50.080800
Hoyt
elmlang
general
Is elm-community/html-test-runner 0.19-compatible? Or is there something else to run tests in the browser? I was hoping to use Parcel to compile my tests and have them running in a tab next to my app.
2019-03-14T15:56:23.082000
Dorsey
elmlang
general
See <https://github.com/elm-explorations/test>
2019-03-14T16:26:42.082200
Bebe
elmlang
general
you can use npm install -g elm-test and then elm-test --watch
2019-03-14T16:27:03.082400
Bebe
elmlang
general
That’s for the terminal, right?
2019-03-14T16:28:48.083200
Dorsey
elmlang
general
yep
2019-03-14T16:31:34.083400
Bebe
elmlang
general
i didn't realise you meant the html runner
2019-03-14T16:31:47.083600
Bebe
elmlang
general
Yeah. Thanks for offering help :)
2019-03-14T16:32:35.084600
Dorsey
elmlang
general
This seems to exist and be 0.19 compatible <https://package.elm-lang.org/packages/jgrenat/elm-html-test-runner/1.0.1/>
2019-03-14T16:33:31.084800
Bebe
elmlang
general
That's interesting. Thanks!
2019-03-14T17:08:51.085300
Dorsey
elmlang
general
i've been out of the elm world for a bit and it looks like `toString` is gone. what's the best way to convert a `List a` to a `String` now (assuming I can convert `a -&gt; String`)?
2019-03-14T17:47:03.086300
Natalie
elmlang
general
<@Natalie> if it's for debugging purposes then `Debug.toString` is still there
2019-03-14T17:49:26.088500
Earlean