workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
maybe let me try that
2019-02-16T10:14:27.568100
Leopoldo
elmlang
general
Well with the command you ran the index.html should be generated for you. I was wondering if it was actually output
2019-02-16T10:14:57.569200
Regenia
elmlang
general
wow.. no html markup when i view source
2019-02-16T10:16:24.569400
Leopoldo
elmlang
general
Okay there might just be an bug in the source it sometimes happens. Did you install elm-live in your project using npm or globally?
2019-02-16T10:17:36.571000
Regenia
elmlang
general
yes i did
2019-02-16T10:17:50.571200
Leopoldo
elmlang
general
Locally or globally?
2019-02-16T10:18:04.571700
Regenia
elmlang
general
npm -g
2019-02-16T10:18:13.571900
Leopoldo
elmlang
general
ok, i m getting somewhere
2019-02-16T10:18:21.572300
Leopoldo
elmlang
general
`Cannot GET /pages`
2019-02-16T10:18:39.572900
Leopoldo
elmlang
general
So in your project files was the index.html created now?
2019-02-16T10:19:32.573800
Regenia
elmlang
general
yes,
2019-02-16T10:19:46.574000
Leopoldo
elmlang
general
apparently the index file is created but i believe the error is from communicating the rest server
2019-02-16T10:20:14.574200
Leopoldo
elmlang
general
the server is able to output the result,
2019-02-16T10:22:00.574400
Leopoldo
elmlang
general
but i don't know why i m having error here
2019-02-16T10:22:15.574700
Leopoldo
elmlang
general
Okay so is the error happening on the root url or when you are trying to navigate to another url in your project?
2019-02-16T10:22:46.575700
Regenia
elmlang
general
on the root url i have a `file not found` error but to another error, i have a `Cannot GET /pages` error
2019-02-16T10:23:37.575900
Leopoldo
elmlang
general
do i have to fetch data from the `Model` or `Page` ? <https://gist.github.com/afidegnum/6192caed9ff5cf85e50d441d1fe269f4#file-main-elm-L445-L452>
2019-02-16T10:25:52.576200
Leopoldo
elmlang
general
any insight? consistently facing a `file not found` on elm-live
2019-02-16T11:02:16.577000
Leopoldo
elmlang
general
You don't have a `main` function in your module, so no JS file is even generated
2019-02-16T11:05:00.578600
Lynne
elmlang
general
Okay don't have to time to go through that all right now, but one thing I would do to make sure it is a code problem not an elm-live problem is try running your project in elm reactor and if you are getting the same issues it would be a code issue and you could start and new thread in the help channel to focus on that. :blush:
2019-02-16T11:05:31.579600
Regenia
elmlang
general
elm reactor ?
2019-02-16T11:06:06.579800
Leopoldo
elmlang
general
I m using `Main.elm`
2019-02-16T11:06:24.580300
Leopoldo
elmlang
general
It has to expose `main` function for the runtime to run it
2019-02-16T11:06:48.580700
Lynne
elmlang
general
give me an example
2019-02-16T11:07:02.580900
Leopoldo
elmlang
general
<https://guide.elm-lang.org>
2019-02-16T11:07:19.581100
Lynne
elmlang
general
this is what i have done `module Main exposing (..)`
2019-02-16T11:08:41.581500
Leopoldo
elmlang
general
On this gist there is no `main` function in the `Main` module: <https://gist.github.com/afidegnum/6192caed9ff5cf85e50d441d1fe269f4#file-main-elm-L445-L452>
2019-02-16T11:09:20.581800
Lynne
elmlang
general
It does not matter that you wrote `exposing (..)` if there is no function it can't be exposed
2019-02-16T11:09:38.582200
Lynne
elmlang
general
wow! lol
2019-02-16T11:12:34.582400
Leopoldo
elmlang
general
ok, it's working now, as suggested adding `main` works
2019-02-16T11:17:56.582500
Leopoldo
elmlang
general
request successfully gone and response fetched but they are not loaded into the view. <https://gist.github.com/afidegnum/8ec22478549ceef6e6d4a7b0f8d0ae80#file-main-elm-L405-L700>
2019-02-16T11:33:47.583500
Leopoldo
elmlang
general
and also requests are sent multiple times i don't understand why
2019-02-16T11:42:06.583900
Leopoldo
elmlang
general
<@Leopoldo> I'd check if the same Msgs fire multiple times. (ie. with `update msg model = case Debug.log "msg" msg of ...`)
2019-02-16T11:44:02.584600
Florencia
elmlang
general
if ie. SubmitNewPage fires multiple times, that would send the request multiple times.
2019-02-16T11:44:22.585000
Florencia
elmlang
general
yes, i believe that could be an issue but it supposed to be when a new event occured,
2019-02-16T11:45:09.585800
Leopoldo
elmlang
general
but fetchlist should fetch requsts once.
2019-02-16T11:45:27.586400
Leopoldo
elmlang
general
for the moment views are not loaded yet,
2019-02-16T11:45:46.586900
Leopoldo
elmlang
general
<@Florencia> where do i place the Debug.log ?
2019-02-16T11:46:49.587400
Leopoldo
elmlang
general
in the `case msg of` in update
2019-02-16T11:47:20.587600
Florencia
elmlang
general
`case Debug.log "msg" msg of`
2019-02-16T11:48:16.588000
Florencia
elmlang
general
``` FetchPages -&gt; ( { model | pages = RemoteData.Loading }, fetchPagesCommand Debug.log "msg" msg of)``` or a new branch?
2019-02-16T11:49:48.588700
Leopoldo
elmlang
general
<https://gist.github.com/afidegnum/8ec22478549ceef6e6d4a7b0f8d0ae80#file-main-elm-L304> here. change the line `case msg of` to `case Debug.log "msg" msg of`
2019-02-16T11:50:27.589100
Florencia
elmlang
general
ok
2019-02-16T11:51:01.589300
Leopoldo
elmlang
general
strange, no output
2019-02-16T11:52:15.589500
Leopoldo
elmlang
general
except the old `Compiled in DEV mode. Follow the advice at <https://elm-lang.org/0.19.0/optimize> for better performance and smaller assets.`
2019-02-16T11:53:01.589800
Leopoldo
elmlang
general
well then, no Msgs are probably firing?
2019-02-16T11:53:20.590100
Florencia
elmlang
general
can you show how your main looks?
2019-02-16T11:53:25.590300
Florencia
elmlang
general
(I can't find it in the source you posted)
2019-02-16T11:53:34.590600
Florencia
elmlang
general
<@Florencia> <https://gist.github.com/afidegnum/2e91cfbaac056defad93f1cff389a8ed#file-main-elm-L304>
2019-02-16T11:59:48.591100
Leopoldo
elmlang
general
do you have the `main` value defined somewhere?
2019-02-16T12:00:41.591700
Florencia
elmlang
general
yes, hold a sec
2019-02-16T12:00:58.591900
Leopoldo
elmlang
general
Anybody knows why running `elm-test` fails in Travis CI? <https://travis-ci.org/GlobalWebIndex/class-namespaces/builds/494264002> <https://github.com/GlobalWebIndex/class-namespaces/blob/with-states/.travis.yml>
2019-02-16T12:11:45.592600
Florencia
elmlang
general
<@Florencia> it works now :slightly_smiling_face:
2019-02-16T12:21:02.592900
Leopoldo
elmlang
general
now trying to fix other parts
2019-02-16T12:21:15.593500
Leopoldo
elmlang
general
whos using elm-format and windows? please weight in here <https://github.com/avh4/elm-format/issues/596>
2019-02-16T13:26:38.594500
Desire
elmlang
general
Dunno if this belongs to the <#C192T0Q1E|beginners>. Posting it here anyways for the reference.
2019-02-16T14:55:03.594800
Lula
elmlang
general
...
2019-02-16T15:13:55.594900
Lula
elmlang
general
How do you folks remember the order of `foldl` / `foldr`'s lambda? (ie. `newVal acc` or `acc newVal`)
2019-02-16T15:35:05.595900
Florencia
elmlang
general
I always have to look it up
2019-02-16T15:35:14.596100
Florencia
elmlang
general
In Elm, "the thing being modified" is usually last, for pipeline-friendliness
2019-02-16T15:49:03.596800
Huong
elmlang
general
so `v -&gt; acc -&gt; acc` :shrug:
2019-02-16T15:49:55.597700
Huong
elmlang
general
Right, kinda makes sense, even though I wouldn't mentally connect that lambda with pipeline-style functions. But yeah, it's adhering to a language-wide convention. Thx!
2019-02-16T15:52:51.599900
Florencia
elmlang
general
Yeah, for some reason, I occasionally visualise folds as long pipelines with the values being folded over being the argument on consecutive lines. So `List.foldl f acc [ 1, 2, 3 ]` becomes `acc |&gt; f 1 |&gt; f 2 |&gt; f 3` :smile:
2019-02-16T15:55:14.601800
Huong
elmlang
general
<@Modesto> ``` 15208275*592256471*3 &gt; 27021597844492572 3*592256471*15208275 &gt; 27021597844492576 ```
2019-02-16T16:09:23.602200
Florencia
elmlang
general
JS console
2019-02-16T16:09:37.602700
Florencia
elmlang
general
this is a problem with JS numbers
2019-02-16T16:09:42.602900
Florencia
elmlang
general
o ok
2019-02-16T16:09:48.603100
Modesto
elmlang
general
thank you
2019-02-16T16:09:50.603300
Modesto
elmlang
general
if you need bigger precision there is a bigint package I think
2019-02-16T16:10:04.603600
Florencia
elmlang
general
<https://package.elm-lang.org/packages/cmditch/elm-bigint/latest/BigInt>
2019-02-16T16:10:15.603800
Florencia
elmlang
general
ok thank you
2019-02-16T16:10:21.604000
Modesto
elmlang
general
was just running some tests
2019-02-16T16:10:26.604200
Modesto
elmlang
general
updated elm-monoid
2019-02-16T16:10:35.604500
Modesto
elmlang
general
to .19
2019-02-16T16:10:39.604700
Modesto
elmlang
general
but was also trying to wrap my head around what monoid is
2019-02-16T16:10:58.605100
Modesto
elmlang
general
with the tests
2019-02-16T16:11:15.605300
Modesto
elmlang
general
Did you figure it out, or do you want some help? :slightly_smiling_face:
2019-02-16T16:12:23.606000
Florencia
elmlang
general
I think i'm ok
2019-02-16T16:12:41.606200
Modesto
elmlang
general
using elm-monoid to write a complex number package for elm
2019-02-16T16:12:59.606700
Modesto
elmlang
general
<https://package.elm-lang.org/packages/elm/core/1.0.2/Basics#Int> Also has a note on the ranges for which operations are safe :slightly_smiling_face:
2019-02-16T16:14:14.607800
Huong
elmlang
general
thank you
2019-02-16T16:14:28.608100
Modesto
elmlang
general
maybe ill round down in my test
2019-02-16T16:14:38.608400
Modesto
elmlang
general
So, in this case the numbers were different because `List.product` and `List.foldr` start from different sides (`List.product` uses `List.foldl`) and in this extreme case (big numbers) the associativity law breaks down. JS numbers are floats under the hood.
2019-02-16T16:15:39.609500
Florencia
elmlang
general
most libraries' approach to "what to do when you the numbers get really big or really small" is "don't care" - that's a possibility for you too. Just use the operators you've been given and inherit their weaknesses
2019-02-16T16:16:35.610500
Florencia
elmlang
general
How can I decode html page? I'm writing a simple blog that internally grubs posts from some urls. For some reason Http.get gives html rather than plain text (`Accept: text/plain` doesn't help), so I guess html decoding might do the thing, though quite painfully
2019-02-16T16:38:20.613200
Valentin
elmlang
general
<@Valentin> this package should probably help: <https://package.elm-lang.org/packages/hecrj/html-parser/latest/Html-Parser>
2019-02-16T16:40:23.613900
Nana
elmlang
general
<@Valentin> yeah if you managed to get it in JSON or XML it would be definitely less painful :slightly_smiling_face:
2019-02-16T16:41:47.614400
Florencia
elmlang
general
maybe you will have luck with parsing the HTML as XML but I'm not sure it would work. Anyways, the XML packages have more tooling (decoders etc.) around than the HTML one
2019-02-16T16:42:53.615700
Florencia
elmlang
general
<@Nana> seems it doesn't parse to elm/html type :disappointed:
2019-02-16T16:42:54.615800
Valentin
elmlang
general
<@Valentin> it parses to its own but you can convert from that one to elm/html
2019-02-16T16:43:08.616200
Florencia
elmlang
general
<https://package.elm-lang.org/packages/hecrj/html-parser/latest/Html-Parser-Util#toVirtualDom>
2019-02-16T16:43:22.616500
Florencia
elmlang
general
Oh, missed that, thanks!
2019-02-16T16:44:52.616800
Valentin
elmlang
general
<https://gist.github.com/afidegnum/4347506487ddfdd90ea91d2665c43a1e#file-main-elm-L459-L461> i m having error here ``` Type mismatch. Required: (Route, String, String) Found: (Msg, String, String)```
2019-02-16T19:02:50.621300
Leopoldo
elmlang
general
Hey <@Leopoldo> your problem seems to be `DeletePage`. `DeletePage` is defined inside your `Msg` type. The thing you want to pass there seems to be `PageDelete` :slightly_smiling_face:
2019-02-17T01:34:41.622900
Moshe
elmlang
general
ok thanks
2019-02-17T01:36:41.623200
Leopoldo
elmlang
general
None
2019-02-17T04:00:53.623600
Leopoldo
elmlang
general
viewPages is expecting 2 arguments, you’re only provided 1. pass the route in as well
2019-02-17T04:09:36.623900
Iona
elmlang
general
i.e. model.route
2019-02-17T04:10:06.624200
Iona
elmlang
general
what about line 457?
2019-02-17T04:13:20.624400
Leopoldo
elmlang
general
the expression on the right of (::) needs to be a list, so wrap the entire list.map expression in parenthesis or use (&lt;|)
2019-02-17T04:21:36.624600
Iona