workspace
stringclasses 4
values | channel
stringclasses 4
values | text
stringlengths 1
3.93k
| ts
stringlengths 26
26
| user
stringlengths 2
11
|
---|---|---|---|---|
elmlang
|
general
|
no
|
2019-01-06T04:36:42.677300
|
Tu
|
elmlang
|
general
|
i decided it'd be nice to have typed input fields that have configurable prefixes/suffixes for units
|
2019-01-06T04:37:03.677500
|
Tu
|
elmlang
|
general
|
so like " 4.5 %/mo" where "%/mo" is the suffix
|
2019-01-06T04:37:32.677700
|
Tu
|
elmlang
|
general
|
it's for a real estate investment model
|
2019-01-06T04:38:00.677900
|
Tu
|
elmlang
|
general
|
So you'd like to always render prefix/suffix close to what user typed in and to achieve this you are considering contenteditable, is it correct?
|
2019-01-06T04:38:08.678100
|
Lynne
|
elmlang
|
general
|
correct, except i'm no longer using contenteditable b/c it doens't maintain cursor position, and it's just not as high priority as finishing
|
2019-01-06T04:39:00.678300
|
Tu
|
elmlang
|
general
|
I see
|
2019-01-06T04:39:14.678500
|
Lynne
|
elmlang
|
general
|
this is a little side project that i used as an excuse to learn elm, and i actually need the finished project to make a decision on an investment!
|
2019-01-06T04:39:33.678700
|
Tu
|
elmlang
|
general
|
You could also look into input addons in Bootstrap style if you haven't yet
|
2019-01-06T04:39:37.678900
|
Lynne
|
elmlang
|
general
|
i haven't, no
|
2019-01-06T04:39:47.679100
|
Tu
|
elmlang
|
general
|
Spontaneously it feels like a decent alternative
|
2019-01-06T04:39:49.679300
|
Lynne
|
elmlang
|
general
|
As you could style them however you want
|
2019-01-06T04:40:19.679500
|
Lynne
|
elmlang
|
general
|
are you sure they can do what i want? it sounds impossible for now as it requires an input field that grows w/input
|
2019-01-06T04:42:04.679700
|
Tu
|
elmlang
|
general
|
which, afaik, is only possible w/contenteditable
|
2019-01-06T04:42:11.679900
|
Tu
|
elmlang
|
general
|
I am not sure of course
|
2019-01-06T04:42:36.680100
|
Lynne
|
elmlang
|
general
|
kk
|
2019-01-06T04:43:00.680300
|
Tu
|
elmlang
|
general
|
I don't understand your need 100%, so it is just a hint which you might want to consider when you are done with more prioritized tasks :slightly_smiling_face:
|
2019-01-06T04:43:07.680500
|
Lynne
|
elmlang
|
general
|
sure :slightly_smiling_face: anyhow — thanks for the input (haha) on the contenteditable hack!
|
2019-01-06T04:43:38.680700
|
Tu
|
elmlang
|
general
|
ur welcome and good luck
|
2019-01-06T04:43:55.680900
|
Lynne
|
elmlang
|
general
|
Hmm.. maybe you mean imitating jQuery `animate` function like <https://stackoverflow.com/a/31212954/1970118> but within Elm
|
2019-01-06T04:50:48.681100
|
Renay
|
elmlang
|
general
|
I meant lower level implementation which jQuery's animate might be using (I don't know how that function is implemented).
|
2019-01-06T04:52:25.681500
|
Lynne
|
elmlang
|
general
|
<https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions>
|
2019-01-06T04:53:19.681700
|
Lynne
|
elmlang
|
general
|
There are also CSS animations
|
2019-01-06T04:53:32.682000
|
Lynne
|
elmlang
|
general
|
Does the google bot index text from inside an SPA? My main page has almost no text, but a user can navigate to another view that does have a bunch of text on it. I don't know how to tell if that's being accessed or not, but I think probably not. One can pass an URL that causes the page to load with the text on it, but google search thinks that's a duplicate to the main view, which has no text displayed - and arguably that's correct since the same code is loaded either way.
|
2019-01-06T09:47:08.687900
|
Lindsey
|
elmlang
|
general
|
<@Lindsey> kind of. If you don't use actual <a href> tags (or provide a sitemap) the bot doesn't have much to work with.
|
2019-01-06T11:19:21.690100
|
Jake
|
elmlang
|
general
|
And although it can handle running some JS in a sandbox, I'm not sure if it's done on all pages (and probably not in the first pass)
|
2019-01-06T11:20:16.692000
|
Jake
|
elmlang
|
general
|
yeah, I get "Duplicate, submitted URL not selected as canonical" for my help page. I could flag it as the canonical page but that's not really what I want visitors to see right away. Still, maybe better than no results on google.
|
2019-01-06T11:23:00.693300
|
Lindsey
|
elmlang
|
general
|
Hmmm, making my tab buttons into hrefs might work though, now that I'm parsing the url.
|
2019-01-06T11:24:23.694100
|
Lindsey
|
elmlang
|
general
|
Are you using hash routing? That might cause Google to consider all of your app to be one document
|
2019-01-06T11:26:57.695100
|
Jake
|
elmlang
|
general
|
I just switched from urls containing various parameters to plain urls corresponding to my four 'pages' and then parameters in the query part. So basically four urls and then /
|
2019-01-06T11:28:49.697100
|
Lindsey
|
elmlang
|
general
|
by hash routing I assume you mean some kind of base64 encoding of parameters and whatnot
|
2019-01-06T11:29:30.697700
|
Lindsey
|
elmlang
|
general
|
Check the webmaster tool, it can show you what Google sees
|
2019-01-06T12:32:37.698200
|
Agustin
|
elmlang
|
general
|
They do run JS in the bot now
|
2019-01-06T12:32:41.698500
|
Agustin
|
elmlang
|
general
|
<@Lindsey> by "hash routing" I mean using URLs like `<http://mysite.com/#/page1|mysite.com/#/page1>` as opposed to `<http://mysite.com/page1|mysite.com/page1>`
|
2019-01-06T12:48:08.700600
|
Jake
|
elmlang
|
general
|
:wave: i'm confused about this error message from the json package:
|
2019-01-06T20:41:17.701300
|
Dee
|
elmlang
|
general
|
```
-- TYPE MISMATCH -------------------------------------------------- src/Main.elm
The 1st argument to `list` is not what I expect:
142| Encode.list (List.map encodeRow rows)
^^^^^^^^^^^^^^^^^^^^^^^
This `map` call produces:
List Encode.Value
But `list` needs the 1st argument to be:
a -> Encode.Value
```
|
2019-01-06T20:41:21.701500
|
Dee
|
elmlang
|
general
|
that doesn't seem to be what `list` needs the 1st argument to be, according to <https://package.elm-lang.org/packages/elm-lang/core/1.1.1/Json-Encode#list>
|
2019-01-06T20:41:45.701900
|
Dee
|
elmlang
|
general
|
oh i'm looking at the wrong docs
|
2019-01-06T20:45:49.702100
|
Dee
|
elmlang
|
general
|
what's the difference between elm-lang/core/Json.Encode and elm/json/Json.Encode?
|
2019-01-06T20:48:01.703100
|
Dee
|
elmlang
|
general
|
<@Dee> `elm-lang/` packages are old package from Elm 0.18
|
2019-01-06T20:56:17.703800
|
Earlean
|
elmlang
|
general
|
ah okay, thanks!
|
2019-01-06T21:06:57.704200
|
Dee
|
elmlang
|
general
|
What is the current best way to focus an input element? Ports required?
|
2019-01-06T22:05:00.704900
|
Loyce
|
elmlang
|
general
|
<https://package.elm-lang.org/packages/elm/browser/latest/Browser-Dom#focus>
|
2019-01-06T22:10:08.705000
|
Claretta
|
elmlang
|
general
|
:+1: Thank you
|
2019-01-06T22:10:20.705200
|
Loyce
|
elmlang
|
general
|
Is there a way I could combine two `string` :arrow_down: so I get `Maybe (String, String)`?
<https://package.elm-lang.org/packages/elm/url/latest/Url-Parser-Query#string>
|
2019-01-06T22:21:02.706300
|
Bernardo
|
elmlang
|
general
|
long shot, are you possibly after: <https://package.elm-lang.org/packages/elm/url/latest/Url-Parser-Query#custom>
|
2019-01-06T22:23:30.706600
|
Ruthann
|
elmlang
|
general
|
the string function returns a `Parser (Maybe String)` you can’t get around that unless you put in your own delimiter perhaps and split it at the end
|
2019-01-06T22:24:14.707400
|
Ruthann
|
elmlang
|
general
|
OR are you actually after a map2: <https://package.elm-lang.org/packages/elm/url/latest/Url-Parser-Query#map2>
|
2019-01-06T22:25:00.707700
|
Ruthann
|
elmlang
|
general
|
Yeah I got kinda close with `map2`, but it's not ideal, since I end up with a record having two `Maybe`s, thus:
```
type alias ConfirmationToken = { tokenId : Maybe String, token : Maybe String}
routeParser : Parser (ConfirmationToken -> a) a
routeParser = query (Query.map2 ConfirmationToken (Query.string "tokenId") (Query.string "token"))
```
|
2019-01-06T22:27:11.708700
|
Bernardo
|
elmlang
|
general
|
```
toMabeConfirmationToken maybeA maybeB =
case ( maybeA, maybeB) of
(Just a, Just b) -> { tokenId = a, token = b }
_ -> Nothing
```
|
2019-01-06T22:41:34.709900
|
Ruthann
|
elmlang
|
general
|
<@Bernardo> you can choose to return nothing if you don’t get both matches is this better? gets rid of the Maybes
|
2019-01-06T22:42:23.710600
|
Ruthann
|
elmlang
|
general
|
Brilliant! Here's the version I just finished writing :grin:
```
type Route = Home | ConfirmRoute String String
toRoute : Url.Url -> Route
toRoute url = case (parse routeParser url) of
Just cToken -> case (cToken.tokenId, cToken.token) of
(Just tokenId, Just token) -> ConfirmRoute tokenId token
otherwise -> Home
otherwise -> Home
```
|
2019-01-06T22:44:37.711100
|
Bernardo
|
elmlang
|
general
|
yep that works
|
2019-01-06T22:45:38.711300
|
Ruthann
|
elmlang
|
general
|
A lot of song and dance to get a couple of query string params thou :disappointed:
|
2019-01-06T22:46:13.712000
|
Bernardo
|
elmlang
|
general
|
you could even put the inner case in a separate function and use the Maybe.andThen with `Maybe.withDefault Home` to streamline the pipes
|
2019-01-06T22:46:41.712600
|
Ruthann
|
elmlang
|
general
|
TY, I'll give that a go
|
2019-01-06T22:47:44.713100
|
Bernardo
|
elmlang
|
general
|
our parser is broken up into a list of possible results, i think if you have more routes, it’s better to do something like this:
```
parser : Parser (Route -> a) a
parser =
Url.Parser.oneOf
[ Url.Parser.map Login top
, Url.Parser.map Login (s "login")
, Url.Parser.map UserSettings (s (toPath UserSettings))
, Url.Parser.map Security (s (toPath Security))
, Url.Parser.map Logout (s "logout")
, Url.Parser.map Search (s "search" </> searchSubPageParser)
, ...
]
```
|
2019-01-06T22:49:18.713900
|
Ruthann
|
elmlang
|
general
|
we’ve only got 20 rules, but if i were to do it like you above, i’d go crazy! hehe
|
2019-01-06T22:49:59.714400
|
Ruthann
|
elmlang
|
general
|
will you look that that, i even put in where i stole the code from:
```
{-| Lifted from: <https://github.com/rtfeldman/elm-spa-example/blob/master/src/Route.elm#L59-L65>
-}
```
|
2019-01-06T22:50:40.714800
|
Ruthann
|
elmlang
|
general
|
that’s using url fragments for routing:<https://github.com/rtfeldman/elm-spa-example/blob/master/src/Route.elm#L59-L65>
|
2019-01-06T22:51:26.715100
|
Ruthann
|
elmlang
|
general
|
Yeah, I'm right on the fence on whether to do fragment routing (so I can just naively serve my `index.html`), or bite the bullet and use a proper web-server
|
2019-01-06T22:58:05.716800
|
Bernardo
|
elmlang
|
general
|
Aaaah, I see now, this turns the fragment *into* the path: `{ url | path = Maybe.withDefault "" url.fragment, fragment = Nothing }`, that's awesome, thanks <@Ruthann>!
|
2019-01-06T23:03:31.717500
|
Bernardo
|
elmlang
|
general
|
ah yeah, old habits ( 0.18 ) die hard, esp when our whole web server is unfortunately hardcoded to serve assets etc via fragments… couldn’t use the history api unfortunately… have fun!
|
2019-01-06T23:05:28.718900
|
Ruthann
|
elmlang
|
general
|
Ended up doing something like <https://ellie-app.com/4nVK5qBgQy2a1> in my project
Thanks <@Lynne>!
|
2019-01-07T03:10:42.719700
|
Renay
|
elmlang
|
general
|
Hey all... I'm trying to run a basically empty elm file (`view _ = text "hi"`, no-op update, etc) through reactor, and it loads for a minute then times out with ```
A web handler threw an exception. Details:
thread killed```
|
2019-01-07T03:11:30.720700
|
Shawnna
|
elmlang
|
general
|
Nothing gets printed in the console where reactor is running
|
2019-01-07T03:11:43.721000
|
Shawnna
|
elmlang
|
general
|
The elm.json is as initially generated by `elm init`, 0.19
|
2019-01-07T03:11:59.721500
|
Shawnna
|
elmlang
|
general
|
also when i use `elm make` it says `Success! Compiled one module.` but doesn't actually make a file
|
2019-01-07T03:23:09.722200
|
Shawnna
|
elmlang
|
general
|
with or without `--output=xyz.js`
|
2019-01-07T03:23:22.722600
|
Shawnna
|
elmlang
|
general
|
Running make in strace, it appears to never open a file to write to
|
2019-01-07T03:26:47.722900
|
Shawnna
|
elmlang
|
general
|
You have to have a `main` function in your module
|
2019-01-07T03:39:19.723700
|
Lynne
|
elmlang
|
general
|
That's how Elm compiler decides if there is anything to do.
|
2019-01-07T03:39:45.724300
|
Lynne
|
elmlang
|
general
|
That `main` function must return a `Program` because this is what Elm runtime is capable of running
|
2019-01-07T03:42:22.725200
|
Lynne
|
elmlang
|
general
|
Hi folks. Do you know if there already is an "UnionFind" implementation in Elm? I've written one and I wonder if I can publish it without make a doublon.
|
2019-01-07T05:18:05.726700
|
Loralee
|
elmlang
|
general
|
small addition: `main` can also be of type `Html msg`
|
2019-01-07T08:42:27.727200
|
Wendell
|
elmlang
|
general
|
There was one, but it doesn’t look like it was updated to 0.19. <https://package.elm-lang.org/packages/mattrrichard/elm-disjoint-set/1.0.1>
|
2019-01-07T08:45:00.727400
|
Wendell
|
elmlang
|
general
|
Ok thanks
|
2019-01-07T12:16:47.728000
|
Loralee
|
elmlang
|
general
|
Is there a guide anywhere for upgrading from elm/http 1.0.0 to elm/http 2.0.0 ?
|
2019-01-07T12:33:46.728500
|
Treva
|
elmlang
|
general
|
Specifically I was depending on the Request type, which seems to have been removed
|
2019-01-07T12:34:08.728700
|
Treva
|
elmlang
|
general
|
Construct the record yourself & use the `Http.request` function
|
2019-01-07T12:45:13.728900
|
Earnest
|
elmlang
|
general
|
Maybe checkout the `elm-http-builder` package
|
2019-01-07T12:46:04.729100
|
Earnest
|
elmlang
|
general
|
:man-shrugging: I think I like the new approach with typed methods, and Expect, and now that I’ve read through all the API docs I can probably do it.
|
2019-01-07T12:47:39.729300
|
Treva
|
elmlang
|
general
|
Even more dependencies is not what I want. Thank you for the suggestions, regardless.
|
2019-01-07T12:47:59.729500
|
Treva
|
elmlang
|
general
|
Because I am going to need headers at some point, and builder looks like it’ll be nice then!
|
2019-01-07T12:48:40.729700
|
Treva
|
elmlang
|
general
|
Yup, I usually just write a more domain-specific version of http-builder in an Api module:
<https://github.com/Southern-Exposure-Seed-Exchange/southernexposure.com/blob/master/client/src/Api.elm>
|
2019-01-07T12:49:16.729900
|
Earnest
|
elmlang
|
general
|
Hi folks, is there any working implementation of a global model (i.e. store a.k.a. redux) for Elm? I've been wondering a lot about it, couldn't exactly spot anything out there, after being repeatedly asked for something like that for my project?
|
2019-01-07T16:55:36.733200
|
Floy
|
elmlang
|
general
|
pretty much, I don't see much of a problem with writing huge model for all my domain object, but I am terrified with dealing with any associations that are out there and keeping them in sync
|
2019-01-07T16:59:48.733900
|
Floy
|
elmlang
|
general
|
<@Rosa> if you don't mind responding here, so I can easily spot this thread later on
|
2019-01-07T17:00:13.734100
|
Floy
|
elmlang
|
general
|
i feel like you _could_ just pass it around as an argument.
|
2019-01-07T17:00:55.734300
|
Rosa
|
elmlang
|
general
|
Can you be more specific about your question? An Elm app has a single model value that hold all the state of your application. (redux got the idea from Elm)
|
2019-01-07T17:04:03.734600
|
Earlean
|
elmlang
|
general
|
What are 'associations' in this context and why do you think they would be a problem to keep in sync?
|
2019-01-07T17:05:11.735000
|
Earlean
|
elmlang
|
general
|
It sounds an awful lot like you’re describing the Elm Architecture itself (which redux is an implementation of).
|
2019-01-07T17:06:01.735800
|
Cammy
|
elmlang
|
general
|
elm spa exmple i think used to have a `Session` object which is almost (smells like ) a `Model`. and then each Page had its own `Model`, and could “sync” data with `Session`
|
2019-01-07T17:06:19.736000
|
Rosa
|
elmlang
|
general
|
so let's say my model looks like:
```
type alias Store = {
students: List Student
classes: List Classes
}
type alias Student = {
classes: List Classes --- or should it be List Classes.Id
}
```
|
2019-01-07T17:06:40.736200
|
Floy
|
elmlang
|
general
|
for like caching, auth, and stuff
|
2019-01-07T17:06:52.736500
|
Rosa
|
elmlang
|
general
|
<@Earlean> the question is if I know change one of the classes that change will not be reflected in each student record that is associated/participates in given classes?
|
2019-01-07T17:08:19.736800
|
Floy
|
elmlang
|
general
|
as everything is stored "as value"?
|
2019-01-07T17:08:29.737000
|
Floy
|
elmlang
|
general
|
or am I fundamentally wrong, now :thinking_face: ?
|
2019-01-07T17:09:02.737200
|
Floy
|
elmlang
|
general
|
btw Richard just gave a rad talk on keeping things in sync
<https://www.youtube.com/watch?v=28OdemxhfbU>
even used Students and Classes for examples
|
2019-01-07T17:09:22.737400
|
Rosa
|
elmlang
|
general
|
awesome, will definitely watch it !
|
2019-01-07T17:09:38.737600
|
Floy
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.