workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
Although I guess I could avoid the lack of hkp by using tuples as the `a` in the example above :thinking_face:
2019-04-10T18:09:53.038800
Raylene
elmlang
general
I definitely must publish this
2019-04-10T18:10:06.039000
Raylene
elmlang
general
What's HKP?
2019-04-10T18:10:22.039200
Kris
elmlang
general
Higher Kindred Polymorphism, sorry. Say that the type above was `Dest a`. I actually need `forall a . Dest a` to use it for forms and for encoders without calculating more than necessary, although I might do without :thinking_face:
2019-04-10T18:12:44.039400
Raylene
elmlang
general
Ah, right, got it.
2019-04-10T19:38:47.039800
Kris
elmlang
general
Thank you!
2019-04-10T20:16:30.040400
Kimiko
elmlang
general
How do I find the docs for Elm Html 5.0.0 lib? Docs were wiped for some reason <https://package.elm-lang.org/packages/evancz/elm-html/latest/Html-Events>
2019-04-10T20:30:50.041100
Lesli
elmlang
general
<@Lesli> those probably aren't the docs your looking for. are you working on an old Elm project?
2019-04-10T20:32:03.041900
Earlean
elmlang
general
Yep working on an Elm 18 project. Want to check targetValue usage in Html.Events. 4.0.0 docs are there but use Signal as an example. Which doesn't seem right.
2019-04-10T20:32:51.043000
Lesli
elmlang
general
those are docs for a package for Elm 0.17, which is ~5yrs old now
2019-04-10T20:33:06.043200
Earlean
elmlang
general
That's the confusing thing about all Elm docs..
2019-04-10T20:33:26.043800
Lesli
elmlang
general
<https://package.elm-lang.org/packages/elm-lang/html/2.0.0/> is Elm 0.18 docs
2019-04-10T20:33:28.044000
Earlean
elmlang
general
Thank you, but I'm not sure how you deduced that? What you search terms were or how did you navigate the docs to that page? That info seems completely hidden to me
2019-04-10T20:34:26.044800
Lesli
elmlang
general
You can get to Elm 0.18 docs via google searches or by going directly to the package url. But they aren't available via the <https://package.elm-lang.org/> index
2019-04-10T20:36:18.046200
Earlean
elmlang
general
You can search for Elm 0.18 docs at <https://dmy.fr/elm-0.18-packages/>
2019-04-10T20:37:09.047100
Earlean
elmlang
general
elm-lang stuff is 0.18.
2019-04-10T20:37:20.047600
Kris
elmlang
general
Is there a reason why that is not advertised on the pages themselves? "Welcome to Elm 0.18 docs"
2019-04-10T20:38:14.048500
Lesli
elmlang
general
It would be nice if there was an Elm lang dropdown on the docs page for example
2019-04-10T20:39:01.049100
Lesli
elmlang
general
it certainly would be nice.
2019-04-10T20:40:52.049700
Earlean
elmlang
general
It's a known issue, but there hasn't been any progress on that.
2019-04-10T20:41:52.050500
Earlean
elmlang
general
At least one of those those two would help identify the Elm version the docs are for :slightly_smiling_face:
2019-04-10T20:41:58.050700
Lesli
elmlang
general
Gotcha, thanks
2019-04-10T20:42:12.051000
Lesli
elmlang
general
Evan's development process doesn't prioritise reducing latency of responding to issues eg. <https://github.com/elm/package.elm-lang.org/pull/285>
2019-04-10T20:44:36.052500
Earlean
elmlang
general
Instead it prioritises overall throughput, which is frustrating but works pretty well
2019-04-10T20:46:18.053800
Earlean
elmlang
general
hey, does anyone know what elm-xref considers an entrypoint? any `main` function in a module?
2019-04-11T04:11:18.056500
Emilee
elmlang
general
yep
2019-04-11T04:40:29.056700
Huong
elmlang
general
<https://github.com/zwilias/elm-xref/blob/master/elm/Main.elm#L146-L158>
2019-04-11T04:41:07.056900
Huong
elmlang
general
it also insists that the `main` be exposed, which isn't entirely correct now that I think about it
2019-04-11T04:41:31.057100
Huong
elmlang
general
Hey Riccardo. I did not realize that you wanted to version images as well. On this I have an insight. My CSS and JS files have content hash in their name but to apply the same technique to images you will probably need to load manifest JSON into your app via flags and take paths from it.
2019-04-11T05:13:10.057300
Lynne
elmlang
general
<https://webpack.js.org/concepts/manifest>
2019-04-11T05:15:43.057500
Lynne
elmlang
general
thanks for the quick reply :slightly_smiling_face:
2019-04-11T05:17:38.057800
Emilee
elmlang
general
for a moment I thought jessta was talking about a garbage collector
2019-04-11T08:55:27.058700
Sharri
elmlang
general
A bullet-proof way to verify if you are looking to the correct package is to browse its source and look into `elm-package.json` (for versions &lt;= 0.18). You will see the Elm version there. If you see no `elm-package.json` but `elm.json`, then it is certainly 0.19.
2019-04-11T09:07:39.058900
Lynne
elmlang
general
Can you have multiple Elm bundles share a single Elm runtime? I'm asking in regards of using Elm inside a React application and I wouldn't want every widget to ship it's own Elm runtime
2019-04-11T10:02:19.060200
Dayna
elmlang
general
Yes I think they do if you compile them at the same time like: ``` elm make src/Main1.elm src/Main2.elm src/Main3.elm ```
2019-04-11T10:09:04.061600
Carman
elmlang
general
I've managed, accidentally, to write some code (78 lines) which crashes the elm make (locks up and gobbles memory until I kill it in Task Manager). I don't want to put it in Ellie in case it does the same to her. Is this a good place to post it or is there somewhere better?
2019-04-11T10:26:52.063700
Vallie
elmlang
general
<@Vallie> Good thinking. I think Ellie no longer does any server compilation, so I think it should be safe, perhaps best to get a second opinion first though :smile:
2019-04-11T10:29:03.064700
Nana
elmlang
general
It does do server compilation - client side compilation was rolled back some time before the 0.19 release
2019-04-11T10:29:58.064900
Huong
elmlang
general
ah :+1:
2019-04-11T10:31:21.065100
Nana
elmlang
general
So NOT Ellie, but here or in elm-dev or even elm-ui as it does involve elm-ui.
2019-04-11T10:35:34.065300
Vallie
elmlang
general
I think it makes sense to try and drill this down to an SSCCE with some help from the folks in <#C4F9NBLR1|elm-ui>, and then log a bug on elm/compiler. It's quite likely that the minimal example won't need elm-ui, so that would be great!
2019-04-11T10:44:28.065500
Huong
elmlang
general
OK. I'll hide it away in elm-ui as I'm pretty sure my code is bad too. But I wasn't able to achieve the crash without it!
2019-04-11T10:46:50.065700
Vallie
elmlang
general
Is there a way to instruct the compiler to preserve comments? I'm thinking of something like JSDoc's `@license` that preserves any comments that include that term. Useful for copyright statements in generated JS.
2019-04-11T12:26:30.067500
Fransisca
elmlang
general
Bundle size wasn't the issue I was addressing here (the bundle size is under 50kb), but code complexity and nesting of sum types.
2019-04-11T12:30:59.067600
Isaiah
elmlang
general
<@Fransisca> nothing like that currently, I've used shell scripts or the webpack banner plugin for that before
2019-04-11T12:43:06.069200
Augustus
elmlang
general
Thanks, <@Augustus>; will do
2019-04-11T12:47:55.069800
Fransisca
elmlang
general
<@Isaiah> in that case it might be more of an issue of code layout.
2019-04-11T13:07:06.069900
Maida
elmlang
general
Anyways, elm allows for easy refactoring. You can continuously improve your source code.
2019-04-11T13:08:06.070100
Maida
elmlang
general
are there any functions or ways to terminate the folding of a list or array early
2019-04-12T02:02:37.001300
Bret
elmlang
general
specifically I have an array of 126 `(Int, Int)`s that I know is sorted ascending (both `Int`s happen to be sorted this way); I have a function that `Array.foldl`s through, searching for the first `Int` that is larger than a certain value. once i find it, i can terminate the fold early and return the accumulator, but I don’t see any such function in `Array` or `Array.Extra`
2019-04-12T02:07:39.005100
Bret
elmlang
general
or the `List` or `List.Extra` modules either for that matter
2019-04-12T02:07:59.005600
Bret
elmlang
general
do I have to implement my own left fold that can terminate early? I could do that with `List` easily, but `Array`??
2019-04-12T02:09:01.006800
Bret
elmlang
general
Maybe I’m early-optimizing but I think it’s wasteful to fold through the whole `Array` even if it’s only 126 elements
2019-04-12T02:09:49.007600
Bret
elmlang
general
<@Bret> are you looking for <https://package.elm-lang.org/packages/elm-community/list-extra/latest/List-Extra#find> ?
2019-04-12T02:11:15.008300
Earlean
elmlang
general
Yeah I do random lookups so I’d like to keep the data structure as an `Array`
2019-04-12T02:12:28.009300
Bret
elmlang
general
<@Earlean> presumably that’s exactly what I need, but for `Array` :sweat_smile:
2019-04-12T02:14:06.010000
Bret
elmlang
general
I’m looking at the source and it looks like `Array` is implemented in `Native.Array` (makes sense) so I don’t think there’s any pure elm way to implement this
2019-04-12T02:18:46.011600
Bret
elmlang
general
possibly a feature request?
2019-04-12T02:18:58.012000
Bret
elmlang
general
The array implementation author <@Patricia> told about adding it in his "De-throning the list": <https://dev.to/skinney/de-throning-the-list-part-sc4k-4e3n> (see "I would add `find` for all three collections. "). But I cannot find any reference why it's not already there... I am pretty sure to have read a discussion about it at some point though:thinking_face:
2019-04-12T02:28:08.013600
Velia
elmlang
general
interesting. he says: `List` and `Array` has a length function, `Set` has size. This is likely due to the fact that `Set` is a thin abstraction on top of `Dict` and so has just copied the name. I would rename `Set.size` to `Set.length` out of consistency if nothing else. I’d do the opposite. I’d rename them `List.size` and `Array.size`. `size` is a more general concept that applies to more structures than `length`
2019-04-12T02:52:07.016500
Bret
elmlang
general
I heard <@Patricia> on the elm town podcast. Very interesting listen about his rewrite of the elm data structures.
2019-04-12T02:53:57.017300
Bret
elmlang
general
is `elm town podcast` a website or online resource?
2019-04-12T02:56:23.018200
Myrna
elmlang
general
This one I guess: <https://elmtown.simplecast.fm/elm-019-improved-collections-robin-heggelund-hansen> ?
2019-04-12T03:00:29.018500
Velia
elmlang
general
Thanks!
2019-04-12T03:00:51.018900
Myrna
elmlang
general
one question, if I want to use elm to implement a simple CLI tool, what kind of packages I will need?
2019-04-12T03:01:04.019200
Myrna
elmlang
general
I know about this one: <https://discourse.elm-lang.org/t/introducing-elm-cli-options-parser-for-building-type-safe-clis/1639>
2019-04-12T03:01:50.019400
Velia
elmlang
general
See this `grep` example: <https://github.com/dillonkearns/elm-cli-options-parser/blob/master/examples/src/Grep.elm>
2019-04-12T03:02:27.019600
Velia
elmlang
general
Thanks!!
2019-04-12T03:03:44.019900
Myrna
elmlang
general
Size can be ambiguous (think unicode characters strings for example).
2019-04-12T03:12:24.020200
Velia
elmlang
general
interesting. `Svg.use` does not let me use `Html.Attributes.href`
2019-04-12T05:15:47.021200
Emilee
elmlang
general
it crashes at runtime because it is a "read-only value"
2019-04-12T05:16:07.021700
Emilee
elmlang
general
okay, this is purely in vdom, and not in the dom itself, so i guess elm just doesn't support svg2 yet
2019-04-12T05:19:01.022400
Emilee
elmlang
general
crashing at runtime is not very nice though
2019-04-12T05:26:57.022800
Emilee
elmlang
general
<https://ellie-app.com/5fdNW543g8Ka1>
2019-04-12T05:30:29.023000
Emilee
elmlang
general
Creating "unacceptable" dom structures in the vdom is one of the easier ways of getting a runtime crash, at the moment. I'm kind of hoping someone will eventually create some sort of safe layer around the lower level elm/html and elm/svg libraries. It's a pretty hard problem though, and different browsers having different definitions of what constitutes "acceptable" makes this just that much harder
2019-04-12T05:30:31.023100
Huong
elmlang
general
it's not a browser problem in this case
2019-04-12T05:31:02.023300
Emilee
elmlang
general
the code crashes in the vdom layer as far as i can tell
2019-04-12T05:31:11.023500
Emilee
elmlang
general
Yeah, while trying to turn the vdom into real dom
2019-04-12T05:31:24.023700
Huong
elmlang
general
and it also crashes on browsers that support the property i'm trying to set
2019-04-12T05:31:24.023900
Emilee
elmlang
general
to be precise: on browsers that *only* support the property i'm trying to set, not the deprecated one
2019-04-12T05:31:45.024100
Emilee
elmlang
general
no you're right, it crashes when trying to set the attribute
2019-04-12T05:33:57.024300
Emilee
elmlang
general
but why is it doing that with `domNode[attr]` instead of `domNode.setAttribute(attr, ...)` ?
2019-04-12T05:34:16.024500
Emilee
elmlang
general
because `Html.href` is a property, not an attribute
2019-04-12T05:35:13.024800
Huong
elmlang
general
<https://ellie-app.com/5fdS28jmXPBa1> gives you the behaviour you'r elooking for, I think
2019-04-12T05:35:24.025000
Huong
elmlang
general
i see. `href` is both an attribute and a property, technically, right? but if it's (understandably) coded as a property in `Html.Attributes` i can see why this crashes
2019-04-12T05:36:27.025200
Emilee
elmlang
general
good to know, thank :slightly_smiling_face:
2019-04-12T05:36:30.025400
Emilee
elmlang
general
In html yep, in svg it's a writable attribute, but a readonly property, apparently :smile:
2019-04-12T05:37:09.025600
Huong
elmlang
general
and yes, I agree there should be a safer layer around the vdom. it's not super dangerous to crash in the view function, but it still kind of betrays the "no runtime errors" promise of elm^^
2019-04-12T05:37:11.025800
Emilee
elmlang
general
also, props to the elm runtime code for being actually readable XD
2019-04-12T05:37:52.026000
Emilee
elmlang
general
the hard thing here is that stuff like `input [ type_ "date" ] []` can crash in some browsers, and work perfectly fine for others
2019-04-12T05:38:01.026300
Huong
elmlang
general
I attempted a safe layer at some point, but the combination of "these specs are really complex" and "browsers do weird stuff" made me give up
2019-04-12T05:38:46.026500
Huong
elmlang
general
hmm, what's more logical to bundle up this little extension... `Svg.Extra.Attributes` or `Svg.Attributes.Extra`?^^
2019-04-12T05:42:21.026700
Emilee
elmlang
general
or i could just have a project-specific toplevel and just `Svg.Attributes` below it, that'd work too, especially if i at some point need a package that exposes one of the other module names
2019-04-12T05:43:12.026900
Emilee
elmlang
general
Personally, I'd go for `svg-extra` and `Svg.Extra(.*)`, assuming it would be more than just that `href` function :smile:
2019-04-12T05:43:52.027100
Huong
elmlang
general
right now it's just gonna live in the project i'm working on, and it's only the one function. but I like keeping "platform extensions/fixes" separate from the actual code
2019-04-12T05:44:36.027300
Emilee
elmlang
general
the same reason I have a `toCssString` for `elm-ui` colors in an extra module^^
2019-04-12T05:44:59.027500
Emilee
elmlang
general
makes sense!
2019-04-12T05:47:00.027800
Huong
elmlang
general
our code base does `Html.Extra` and `Html.Attributes.Extra`, and it trips me up, for some reason
2019-04-12T05:47:34.028000
Huong
elmlang
general
on the other hand, there's precendent for it
2019-04-12T05:48:00.028300
Huong
elmlang
general
elm-community/json-extra does `Json.Decode.Extra` and `Json.Encode.Extra` :thinking_face:
2019-04-12T05:48:22.028500
Huong