Re: [elm-discuss] Arbitrary length currying

2017-11-07 Thread Matthew Bray
It's not quite what you asked for, but Kris Jenkins' Formatting[0] library does some interesting stuff with variadic functions. In that library, the `print` function's arity depends on the value of its first argument. Here's the idea applied to this problem (code lifted straight from the Formattin

Re: [elm-discuss] Making enter/return in text input have same effect as button

2016-12-04 Thread Matthew Bray
Take a look at onEnter from elm-todomvc: https://github.com/evancz/elm-todomvc/blob/master/Todo.elm#L237 On Sat, 3 Dec 2016, 22:11 Brian Marick, wrote: > (Disclaimer: I didn’t come to Elm knowing Javascript.) > > Anyone know of a source for code that sends a message when the user > presses ente

[elm-discuss] Cancelling HTTP requests (Was: Draft of Http library)

2016-10-02 Thread Matthew Bray
(Starting a new thread and moving to elm-discuss, as this seems out of scope for the concrete task of moving Http to core.) On Sun, 2 Oct 2016, 10:33 Mark Hamburg, wrote: > From an API standpoint, it feels like the way to have requests that can be > canceled is to make them subscriptions rather

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread Matthew Bray
If I were you I'd `brew install haskell-stack`[1], which is by far the easiest way to solve all your Haskell problems. I've whipped up a quick `stack.yaml`[2] for the elm-lang.org package. Use it like this: brew install haskell-stack cd /path/to/elm-lang.org curl -OL https://gist.github.com/mattj

Re: [elm-discuss] Abort tasks?

2016-06-29 Thread Matthew Bray
Yes, my earlier statement was a white lie - the issue I linked to describes exactly what you are running into. It is possible to abort HTTP requests using spawn and kill, but not while retaining the ability to get at the result. This is the interprocess communication Evan is talking about. So AFAIK

Re: [elm-discuss] Abort tasks?

2016-06-23 Thread Matthew Bray
It's not possible to abort requests using the HTTP library (yet). See this issue[1] for some discussion. [1] https://github.com/evancz/elm-http/issues/17 On Thu, 23 Jun 2016 at 15:29 barmin wrote: > Hello again, > > As an exercise for learning elm, I'm making a small app that aggregates > the t

Re: [elm-discuss] using different json decoders based on the value of a field

2016-06-03 Thread Matthew Bray
Yep, take a look at Json.Decode.andThen. http://package.elm-lang.org/packages/elm-lang/core/4.0.1/Json-Decode#andThen On Fri, 3 Jun 2016 at 10:21 surfncode wrote: > Hello, > > I'm currently stuck trying to decode one portion of my model. The problem > I have is the following: > > The portion I'

Re: [elm-discuss] Accessing Elm Reactor on EC2

2016-05-25 Thread Matthew Bray
Two things: * Ask elm-reactor to bind to all addresses, not just localhost, using "elm-reactor -a 0.0.0.0". * On EC2, for your instance's security group, make sure there is a rule allowing inbound TCP traffic on port 8000. Note that you incur the (small?) risk of someone exploiting an unknown vul

Re: [elm-discuss] New to Elm - Is the StartApp.Simple broken on the online "try elm" editor?

2016-05-16 Thread Matthew Bray
In Elm 0.17, StartApp became Html.App. Have a look at http://elm-lang.org/examples/buttons. On Mon, 16 May 2016 at 15:08 Marty M wrote: > Having this issue - even with copy and pasted code: > > > I cannot find module 'StartApp.Simple'. > > Module 'Temp1463407326554487' is trying to import it. >