elm-lang/elm-reactor — pull request #35 by michaelbjames (2014-08-26 11:39:18+00:00)
Title: Bugfix/33

This is a proposed bug fix for https://github.com/elm-lang/elm-reactor/issues/33.

This works in all my testing. The `urlDecode` isn't needed for `serveRuntime` since the runtime is only ever downloaded. `urlDecode` in `server.hs` allows a filename like `Numbers%20Input.elm` to match the existing file `Numbers Input.elm`. The matching lets the `serveElm` snap do its thing. Without `urlDecode`, filenames with encoded special characters (i.e., spaces), are just downloaded and not run as elm files.

Style note:
Do you see a better way to do this than extracting the `Maybe`? If I use `<$>` all over the place I'll have the Maybe floating around. And the rest of the `serveElm` would be mired by `<$>`s and lambdas to get the parameters ordered, right?