workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
Yeah I didn't have any luck implementing an animation
2019-02-07T16:33:58.081500
Karrie
elmlang
general
Eventually, after not finding a solution, I resorted to ports and JavaScript
2019-02-07T16:34:35.081700
Karrie
elmlang
general
Basically I have an outgoing port that will "tell" js that he needs to scroll down or up
2019-02-07T16:35:18.082100
Karrie
elmlang
general
You can pass all the parameters you want to the port, depending on your case
2019-02-07T16:35:41.082700
Karrie
elmlang
general
Tanks <@Earnest> i will look into this one.
2019-02-07T16:36:12.083400
Olene
elmlang
general
Thanks*
2019-02-07T16:36:21.083600
Olene
elmlang
general
its looks like there was Http.toTask in the 0.18 version. I wonder why it was removed. is it better to keep track of the different requests (used as partial steps) as part of the model (i.e. different Msg for different request) then using chaining task one after another and then create the final Msg (just want to know how to approach that problem without polluting the model too much)
2019-02-07T16:42:12.088000
Olene
elmlang
general
any talks to move elm to use webasm?
2019-02-07T16:59:46.088400
Lupita
elmlang
general
Yes. I think at least three of us have done little Elm to wasm projects, but I dont think anything has taken off.
2019-02-07T17:02:59.089100
Ashton
elmlang
general
i'm so super intrigued with elm. coming from vue, it's an interesting experience but still total noob
2019-02-07T17:10:58.089700
Lupita
elmlang
general
work in c# and omg i want to wring the necks of some of the devs who think functional is bad
2019-02-07T17:11:26.090300
Lupita
elmlang
general
was there a particular reason that elm uses currying?
2019-02-07T17:12:59.091500
Lupita
elmlang
general
Uh, I dont know. Good question. Elm looks a lot like Haskell, which also has partial application and currying. Seems like its just second nature to functional programming languages. So theres a lot of history there.
2019-02-07T17:14:36.092800
Ashton
elmlang
general
But, it is super useful.
2019-02-07T17:14:40.093000
Ashton
elmlang
general
I think.
2019-02-07T17:14:47.093200
Ashton
elmlang
general
i get it makes stuff like mapping easier
2019-02-07T17:15:34.094000
Lupita
elmlang
general
Currying leads to partially applying functions
2019-02-07T17:20:10.095100
Danika
elmlang
general
a poor mans dependency injection :slightly_smiling_face:
2019-02-07T17:22:25.095900
Lupita
elmlang
general
I think you’d offend a lot of people saying that ^^
2019-02-07T17:24:35.096800
Danika
elmlang
general
I gotta admit I got a bit riled up, but then decided one can think what one wants :)
2019-02-07T17:26:00.099200
Bert
elmlang
general
well not sure how else i would put it.
2019-02-07T17:26:04.099300
Lupita
elmlang
general
Curried functions is a mathematical concept that predates dependency injection
2019-02-07T17:26:30.100000
Danika
elmlang
general
ok so DI is an example of currying.
2019-02-07T17:27:38.100900
Lupita
elmlang
general
Currying (or partial application) is a function level thing. You apply some of the arguments of a function, but not all. That's it.
2019-02-07T17:29:36.103200
Bert
elmlang
general
You’re gonna offend just as many people equating currying to partial application :smirk:
2019-02-07T17:30:11.104400
Danika
elmlang
general
Not as many :smile:
2019-02-07T17:30:47.105000
Bert
elmlang
general
it's an interesting discussion but nothing to get offended about. i choose to look at it in practical terms
2019-02-07T17:32:40.106100
Lupita
elmlang
general
I dont think many *here* will be offended, and i think its silly to get all anal about it. But FP has its roots deeeeep in maths and academia and so you get a lot of people that take everything too seriously
2019-02-07T17:33:59.107800
Danika
elmlang
general
i get it. i'll tread lightly. really the only functional lang i've seen is erlang/exlixir before elm.
2019-02-07T17:35:02.108900
Lupita
elmlang
general
We dont mind here, we’re a fun bunch
2019-02-07T17:35:15.109700
Danika
elmlang
general
but makes sense when you see it done in js and then realize that's how all that redux is done
2019-02-07T17:35:37.110600
Lupita
elmlang
general
Partial application can be used to do DI. That's a given. It's a limiting view to consider it only that, though.
2019-02-07T17:36:42.112700
Huong
elmlang
general
^^ one of the nice things about Elm is that its designed to be used, not talked about :D let the mathematicians worry about category theory, we can think about if we any to but it doesnt get in the way
2019-02-07T17:37:20.112900
Danika
elmlang
general
Want*, not any
2019-02-07T17:37:43.113300
Danika
elmlang
general
well to be honest, it makes sense to use functional in webpage because of all the different thinks that can happen
2019-02-07T17:39:44.115200
Lupita
elmlang
general
things
2019-02-07T17:39:50.115500
Lupita
elmlang
general
i've pulled my hair out years ago with some jquey stuff and vowed never again
2019-02-07T17:41:06.116000
Lupita
elmlang
general
(One could say "DI is needed to make up for the lack of partial application", and that would be an equally incomplete-yet-not-completely-incorrect statement)
2019-02-07T17:45:25.117300
Huong
elmlang
general
very reasonable definition
2019-02-07T17:46:11.117800
Lupita
elmlang
general
Dependency Injection is something C# and Java developers made up to fix other problems :joy:
2019-02-07T17:50:37.118800
Agustin
elmlang
general
just nixed a ton of DI in my c# code base, it wasn't needed an tbh, made the code much more inflexible
2019-02-07T17:51:51.120000
Lupita
elmlang
general
the only reason i see using it is because of mocking.
2019-02-07T17:54:17.120900
Lupita
elmlang
general
Ruby went through a period of fascination with formal DI
2019-02-07T17:56:30.121300
Agustin
elmlang
general
Where you’d configure and use things rather than constants
2019-02-07T17:56:42.121600
Agustin
elmlang
general
But it was symptom of it not being functional enough to pass in your collaborators properly
2019-02-07T17:56:59.122000
Agustin
elmlang
general
Not enough SoC
2019-02-07T17:57:12.122300
Agustin
elmlang
general
have they fixed it in rails?
2019-02-07T17:57:14.122500
Lupita
elmlang
general
No and they shouldn’t
2019-02-07T17:57:36.122800
Agustin
elmlang
general
Thats not what Rails is for
2019-02-07T17:57:45.123000
Agustin
elmlang
general
If you want to go functional and use a Rails like framework, theres Phoenix :troll:
2019-02-07T17:58:06.123500
Agustin
elmlang
general
what is SoC mean?
2019-02-07T17:58:12.123700
Lupita
elmlang
general
Separation of Concerns
2019-02-07T17:58:21.124100
Agustin
elmlang
general
gotcha
2019-02-07T17:58:26.124500
Lupita
elmlang
general
i love phoenix so far
2019-02-07T17:58:38.125000
Lupita
elmlang
general
Yeah Phoenix is my current goto
2019-02-07T17:58:52.125300
Agustin
elmlang
general
But Rails has a place too
2019-02-07T17:58:57.125500
Agustin
elmlang
general
Just like wordpress does
2019-02-07T17:59:23.126000
Agustin
elmlang
general
we're using aspcore net for work apps
2019-02-07T18:00:02.126400
Lupita
elmlang
general
I’m sure they had legitimate reasons for that decision, I just can’t imagine what they are.
2019-02-07T18:01:02.127100
Agustin
elmlang
general
Beyond my cynical biased ones.
2019-02-07T18:01:17.127500
Agustin
elmlang
general
c# on the brain here
2019-02-07T18:01:27.127700
Lupita
elmlang
general
the service i'm working on is super simple, node js express would have been faster to develop and get working
2019-02-07T18:03:55.128800
Lupita
elmlang
general
so things i do like with c# but overall it's a pain
2019-02-07T18:04:59.129500
Lupita
elmlang
general
I just got a job where all they do is C#, coming from Laravel
2019-02-07T18:06:34.130400
Rosalee
elmlang
general
<@Lupita> F# seems pretty nice though
2019-02-07T18:06:45.130900
Nana
elmlang
general
I haden’t written a line of c# before last week. Lets just say I’m not sold.
2019-02-07T18:07:06.131400
Rosalee
elmlang
general
But I have to grind through it grr
2019-02-07T18:07:24.131800
Rosalee
elmlang
general
<@Lupita> If you have any good resources for getting up to speed with <http://asp.net|asp.net> core mvc let me know
2019-02-07T18:07:56.133100
Rosalee
elmlang
general
well, i'm not a huge fan of static typing at all because i think it just lengthens your dev time
2019-02-07T18:08:11.133400
Lupita
elmlang
general
After using Elm, the type system in C# feels so clunky
2019-02-07T18:08:41.134200
Rosalee
elmlang
general
json is cake in perl, python, js :slightly_smiling_face:
2019-02-07T18:08:54.134600
Lupita
elmlang
general
<@Ike> yes, i will have to look up a tutorial that i liked. are you doing EF?
2019-02-07T18:09:27.135200
Lupita
elmlang
general
<@Lupita> I’ll dm you
2019-02-07T18:09:54.135900
Rosalee
elmlang
general
well, in languages like Java (and I assume C#), you're forced to type annotate everything, and you still get null pointer exceptions, which is probably the number one type error
2019-02-07T18:12:30.139300
Nana
elmlang
general
<@Rosalee> if you’re completely new to <http://asp.net|asp.net> mvc, i’d suggest doing a 4-5 hr pluralsight course, they are taught by very experienced ppl and made me a intermediate over night. of course then you have to go and use it.
2019-02-07T18:12:34.139500
Ruthann
elmlang
general
I checked them out, and started a course only to realize it was out of date.
2019-02-07T18:13:11.140400
Rosalee
elmlang
general
they were following the latest mvc releases when i was looking at it back then… 4, 5, but i haven’t personally looked in a while… long while
2019-02-07T18:14:14.141200
Ruthann
elmlang
general
<@Nana> yes it's crazy but i try use it as simply as possible, if i don't need it , i don't use it. a common practice is hiding a lot of what something is doing by doing clever OO tricks
2019-02-07T18:18:13.142900
Lupita
elmlang
general
and you can also get unhandled exceptions
2019-02-07T18:19:42.144000
Nana
elmlang
general
so yeah then it kinda feels like you might as well go without static types
2019-02-07T18:20:06.144500
Nana
elmlang
general
but if static types actually mean that your application never crashes, then it's pretty cool
2019-02-07T18:20:38.145200
Nana
elmlang
general
i did a whole project in perl, no static types all functions were just hashes as parameters. was extremely maintainable.
2019-02-07T18:22:43.148100
Lupita
elmlang
general
I feel like we need to make the distinction between java-like type systems (~ subtyping) and ML-like type systems (hindley milner based, like what we use in Elm). They give you very different things. In Elm, they mean the compiler can really help you figure things out and guide you through huge refactors that would be a pain without that type system, and essentially mean you won't have runtime exceptions.
2019-02-07T18:23:13.148700
Huong
elmlang
general
yes i get that
2019-02-07T18:23:37.149000
Lupita
elmlang
general
Both static types, but a completely different set of guarantees
2019-02-07T18:23:53.149400
Huong
elmlang
general
i did a c# project where everything i got from sql db was either a dictionary&lt;string, string&gt; or a list of dictionaries all strings and then i didn't have to worry about objects. I just did type conversion when needed for ints, dates, floats and had a reasonable about of teritary code to avoid exceptions and never had any issues with it. dev time was a fraction of what it would have been otherwise
2019-02-07T18:26:59.152600
Lupita
elmlang
general
i have about 4 or 5 generic functions that could query any sql and return that. and then was able to use linq to get what i needed. it was stupid simple
2019-02-07T18:29:22.154000
Lupita
elmlang
general
That's cool that that worked for you! I usually mess up big time in such situations, and really appreciate the compiler helping me make sure everything has the shape I want it to be - no possibility of surprises.
2019-02-07T18:33:07.157600
Huong
elmlang
general
But hey, to each their own, and who knows, it might grow on you, too :wink:
2019-02-07T18:33:26.158100
Huong
elmlang
general
i wrote that system in about 2 weeks. start to finish and it was super ez to maintain. poor man's ef is what i called it
2019-02-07T18:35:02.159600
Lupita
elmlang
general
the only issue i hate with it was it was a WCF service that i called and i had to use a stupid service reference
2019-02-07T18:40:26.162900
Lupita
elmlang
general
Quick design question. I have a `model`. The `model` has a `query` type attached to it. The `query` has a `filters` type. The `filters` type has a bunch of properties like `inStock`, `bpaFree`, etc. Those filters are implemented by a type called `BooleanFilter`. Visually, it looks a bit like this: ``` model query filters inStock bpaFree ``` I omitted a bunch of other properties on the `model`, `query`, and `filters` types. I have a lot of repeated code that handles toggling the filters. It looks something like this: ``` let query = model.query filters = model.query.filters in filters.inStock |&gt; (\filter -&gt; BooleanFilter (not filter.value)) |&gt; (\updatedFilter -&gt; { filters | inStock = updatedFilter }) |&gt; (\updatedFilters -&gt; { query | filters = updatedFilters }) |&gt; (\updatedQuery -&gt; { model | query = updatedQuery }) ``` I have this block of code for each of the properties on `filters`. There are a lot of them. How would you go about DRYing this up?
2019-02-07T21:04:23.173200
Marcus
elmlang
general
You can pull everything but the `.inStock` and `\updateFilter -&gt; ...` out.
2019-02-07T21:23:22.174100
Earnest
elmlang
general
So I'd make my call something like ``` toggleFilter : (Filters -&gt; Bool) -&gt; (Filters -&gt; Bool -&gt; Filters) -&gt; Model -&gt; Model -- usage model |&gt; toggleFilter .inStock (\f v -&gt; { f | inStock = v }) ```
2019-02-07T21:25:35.176000
Earnest
elmlang
general
Ah, I like it.
2019-02-07T21:26:47.176200
Marcus
elmlang
general
I always forget about the `.inStock` syntax.
2019-02-07T21:27:16.176600
Marcus
elmlang
general
Thanks
2019-02-07T21:27:27.176800
Marcus
elmlang
general
i need to learn that ^
2019-02-07T21:32:52.177800
Lupita
elmlang
general
You can access a property on a record like `filters.inStock` or like `(.inStock filters)`. So, you can pass the accessor around like a function (since it is).
2019-02-07T21:35:41.179700
Marcus
elmlang
general
In the example above, `.inStock` is passed in as a parameter.
2019-02-07T21:36:16.180200
Marcus