workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
the compiler error message says this as well
2019-02-17T04:21:47.624800
Iona
elmlang
general
it didnt worked out. <https://gist.github.com/afidegnum/57a63d81f0273e52f6a858282c573734#file-main-elm-L458>
2019-02-17T04:30:08.625000
Leopoldo
elmlang
general
Do we have any mitigation strategies for the error `elm: Map.!: given key is not an element in the map` when using the webpack / rollup loader for elm modules? I found <https://github.com/elm/compiler/issues/1851> but I have not found a workaround to this problem.
2019-02-17T04:37:34.626300
Moshe
elmlang
general
this is what i have done and the new error <https://gist.github.com/afidegnum/76daeb299a593dd4bd4ab9b3e79b165b#file-main-elm-L454-L463> ``` I am having trouble with this (::) operator: 457|&gt; (text page.title 458|&gt; :: (List.map (viewLinkOrText currentRoute) 459|&gt; [ (ReadPage page.id, "Read", (String.fromInt page.id)) 460|&gt; , (EditPage page.id, "Edit", (String.fromInt page.id)) 461|&gt; , (PageDelete page.id, "Delete", (String.fromInt page.id)) 462|&gt; ] ) The left side of (::) is: Html.Html msg But you are trying to put that into a list filled with: String -&gt; String -&gt; Html.Html msg Lists need ALL elements to be the same type though. -- TYPE MISMATCH -------------------------------------------------- src/Main.elm The 2nd argument to `map` is not what I expect: 458| :: (List.map (viewLinkOrText currentRoute) 459|&gt; [ (ReadPage page.id, "Read", (String.fromInt page.id)) 460|&gt; , (EditPage page.id, "Edit", (String.fromInt page.id)) 461|&gt; , (PageDelete page.id, "Delete", (String.fromInt page.id)) 462|&gt; ] ) This argument is a list of type: List ( Route, String, String ) But `map` needs the 2nd argument to be: List Route -- TYPE MISMATCH -------------------------------------------------- src/Main.elm The 3rd element of this list does not match all the previous elements: 213| [ UP.map ListPage <http://UP.top|UP.top> 214| , UP.map AddPage (UP.s "add") 215|&gt; , UP.map ReadPage (UP.s "id") -- page id 216| , UP.map EditPage (UP.s "edit") -- Page id 217| ] This `map` call produces: UP.Parser ((PageId -&gt; Route) -&gt; c) c But all the previous elements in the list are: UP.Parser (Route -&gt; c) c ```
2019-02-17T04:43:35.626400
Leopoldo
elmlang
general
<@Moshe> I think there are two major workarounds: do not use the `--debug` flag and build compiler from forked repo where this bug is fixed as a temporary solution
2019-02-17T04:45:59.627900
Lynne
elmlang
general
There is a PR: <https://github.com/elm/compiler/pull/1850> and the respective repo: <https://github.com/tomstejskal/compiler>
2019-02-17T04:48:10.628300
Lynne
elmlang
general
In PR there are instructions on how to build it
2019-02-17T04:48:19.628600
Lynne
elmlang
general
<@Lynne> hi, can you please lend a hand ?
2019-02-17T04:48:48.629000
Leopoldo
elmlang
general
<@Lynne> awesome! Thanks for the links.
2019-02-17T04:57:18.629800
Moshe
elmlang
general
<@Leopoldo> You are trying to `cons` / `::` a new element to a list. The element is a `Html msg` and the compiler is complaining the other elements in the list are `String -&gt; String -&gt; Html msg`. This tells us, that the function `viewLinkOrText` is expecting other arguments than what you are handing over. In your case the function `viewLinkOrText` would need the function signature `viewLinkOrText : Route -&gt; (Route, String, String) -&gt; Html msg` to fullfil your contract. So either: you change the function signature of `viewLinkOrText`, or you build a helper function that takes a triplet of `(Route, String, String)` and calls your `viewLinkOrText` function with the unwrapped parameters. :slightly_smiling_face:
2019-02-17T05:05:54.629900
Moshe
elmlang
general
hi
2019-02-17T06:43:50.636500
Leopoldo
elmlang
general
I’m having the ports undefined problem in a mini-project. I believe this is because I must declare AND use a port in the Elm code?
2019-02-17T07:45:56.637300
Vilma
elmlang
general
<@Vilma> if you don't use a port the compiler will consider it dead code and remove it
2019-02-17T07:48:54.637800
Earlean
elmlang
general
yes I read about that
2019-02-17T07:49:06.638100
Vilma
elmlang
general
just now in the forum
2019-02-17T07:49:20.638600
Vilma
elmlang
general
so I must call the port function in the Elm code?
2019-02-17T07:49:33.638900
Vilma
elmlang
general
also is that a bug? :thinking_face:
2019-02-17T07:49:39.639100
Vilma
elmlang
general
It's intentional
2019-02-17T07:49:57.639500
Earlean
elmlang
general
if it's an outgoing port then you'll need to have some code that sends to it, if it's an incoming port then you'll need to subscribe to it in your `subscriptions` function
2019-02-17T07:51:36.641200
Earlean
elmlang
general
<@Leopoldo> did this solve your problem?
2019-02-17T09:32:54.641900
Moshe
elmlang
general
yes, i have a full working page <https://gist.github.com/afidegnum/a26cae4270961855e197188c2430f293>
2019-02-17T09:33:18.642100
Leopoldo
elmlang
general
i m now trying to open a form and interact with individual items of the list
2019-02-17T09:33:38.642300
Leopoldo
elmlang
general
have fun :slightly_smiling_face:
2019-02-17T09:34:01.642500
Moshe
elmlang
general
thanks a lot for your help
2019-02-17T09:34:16.642700
Leopoldo
elmlang
general
I hope you had some rest in between :smile: and no problem :slightly_smiling_face:
2019-02-17T09:34:33.642900
Moshe
elmlang
general
yes, but i want to finish this at once, rest a bit, move to the next chapter :slightly_smiling_face:
2019-02-17T09:35:07.643100
Leopoldo
elmlang
general
I have CORS enabled, i have been able to fetch the items, but when Posting a new form, i have a `Cannot GET /page` error. there is now GET `page` request on the server,
2019-02-17T10:03:24.645800
Leopoldo
elmlang
general
what can be the cause?
2019-02-17T10:03:32.646100
Leopoldo
elmlang
general
You need to be more explicit, do you explicitly send a POST request from Elm code? How do you send the post request from Elm code?
2019-02-17T13:22:29.646400
Dorethea
elmlang
general
furthermore seems like needs to be asked on <#C192T0Q1E|beginners>
2019-02-17T13:23:28.646600
Dorethea
elmlang
general
i think the POST is sent from line 175
2019-02-17T13:23:42.646800
Leopoldo
elmlang
general
in line 138 you are concatanating `links` and `"page"` and `pageid` you do not use any slash, maybe you are passing pageid blank string, that's why it is trying to GET `/page` ?
2019-02-17T13:28:07.647000
Dorethea
elmlang
general
You should use `/` btw if i'm not wrong?
2019-02-17T13:28:35.647200
Dorethea
elmlang
general
well, there have not been a POST request call from the server,
2019-02-17T13:29:01.647400
Leopoldo
elmlang
general
only GET all along
2019-02-17T13:29:07.647600
Leopoldo
elmlang
general
<@Dorethea> you are right `/page` made it work
2019-02-17T13:34:46.647800
Leopoldo
elmlang
general
it even returned `OPTIONS` i don't know why
2019-02-17T13:35:08.648000
Leopoldo
elmlang
general
but i m still facing the `Cannot GET /pages` error
2019-02-17T13:37:49.648300
Leopoldo
elmlang
general
When you are initializing your app you are issueing fetchPages command, which sends a get request to `/pages` so Elm works
2019-02-17T14:21:41.648500
Dorethea
elmlang
general
Why your server doesn't work the way you want it to IDK
2019-02-17T14:21:57.648700
Dorethea
elmlang
general
it's now working, except the `Cannot GET /page` error i don't understand and after submitting the form the url redirects to localhot:9000/page?
2019-02-17T14:23:45.649000
Leopoldo
elmlang
general
Are there any plans to make this part of the debugger resizable? Am I missing something?
2019-02-17T17:01:29.649200
Valorie
elmlang
general
You can hover the lines and it'll tooltip it for you
2019-02-17T17:11:16.649500
Martin
elmlang
general
not great, but works
2019-02-17T17:11:21.649700
Martin
elmlang
general
that’s better
2019-02-17T17:15:21.650000
Valorie
elmlang
general
but still displays an ellipsis if the message is too long
2019-02-17T17:15:32.650200
Valorie
elmlang
general
I usually end up removing the `width` property from the `sidebar`/whatever the css class for it is so it goes width 100%.
2019-02-17T17:24:04.650500
Lizabeth
elmlang
general
I did a workaround ellipsis in 0.18 by changing some Elm codes. The file path would be different, but there shouldn‘t be a significant change to the code. <https://harfangk.github.io/2018/07/28/display-entire-text-in-elm-debugger.html>
2019-02-17T19:50:01.653700
Charmaine
elmlang
general
yanngib
2019-02-17T22:55:56.654300
Zaida
elmlang
general
So, thanks to you fine gentlepeople we got from 1min 5s compilation time to about 25s :slightly_smiling_face: thanks.
2019-02-18T04:52:04.663900
Antonette
elmlang
general
Hello, I have a listing with multiple cards. I was thinking about making cards modular by moving a local state in their own model. no problem for init or views, but how would I target the right subModel in an update function? Is this a good pattern?
2019-02-18T12:52:07.667200
Elza
elmlang
general
I have thought about adding the subModel to the msg, but I do not see a way of updating the parent Model
2019-02-18T12:53:30.668300
Elza
elmlang
general
<@Elza> Introducing "child" triplets (i.e. modules with their own init/update/view and Model/Msg) is generally not considered as a good pattern but it depends on your app and its structure. For example, it is very practical having single pages in an SPA as stand-alone triplets.
2019-02-18T12:58:11.670400
Lynne
elmlang
general
I doubt it is a good idea for cards though.
2019-02-18T12:59:03.671100
Lynne
elmlang
general
yes that is what I am using in single pages
2019-02-18T12:59:07.671300
Elza
elmlang
general
but I hear you for smaller components
2019-02-18T12:59:16.671500
Elza
elmlang
general
I am considering alternatives
2019-02-18T12:59:23.671700
Elza
elmlang
general
ok
2019-02-18T12:59:44.671900
Elza
elmlang
general
will be using a `Set` instead to mark instances I need instead of submodules/child triplets
2019-02-18T13:00:12.672100
Elza
elmlang
general
`Set` can only contain comparables
2019-02-18T13:00:35.672400
Lynne
elmlang
general
You are probably after the `List`
2019-02-18T13:00:46.672600
Lynne
elmlang
general
sorry i meant a `List` containing models, with a `Set` to tag some of them by `id`
2019-02-18T13:36:26.672800
Elza
elmlang
general
hello, my brain just emptied... i am having hard time incorporating `viewOnepage` <https://ellie-app.com/4LPyRxJvFcBa1>
2019-02-18T14:01:13.673800
Leopoldo
elmlang
general
i wanted to fetch and load content of a single page ID
2019-02-18T14:01:42.674200
Leopoldo
elmlang
general
Has anyone seen any info on how to create an interface like this using native Elm (i.e., not using ports)? I don't have a specific application, it just looks like it would be cool to make.
2019-02-18T18:46:43.675000
Marcus
elmlang
general
BTW, that's a shot from Twilio Studio - a tool for visually creating messaging flows.
2019-02-18T18:47:13.675700
Marcus
elmlang
general
I'd be interested in that, I'm looking to build a graph (nodes and edges) editor in Elm
2019-02-18T19:10:21.676200
Vashti
elmlang
general
I'm not sure how to describe such an interface
2019-02-18T19:10:50.676700
Vashti
elmlang
general
"canvas interfaces" maybe (as in the user can somewhat arbitrarily place and move objects on a canvas)
2019-02-18T19:11:14.677300
Vashti
elmlang
general
but the word canvas already has a specific meaning when it comes to webdev
2019-02-18T19:11:27.677700
Vashti
elmlang
general
I'm not sure either. FWIW, the implementation of that interface is all SVG. I was worried it might be HTML Canvas, but that's not the case, fortunately.
2019-02-18T20:11:41.679700
Marcus
elmlang
general
I'd probably describe it as a workflow editor.
2019-02-18T20:15:01.680200
Marcus
elmlang
general
This gets close, but looks like a piece of a larger platform, not a stand-alone component: <https://www.totaljs.com/flow/>
2019-02-18T20:19:06.680800
Marcus
elmlang
general
<@Marcus> I guess you could build the svg based on input messages using elm/svg somehow and then render that
2019-02-18T20:36:56.681400
Vashti
elmlang
general
the problem is you'd somehow have to keep track exactly of where every element in the svg is on the page?
2019-02-18T20:37:24.682000
Vashti
elmlang
general
so that you can correctly interpret a click
2019-02-18T20:37:40.682300
Vashti
elmlang
general
which sounds scarily like it could get very platform dependent quickly
2019-02-18T20:37:55.682700
Vashti
elmlang
general
<@Vashti> I think you are right about the implementation. You'd need to store the x,y location of each node in the workflow. The edges between them could be calculated on the fly. I'd probably set the center of the design surface to be 0,0 and allow nodes to be placed anywhere in relation to that. The messages would be something like `AddNode`, `DeleteNode`, `NodeDragging`, and `NodeDropped`. I'm shooting from the hip a bit there, but that's where I'd start.
2019-02-18T20:53:34.686800
Marcus
elmlang
general
yup, sounds about right
2019-02-18T20:55:21.687000
Vashti
elmlang
general
my only worry is converting window level coordinates that the browser sends you on a click to surface coordinates
2019-02-18T20:55:49.687600
Vashti
elmlang
general
I'd need to be certain the SVG was being drawn _exactly_ where I thought
2019-02-18T20:56:00.688100
Vashti
elmlang
general
and I kind of have a hunch that's a dangerous assumption to make
2019-02-18T20:56:20.688500
Vashti
elmlang
general
I don't have my head around that one either. The examples I've seen of drag-and-drop functionality with Elm haven't been great.
2019-02-18T21:16:41.689500
Marcus
elmlang
general
<@Marcus> got any examples you could share off the top of your head?
2019-02-18T21:21:30.690000
Vashti
elmlang
general
I may have to move away from elm, or just use ports for that component of the UI
2019-02-18T21:21:44.690500
Vashti
elmlang
general
One sec. I'll see if I can find it.
2019-02-18T21:32:08.690800
Marcus
elmlang
general
<https://github.com/wintvelt/elm-sortable-list>
2019-02-18T21:33:17.691000
Marcus
elmlang
general
There's one. There's another that I'm thinking of though. I feel like it came with the old Elm mouse event library.
2019-02-18T21:33:42.691600
Marcus
elmlang
general
This just came up in my search: <https://www.youtube.com/watch?v=YbzNit_D98Y>
2019-02-18T21:34:41.691900
Marcus
elmlang
general
That looks interesting.
2019-02-18T21:34:45.692100
Marcus
elmlang
general
thanks very much
2019-02-18T21:34:59.692400
Vashti
elmlang
general
I feel like `elm/browser` got some updates in 0.19 that might help. Unconfirmed though.
2019-02-18T21:35:37.693200
Marcus
elmlang
general
oh that talk is _very_ interesting
2019-02-18T21:37:17.693700
Vashti
elmlang
general
I don't know if it's something supported natively by the svg package but they can set mouse event attributes directly on their svg nodes
2019-02-18T21:37:55.694400
Vashti
elmlang
general
Interesting. I didn't know that.
2019-02-18T21:38:26.694600
Marcus
elmlang
general
I need to improve my SVG knowledge.
2019-02-18T21:38:37.694900
Marcus
elmlang
general
<https://package.elm-lang.org/packages/elm/svg/latest/Svg-Events#onClick>
2019-02-18T21:39:36.695100
Vashti
elmlang
general
well, that means it's considerably easier than I expected
2019-02-18T21:39:48.695400
Vashti
elmlang
general
Yeah, the `onMouseDown` and `onMouseUp` seem like they would do the trick.
2019-02-18T21:40:23.695900
Marcus
elmlang
general
that's very nice
2019-02-18T21:40:42.696100
Vashti