workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
<@Virgie> thanks
2019-01-02T17:35:56.463500
Earleen
elmlang
general
Thanks! I tried having signatures of both `(a -&gt; Msg)` and `(String -&gt; msg)`; but the compiler warned me: ``` Hint: Your type annotation uses type variable `msg` which means ANY type of value can flow through, but your code is saying it specifically wants a `Msg` value. Maybe change your type annotation to be more specific? Maybe change the code to be more general? ``` then I tried `(String -&gt; msg) -&gt; Cmd msg` and this passed; I see how this could be more useful
2019-01-02T17:39:27.464200
Su
elmlang
general
Greetings, all. I’m having issues with `elm/time`. I’m trying to use `Time.Month` like so:
2019-01-02T21:18:18.465800
Hien
elmlang
general
``` import Time exposing (Month) daysInMonth : Month -&gt; List Int daysInMonth month = case month of Jan -&gt; List.range 1 31 Feb -&gt; List.range 1 28 Mar -&gt; List.range 1 31 Apr -&gt; List.range 1 30 May -&gt; List.range 1 31 Jun -&gt; List.range 1 30 Jul -&gt; List.range 1 31 Aug -&gt; List.range 1 31 Sep -&gt; List.range 1 30 Oct -&gt; List.range 1 31 Nov -&gt; List.range 1 30 Dec -&gt; List.range 1 31 ```
2019-01-02T21:18:19.466000
Hien
elmlang
general
I’m getting an error for every month similar to this:
2019-01-02T21:18:41.466300
Hien
elmlang
general
```I cannot find a `Dec` constructor: 117| Dec -&gt; ^^^ These names seem close though: EQ Err GT LT```
2019-01-02T21:18:44.466500
Hien
elmlang
general
Can someone give me a pointer to what I’m doing wrong?
2019-01-02T21:18:52.466800
Hien
elmlang
general
I thought these types were importable and usable as shown in the docs.
2019-01-02T21:19:11.467200
Hien
elmlang
general
<https://package.elm-lang.org/packages/elm/time/latest/Time>
2019-01-02T21:19:15.467400
Hien
elmlang
general
I know I’m not handling leap years yet. This is my first implementation and I’m trying to populate a dropdown.
2019-01-02T21:19:57.467500
Hien
elmlang
general
`import Time exposing (Month (..))`
2019-01-02T21:21:13.468000
Rebekah
elmlang
general
You are importing the Month type from the Time module, without it's type constructors (Jan, Feb, Mar, ...)
2019-01-02T21:21:48.468300
Rebekah
elmlang
general
Oh geez. Thank you. I didn’t see an example in the docs.
2019-01-02T21:30:20.468600
Hien
elmlang
general
It that the only way to use it?
2019-01-02T21:30:25.468800
Hien
elmlang
general
I can’t do `Month.Jan`, can I?
2019-01-02T21:30:34.469000
Hien
elmlang
general
Is there any other way to use it without the `(..)` import?
2019-01-02T21:31:39.469200
Hien
elmlang
general
I tried `Month.Jan` but it didn’t work. While I’m sure there’s a good reason, I just don’t know what it is. (yet)
2019-01-02T21:41:49.469400
Hien
elmlang
general
admin note: since some of these messages were deleted, and they're just noise, I'm just gonna delete all of them. For people coming into this later: it was just someone being disruptive. Carry on :slightly_smiling_face:
2019-01-02T21:56:55.480700
Georgene
elmlang
general
<@Hien> `Time.Jan`
2019-01-02T21:58:36.483200
Earlean
elmlang
general
<@Georgene> Feel free to delete my last comment, too. :slightly_smiling_face:
2019-01-02T21:58:39.483500
Hien
elmlang
general
alright, done. Wasn't sure if that was part of the prior conversation :slightly_smiling_face:
2019-01-02T21:59:06.483700
Georgene
elmlang
general
<@Earlean> Oh, so each “variant” of that type is attached directly to time. Interesting.
2019-01-02T21:59:27.483900
Hien
elmlang
general
Thanks <@Earlean> and <@Rebekah>!
2019-01-02T21:59:40.484300
Hien
elmlang
general
Thanks! It was part of my question but was useless. I was concerned that my lengthy post was basic enough to be in <#C192T0Q1E|beginners> rather than here.
2019-01-02T22:00:16.484500
Hien
elmlang
general
there's not a really deep distinction. If you feel like moving it, feel free. Otherwise here is fine!
2019-01-02T22:00:50.484700
Georgene
elmlang
general
I thought using unsafePerformIO was as controversial as functional programming could get, guess I was wrong :grimacing:
2019-01-02T22:02:29.485600
Rosanne
elmlang
general
Someone dm me what the argument was about I missed it
2019-01-02T22:28:37.486300
Mozella
elmlang
general
also, has anyone used any of the available xml parsing modules?
2019-01-02T22:30:00.487400
Mozella
elmlang
general
I'm a bit lost on how to decode stuff
2019-01-02T22:30:17.487800
Mozella
elmlang
general
No worries. I've built (another) calendar widget (elm-ui based) with a simple core API. I'm planning to open source in the next few weeks.
2019-01-02T22:35:39.489700
Leoma
elmlang
general
```The elm.json for elm-community/list-extra 1.0.0 gotcorrupted somehow. I removed it from my file cache, so if it was some transient error it should be fixed if you try the same thing again. Please report this if it seems like an Elm problem though!``` This is not the first time i've got this message when trying to install a package with `elm install`, any ideas?
2019-01-03T03:37:16.490800
Danika
elmlang
general
<@Danika> try deleting elm-stuff folder
2019-01-03T06:10:34.491600
Sherri
elmlang
general
No such like, I've tried that before. I believe this is some sort of dependency issue with a non-helpful error. The latest version of list extra is 8.1.0... On some further investigation it looks like I was triyng to install an old package (`NoRedInk/elm-decode-pipeline`) when a newer version (`NoRedInk/elm-json-decode-pipeline`) exists. Frustrating to say the least but at least it works now.
2019-01-03T06:35:40.494900
Danika
elmlang
general
<@Leoma> neat!
2019-01-03T09:37:47.495200
Michelle
elmlang
general
if you'll excuse my curiosity, what happened?
2019-01-03T09:38:23.495400
Emilee
elmlang
general
just technical difficulties. One person pinged a lot of people at once (seemed like an accident.) One of the people who was pinged reacted disruptively.
2019-01-03T09:41:36.495700
Georgene
elmlang
general
for full transparency: we didn't have full-Slack pings turned off for whatever reason. Now they're fixed so the cause should not happen again. :slightly_smiling_face:
2019-01-03T09:42:18.495900
Georgene
elmlang
general
i see, thanks for the reply :slightly_smiling_face:
2019-01-03T09:42:37.496100
Emilee
elmlang
general
(not sure what's the policy on announcements here, but I'll post it anyway) Using Nix to deploy Elm application: <https://blog.hercules-ci.com/elm/2019/01/03/elm2nix-0.1/>
2019-01-03T10:47:17.497100
Zachary
elmlang
general
there is the <#C0K384K4Y|news-and-links> channel
2019-01-03T10:47:55.497700
Virgie
elmlang
general
yeah, share it in <#C0K384K4Y|news-and-links> too!
2019-01-03T10:48:23.498000
Lashawnda
elmlang
general
thanks! :slightly_smiling_face:
2019-01-03T10:49:53.498200
Zachary
elmlang
general
Anyone know whats wrong with this Regex
2019-01-03T11:01:08.498800
Lecia
elmlang
general
``` protocolExp = Regex.regex "^https?\:\/\/" ```
2019-01-03T11:01:11.499000
Lecia
elmlang
general
compiler says
2019-01-03T11:01:21.499200
Lecia
elmlang
general
``` (line 1, column 10): unexpected ":" expecting space, "&amp;" or escape code 62| Regex.regex "^https?\:\/\/" ^ Maybe &lt;http://elm-lang.org/docs/syntax&gt; can help you figure it out. ```
2019-01-03T11:01:24.499400
Lecia
elmlang
general
Perhaps colons don’t require escaping
2019-01-03T11:03:05.499900
Kris
elmlang
general
this looks like maybe it's 0.18?
2019-01-03T11:05:20.500200
Georgene
elmlang
general
regardless: yeah, colons and forward slashes don't need escaping.
2019-01-03T11:05:48.500700
Georgene
elmlang
general
if you want a literal backslash use `\\`
2019-01-03T11:06:10.501000
Georgene
elmlang
general
ah cool, thanks
2019-01-03T11:07:41.501200
Lecia
elmlang
general
Does anyone have enough experience with the `composable-form` package to know how to make a custom field to just display a paragraph of text?
2019-01-03T11:17:04.501900
Hyacinth
elmlang
general
You want a `&lt;textarea&gt;` ?
2019-01-03T11:17:37.502200
Carman
elmlang
general
Just a block of text for description purposes between fields.
2019-01-03T11:17:55.502600
Hyacinth
elmlang
general
Is it tied to a particular field? Or perhaps to a sub-form?
2019-01-03T11:18:34.503200
Carman
elmlang
general
To a sub-form maybe. I'm making a multi-page wizard for helping new customers set up their accounts. Currently each page is a separate form to be able to send a request to save the data with each step. Most of the time keeping the description text outside of the form works fine, but sometimes for design purposes it would be nice to have be able to have an arbitrary number of paragraphs of text within the form itseld.
2019-01-03T11:21:12.505700
Hyacinth
elmlang
general
I suppose that for the most part it would work just fine to include an optional description text to any field.
2019-01-03T11:22:25.506300
Hyacinth
elmlang
general
I have a `User` record with `firstName` and `lastName`. Both are of type `Maybe String`. What's the best way to say "if firstName isn't Nothing and lastName isn't Nothing then"?
2019-01-03T14:33:22.509600
Marcus
elmlang
general
You have a function that needs both the first and last name strings?
2019-01-03T14:33:55.509900
Carman
elmlang
general
Yes, exactly correct.
2019-01-03T14:34:56.510400
Marcus
elmlang
general
If either is Nothing, then I won't display them. Only if both are present do they get shown.
2019-01-03T14:35:27.511600
Marcus
elmlang
general
You can do something like: ``` Maybe.map2 yourFunction user.firstName user.lastName ```
2019-01-03T14:35:36.511800
Carman
elmlang
general
This will either return `Just outputOfYourFunction` or `Nothing`
2019-01-03T14:36:07.512300
Carman
elmlang
general
Cool. I imagine the type annotation of `yourFunction` would look something like `yourFunction : String -&gt; String -&gt; String`, assuming the output is the two strings concatenated together.
2019-01-03T14:38:16.513800
Marcus
elmlang
general
Correct
2019-01-03T14:38:35.514100
Carman
elmlang
general
Thanks for your help.
2019-01-03T14:38:56.514300
Marcus
elmlang
general
Glad to help! :slightly_smiling_face:
2019-01-03T14:39:23.514600
Carman
elmlang
general
You may find these articles on the topic useful: • <https://robots.thoughtbot.com/maybe-mechanics> • <https://robots.thoughtbot.com/problem-solving-with-maybe> • <https://robots.thoughtbot.com/two-ways-of-looking-at-map-functions>
2019-01-03T14:40:07.515200
Carman
elmlang
general
Hi everyone and happy new year! If you missed it last month, we’re excited to announce Elm in the Spring, a new one-day single-track conference for developers interested in Elm! Join us in Chicago on April 26th, 2019 for a great day of learning, teaching, and community. <https://www.elminthespring.org>
2019-01-03T17:02:48.516400
Melodee
elmlang
general
Our CFP is open — if you have an idea or story you want to share with the Elm community, we’d love to hear what you have to say! :grinning:
2019-01-03T17:03:14.517100
Melodee
elmlang
general
Hi everyone! Does anyone know whether the 0.19 elm/random module supersedes the elm-random-extended-pcg library? I'm trying to figure out a way forward for <https://github.com/danyx23/elm-uuid/issues/10>
2019-01-03T20:14:39.518400
Kimiko
elmlang
general
Never mind, I think the answer is "no, it doesn't"
2019-01-03T20:40:25.518800
Kimiko
elmlang
general
I'm trying out the navbar in rundis/elm-bootstrap. It looks a little weird and fails to collapse. I'm using elm 0.19. Same thing when I try this example <http://elm-bootstrap.info/getting-started> Anyone who tried this?
2019-01-04T03:10:05.519200
Arie
elmlang
general
<@Arie> Do you have the navbar subscriptions enabled in your app? Have you linked to the (correct) bootstrap CSS? Those are just questions off the top of my head. People in <#C3U2E3JRX|elm-bootstrap> might know more.
2019-01-04T03:20:37.521300
Jin
elmlang
general
<@Jin> I have the navbar subscription. I have not linked the bootstrap CSS, can you give any hint on how to do so?
2019-01-04T03:31:40.522600
Arie
elmlang
general
As mentioned in the linked guide you could use `Bootstrap.CDN.stylesheet` to create an inline style node. This works, also in `elm reactor`, but is not meant to be used for serious applications. There you could link to a hosted CSS via a normal link tag in your Html file, `&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"&gt;`. Or, if you have some build tooling in place, you could add the CSS as a dependency and import and build it like your other CSS.
2019-01-04T03:36:10.526400
Jin
elmlang
general
<@Jin> You pointed me in the right direction and it work perfectly! Thank you.
2019-01-04T03:52:38.527200
Arie
elmlang
general
Hey folks. I think I know the answer to my question but there is a chance I am missing something. Say I have a list of rose trees where each node contains an object of the same type. I would like to work with this "forest" as if it is a rose tree to use zipper etc. This is easily achievable by catering some root item which would be a non-meaningful value of the same type which all trees are using. But that's what I would like to avoid. Is there any way to model it somehow?
2019-01-04T10:10:43.531200
Lynne
elmlang
general
What about a list zipper over a list of tree zippers
2019-01-04T10:35:59.531800
Lashawnda
elmlang
general
I won't be able to use library dedicated for rose trees then (like zwilias/elm-rosetree which I am currently adopting)
2019-01-04T10:39:21.532800
Lynne
elmlang
general
I mean I won't be able to use to full power (like traversing "forward" to a next tree if there is no child which is exactly what I want)
2019-01-04T10:41:06.533700
Lynne
elmlang
general
I didn’t quite understand what you wanted
2019-01-04T10:41:12.534000
Kris
elmlang
general
But I think it’s a zipper over the tree
2019-01-04T10:41:23.534400
Kris
elmlang
general
Yes, with exception
2019-01-04T10:41:37.534700
Lynne
elmlang
general
Root of this tree does not contain something which is contained within its descendants
2019-01-04T10:42:10.535400
Lynne
elmlang
general
Imagine a `Tree (Maybe a)` where root is `Tree Nothing` but all children are always `Tree (Just a)`
2019-01-04T10:42:41.536500
Lynne
elmlang
general
That's basically what I'd like to model
2019-01-04T10:43:12.537000
Lynne
elmlang
general
Well, you should probably model it as something like `type MyThing a = Root Something (Tree a)`
2019-01-04T10:44:15.538100
Kris
elmlang
general
That’s probably easier than trying to stuff it in the same type
2019-01-04T10:44:44.538800
Kris
elmlang
general
Not sure I understand. Do you suggest using a type with single constructor where root would be `Root Something &lt;no tree&gt;` and every descendant `Root &lt;nothing&gt; &lt;some tree&gt;`?
2019-01-04T10:47:26.540200
Lynne
elmlang
general
Is there any way to find out which github repos use a particular elm package?
2019-01-04T16:26:53.543500
Monte
elmlang
general
hmm, maybe not bulletproof but how about something like <https://github.com/search?q=noredink%2Felm-json-decode-pipeline+filename%3Aelm.json&amp;type=Code>
2019-01-04T16:29:23.544200
Alicia
elmlang
general
That's a pretty interesting problem!
2019-01-04T16:39:05.544400
Huong
elmlang
general
how would one build a heterogenous Dict-like (Hash-like, Map-like) data structure in Elm? ie, w/ homogenous (say, String keys) but w/ heterogenous values?
2019-01-04T16:41:54.545900
Nery
elmlang
general
How heterogenous is it? If it’s just a small set of types, you could create a custom type that wraps those under one unified type.
2019-01-04T16:42:45.546600
Timika
elmlang
general
```type HValue = StringValue String | IntValue Int | ArrayIntValue (Array Int) ``` for example. But you have to wrap and unwrap yourself.
2019-01-04T16:44:32.548800
Timika
elmlang
general
ah nice so, eg, `type Value = String | Int | Time` ? but i suppose for more arbitrary number of types.... or is this the only viable way to achieve this
2019-01-04T16:44:34.548900
Nery
elmlang
general
<@Alicia> thanks, more or less what I needed :smiley:
2019-01-04T16:44:52.549300
Monte
elmlang
general
<@Timika> i see i have to have constructors
2019-01-04T16:45:07.549800
Nery
elmlang
general
there is great value in other langs in "programming w/ maps" per se should i not expect to get that kind of experience in Elm (strongly typed land)?
2019-01-04T16:45:47.551200
Nery