workspace
stringclasses 4
values | channel
stringclasses 4
values | text
stringlengths 1
3.93k
| ts
stringlengths 26
26
| user
stringlengths 2
11
|
---|---|---|---|---|
elmlang
|
general
|
that is a big problem in complex software as you run into huge files ("where did I put xy...?") and naming difficulties. Also you mix up abstractions in your mind which can be puzzling
|
2019-01-30T08:03:57.421000
|
Daysi
|
elmlang
|
general
|
<@Lynne>
|
2019-01-30T08:04:02.421300
|
Daysi
|
elmlang
|
general
|
I don't really want to discuss abstraction, encapsulation and other stuff which may or may not be a universal concept. This is philosophy to very large extent.
|
2019-01-30T08:06:59.423900
|
Lynne
|
elmlang
|
general
|
Elm architecture is simple and straightforward: you have a model, you update the model, you render the model
|
2019-01-30T08:07:34.425500
|
Lynne
|
elmlang
|
general
|
<@Lynne> I don't think you should say "Elm doesn't do that" though. it does, it just works a little differently
|
2019-01-30T08:07:35.425600
|
Nana
|
elmlang
|
general
|
<@Nana> I did not say that
|
2019-01-30T08:07:53.426000
|
Lynne
|
elmlang
|
general
|
to be fair, he said in Elm "People just tend to call things differently"
|
2019-01-30T08:08:23.426500
|
Daysi
|
elmlang
|
general
|
<@Daysi> Then, if you have some business-related logic, you generally create a module with functions encapsulating this logic and modifying your model or part of it, returning new one
|
2019-01-30T08:09:13.427900
|
Lynne
|
elmlang
|
general
|
but the abstraction problem remains: the tabs should always scroll into view when the user clicks on them, regardless of where (in which top-level program) they are used
|
2019-01-30T08:09:54.429800
|
Daysi
|
elmlang
|
general
|
<@Lynne> yeah that is basic knowledge, no?
|
2019-01-30T08:10:28.431400
|
Daysi
|
elmlang
|
general
|
> Sergey Zubtsovskiy [1:41 PM]
> That's not how Elm works, so not possible
I think it's better to say "You do that by mapping the update function" or something
|
2019-01-30T08:10:30.431500
|
Nana
|
elmlang
|
general
|
<@Daysi> Disregarding all philosophical discussions, here's how you can achieve what you want in Elm: Define a Msg type for your component, then define an update function for those messages, then in your main function add a message with type of something like `MessageFromComponent ComponentMsg` and in the update function add `case MessageFromComponent msg -> Component.update msg state` and you're done, that's all of the plumbing you have to do
|
2019-01-30T08:10:53.432100
|
Dayna
|
elmlang
|
general
|
that's not very elegant
|
2019-01-30T08:11:30.432700
|
Daysi
|
elmlang
|
general
|
:disappointed:
|
2019-01-30T08:11:31.433000
|
Daysi
|
elmlang
|
general
|
<@Daysi> that's true, I just wanted to address your concern about abstraction of business and view logic
|
2019-01-30T08:11:45.433900
|
Lynne
|
elmlang
|
general
|
so I have to handle these cases every time I use the component in a view
|
2019-01-30T08:11:54.434400
|
Daysi
|
elmlang
|
general
|
No need, you can have a single case for all components
|
2019-01-30T08:12:17.435200
|
Dayna
|
elmlang
|
general
|
<@Daysi> yeah it's a bit fiddly to set up, but it still seems the simplest solution for a pure functional language
|
2019-01-30T08:12:34.435700
|
Nana
|
elmlang
|
general
|
<@Nana> yeah
|
2019-01-30T08:12:45.436200
|
Daysi
|
elmlang
|
general
|
If you just need a way to differentiate them, maybe make an opaque Id for each
|
2019-01-30T08:13:00.436800
|
Dayna
|
elmlang
|
general
|
I think we have here a hot spot where FP and the DOM collide a little bit :confused:
|
2019-01-30T08:13:10.437000
|
Daysi
|
elmlang
|
general
|
I hate it since I love Elm otherwise and I wish there was a more elegant solution
|
2019-01-30T08:13:48.437800
|
Daysi
|
elmlang
|
general
|
Why is this solution not elegant?
|
2019-01-30T08:14:24.439000
|
Lynne
|
elmlang
|
general
|
Well you do really mind adding 3 lines of boilerplate to your main file, if you really do then you're not going to like the rest of Elm either
|
2019-01-30T08:14:26.439300
|
Dayna
|
elmlang
|
general
|
<@Dayna> I know Elm quite a bit by now and I can say for sure I love it
|
2019-01-30T08:14:55.439800
|
Daysi
|
elmlang
|
general
|
It is just a way how single data flow is implemented. In React world there is Redux which does pretty much same thing.
|
2019-01-30T08:15:26.440800
|
Lynne
|
elmlang
|
general
|
To be fair you would never do that in react + redux
|
2019-01-30T08:15:42.441200
|
Dayna
|
elmlang
|
general
|
yep
|
2019-01-30T08:15:51.441400
|
Daysi
|
elmlang
|
general
|
I programmed with React and Redux for 6 years and I know it inside and out
|
2019-01-30T08:16:11.442300
|
Daysi
|
elmlang
|
general
|
but I guess I have to bite the bullet in this case. If I come across a better approach I'll tell you guys.
|
2019-01-30T08:16:51.443300
|
Daysi
|
elmlang
|
general
|
Thank you for your helps!
|
2019-01-30T08:16:57.443600
|
Daysi
|
elmlang
|
general
|
So in React+Redux you would just call the JS function?
|
2019-01-30T08:17:16.444100
|
Lynne
|
elmlang
|
general
|
<@Myong> seriously?
|
2019-01-30T08:17:21.444200
|
Daysi
|
elmlang
|
general
|
Even the most hardcore Elm-inspired redux people would probably call the js function before dispatching the action. There is no mechanism to treat the DOM API as a Task or side effect, you would have to do the wrapping yourself
|
2019-01-30T08:19:04.445600
|
Dayna
|
elmlang
|
general
|
Yeah, I see, but anyway I mentioned Redux because it is generally built in a similar to Elm way.
|
2019-01-30T08:20:39.446400
|
Lynne
|
elmlang
|
general
|
Of course, it is not the same, I only meant idea of single data flow
|
2019-01-30T08:20:59.447200
|
Lynne
|
elmlang
|
general
|
Even in Elm applications are stateful because the DOM has so much state, things like scroll positions, forms, media queries
|
2019-01-30T08:21:18.447500
|
Dayna
|
elmlang
|
general
|
Well, that's a web application after all.
|
2019-01-30T08:22:50.448000
|
Lynne
|
elmlang
|
general
|
Maybe the `scrollIntoView` behav should even be in CSS :thinking_face:
|
2019-01-30T08:27:42.448500
|
Daysi
|
elmlang
|
general
|
idk
|
2019-01-30T08:28:23.449000
|
Daysi
|
elmlang
|
general
|
boundaries are blurring these days...
|
2019-01-30T08:28:32.449400
|
Daysi
|
elmlang
|
general
|
like `:active { scroll-into-view: true }` or something
|
2019-01-30T08:29:45.451200
|
Daysi
|
elmlang
|
general
|
If we had a purely functional web (everything is data and in the model) it would be absolutely amazing
|
2019-01-30T08:29:53.451400
|
Dayna
|
elmlang
|
general
|
<@Daysi> hmm those scrolling tabs in the example were pretty terrible though :grimacing: you have to click them one by one to inch the view to the right, unless you're on a phone or laptop where you have horizontal scrolling gestures I guess
|
2019-01-30T08:31:21.452900
|
Nana
|
elmlang
|
general
|
<@Nana> you can use Shift+Mouse Wheel
|
2019-01-30T08:31:52.453400
|
Daysi
|
elmlang
|
general
|
^^
|
2019-01-30T08:31:53.453600
|
Daysi
|
elmlang
|
general
|
pretty intuitive imo
|
2019-01-30T08:31:59.453800
|
Daysi
|
elmlang
|
general
|
but that's just me
|
2019-01-30T08:32:04.454100
|
Daysi
|
elmlang
|
general
|
touch pad: swiping left/right should do the job
|
2019-01-30T08:32:37.454800
|
Daysi
|
elmlang
|
general
|
<@Daysi> considering I didn't know that, I doubt many users know about that :stuck_out_tongue:
|
2019-01-30T08:32:48.455100
|
Nana
|
elmlang
|
general
|
:thinking_face:
|
2019-01-30T08:32:55.455300
|
Daysi
|
elmlang
|
general
|
well, a couple of years ago I established an axiom for myself: If my mom can use it, anyone can use it
|
2019-01-30T08:33:41.456700
|
Daysi
|
elmlang
|
general
|
I think it's intuitive if you're making a mobile-only app, but otherwise I think it's pretty bad
|
2019-01-30T08:34:01.457100
|
Nana
|
elmlang
|
general
|
I'll show it to my mom over the weekend and get back in touch with you :blush:
|
2019-01-30T08:34:16.457500
|
Daysi
|
elmlang
|
general
|
<@Daysi> show it to her on a desktop computer then, not a phone
|
2019-01-30T08:34:39.458100
|
Nana
|
elmlang
|
general
|
when she can use it, you should consider changing to another profession than programming, e.g. backend :wink:
|
2019-01-30T08:35:24.458900
|
Daysi
|
elmlang
|
general
|
horizontal scrolling without scrollbars is highly unusual on the web
|
2019-01-30T08:40:21.459500
|
Nana
|
elmlang
|
general
|
to me it looks like an oversight by the developer
|
2019-01-30T08:40:49.459800
|
Nana
|
elmlang
|
general
|
but the developer is google
|
2019-01-30T08:43:51.460100
|
Daysi
|
elmlang
|
general
|
What are you discussing?
|
2019-01-30T08:44:50.460400
|
Danika
|
elmlang
|
general
|
material design scrollable tabs
|
2019-01-30T08:45:38.460700
|
Daysi
|
elmlang
|
general
|
<@Danika> the tabs at the bottom of this page <https://material-components.github.io/material-components-web-catalog/#/component/tabs>
|
2019-01-30T08:46:02.461500
|
Nana
|
elmlang
|
general
|
<@Nana> you actually might be right! In the design guide lines they say that you should provide an indicator that you can scroll
|
2019-01-30T08:46:08.461600
|
Daysi
|
elmlang
|
general
|
<https://material.io/design/components/tabs.html#scrollable-tabs>
|
2019-01-30T08:46:21.461800
|
Daysi
|
elmlang
|
general
|
but they don't show it in the development/web/ section!
|
2019-01-30T08:46:43.462300
|
Daysi
|
elmlang
|
general
|
good catch actually :thinking_face:
|
2019-01-30T08:46:51.462600
|
Daysi
|
elmlang
|
general
|
hmm
|
2019-01-30T08:47:30.463000
|
Danika
|
elmlang
|
general
|
but for this you would need JavaScript and were back at the start of our discussion again
|
2019-01-30T08:47:52.463800
|
Daysi
|
elmlang
|
general
|
I wasn't even paying attention and instinctively swiped to scroll. But that is horrible UX for desktop.
|
2019-01-30T08:47:58.464000
|
Danika
|
elmlang
|
general
|
yeh
|
2019-01-30T08:48:06.464200
|
Daysi
|
elmlang
|
general
|
agree
|
2019-01-30T08:48:12.464500
|
Daysi
|
elmlang
|
general
|
<@Daysi> told you :grin:
|
2019-01-30T08:48:22.465000
|
Nana
|
elmlang
|
general
|
I think it's very obvious these design guidelines are geared towards mobile development though
|
2019-01-30T08:48:28.465200
|
Danika
|
elmlang
|
general
|
<@Danika> both actually
|
2019-01-30T08:48:42.465600
|
Daysi
|
elmlang
|
general
|
read on!
|
2019-01-30T08:48:44.465800
|
Daysi
|
elmlang
|
general
|
95% of the examples in the design spec are mobile layout
|
2019-01-30T08:49:29.466300
|
Danika
|
elmlang
|
general
|
I'm not a huge fan of Material Design anyway, it's kind of weird to adopt another company's look and feel, unless you're specifically designing for Android
|
2019-01-30T08:50:12.467000
|
Nana
|
elmlang
|
general
|
They addressed that with their refresh of Material that they launched, i want to say last year? It was never really fully intended to be cloned the way it was, and they've tried to make that clearer but not really succeeded
|
2019-01-30T08:51:17.468700
|
Danika
|
elmlang
|
general
|
Also if you scroll down to the very very bottom and look at the actual design spec.
|
2019-01-30T08:51:39.469300
|
Danika
|
elmlang
|
general
|
None
|
2019-01-30T08:51:45.469400
|
Danika
|
elmlang
|
general
|
It's very obvious this spec is for mobile and desktop is like "yeah you can make it look like that for desktop too."
|
2019-01-30T08:51:59.470000
|
Danika
|
elmlang
|
general
|
None
|
2019-01-30T08:53:32.470100
|
Daysi
|
elmlang
|
general
|
I don’t think the design intention here is that you scroll. You click the indicator
|
2019-01-30T08:55:09.472100
|
Danika
|
elmlang
|
general
|
I don’t think this is particularly relevant discussion for <#C0CJ3SBBM|general> though ^^
|
2019-01-30T08:55:40.473200
|
Danika
|
elmlang
|
general
|
it is not possible to check in Elm if scrollWidth > clientWidth, yes?
|
2019-01-30T08:56:05.473900
|
Daysi
|
elmlang
|
general
|
only with js interop
|
2019-01-30T08:56:48.475100
|
Daysi
|
elmlang
|
general
|
and ports
|
2019-01-30T08:56:53.475400
|
Daysi
|
elmlang
|
general
|
it's better with the indicator/scroll button, but even that looks pretty annoying to use. I'd only use it if I knew that in 80% of cases you wouldn't need to scroll, and have the indicator for those edge cases
|
2019-01-30T08:57:27.475900
|
Nana
|
elmlang
|
general
|
I would use `text ""` because that is literally nothing in HTML, while `div [] []` still adds a node
|
2019-01-30T08:58:48.476000
|
Earnest
|
elmlang
|
general
|
And if you swap the order of arguments it might look nicer in use:
```
let
someConditionalHtml = maybeView2 maybeA maybeB <| \a b ->
div [] [ text <| a ++ b ]
```
|
2019-01-30T08:59:30.476300
|
Earnest
|
elmlang
|
general
|
it's such a bummer you cannot programmatically react to browser window rendering changes in Elm
|
2019-01-30T09:00:48.477200
|
Daysi
|
elmlang
|
general
|
only through ports
|
2019-01-30T09:00:56.477400
|
Daysi
|
elmlang
|
general
|
<@Daysi> you don't need ports, there's a subscription for that
|
2019-01-30T09:01:47.478400
|
Nana
|
elmlang
|
general
|
otherwise you'd need some kind of dependency injection of the whole DOM into view component
|
2019-01-30T09:02:02.478900
|
Daysi
|
elmlang
|
general
|
<@Daysi> by rendering changes, do you mean like viewport width/height?
|
2019-01-30T09:02:08.479100
|
Cecile
|
elmlang
|
general
|
<@Cecile>
|
2019-01-30T09:02:17.479300
|
Daysi
|
elmlang
|
general
|
yea
|
2019-01-30T09:02:19.479500
|
Daysi
|
elmlang
|
general
|
<@Nana> thanks! will look into it
|
2019-01-30T09:02:43.480000
|
Daysi
|
elmlang
|
general
|
lol then I hope <@Leanna> is right
|
2019-01-30T09:02:54.480300
|
Cecile
|
elmlang
|
general
|
<@Daysi> `Browser.Events.onResize`
|
2019-01-30T09:03:39.481100
|
Nana
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.