workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
My guess is that the color codes it uses happen to coincide with the background color in your shell.. I'm not sure what the best course of action is!
2019-03-28T17:26:47.061000
Huong
elmlang
general
<@Huong> thank you for taking the time to help me!
2019-03-28T17:28:22.061400
Kent
elmlang
general
<@Kent> you can try `elm repl --no-colors`, if my guess is right and this is because of the colors colliding, that should help :slightly_smiling_face:
2019-03-28T17:34:23.062200
Huong
elmlang
general
:bow: thank you sir!
2019-03-28T17:35:43.062600
Kent
elmlang
general
:fireworks:
2019-03-28T17:35:52.062900
Kent
elmlang
general
If my Browser.element doesnt use any flags, what type should I put for flags?
2019-03-28T18:30:06.063500
Broderick
elmlang
general
`()`
2019-03-28T18:31:03.063900
Chae
elmlang
general
<@Chae> Ahh, forgot about that unit.. thanks!
2019-03-28T18:31:32.064500
Broderick
elmlang
general
If I subscribe to onAnimatinoFrame, but my app is slow, what happens to the missing frame messages? Is there a backlog of frames?
2019-03-28T20:00:54.066400
Lindsey
elmlang
general
Recently, in learning elm, I have encountered a difficult problem in how to change the URL of the page to achieve the goal of reloading. Can anyone recommend a learning route?
2019-03-29T03:33:54.067000
Carrie
elmlang
general
I would start with <https://package.elm-lang.org/packages/elm/browser/latest/Browser#application> and then read the linked examples. Also make sure to read <https://guide.elm-lang.org/webapps/navigation.html>
2019-03-29T03:43:48.067100
Jin
elmlang
general
there's no backlog
2019-03-29T03:53:50.067300
Nana
elmlang
general
if your app is slow, the framerate will be lower, so fewer onAnimationFrame events will be dispatched
2019-03-29T03:54:53.067500
Nana
elmlang
general
thank you very much
2019-03-29T03:57:32.067700
Carrie
elmlang
general
I read this code "( Model key url, Cmd.none )" .It means how to operate the Model?
2019-03-29T04:59:38.068000
Carrie
elmlang
general
`(Model, Cmd Msg)` is usually the return type of the `init` and `update` function in an Elm application. The `Cmd Msg` is an opaque thing to tell the Elm runtime about side-effects it should do. A `Msg` value will be passed to the `update` function to return a new `Model`.
2019-03-29T05:02:58.068200
Jin
elmlang
general
I've noticed that multiline strings cause any compiler error messages in the same file to appear on the wrong line. Is this a known bug?
2019-03-29T05:45:30.069900
Jae
elmlang
general
Maybe this one <https://github.com/elm/compiler/issues/1900>
2019-03-29T06:04:35.070100
Lea
elmlang
general
Yep, that's the bug. Thanks
2019-03-29T06:05:29.070300
Jae
elmlang
general
What do you good people use/recommend for backend server + DB?
2019-03-29T10:54:04.072200
Jana
elmlang
general
Flask (Python), with mypy if you want static type checking, and PostgreSQL
2019-03-29T11:19:55.075100
Leonardo
elmlang
general
<@Jana> depends on your needs / previous experience really. Anything should be fine from Ruby to Python to Haskell to Java to Go to Rust to Elixir. Obviously there's a certain familiarity if it's Haskell... :slightly_smiling_face:
2019-03-29T11:19:57.075300
Corinne
elmlang
general
PureScript :smile:
2019-03-29T11:38:12.076600
Niesha
elmlang
general
What are you building?
2019-03-29T11:46:40.076800
Shenita
elmlang
general
I’m starting a new app “Logger”. So far I’ve been using Elixir/Phoenix, and am quite happy with that combo (though I miss the types). Curious if there is something else that would be better.
2019-03-29T11:48:50.077000
Jana
elmlang
general
Yeah, I’m in a similar boat of wanting something functional for server but with static types (so not elixir) and better tooling than haskell
2019-03-29T11:56:51.077300
Shenita
elmlang
general
@sam literally the reason we're using PureScript.
2019-03-29T11:57:22.077500
Niesha
elmlang
general
I think maybe ocaml could fit that gap? But I’ve never tried it
2019-03-29T11:57:24.077700
Shenita
elmlang
general
ah okay, how is the interop with node packages though?
2019-03-29T11:58:22.077900
Shenita
elmlang
general
We're using an express server
2019-03-29T11:58:45.078100
Niesha
elmlang
general
Works, but you gotta write the FFI yourself.
2019-03-29T11:58:55.078300
Niesha
elmlang
general
Using flow with js before you lose all type safety as soon as you pull in an untyped module
2019-03-29T11:59:02.078500
Shenita
elmlang
general
PureScript doesn't allow for untyped code. Gotta type all FFI
2019-03-29T11:59:18.078700
Niesha
elmlang
general
ah okay, that’s probably better than having `any` everywhere
2019-03-29T12:00:05.078900
Shenita
elmlang
general
might give it a try next time I get to make that choice :smile:
2019-03-29T12:00:30.079100
Shenita
elmlang
general
Rust has Elm-like typing.
2019-03-29T12:06:32.083100
Dede
elmlang
general
I am using Rust and Postgresql.
2019-03-29T12:06:36.083400
Dede
elmlang
general
Hey guys, I'm brand new to using Elm and I'm currently trying to make a game. What I'm trying to accomplish right now is to have a specific element removed from a list, so I experimented with different list functions in the REPL. Ill do something like , x = [1,2,3,4,5] x.filter isEven and then get an error " you gave me a list number, I need a record with a remove field". Im probably making a dumb mistake but I'm not sure what to do.
2019-03-29T12:06:56.083800
Nikia
elmlang
general
Rust has several good webserver options.
2019-03-29T12:07:06.084000
Dede
elmlang
general
You probably want `List.filter isEven x`
2019-03-29T12:07:46.084200
Dede
elmlang
general
In some contexts it might be clearer to write ``` x |&gt; List.filter isEven |&gt; nextTransformation |&gt; nextTransformation ```
2019-03-29T12:08:16.084400
Dede
elmlang
general
Core point, though, is that Elm doesn't attach operations to data. You have to explicitly call functions.
2019-03-29T12:08:48.084700
Dede
elmlang
general
So `List.filter` calls the `filter` function defined in the `List` module.
2019-03-29T12:09:00.085100
Dede
elmlang
general
<@Nikia> So, you're trying to chain stuff like `myValue.method args` - but in Elm it happens through function application: `fn args myValue` etc.
2019-03-29T12:09:26.085800
Florencia
elmlang
general
ahhh I see, that helps a lot!
2019-03-29T12:09:58.086300
Nikia
elmlang
general
even if `myValue` is a List, you can't use `List.filter` like `myValue.filter foo`
2019-03-29T12:09:59.086500
Florencia
elmlang
general
Thanks everyone! Makes sense now
2019-03-29T12:10:10.086800
Nikia
elmlang
general
Hello! I seem to remember a discussion about a tool that can extract tests from doc comments, similar to how it works in Elixir. Is there a tool like this or did I dream it up?
2019-03-29T13:01:04.088600
Dorsey
elmlang
general
<@Dorsey> Probably this :slightly_smiling_face: <https://github.com/stoeffel/elm-verify-examples>
2019-03-29T13:01:28.088800
Florencia
elmlang
general
Nice. Thanks <@Florencia>! Do you have any experience with it?
2019-03-29T13:03:03.089400
Dorsey
elmlang
general
Is it good?
2019-03-29T13:03:08.089600
Dorsey
elmlang
general
Yeah, it's great :slightly_smiling_face:
2019-03-29T13:03:24.089900
Florencia
elmlang
general
I use it to make sure the examples in documentation of my packages are actually correct. Note that this isn't meant to replace regular tests, but rather as a verification of correctness of examples :slightly_smiling_face:
2019-03-29T13:04:31.091100
Huong
elmlang
general
Yeah, I know. But it looks like a great complementary.
2019-03-29T13:05:03.091900
Dorsey
elmlang
general
Oh absolutely. It's just easy to forgo writing actual tests, and before you know it, you're writing examples that test edge-case behaviour :smile:
2019-03-29T13:06:02.093000
Huong
elmlang
general
I have to remind myself that the examples are just that: examples. I can verify their correctness. To check that they code they demonstrate is correct, I (should) write actual tests
2019-03-29T13:06:52.094600
Huong
elmlang
general
I suppose for edge-cases fuze tests are great. I had a lot of fun writing them lately!
2019-03-29T13:07:21.095500
Dorsey
elmlang
general
Oh yeah, always fun :smile:
2019-03-29T13:07:44.096200
Huong
elmlang
general
i just found this out. is it corect to consider this should produce a compile error? ``` import E.P.B as SPrice exposing (BPrice) import E.P.S as SPrice exposing (SPrice) ``` note i have `SPrice` twice and i have no compilation error. Can this be considered a bug? Since is a mistake. the correct version should be: ``` import E.P.B as BPrice exposing (BPrice) import E.P.S as SPrice exposing (SPrice) ``` I was hoping elm compiler helps me here. Thought to ask people before creating an issue.
2019-03-29T13:09:10.097600
Yang
elmlang
general
I think it's intended and I like it a lot.
2019-03-29T13:09:36.097900
Dorsey
elmlang
general
It's not a problem because the exposed values don't collide
2019-03-29T13:09:46.098500
Florencia
elmlang
general
if they did, Elm compiler would tell you
2019-03-29T13:09:53.099000
Florencia
elmlang
general
(instead of just picking one, which would be :scream: )
2019-03-29T13:10:07.099500
Florencia
elmlang
general
What I often do is ``` import Maybe import Maybe.Extra as Maybe Maybe.or a b ```
2019-03-29T13:10:22.099800
Dorsey
elmlang
general
yup!
2019-03-29T13:11:19.100500
Florencia
elmlang
general
I suppose as soon as you try to use `BPrice.funcFromBPrice` elm will throw an error
2019-03-29T13:11:23.100700
Shenita
elmlang
general
(sidenote: it only yells when you try to use a colliding value)
2019-03-29T13:11:27.100900
Huong
elmlang
general
possibly a confusing error but there will be one :slightly_smiling_face:
2019-03-29T13:11:44.101300
Shenita
elmlang
general
oh, the error should be pretty good
2019-03-29T13:12:36.101800
Huong
elmlang
general
```This usage of `H.class` is ambiguous. 36| [ button [ H.class "hi", onClick Increment ] [ text "+1" ] ^^^^^^^ It could refer to a variable from either of these imports: import Html.Attributes as H import Svg.Attributes as H ``` that sort of stuff
2019-03-29T13:12:48.102300
Huong
elmlang
general
<@Dorsey> thats interesting. didnt think to use maybe extra. Maybe i should. would be wired if `Maybe.iShould` is an actual function :smile:
2019-03-29T13:13:23.102900
Yang
elmlang
general
Ha ha :laughing:
2019-03-29T13:13:59.103600
Dorsey
elmlang
general
It's in `Maybe.Extra.Extra`.
2019-03-29T13:14:19.103900
Dorsey
elmlang
general
Hi everyone, I have this function here which is returning the error: The (::) operator can only add elements onto lists. 32| (x::xs) -&gt; if x == fruit then xs else x :: removeOne xs ^^^^^^^^^^^^ This `removeOne` call produces: List Fruit -&gt; List Fruit But (::) needs a List on the right. My objective is to write a function that searches for a "fruit" in the list and removes it if it is found.
2019-03-29T15:55:24.106600
Nikia
elmlang
general
`removeOne` expects two arguments but you're only giving it one in the recursive call
2019-03-29T15:58:21.107400
Lashawnda
elmlang
general
try `if x == fruit then xs else x :: removeOne fruit xs`
2019-03-29T15:58:56.108100
Lashawnda
elmlang
general
Thanks a lot Luke!
2019-03-29T16:24:19.108900
Nikia
elmlang
general
You’re welcome. Whenever I see `_ needs a _ on the right/left` errors I always look for an arrow in what the call produces. Usually the compiler can tell when you forgot an argument to a function but there are a couple cases like this one where it can’t
2019-03-29T16:43:26.111200
Lashawnda
elmlang
general
Hi all, I have this list: ```[ A, B, X, X, A, D, D, D, A, B, X, A, C, C, A, A, B, B, B, B, B ]``` and I want to transform it into: ```[ [A, B], [X], [X], [A, D, D, D], [A, B], [X], [A, C, C], [A], [A, B, B, B, B, B] ]``` Is the recursive function with two arguments (like: `fn : List a -&gt; List (List a) -&gt; List (List a)`) the way to go, or is there an easier way?
2019-03-29T17:16:04.114100
Izola
elmlang
general
Have a look at groupWhile from the list extra package
2019-03-29T17:22:30.114600
Kris
elmlang
general
Thanks, I'll check it out
2019-03-29T17:24:46.114800
Izola
elmlang
general
Thanks all for your suggestions!
2019-03-29T18:53:04.115200
Jana
elmlang
general
hey everyone! follow elm-conf on instagram for extremely good posts related to this year's upcoming elm-conf <https://www.instagram.com/stories/elmconf/>
2019-03-29T21:34:23.116000
Lashawnda
elmlang
general
Hey! I was just about to start off with my first Elm projects that uses WebSockets. I just wanted to know whether `elm-lang/websocket` would work with `0.19`.
2019-03-29T22:31:02.117400
Florentina
elmlang
general
<@Florentina> it doesn't work with 0.19. you need to use ports instead
2019-03-29T22:32:54.118200
Earlean
elmlang
general
<https://package.elm-lang.org/packages/billstclair/elm-websocket-client/latest/> is a package that makes using ports for websockets a bit easier.
2019-03-29T22:33:26.119100
Earlean
elmlang
general
I see. Thanks for the quick reply! :slightly_smiling_face:
2019-03-29T22:33:50.119500
Florentina
elmlang
general
If you want something that's more like Elm with better tooling than haskell why not try F#? You can do class-oriented but you don't need to. Have a look at what SAFE does server side (giraffe+saturn+Elmish) <https://safe-stack.github.io/docs/intro/>
2019-03-30T05:08:33.119600
Denae
elmlang
general
+ postgres obviously ^.^
2019-03-30T05:09:22.120000
Denae
elmlang
general
I am starting an iOS/Android project that accesses a local SQLite database and I would like to use Elm. Is this feasible? What would be the best tool to use with it (Capacitor/Cordova/React Native)?
2019-03-30T06:24:01.127300
Mireya
elmlang
general
<@Hsiu> may have something to say about it :slightly_smiling_face:
2019-03-30T06:24:46.127600
Lynne
elmlang
general
<@Mireya> I use plain xcode and android studio.. just open a fullscreen webview and does the rest in elm.. native code can easily be called with ports..
2019-03-30T06:36:26.129600
Monnie
elmlang
general
I’m not sure I would call it “easy”. Are you saying I can go directly from Elm to Swift/Java and back with ports? Is there a tutorial on that?
2019-03-30T07:23:45.132400
Mireya
elmlang
general
You need an incoming/outgoing port set up in Elm, native ios/android can send messages to elm directly, but you will need to add a small function in javascript to forward messages from elm to native.... after that you just add messages on swift and elm side when you need more functionallity.. Searching for javascript interop Wkwebview or android webview should give your some guides.. its pretty slimilar... An example for IOS: <https://medium.com/@JillevdWeerd/creating-links-between-wkwebview-and-native-code-8e998889b503>
2019-03-30T07:29:06.132600
Monnie
elmlang
general
Using ports to native swift/java code is actually pretty similar as interop between elm and javascript.
2019-03-30T07:39:13.132900
Monnie
elmlang
general
My current application is augmented reality.. So I show the camera nativly fullscreen and load a transparent webview on top of the video.. the rest of the userinterface/overlay is done in elm.
2019-03-30T07:41:08.133100
Monnie
elmlang
general
Hey everyone, I am currently trying to create an app where a certain key in the dictionary has an updated value upon clicking. I am almost sure that I have more than a couple problems with my current code. But right now I am getting an error with my init function. This is the error : I was not expecting this equals sign while parsing an expression (in parentheses) in init's definition. 15| init flags url = ( fruits={ Apple : 0 , Grapes : 0 } , Cmd.none ) -- add init model Im pretty stuck and some guidance would help. Thanks!
2019-03-30T15:25:36.134000
Nikia
elmlang
general
First, your `Dict` is missing the types it uses for key and value. After that is done, the other issues can be solved, I am happy to assist if necessary. :slightly_smiling_face:
2019-03-30T15:30:08.134700
Timika
elmlang
general
`type alias Model = { fruits : Dict }` From what I can guess from the code is, that you want to store fruit quantities? Sadly, you cannot use custom types for the key, as your keys have to be `comparable`, so we need to find a different solution there. If the amount of different fruits is not too large and does not change often, you can just use a record instead.
2019-03-30T15:31:24.135400
Timika
elmlang
general
yes exactly, I changed it to fruits : Dict Fruits Int However, I'm still getting the same error.
2019-03-30T15:32:31.136100
Nikia