workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
Theres at least one package that ships as a npm + elm package
2019-01-08T11:04:59.815000
Agustin
elmlang
general
Where the npm package generates ports for the elm package
2019-01-08T11:05:06.815400
Agustin
elmlang
general
interesting. do you know how that works?
2019-01-08T11:05:26.815700
Danika
elmlang
general
Check out elm-mapbox for an example
2019-01-08T11:08:05.816800
Alana
elmlang
general
Thanks
2019-01-08T11:08:15.817000
Danika
elmlang
general
(which is awesome, btw)
2019-01-08T11:08:34.817500
Alana
elmlang
general
Ah cool so you basically just ask politely for developers to define the ports themselves (or supply different port names to the js portion of the library).
2019-01-08T11:11:38.817600
Danika
elmlang
general
This was the package I was thinking of <https://github.com/billstclair/elm-websocket-client>
2019-01-08T11:19:15.818100
Agustin
elmlang
general
But its a copy and paste job, I thought someone was talking about adding a generator
2019-01-08T11:19:35.818600
Agustin
elmlang
general
seems like thats the only way to go. I’d like to throw together a simple Web Audio library over the weekend (elm-webaudio is _old_) as FP works well in the audio processing world
2019-01-08T11:23:47.820000
Danika
elmlang
general
If you find something that works well, you might be able to ask for an elm-explorations repo
2019-01-08T11:45:05.820900
Agustin
elmlang
general
That allows native code as experimental packages
2019-01-08T11:45:31.821300
Agustin
elmlang
general
I have no idea what the process is though
2019-01-08T11:45:47.821600
Agustin
elmlang
general
Ah I doubt anything i whip together will come close to being blessed with native code ^^
2019-01-08T11:47:09.822100
Danika
elmlang
general
And this developer gladly complied! :slightly_smiling_face:
2019-01-08T12:29:58.822300
Alana
elmlang
general
Is there a way to send/receive `Bytes` values over http? One would need Json encoders/decoders for `Bytes`, but I can’t find any.
2019-01-08T13:44:05.823700
Jana
elmlang
general
I guess one could map to a huge hex string and back, but this seems wasteful.
2019-01-08T13:44:48.824500
Jana
elmlang
general
Hmmm I seem to remember version 2.0 of the elm/http package having something for byte payloads
2019-01-08T13:47:36.826900
Carman
elmlang
general
this is what I use ``` type Msg = LoadFont (Result String Bytes) loadFont : Cmd Msg loadFont = Http.request { method = "GET" , headers = [ Http.header "Accept-Ranges" "bytes" ] , url = currentFont.url --, url = "../Raleway-v4020-Regular.otf" , body = Http.emptyBody , expect = Http.expectBytesResponse LoadFont keepBytes , timeout = Nothing , tracker = Nothing } keepBytes : Http.Response Bytes -&gt; Result String Bytes keepBytes response = case response of Http.GoodStatus_ _ bytes -&gt; Ok bytes _ -&gt; Err (Debug.toString response) ```
2019-01-08T13:47:37.827000
Virgie
elmlang
general
<@Carman> — great, I will look there. And <@Virgie>, thankyou!!!
2019-01-08T13:48:41.827500
Jana
elmlang
general
specifically `Http.expectBytesResponse` will give access to it, and then you have to transform the http response into a result as shown
2019-01-08T13:49:30.828300
Virgie
elmlang
general
Looks like requests can have a `bytesBody` or a `fileBody` as their payload (in addition to the more traditional string and JSON options)
2019-01-08T13:50:06.830000
Carman
elmlang
general
hello, i m upgrading an elm package from 0.18 to 0.19, what are the syntax and packaging guidelines to follow? i read the docs and but couldn't see a template to start on
2019-01-08T14:17:32.835200
Leopoldo
elmlang
general
you mean for an `elm.json`? syntax guidelines are effectively whatever elm-format does
2019-01-08T14:18:16.835600
Virgie
elmlang
general
what about the main coding structure, etc.. ?
2019-01-08T14:19:02.836600
Leopoldo
elmlang
general
I’ve put together an API for streamlining the boilerplate in large apps with pages, sub pages, components, etc, and their communication. I’ve been using it in a large project and it’s helped be with readability and organization (obviously this is subjective). I’d appreciate any comments before I pull the trigger on publishing it. <https://github.com/z5h/component-result>
2019-01-08T14:20:39.839300
Leoma
elmlang
general
where do i submit an elm package?
2019-01-08T15:02:29.840500
Leopoldo
elmlang
general
`elm publish --help`
2019-01-08T15:07:27.840700
Leoma
elmlang
general
thanks
2019-01-08T15:21:55.840900
Leopoldo
elmlang
general
i couldn't see a guideline, i trying to upload the package <https://github.com/afidegnum/elm-tailwind> a 0.19 version of. <https://github.com/splodingsocks/elm-tailwind> The maintainer is not ready to maintain this package anymore as i discussed with him.
2019-01-08T15:28:14.841100
Leopoldo
elmlang
general
This definitely looks like something I’d use. One use case I had with a component that this wouldn’t work for though: I have what I call a “SuperSelect” component which is basically just an autocomplete. One need I had while making it was the `update` function of the component, in addition to returning it’s `model` and `cmd` also returned the third option of `maybe Option` (option being an internal type for the selected autocomplete option) which was the previously selected, or just then selected option based on logic that occurred inside the component’s update function
2019-01-08T16:58:12.841300
Theda
elmlang
general
I think I can actually work around that though
2019-01-08T17:01:09.841600
Theda
elmlang
general
<@Theda> this is what the external message functionality is for.
2019-01-08T17:16:52.842500
Leoma
elmlang
general
It’s there. Unless I’ve misunderstood your requirements.
2019-01-08T17:17:22.843200
Leoma
elmlang
general
So in this case an option can be selected for a large number of reasons. 1. The input loses focus but there was a “hovered” option by arrow key navigation. `OnBlur` 2. The user clicks on an option from the autocomplete dropdown. `OnClick optionIndex` 3. The user navigates the options via arrow keys and hits “enter” to select `OnKeyPress` subscription. So three different messages can result in this change and the consumer would have to watch for every one
2019-01-08T17:21:58.843400
Theda
elmlang
general
Right, so I’n my example, my TextEditorComponent can signal that a value was accepted, or reverted: <https://github.com/z5h/component-result/blob/master/examples/src/TextEditorComponent.elm#L31> It’s dispatched here, for example: <https://github.com/z5h/component-result/blob/master/examples/src/TextEditorComponent.elm#L47> And handled in the caller: <https://github.com/z5h/component-result/blob/master/examples/src/Page.elm#L63>
2019-01-08T17:28:11.843700
Leoma
elmlang
general
Actually, perhaps I’m still not understanding your need. Do you have a link to code, or an ellie or something I could see?
2019-01-08T17:32:00.843900
Leoma
elmlang
general
<@Leopoldo> You mentioned not seeing guidelines for publishing packages. I’m not sure where you’re feeling stuck, but thought I’d throw this out here in case you haven’t already encountered it: <https://package.elm-lang.org/help/design-guidelines>
2019-01-08T17:48:48.845600
Opal
elmlang
general
<@Opal> i read that already, i needed to run `elm publish`, which leads me to a next issue
2019-01-08T17:50:16.846500
Leopoldo
elmlang
general
Cool. I figured maybe that was the case, but it looked like maybe you were still stuck from your last post.
2019-01-08T17:51:06.847400
Opal
elmlang
general
now, it's requires i had to expose everything, which seems to be tough, they are about _10 000_ objects
2019-01-08T17:53:18.848300
Leopoldo
elmlang
general
<https://github.com/abradley2/form-elements/blob/master/src/FormElements/SuperSelect.elm> Ah. I see your example more clearly now. I didn't realize withExternal message used an actual message from the update. I thought it just piped whatever message the view put out
2019-01-08T17:57:24.848400
Theda
elmlang
general
Just to be clear, are you still stuck, or is this just a frustration that you have a workaround for? If stuck, can you share some code snippets or other details that might help us help you? :slightly_smiling_face:
2019-01-08T18:15:30.848900
Opal
elmlang
general
thanks a lot, i even forgot it figured in the docs, but in my way to share it
2019-01-08T18:19:47.849100
Leopoldo
elmlang
general
Seems like you'd want to edit the `convert.js` so it explicitly lists all the generated functions/values instead of just having `exposing (..)` in the `elmString`
2019-01-08T18:40:58.849400
Earnest
elmlang
general
on this class, <https://github.com/afidegnum/elm-tailwind/blob/master/src/Tailwind/Classes.elm> i m having an error I cannot find a ```TailwindClass` constructor: These names seem close though:```
2019-01-08T18:42:06.849600
Leopoldo
elmlang
general
<@Earnest> the classes are listed in the `@docs` but i will need to work on the js as well
2019-01-08T18:42:57.849800
Leopoldo
elmlang
general
It'd help to post the full error
2019-01-08T18:43:07.850000
Earnest
elmlang
general
``` I cannot find a `TailwindClass` constructor: 36| folder (TailwindClass c) memo = ^^^^^^^^^^^^^ These names seem close though: Basics.EQ Basics.False <http://Basics.GT|Basics.GT> <http://Basics.LT|Basics.LT> Hint: Read &lt;https://elm-lang.org/0.19.0/imports&gt; to see how `import` declarations work in Elm. ```
2019-01-08T18:43:59.850200
Leopoldo
elmlang
general
<https://github.com/afidegnum/elm-tailwind/blob/master/src/Tailwind.elm>
2019-01-08T18:44:04.850400
Leopoldo
elmlang
general
you're only exporting the `TailwindClass` type, not the `TailwindClass` constructor
2019-01-08T18:44:50.850600
Earnest
elmlang
general
to export all the tags/constructors you'd need to do something like `exposing (TailwindClass(..))`
2019-01-08T18:45:13.850800
Earnest
elmlang
general
oh, wow! :slightly_smiling_face:
2019-01-08T18:45:33.851000
Leopoldo
elmlang
general
Or add a function like `fromTailwindClass : TailwindClass -&gt; String`, depending on if you want consumers to be able to create their own TailwindClass or not
2019-01-08T18:46:08.851200
Earnest
elmlang
general
Just exposing the type &amp; function means people can pull values out, but not make their own. Exposing the type &amp; constructor means they can do both.
2019-01-08T18:46:41.851400
Earnest
elmlang
general
ok...
2019-01-08T18:47:31.851600
Leopoldo
elmlang
general
<@Earnest> apart from `exposing (TailwindClass(..))` do i add something else again?
2019-01-08T18:58:08.851800
Leopoldo
elmlang
general
```I do not see `absolute` in the `exposing` list, but it is in your module documentation: 24| @docs negm_0 ... Does it need to be added to the `exposing` list as well? Or maybe you removed `absolute` and forgot to delete it here? ```
2019-01-08T19:00:17.852000
Leopoldo
elmlang
general
any hint?
2019-01-08T19:16:15.852300
Leopoldo
elmlang
general
I've got an odd challenge; I'm trying to create a text box that automatically replaces characters as the user types. Imagine essentially typing `gamma` and after you hit space, the `gamma` becomes `ɣ`
2019-01-08T19:37:48.853100
Sofia
elmlang
general
I'd like to keep the cursor in the same place as well as set the value on the input box with the new value.
2019-01-08T19:38:26.854200
Sofia
elmlang
general
If I use an unkeyed `Html.input`, the cursor doesn't change positions unless the value is explicitly changed; imagine that the cursor is always set to 0 in the dom -- the dom ignores it since it never changes. ``` Html.input [ HtmlA.type_ "text" , HtmlA.value replacedString , HtmlA.selectionStart inputBox.input.caret , HtmlA.selectionEnd inputBox.input.caret , HtmlE.onInput DoAThing ] [] ) ] ```
2019-01-08T19:40:48.856500
Sofia
elmlang
general
If I use a keyed Html.input where the key changes every time the input changes, then the dom node gets recreated over and over which leads to the mobile keyboard quickly closing and reopening and keystrokes being dropped.
2019-01-08T19:41:20.857200
Sofia
elmlang
general
Is there a good way to do this kind of auto-replace in textboxes in elm?
2019-01-08T19:41:50.857600
Sofia
elmlang
general
not sure on that one, looks like it's in both...
2019-01-08T20:57:57.857700
Earnest
elmlang
general
<@Sofia> we ran into a similar problem with supporting `@mentions` in a comment area, You could do it through ports with something like <https://stackoverflow.com/a/512542> and either put the cursor to the end of the input (with another port), or use a subscription that keeps track of the current cursor position and restore it to where it was.
2019-01-08T22:26:05.865300
Augustus
elmlang
general
if it needs to be more complex than that I would recommend using another library like Quill and wrapping it in a custom element, you have a lot more control and easier cross-browser support with it than rolling your own
2019-01-08T22:26:42.866200
Augustus
elmlang
general
can someone tell me if there's a css to list style for elm, where I would pass a block of css definition and return a list of html attribute with the style
2019-01-09T00:05:53.867400
Bailey
elmlang
general
couldn't find anything on google
2019-01-09T00:06:03.867700
Bailey
elmlang
general
great news~! <https://package.elm-lang.org/packages/afidegnum/elm-tailwind/latest/>
2019-01-09T02:50:40.868100
Leopoldo
elmlang
general
can you try this ? <https://package.elm-lang.org/packages/afidegnum/elm-tailwind/latest/>
2019-01-09T02:53:10.868700
Leopoldo
elmlang
general
<https://package.elm-lang.org/packages/afidegnum/elm-tailwind/latest>
2019-01-09T02:53:30.868800
Leopoldo
elmlang
general
<@Leopoldo> I think <@Bailey> is asking about a general purpose tool, for any CSS, not a specific framework. I don't know of any, but depending on your case simple search and replace with regular expressions could work. Something like: replace `/(.+?)\:(.+?);/` to `Html.Attributes.style "$1" "$2" ,`.
2019-01-09T03:46:11.871000
Dorsey
elmlang
general
You will probably need a little bit of manual post processing. Finally Elm Format will help you align everything.
2019-01-09T03:47:12.871800
Dorsey
elmlang
general
Ok
2019-01-09T03:52:01.872000
Leopoldo
elmlang
general
in elm 0.18 is there a way to get the entire hash part of the location. I naively tried to use ``` tokenParser = Url.custom "TOKEN" (\urlString -&gt; Debug.log "" urlString ..... ``` and all I ever get is the string up to the first `/` in my hash rather than the whole thing
2019-01-09T05:00:33.874200
Lynn
elmlang
general
(we’ve inherited some hash routing)
2019-01-09T05:01:13.874900
Lynn
elmlang
general
<@Lynn> when using `parsePath`, the parser is run on the path, when using parseHash, it only ever sees the hash. To mix, I'd try pass the `hash` as a parameter to the parser manually, so ```toRoute : Location -&gt; Maybe Route toRoute location = UrlParser.parsePath (myParser location.hash) location```
2019-01-09T05:32:26.876400
Huong
elmlang
general
or something like that
2019-01-09T05:32:58.876700
Huong
elmlang
general
so I am using parseHash at present but let me play around with your suggestion
2019-01-09T05:37:44.877300
Lynn
elmlang
general
ohh, okay, so you want "the rest of the url" so to speak. There's no built-in way to do that at present - passing it as a parameter is the easiest way, the alternative is to build a sort of recursive, depth-limited parser, but that tends to get slow and ugly
2019-01-09T05:39:29.879000
Huong
elmlang
general
perhaps an example would help
2019-01-09T05:40:18.879400
Lynn
elmlang
general
if I have `<http://localhost:3000/#edit/nestedQueries/P5-ZypUo#token=23456>` (which I know is ugly)
2019-01-09T05:40:34.879800
Lynn
elmlang
general
I want `#edit/nestedQueries/P5-ZypUo#token=23456`
2019-01-09T05:40:44.880100
Lynn
elmlang
general
or perhaps without the first `#`
2019-01-09T05:40:52.880300
Lynn
elmlang
general
what I get is `edit` and none of what follows the `/`
2019-01-09T05:43:13.880900
Lynn
elmlang
general
is there an elm library that parses urls, and accepts urls that have no scheme?
2019-01-09T06:13:31.881600
Emilee
elmlang
general
i'm trying to sanitize form input, and at first I used a premade regex to check urls (which did not work well *at all*), then I tried `elm/url`, but the problem here is that it only accepts urls with a scheme
2019-01-09T06:14:11.882500
Emilee
elmlang
general
seems `elm/url` is not a great choice for this usecase anyway since it also accepts more urls than i want ( `<https://asdf>` for example is a valid url, but I don't want it to be accepted by my form because it doesn't have a tld)
2019-01-09T06:25:27.883800
Emilee
elmlang
general
<@Lynn> I _think_ that would all be in `location.hash`. Which you have access to _outside_ your urlParser, so it can be passed along as a param
2019-01-09T07:55:22.885400
Huong
elmlang
general
yes, that's what I sort of worked out. thanks again
2019-01-09T08:33:02.886000
Lynn
elmlang
general
hello, anyone has collections of bare html templates to use with no js? those i have are cluttered with JSes, dificult to handle
2019-01-09T08:38:53.887000
Leopoldo
elmlang
general
What do you mean by templates?
2019-01-09T11:05:33.887700
Bert
elmlang
general
I've just hit our old friend ``` Success! Compiled 9 modules. 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 ``` *again*, this time when just creating a new, pretty basic module and trying to use it. Again, is there any progress on this? I have no clue how to get around it. Its such a painful bug and I've got it on every 0.19 project I have.. Its really frustrating
2019-01-09T16:46:55.890100
Jenice
elmlang
general
I shudder to think how many new elm users hit this bug and then bail out altogether
2019-01-09T16:47:38.890400
Jenice
elmlang
general
Is the agreed upon solution to do `rm -rf elm-stuff/0.19.0/`? This is my go-to fix.
2019-01-09T16:51:47.890900
Leoma
elmlang
general
Unfortunately that doesn't fix it forme
2019-01-09T16:52:11.891400
Jenice
elmlang
general
I’ve also seen to try elm make without the --debug flag
2019-01-09T16:53:07.892200
Asha
elmlang
general
I'm also curious about this, I've never run into the issue and we've done 2 or 3 elm sites for clients in 0.19 since it was released :thinking_face:
2019-01-09T16:55:47.892800
Teddy
elmlang
general
Turning off the debugger does fix it, but I personally find the debugger so invaluable when developing it makes life really really difficult
2019-01-09T16:59:49.894500
Jenice