workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
Yikes, I had not expected this: ``` Date.fromString "Cisco 6807" Ok <Mon Jan 01 6807 00:00:00 GMT+0100 (Central European Standard Time)> : Result.Result String Date.Date ```
2019-02-12T04:09:25.120800
Lynn
elmlang
general
I had expected this would return an Err
2019-02-12T04:09:56.121100
Lynn
elmlang
general
The problematic package was: thebritican/elm-autocomplete. In the issues on github I found that it had been forked to: ContaSystemer/elm-menu. I've now installed the latter and the installation succeeded
2019-02-12T04:11:25.121300
Shirley
elmlang
general
I see that it reflects what js does though
2019-02-12T04:12:00.122000
Lynn
elmlang
general
i'm new to elm
2019-02-12T04:12:18.122400
Yelena
elmlang
general
can anyone tell me from where can i start
2019-02-12T04:12:29.122700
Yelena
elmlang
general
I see. That package itself is for Elm 0.18 (you can be sure of it whenever you see `elm-package.json` and don't see `elm.json` in the source) so I am wondering why `elm install` did not say anything about it
2019-02-12T04:14:27.122800
Lynne
elmlang
general
Why, yes, there are many resources for new developers ; one which will guide you through the process of discovering and building a few examples is the official documentation, it's easy to read and encourages you to practice to get the basics.
2019-02-12T04:14:55.123000
Antonette
elmlang
general
<https://guide.elm-lang.org/install.html>
2019-02-12T04:15:09.123200
Antonette
elmlang
general
Also, if you forgive this shameless promotion, yours truly has made a blog with his ducky that's aimed at beginners to dig a bit deeper and understand the underlying principles all through easily readable and hopefully digestible bites of 3-5 minutes reads.
2019-02-12T04:16:10.123600
Antonette
elmlang
general
<https://medium.com/wat-the-elm-ist>
2019-02-12T04:16:20.124000
Antonette
elmlang
general
:slightly_smiling_face:
2019-02-12T04:16:22.124200
Antonette
elmlang
general
I'm trying out Vue.js for writing a prototype for a tentative service (which is almost approaching full complexity of an actual product as prototypes always do), and I'm sorely missing custom types for modeling states.
2019-02-12T04:17:16.125400
Charmaine
elmlang
general
Also, asking questions is a great way to go past road blocks, so if you do feel so blocked, I cannot recommend enough asking your question here, especially in the <#C192T0Q1E|beginners> channel which is dedicated to help newcomers.
2019-02-12T04:18:03.125500
Antonette
elmlang
general
I feel for you <@Charmaine> :slightly_smiling_face:
2019-02-12T04:18:33.126000
Antonette
elmlang
general
(and I'm also working on some crummy old legacy JS just as we speak)
2019-02-12T04:19:06.126600
Antonette
elmlang
general
Yeah, not all browsers will do that. Hence why `Date.fromString` was removed in 0.19 - it's not a pure function, since it depends on (a) browser and (b) timezone. So with the same input, that function can return different things in different clients. Pretty annoying!
2019-02-12T04:33:45.127100
Huong
elmlang
general
I saw there are babel plugins for a pipe operator |&gt;, function composition &gt;&gt; &lt;&lt;, partial application ?, and pattern matching. Has anyone tried any of them?
2019-02-12T04:50:39.129200
Danika
elmlang
general
how can you do partial application with C syntax?
2019-02-12T04:56:37.129700
Lewis
elmlang
general
<@Charmaine> TypeScript has pseudo-discriminated unions but they're not very pretty... <https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions>
2019-02-12T04:56:48.130100
Nana
elmlang
general
`… |&gt; my_two_arg_function(10, _)`, or something, I guess?
2019-02-12T04:57:31.130200
Lewis
elmlang
general
<https://github.com/tc39/proposal-partial-application/blob/master/README.md>
2019-02-12T05:09:50.130900
Danika
elmlang
general
```const addOne = add(1, ?); // apply from the left addOne(2); // 3 const addTen = add(?, 10); // apply from the right addTen(2); // 12 // with pipeline let newScore = player.score |&gt; add(7, ?) |&gt; clamp(0, 100, ?); // shallow stack, the pipe to `clamp` is the same frame as the pipe to `add`. ```
2019-02-12T05:10:03.131400
Danika
elmlang
general
aaah! :slightly_smiling_face:
2019-02-12T05:12:18.131600
Lewis
elmlang
general
<https://github.com/tc39/proposal-pipeline-operator/blob/master/README.md>
2019-02-12T05:12:54.131900
Danika
elmlang
general
<https://www.npmjs.com/package/babel-plugin-functional-composition>
2019-02-12T05:13:47.132200
Danika
elmlang
general
cool. today I learned.
2019-02-12T05:14:05.132500
Lewis
elmlang
general
<https://github.com/tc39/proposal-pattern-matching>
2019-02-12T05:14:10.132800
Danika
elmlang
general
!! Really cool
2019-02-12T05:14:15.133100
Danika
elmlang
general
yeah :star-struck:
2019-02-12T05:14:43.133300
Lewis
elmlang
general
Sorry for the link spam, I was trying to paste them all before i lost signal on the underground :sweat_smile:
2019-02-12T05:20:12.134800
Danika
elmlang
general
I feel like ts plus the babel plugins I just mentioned is a really solid step towards solid FP in js
2019-02-12T05:41:58.135700
Danika
elmlang
general
hello, i m having an issue with my models,
2019-02-12T06:05:41.136300
Leopoldo
elmlang
general
can you please look at <https://elmlang.slack.com/archives/C192T0Q1E/p1549967822373700> ?
2019-02-12T06:06:32.136600
Leopoldo
elmlang
general
Ok, local issue. `stack init &amp;&amp; stack build` work just fine.
2019-02-12T07:26:15.137600
Niesha
elmlang
general
<@Leopoldo> I'd also need the type of `WebData` and `findPageById`
2019-02-12T07:27:55.138500
Niesha
elmlang
general
Ah, second one is there.
2019-02-12T07:28:06.138800
Niesha
elmlang
general
Is there a way to convert a `Html.Html msg` into a string in the repl?
2019-02-12T09:21:06.139600
Salvador
elmlang
general
`Debug.toString` is your friend, as long as you're not pushing it into production :wink:
2019-02-12T09:24:39.140400
Antonette
elmlang
general
(warning, the results may not be very readable)
2019-02-12T09:25:05.140700
Antonette
elmlang
general
<@Salvador> `elm/html` doesn't expose the `Html msg` type in a way that it can be converted in to a string. But <https://package.elm-lang.org/packages/zwilias/elm-html-string/2.0.1/> provides a similar API and has a `toString` function
2019-02-12T09:30:39.142100
Earlean
elmlang
general
I saw that, but it doesn’t help as you can not turn an `Html.Html` into an `Html.String.Html`, unless I missed something.
2019-02-12T09:31:51.143200
Salvador
elmlang
general
Yeah, it requires changing your imports - there's no way to convert `Html.Html msg` into anything, since it's an opaque type
2019-02-12T09:32:51.144200
Huong
elmlang
general
I was afraid so, I was trying to generate a QRCode and output it’s svg in the repl. I’ll have to display it then.
2019-02-12T09:34:06.145300
Salvador
elmlang
general
Hello
2019-02-12T09:42:15.147600
Sadie
elmlang
general
I have a elm SPA app (built from elm-kitchen) and I have a question regarding the routing : <https://github.com/rtfeldman/elm-spa-example/blob/master/src/Route.elm#L32>
2019-02-12T09:42:39.148400
Sadie
elmlang
general
I have a list of things that I can filter / #faceting)
2019-02-12T09:42:46.148800
Sadie
elmlang
general
I am considering adding this facets selection into the URL
2019-02-12T09:43:17.149400
Sadie
elmlang
general
So that people can save or share them
2019-02-12T09:43:39.150000
Sadie
elmlang
general
Does anyone already did something like that with the Url Parser?
2019-02-12T09:44:14.150400
Sadie
elmlang
general
<@Sadie> the `#` part of the url is called the 'fragment', <https://package.elm-lang.org/packages/elm/url/latest/Url-Parser#fragment>
2019-02-12T09:45:53.151200
Earlean
elmlang
general
Yes I know, I am a bit reluctant to add a querystring inside the fragment
2019-02-12T09:46:41.152300
Sadie
elmlang
general
I am also reluctant to add null values in the URL
2019-02-12T09:47:06.153100
Sadie
elmlang
general
I’m trying to figure out a nice way to tween between values. As an example: I have a view that displays a dollar amount “$1234” and when I get an update to that value I want to animate between the old value and the new value.
2019-02-12T09:47:34.153800
Dorthey
elmlang
general
:confused: `#/things/filterStatus=open/filterOP=True/`
2019-02-12T09:47:53.154200
Sadie
elmlang
general
What's wrong with queries? Maybe you could use something like `https://...?filter=foo+bar+whatever`?
2019-02-12T09:48:37.154400
Velia
elmlang
general
How do you imagine the animation happening?
2019-02-12T09:49:21.154600
Bert
elmlang
general
Just to make sure: this is a major feature for the app, yes?
2019-02-12T09:50:17.154800
Bert
elmlang
general
I’m imagining it would work something like `mdgriffith/elm-style-animation` but instead of animating a style I can animate a generic property on my model that I can display in my view.
2019-02-12T09:51:33.155100
Dorthey
elmlang
general
<https://github.com/mdgriffith/elm-style-animation>
2019-02-12T09:51:38.155300
Dorthey
elmlang
general
And yes – unfortunately this is a major feature for the app. :slightly_smiling_face:
2019-02-12T09:52:14.155500
Dorthey
elmlang
general
I am trying to see if we could do that with elm-animation and some css
2019-02-12T09:53:27.155700
Sadie
elmlang
general
Something like that <https://css-tricks.com/animating-the-content-property/#article-header-id-1>
2019-02-12T09:54:12.156200
Sadie
elmlang
general
hah, I've been doing that "animated numbers" feature for my previous employer. Not in Elm back then though :upside_down_face:
2019-02-12T09:54:14.156500
Florencia
elmlang
general
hmm, i'm running into an unexpected type error I've got this aliasing going on: ``` type alias Attribute msg = Attr () msg type Attr decorative msg = Attr (Skin -&gt; Element.Attr decorative msg) ``` and when I try to mix these in a list I get this: ``` This `roundEach` call produces: #Attribute msg# But all the previous elements in the list are: #Attr decorative msg# ```
2019-02-12T09:54:51.157300
Emilee
elmlang
general
I guess it depends on what the animation should look like. I am imagining a scrolling flip number thing, which is probably very hard to do no matter the tech
2019-02-12T09:55:02.157600
Bert
elmlang
general
I would think `Attr () msg` and `Attr decorative msg` would be compatible? O.o
2019-02-12T09:55:12.158000
Emilee
elmlang
general
<https://css-tricks.com/reverse-text-color-mix-blend-mode/>
2019-02-12T09:55:21.158100
Sadie
elmlang
general
<@Bert> It doesn’t need to be that fancy. Just a text node that counts up the value over the course of a second or two.
2019-02-12T09:55:49.158600
Dorthey
elmlang
general
Depending on what `decorative` is, not necessarily.
2019-02-12T09:56:34.159400
Antonette
elmlang
general
`decorative` isn't bound anywhere
2019-02-12T09:56:58.160000
Emilee
elmlang
general
It's bound to `()` in that list
2019-02-12T09:57:46.161800
Earlean
elmlang
general
For example, if my list is filled with `Attr Int Msg` and I want to add an `Attribute Msg`, I will attempt to add an `Attr () Msg` in a list of `Attr Int Msg`.
2019-02-12T09:57:47.161900
Antonette
elmlang
general
So, if you want your list to remain unbound, you can't put an `Attribute Msg` inside.
2019-02-12T09:58:20.162600
Antonette
elmlang
general
the list: ``` [ Background.color skin.primaryColor , Border.roundEach { topLeft = 5 , bottomLeft = 5 , topRight = 0 , bottomRight = 0 } ] ``` the types: `color : Color -&gt; Attr decorative msg` ``` roundEach : { topLeft : Int , topRight : Int , bottomLeft : Int , bottomRight : Int } -&gt; Attribute msg ```
2019-02-12T09:58:54.163300
Emilee
elmlang
general
`color` does not bind the `attribute` type variable, so I would assume it will be bound to `()`
2019-02-12T09:59:38.164000
Emilee
elmlang
general
in both instances
2019-02-12T09:59:48.164300
Emilee
elmlang
general
Maybe the binding is done higher up in your definitions.
2019-02-12T10:00:28.165100
Antonette
elmlang
general
huh, apparently recompiling often enough fixed it?
2019-02-12T10:03:07.167600
Emilee
elmlang
general
You mean using the fragment for page routing and the querystring for filters?
2019-02-12T10:03:31.168000
Sadie
elmlang
general
That's suspicious... maybe you hadn't saved your file on the previous compile?
2019-02-12T10:03:32.168200
Antonette
elmlang
general
pretty sure i did
2019-02-12T10:03:44.168400
Emilee
elmlang
general
but you never know
2019-02-12T10:03:48.168600
Emilee
elmlang
general
at least it works now. if that hadn't worked it would've thrown my whole project overboard pretty much
2019-02-12T10:04:12.169300
Emilee
elmlang
general
and would have had me question a lot of things
2019-02-12T10:04:37.170100
Emilee
elmlang
general
As long as it works :wink:
2019-02-12T10:04:51.170300
Antonette
elmlang
general
I was thinking paths for routing and queries for filter. But I may have misunderstood your requirements, it might be easier with some examples.
2019-02-12T10:05:12.170400
Velia
elmlang
general
Apparently there is an open issue for elm-style-animation and content <https://github.com/mdgriffith/elm-style-animation/issues/43>
2019-02-12T10:06:47.170600
Sadie
elmlang
general
But it is not there yet
2019-02-12T10:06:51.170800
Sadie
elmlang
general
With elm-spa, the route looks like that: - #/ - #/login - #/logout - #/settings - #/profile/{username} - #/register - #/article/{article-slug} - #/editor - #/editor/{article-slug}
2019-02-12T10:08:55.171000
Sadie
elmlang
general
I think I’ve just got a wrong version of Haskell or something installed
2019-02-12T10:11:08.171200
Garnett
elmlang
general
<@Sadie> Thank! I appreciate your help. :slightly_smiling_face:
2019-02-12T10:13:28.171400
Dorthey
elmlang
general
<@Dorthey> Re animated number, would this work? <https://ellie-app.com/4J5h5j4n6TWa1>
2019-02-12T10:14:13.171800
Florencia
elmlang
general
<@Florencia> thank you! That’s a very good start for me. I’m thinking I might need a way also to update a currently running animation.
2019-02-12T10:17:27.173000
Dorthey
elmlang
general
that's easy to do - do something in `update &gt; StartAnimatingTo &gt; Animating` :slightly_smiling_face:
2019-02-12T10:18:04.173700
Florencia
elmlang
general
it could use some polishing, ie. caching the intermediate calculations inside the Animating record and just multiplying the delta by that on each tick
2019-02-12T10:18:51.174500
Florencia
elmlang
general
<@Florencia> thanks! I’ll have a go with it. :slightly_smiling_face:
2019-02-12T10:20:54.174900
Dorthey
elmlang
general
stack doesn't care about that
2019-02-12T10:26:50.175100
Niesha
elmlang
general
IIRC hash routing is imposed by spa-example, but I would not use it if I had the choice. Anyway you can also mix hash routes and queries.
2019-02-12T10:29:52.175500
Velia
elmlang
general
Fair enough, though it is now working after switching to 8.2.2 and using `stack init --resolver lts-11.20`, but I may have changed something else in my environment :man-shrugging::skin-tone-3:
2019-02-12T10:32:21.175700
Garnett