[elm-discuss] Re: Elm's compiler is trying to import a module that doesn't exist...?

2017-01-11 Thread Frederick Yankowski
I've seen that error when `elm-lang/core` is missing from the dependencies in elm-package.json. Try `elm package install elm-lang/core`. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails

[elm-discuss] Re: Using Elm with JSON when you do not know the names and types of the properties at compile time

2016-12-07 Thread Frederick Yankowski
I wanted to decode fairly general JSON (JSON Schema embedded in an ad-hoc structure) and found that fairly easy to do, generating an ADT value that matches the structure of the JSON one-to-one. https://github.com/fredcy/tezos-client/blob/37615ef93bb90b38afd58f282610a4011427c933/Schema.elm#L38

[elm-discuss] Re: Beginner Question following https://www.elm-tutorial.org/en/

2016-11-02 Thread Frederick Yankowski
Http.send creates a Task. To run a Task you have to create a Cmd Msg from it and hand that to the runtime via the return from the init or update function. So rather than passing the task to Task.succeed you probably want to pass it to Task.perform instead. There’s an example at

Re: [elm-discuss] 0.17-compatible web storage

2016-10-31 Thread Frederick Yankowski
https://github.com/fredcy/localstorage runs in Elm 0.17 and has storage events. The provided examples show it handling some events. That repo will never be published as an Elm package though. I originally named it "Storage", thinking to do session storage next. But it's a dead end and I gave

[elm-discuss] Re: ports and reserved words

2016-10-20 Thread Frederick Yankowski
I had a similar problem with a field named `default`. I think you have to avoid all Javascript reserved words for records passed through ports. http://www.w3schools.com/js/js_reserved.asp It is an unfortunate leak of Javascript constraints into the Elm world. It does seem that the compiler

Re: [elm-discuss] Why aren't doc PRs merged?

2016-10-19 Thread Frederick Yankowski
Also, contributions to the Elm FAQ are welcome. It’s a community document hosted as an elm-community repo at GitHub . Most PRs to that repo are merged quickly as long as they don’t duplicate other material already

[elm-discuss] Re: Getting functions out of the model

2016-10-13 Thread Frederick Yankowski
The elm-autocomplete package does something much like you describe. Configuration data, including some functions, is defined separately from the model and is passed as an additional parameter to the update function.

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-09-27 Thread Frederick Yankowski
I took Peter’s gist as a basis and made a repo out of it: https://github.com/fredcy/elm-polymer-calendar My version uses a small bit of native code to convert the JS Date value from the calendar component (sent as a JS event) into an Elm Date value. That avoids the kluge I had before using

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-09-26 Thread Frederick Yankowski
Peter, I played around with the code in your gist. The value returned by the "date-changed" event does indeed seem to be a JS Date value (which I determined by handling it as a Json.Value value). I don't see how to convert that Json.Value holding a JS Date into an Elm `Time` value. The

[elm-discuss] Re: The Elm Slack is now archived by SlackArchive.io

2016-09-26 Thread Frederick Yankowski
This will be a great resource, Luke. Thanks. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit

[elm-discuss] Re: List.sortBy browser dependance?

2016-07-13 Thread Frederick Yankowski
A workaround I’ve used to get stable sorting in Javascript is to add an artificial index, sort with that as a secondary sort parameter, and then strip that index off from the result. To sort a list of int-pairs in Elm it could go like this: stableSort : List (Int, Int) -> List (Int, Int)

[elm-discuss] Re: Debouncing in Elm 0.17

2016-07-08 Thread Frederick Yankowski
There is a published package that helps with de-bouncing: http://package.elm-lang.org/packages/athanclark/elm-debouncer/2.0.0/ I have also done it like this: https://github.com/fredcy/example-elm-debounce/blob/master/Debounce.elm On Friday, July 8, 2016 at 8:19:40 AM UTC-5, Charlie Koster

[elm-discuss] Re: How to create an animation?

2016-06-22 Thread Frederick Yankowski
I would start with https://github.com/jamesmacaulay/elm-gif-lab. However, it doesn't appear to be updated to Elm 0.17. On Tuesday, June 21, 2016 at 10:21:22 PM UTC-5, cass...@gmail.com wrote: > > How can I make a .gif? > -- You received this message because you are subscribed to the Google

[elm-discuss] Re: Data from JS to Elm without delay

2016-06-07 Thread Frederick Yankowski
`Html.App.programWithFlags` works fine with `embed()`, not just `fullscreen()`. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to