Re: [elm-discuss] Re: Unit testing what else

2017-03-17 Thread Nick H
Elm Test does support test case minimization. From the Fuzz documentation : Fuzzers will often generate edge cases likely to find bugs. If the fuzzer > can make your test fail, it also knows how to "shrink" that failing input

Re: [elm-discuss] Wrong package not found reported using elm-make 0.18.0

2017-03-03 Thread Nick H
This is a nice detailed description of the bug! I see this behavior too. BUT this is not an issue with elm-make. It is an issue with elm-package. And there is already a bug report open there . (elm-make is running elm-package silently, and it is

Re: [elm-discuss] Html.Attributes.selected in Html.select

2017-02-27 Thread Nick H
Change" event handler, so I think that the custom event handler is the only solution. And now I will stop pinging the thread :-) On Mon, Feb 27, 2017 at 10:17 AM, Nick H <falling.maso...@gmail.com> wrote: > (and Attr is an alias for Html.Attributes) > > On Mon, Feb 27, 2017

Re: [elm-discuss] Html.Attributes.selected in Html.select

2017-02-27 Thread Nick H
(and Attr is an alias for Html.Attributes) On Mon, Feb 27, 2017 at 10:16 AM, Nick H <falling.maso...@gmail.com> wrote: > I am looking through some code where I successfully implemented a > drop-down menu, and it appears I wrote a custom event handler. "onInput" > did

Re: [elm-discuss] Html.Attributes.selected in Html.select

2017-02-27 Thread Nick H
I am looking through some code where I successfully implemented a drop-down menu, and it appears I wrote a custom event handler. "onInput" did not work for me. Here is the function that I wrote (Evt is an alias for Html.Events). select : (String -> a) -> String -> List ( String, String ) -> Html

Re: [elm-discuss] elm-lang/http and evancz/elm-http

2017-02-05 Thread Nick H
a trail to the superseding >> package. The old packages usually still get a lot of hits from Google and >> references from projects still using them. >> >> >> On Tuesday, 31 January 2017 04:17:18 UTC, Nick H wrote: >>> >>> They are the same library. el

Re: [elm-discuss] elm-lang/http and evancz/elm-http

2017-01-30 Thread Nick H
They are the same library. elm-http was migrated from evancz/ to elm-lang/ when 0.18 was released, so only the latter will work. I guess the URL function was removed. On Mon, Jan 30, 2017 at 3:05 PM, Brian Marick wrote: > I’m confused by the relationship between these two

Re: [elm-discuss] Modeling units of measure with phantom types

2017-01-22 Thread Nick H
In the same way that a vector is usually represented by a line segment, a bivector can be represented by a parallelogram where the component vectors form the sides. I was imagining a naive representation where you just store the component vectors. type alias Bivector = { a : Vector, b : Vector }

Re: [elm-discuss] Why are unbound type variables forbidden for functions in records?

2017-01-20 Thread Nick H
g the functions of the aforementioned weird > form in TypeInfo a so it probably cannot work. I am aware of cases that > could not be solved in principle without help from compiler even if > everything worked as I hoped it would (and maybe there are other problems I > missed), but I had

Re: [elm-discuss] Why are unbound type variables forbidden for functions in records?

2017-01-20 Thread Nick H
All type variables need to be mentioned on the left side of the type alias definition. But that doesn't mean you need to bind them. This compiles fine: type alias Convertor b a = { convert : b -> a } c: Convertor b String c = {convert = convertString} In other words, the unbound type

Re: [elm-discuss] State of Elm Survey 2017 is live

2017-01-18 Thread Nick H
> > The same would apply to people working alone as freelancers. > I just put in 10 :-) On Wed, Jan 18, 2017 at 3:48 PM, Matthieu Pizenberg < matthieu.pizenb...@gmail.com> wrote: > Hey, I just participated in the survey :) > A few remarks before forgetting: > - I am not sure large scale

Re: [elm-discuss] OK, or very very wrong?

2017-01-17 Thread Nick H
) ] [ text "+" ] ] update msg model = case msg of Add delta -> model + delta On Tue, Jan 17, 2017 at 11:31 PM, Nick H <falling.maso...@gmail.com> wrote: > I would come down on the side of very very wrong. Functions can't be > converted into

Re: [elm-discuss] OK, or very very wrong?

2017-01-17 Thread Nick H
I would come down on the side of very very wrong. Functions can't be converted into strings, and they can't be checked for equality. So if you need to debug your program (say, with the interactive debugger), There is no way to examine the data being passed in your commands. On Tue, Jan 17, 2017

Re: [elm-discuss] Convert String to symbol (previously `Text.fromString`, like Haskell's `read`)

2017-01-17 Thread Nick H
iscussed? I know I saw a talk where Evan mentioned > adding features to the language over time intentionally to help drive > adoption. > > Thanks! > > On Monday, January 16, 2017 at 9:06:50 PM UTC-5, Nick H wrote: >> >> I doubt such a function will be introduced any time

Re: [elm-discuss] Convert String to symbol (previously `Text.fromString`, like Haskell's `read`)

2017-01-16 Thread Nick H
I doubt such a function will be introduced any time soon, because it's not a properly typed operation. In Haskell, you have to add the type annotation to the function call because read's return type is ambiguous. However, Elm doesn't have any similar ability. For converting Strings to numeric

Re: [elm-discuss] Cannot find module "String"...

2017-01-09 Thread Nick H
I'm curious, what happens if you remove the "import String" line altogether? String should now be imported by default. On Mon, Jan 9, 2017 at 9:00 AM, Rex van der Spuy wrote: > Hi Everyone, > > Here's a strange puzzle! > While upgrading some old 0.17 to 0.18. I received

Re: [elm-discuss] Re: Emphasizing /r/elm more

2017-01-02 Thread Nick H
I have never really used Reddit, but I am happy to try it out! That second bullet point in particular has really been wearing down my morale lately. Don't forget, elm-discuss still has top billing on the community page On Mon, Jan 2, 2017 at 8:23 PM, Mark Hamburg

Re: [elm-discuss] Re: Tuple indexing?

2016-12-27 Thread Nick H
I don't think the internal storage of tuples vs records is the difficulty that Max is pointing out. (I think your assumption is correct, that they are built similarly "under the hood.") Rather, the difficulty is that these tuple accessors would require a major extension to Elm's type system. On

Re: [elm-discuss] Re: DOM geometry / SVG library

2016-12-22 Thread Nick H
Yes, I agree with Rex. The DOM is write-only by design. Going forward, I don't expect there ever to be a generic way to read the DOM... if specific problems come up that absolutely require it, they will be solved by specific APIs, such as in elm-lang/window and elm-lang/dom. On Thu, Dec 22, 2016

Re: [elm-discuss] Re: Combining subscriptions under 0.18

2016-12-20 Thread Nick H
I think what you have in your first post is just fine. The combineSubscriptions seems like overkill for a two-item list. If it bugs you to have to pass the model to a bunch of different functions, I'm curious how complicated the "viewSubscriptions" and "webSubscriptions" functions are, and

Re: [elm-discuss] What do you think Elm's biggest shortcomings are when it comes to natively supported API's?

2016-12-18 Thread Nick H
It hasn't been updated in 7 months, and it won't work with the latest version of Elm, so I would reckon it is not. On Sun, Dec 18, 2016 at 12:56 PM, Joel wrote: > I came across elm-webaudio... Is it up-to-snuff? > > https://github.com/trotha01/elm-webaudio > > Joel > > > On

Re: [elm-discuss] Formating numbers

2016-12-16 Thread Nick H
One thing you might want to also test is how your code deals with negative numbers. In particular, negative numbers that round to zero! On Fri, Dec 16, 2016 at 1:42 PM, Nick H <falling.maso...@gmail.com> wrote: > There's nothing in the standard libraries (that I know of) to help with

Re: [elm-discuss] Formating numbers

2016-12-16 Thread Nick H
There's nothing in the standard libraries (that I know of) to help with number formatting. There have been a few libraries written, but this is the only one I see that is up-to-date with 0.18. My personal guideline

Re: [elm-discuss] Re: Why is "port" forbidden as field name inside record?

2016-12-15 Thread Nick H
Ah, I guess you would run into typing issues if you tried to use a Dict... that's just my knee-jerk response when people ask about doing things with records that you can't do with records :-| On Thu, Dec 15, 2016 at 4:06 PM, Nick H <falling.maso...@gmail.com> wrote: > If you want

Re: [elm-discuss] Re: Why is "port" forbidden as field name inside record?

2016-12-15 Thread Nick H
If you want something that can hold arbitrary string keys like a JavaScript object, you can use a Dict. Making keywords context-sensitive would be a language designer's nightmare. I don't think most languages allow this. Which contexts would the keywords be reserved, and which would they not be?

Re: [elm-discuss] Why is "port" forbidden as field name inside record?

2016-12-15 Thread Nick H
Think about how you would construct such a record... myRecord = { port = ... } That's a reserved keyword appearing in an incorrect place. This won't work for any Elm keyword! I can't think of a way to solve your problem besides changing the JS that calls the port. In the Elm HTML library,

Re: [elm-discuss] “TypeError: domNode is undefined” and other errors with Elm and 3rd party JS libraries

2016-12-13 Thread Nick H
I think the way to work cleanly with a DOM-rewriting library is to decide which parts of your page you want Elm to control and which parts you want JS to control. You can use Elm.Main.embed to restrict your Elm program to only controlling a part of the page. Or you could use Platform.program to

Re: [elm-discuss] elm-lang/Navigation with hash and query string

2016-12-11 Thread Nick H
Maybe Bogdanp/elm-querystring could be helpful? On Sun, Dec 11, 2016 at 2:23 PM, Charlie Koster wrote: > I don't disagree with anything your wrote there, but I still have this > problem to deal with now. The path of least resistance happens to also be > the path that uses

Re: [elm-discuss] Re: Documentation storage : IN or OUT ?

2016-12-11 Thread Nick H
Yes, I'm curious what exactly your concerns are with the current documentation system. Seems like removing all documentation from the source code would just make it harder to notice mistakes. On Sun, Dec 11, 2016 at 9:52 AM, Max Goldstein wrote: > You're going to be

Re: [elm-discuss] elm-lang/Navigation with hash and query string

2016-12-09 Thread Nick H
I would call this not a bug, since it conforms to the URL standard . in your second example, ?a=b=d is not a query string, but a part of the fragment string. This is just one of several ways that URL syntax can lead you down a dark alley and steal your

Re: [elm-discuss] Re: fold function argument order

2016-12-09 Thread Nick H
expection to this exceptation. On Fri, Dec 9, 2016 at 2:17 PM, Nick H <falling.maso...@gmail.com> wrote: > I would disagree with "not expected in general." In general -- when a and > b are different types -- Elm's API design guidelines should set you up to > always expec

Re: [elm-discuss] Re: fold function argument order

2016-12-09 Thread Nick H
I would disagree with "not expected in general." In general -- when a and b are different types -- Elm's API design guidelines should set you up to always expect a -> b -> b and never b -> a -> b. If the definition of foldl were changed to take the latter, it would be the only exception to this

Re: [elm-discuss] `Case of` branches grouping

2016-12-09 Thread Nick H
on you might decide to add / > remove some types from union type. > > On Friday, December 9, 2016 at 4:57:48 PM UTC+1, Nick H wrote: >> >> You can also do equality tests on type values, which means in your first >> two cases you can use an if statement. >> >> if

Re: [elm-discuss] Re: how to make a port compnent

2016-12-09 Thread Nick H
Forgot to say... that's a really cool idea! :-) On Fri, Dec 9, 2016 at 10:25 AM, Nick H <falling.maso...@gmail.com> wrote: > I would love for somebody to disagree with me, but I really don't think > Elm is a good choice for this project. > > Elm does not have any aud

Re: [elm-discuss] Re: how to make a port compnent

2016-12-09 Thread Nick H
I would love for somebody to disagree with me, but I really don't think Elm is a good choice for this project. Elm does not have any audio support yet, so that would all be done through ports. You've said the code editor will not be in Elm... and it sounds like that is going to be a major part of

Re: [elm-discuss] Why latest versions of elm-compiler not available on Hackage?

2016-12-09 Thread Nick H
You need to build from source. The elm compiler moved from hackage to npm. It was never maintained in both places at once. On Fri, Dec 9, 2016 at 1:51 AM, Jan Hrček wrote: > Hello, > > is there a distribution of latest (0.18) elm-compiler available as haskell > library? I

Re: [elm-discuss] Re: how to make a port compnent

2016-12-09 Thread Nick H
I am pretty sure it is impossible to "wrap" a JS component with Elm, especially if it is as complicated as a code editor. This thing is going to have loads of code that already manages rendering and event handling. Its not going to play nicely with the VDOM. What is the rest of your program

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

2016-12-06 Thread Nick H
What sorts of widgets are we talking about? If you know what sorts of widgets you are displaying, then you should also know what types of data they need. If this is true, then you could decode your JSON to simple "Dict String Json.Value". Then your widgets will have more fine-grained decoders

Re: [elm-discuss] towards enact-like coding? ideas for future directions

2016-12-05 Thread Nick H
Think "12 Monkeys" instead of "Back to the Future"! On Mon, Dec 5, 2016 at 12:57 PM, Duane Johnson <duane.john...@gmail.com> wrote: > No traveling!? I think this should be called the Archeological Debugger. :) > > On Mon, Dec 5, 2016 at 1:35 PM, Nick

Re: [elm-discuss] towards enact-like coding? ideas for future directions

2016-12-05 Thread Nick H
Thanks for sharing your thoughts! The "time split" you describe actually used to be a feature of the time travel debugger. But judging from Evan's comments on elm-dev, it doesn't sound like it is going to come back. For example: (Source

Re: [elm-discuss] Re: Maximum call stack size exceeded while parsing generated code

2016-12-05 Thread Nick H
Glad you found a solution! On Sun, Dec 4, 2016 at 8:43 PM, Iain Gray wrote: > It turned out to be an instance of this > . I have a list of > time-zones that I use for a drop-down list, which was big enough to cause >

Re: [elm-discuss] Maximum call stack size exceeded while parsing generated code

2016-12-04 Thread Nick H
In my case, a recursive function was written in such a way that it couldn't benefit from tail-call optimization. It was in 0.17. That was the only time I've encountered the error. On Sun, Dec 4, 2016 at 3:58 PM, Richard Feldman wrote: > Is this true only when the

Re: [elm-discuss] Cmd.andThen

2016-11-30 Thread Nick H
This does sound like a useful addition. Unlike most of the functions that people suggest adding to core, I don't think Cmd.andThen can be written by an end user (or library author). On Wed, Nov 30, 2016 at 7:19 AM, Mark Hamburg wrote: > A bigger issue going forward is

Re: [elm-discuss] Re: Advantages of the module - exposing syntax

2016-11-30 Thread Nick H
The module's interface is an entity unto itself. When I am visiting unfamiliar code, I often want to know what its API looks like. Having everything there at the top is way easier than having to scan through search results for Ctrl-F "exposed". It also helps with design. Seeing the entire

Re: [elm-discuss] Cmd.andThen

2016-11-29 Thread Nick H
I can't picture how this function would work. Could you give an example of where you would want to use it? Is this just a shortcut around having to make two passes through the update function? On Tue, Nov 29, 2016 at 1:27 PM, Mark Hamburg wrote: > With various libraries

Re: [elm-discuss] Firebase package - should be an effect module or native module?

2016-11-29 Thread Nick H
(I mentioned version 0.16 because I think that is when the native review process was officially discontinued, but actually I bet the community packages on the whitelist are older even than that.) On Tue, Nov 29, 2016 at 11:33 AM, Nick H <falling.maso...@gmail.com> wrote: > There is n

Re: [elm-discuss] Inter triplets communication.

2016-11-29 Thread Nick H
5 AM, <sergii.kamens...@zalando.de> wrote: > @Rupert Smith > Your module for pub/sub looks great! I will be useful for a lot of people > like me. I think you should publish it. > Can you add a README or provide few examples how to use it properly? > > @Nick H > I also thought

Re: [elm-discuss] Re: elm-make: Map.!: given key is not an element in the map

2016-11-28 Thread Nick H
The situation should be much improved now in 0.18. I don't see it mentioned in the release notes, but from the beta announcement : Fix elm-make bug where build artifacts could get corrupted, requiring > delete of

Re: [elm-discuss] ANN: style-elements v2 published

2016-11-28 Thread Nick H
Looks awesome! Can't wait to try it out. On Mon, Nov 28, 2016 at 7:51 AM, Matthew Griffith wrote: > > v2.0.0 of the style-elements > library is now released! > > The library is an experiment in handling style in elm,

Re: [elm-discuss] Inter triplets communication.

2016-11-28 Thread Nick H
> > (In the UserInfo "update" function if cannot return a command(effect) > "Ratings Reload" directly, because of this "Cmd.map UserInfo effect") > It seems to me that you should not be wrapping "Loaded" in a "UserInfo" action. Judging from your update function, I am guess your main action type

Re: [elm-discuss] Noob HTTP questions

2016-11-26 Thread Nick H
I would recommend having another read through the "Linked List" and "Generic Data Structures" sections of the union types page. The types you are asking questions about behave the same way that the "List a" does. 1) Msg is a type. "Cmd Msg",

Re: [elm-discuss] Re: Whither Rationals?

2016-11-26 Thread Nick H
ing frowned upon. I have hesitated to publish it. > > On Saturday, 26 November 2016 20:57:50 UTC, Nick H wrote: >> >> I have a module that implements most of the math functions from *Basics* >> for rational numbers. Happy to publish it. >> >> For interop with ints, there i

Re: [elm-discuss] About output file size

2016-11-26 Thread Nick H
Luiz, what sort of load times are you looking at? On Sat, Nov 26, 2016 at 1:27 PM, Nick H <falling.maso...@gmail.com> wrote: > I would 100% recommend Elm for small projects! > > The core platform takes up a certain size, but the code you write on top > of that is not goin

Re: [elm-discuss] About output file size

2016-11-26 Thread Nick H
I would 100% recommend Elm for small projects! The core platform takes up a certain size, but the code you write on top of that is not going to add much more. On Sun, Nov 20, 2016 at 8:06 AM, Luiz Bills wrote: > Can I output a js file more optimized? A simple hello world

Re: [elm-discuss] The Elm Architecture and Html.beginnerProgram

2016-11-26 Thread Nick H
What are you trying to figure out? If you are looking for the implementation of Html.beginnerProgram, you can look in the elm-stuff/packages directory. Or you can compile your program and read the output JavaScript to see what is "really" going on. But I don't think either of those things are

Re: [elm-discuss] Re: Whither Rationals?

2016-11-26 Thread Nick H
2016 at 12:57 PM, Nick H <falling.maso...@gmail.com> wrote: > I have a module that implements most of the math functions from *Basics* > for rational numbers. Happy to publish it. > > For interop with ints, there is > > int : Int -> Rational > > Then converting bac

Re: [elm-discuss] Re: Whither Rationals?

2016-11-26 Thread Nick H
I have a module that implements most of the math functions from *Basics* for rational numbers. Happy to publish it. For interop with ints, there is int : Int -> Rational Then converting back you have the normal round/floor/ceiling as well as toFloat. Is that unobtrusive enough? On Sat, Nov

Re: [elm-discuss] What Elm needs to move forward

2016-11-24 Thread Nick H
I found out about the 0.18 release and elm-conf EU via Twitter. Also lots of announcements there about live coding sessions, local meetups, etc. I can try to echo some of that stuff here if the organizers don't do it, but I am only on Twitter sporadically. But there is a wealth of community

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-22 Thread Nick H
OK, here are the suggestions so far: type Maybe a = ... Nothing | Just a Nothing | Something a None | Some a NoValue | Some a Nothing | Some a Nothing | The a Nothing | A a Nothing | Thing a NoThing | Thing a Nothing | Have a Nothing | Got a Null | NotNull a No | Yes a Empty | Full a (I just

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Nick H
> > You might look at lenses (e.g. elm-monocle) to see one approach that might > appeal to you. This is pretty cool. I've often made setter functions for my records, wrapping around Elm's regular update syntax. I didn't realize that it's part of a larger class of patterns. On Tue, Nov 22, 2016

Re: [elm-discuss] Proposed addition for Task package

2016-11-21 Thread Nick H
 On Mon, Nov 21, 2016 at 7:04 PM, Charlie Koster wrote: > I'm a fan of the changes to Task.perform in Elm 0.18. However, I'm still > finding that I'm writing a lot of boilerplate in some situations. For > example, there are several instances when I want to send a msg

Re: [elm-discuss] Re: ANN: update-clock for fixed-time-step game loops

2016-11-21 Thread Nick H
wouldn't be so sure. For example, in networking games where one might > need to keep clocks synced. > > Le dimanche 20 novembre 2016 21:08:37 UTC+1, Nick H adn écrit : >> >> The purpose of the Clock is to relate the passage of time in the "real" >> world to

Re: [elm-discuss] Re: Open discussion about optimization of code potentially triggered very often (mousemove) ?

2016-11-20 Thread Nick H
That actually sounds like it works pretty well. Even though you are getting multiple triggers, you are still preventing an enormous volume of mousemove updates. (I am assuming the time until reactivation is relatively long). The only thing that I would add is a filter on MoveMsg updates... if

Re: [elm-discuss] Re: ANN: update-clock for fixed-time-step game loops

2016-11-20 Thread Nick H
il.com> wrote: > Passing Clock.period would be indeed more useful in the example's use case. > > Could we imagine update functions where the total elapsed time is needed? > > Wouldn't it be more flexible to pass the Clock object? > > Le samedi 19 novembre 2016 18:59:02 UTC+1, N

Re: [elm-discuss] Proposed addition to Result in elm-lang/core

2016-11-19 Thread Nick H
This function is called unpack in elm-community/result-extra On Sat, Nov 19, 2016 at 12:58 PM, Charlie Koster wrote: > Just this morning I upgraded a 3500 line Elm 0.17 project to

Re: [elm-discuss] Re: ANN: update-clock for fixed-time-step game loops

2016-11-19 Thread Nick H
a step counter, but this is not used in > the example, is this counter really useful for a physical update? Wouldn't > we need more the real time (Clock.time*Clock.period)? > > Le mercredi 16 novembre 2016 22:42:37 UTC+1, Nick H a écrit : >> >> Sorry about that. Thanks for taking prope

Re: [elm-discuss] Elm Http regression with requests for binary resources

2016-11-18 Thread Nick H
y the same problem, I'm afraid. > > On Friday, 18 November 2016 17:22:59 UTC, Nick H wrote: >> >> Does anything different happen if you use a MIDI mimetype, like >> "audio/midi"? >> >> On Fri, Nov 18, 2016 at 5:33 AM, John Watson <john@g

Re: [elm-discuss] Can't install native package using elm-github-install

2016-11-18 Thread Nick H
What if you just removed the port declarations from your package? That's only a few lines of code, and nothing else seems to depend on them (except a little Util function). The rest of your work could even be published to the package manager. On Fri, Nov 18, 2016 at 4:18 AM, 'Rupert Smith' via

Re: [elm-discuss] Elm Http regression with requests for binary resources

2016-11-18 Thread Nick H
Does anything different happen if you use a MIDI mimetype, like "audio/midi"? On Fri, Nov 18, 2016 at 5:33 AM, John Watson wrote: > I have a small MIDI > > file. With Elm 0.17

Re: [elm-discuss] dependency problem with upgrading to 0.18

2016-11-18 Thread Nick H
I am looking at the github page for that project, and it's elm-package.json says something different: "dependencies": { "elm-lang/core": "4.0.0 <= v < 5.0.0" }, "elm-version": "0.17.0 <= v <

Re: [elm-discuss] Re: ANN: update-clock for fixed-time-step game loops

2016-11-16 Thread Nick H
Sorry about that. Thanks for taking proper credit! On Wed, Nov 16, 2016 at 9:23 AM, Rex van der Spuy wrote: > Wow, that's absolutely brilliant!!! > (My username was `d13` by the way - so that was me!) > Congratulations!!! > > -- > You received this message because you are

[elm-discuss] ANN: update-clock for fixed-time-step game loops

2016-11-15 Thread Nick H
On the advice of counsel (thanks Overmind), I moved this to a new thread. So a long time ago, d13 shared this article on elm-discuss. It explains how to update your model at fixed intervals, even when the updates are driven by, say, a

Re: [elm-discuss] Re: Effects.tick vs Time.fps

2016-11-15 Thread Nick H
On second thought, maybe it was not the best idea to resurrect a thread whose title refers to two functions that no longer exist... On Tue, Nov 15, 2016 at 1:09 PM, Nick H <falling.maso...@gmail.com> wrote: > Thread... resurrected! > > Just wanted to mention that I took the ga

Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-15 Thread Nick H
> > What do you think about my suggestion in previous reply ? replacing > List.range with List.(..) operator ? Forgive me if somebody has already pointed this out, but it is very easy to write such a function yourself. (..) : Int -> Int -> List Int > (..) a b = List.range a b > If this is

Re: [elm-discuss] Re: Effects.tick vs Time.fps

2016-11-15 Thread Nick H
Thread... resurrected! Just wanted to mention that I took the game loop pattern and wrapped it up in a library . If anyone has feedback on the API, I would love to hear it. I went with something that made sense to me, but... well,

Re: [elm-discuss] What do you think about Eve?

2016-11-15 Thread Nick H
Also, the flappy bird example doesn't render properly in Firefox, at least for me. On Tue, Nov 15, 2016 at 11:27 AM, Nick H <falling.maso...@gmail.com> wrote: > Embedding the code in its documentation is a very interesting idea. I can > see it being very useful for tutorials

Re: [elm-discuss] What do you think about Eve?

2016-11-15 Thread Nick H
Embedding the code in its documentation is a very interesting idea. I can see it being very useful for tutorials & libraries. (The examples were pleasant to read through.) But generally I try to avoid comments in favor of making the code self-documenting. Comments are a liability -- it's easy for

Re: [elm-discuss] Help for article review for SPA applications in Elm 0.18

2016-11-15 Thread Nick H
I wonder if you could run the example on gh-pages? That way the links will work (instead of linking to localhost). I've not ever used the navigation & url-parser packages, so some of this was new to me. I like the way the program develops incrementally. Thanks for sharing! On Tue, Nov 15, 2016

Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-15 Thread Nick H
It was indeed: https://groups.google.com/forum/#!topic/elm-discuss/ehtYLofp3TE Responses ranged from "I'd rather get rid of it" to "I like it, but I wouldn't complain if it went away." There was also a lovely tangent about Hoogle. Nobody was worried at that time that changing the syntax would

Re: [elm-discuss] port Maybe field behavior

2016-11-10 Thread Nick H
I think this would be a reasonable change. The maybe decoder in Json.Decode already works this way. On Thu, Nov 10, 2016 at 2:35 PM, Kasey Speakman wrote: > So something that I just tripped

Re: [elm-discuss] Animation not very smooth.

2016-11-06 Thread Nick H
sically annoying but still playable, on Firefox it is >> not playable. >> >> Thanks, >> >> Le jeudi 3 novembre 2016 02:33:35 UTC+1, Nick H a écrit : >>> >>> I am guessing your viewGrid function is slowing your code down. This >>> funct

Re: [elm-discuss] Animation not very smooth.

2016-11-02 Thread Nick H
I am guessing your viewGrid function is slowing your code down. This function is creating a new mesh and passing it to the GPU on every animation frame. The solution is to make sure your WebGL.Drawable (line 465, where it says "GL.Lines gridPoints") is a constant. So extract that into its own

Re: [elm-discuss] Re: zip function in the standard library

2016-10-26 Thread Nick H
It's not the *standard* library, but this function and a ton of other List stuff is available in elm-community/list-extra On Tue, Oct 25, 2016 at 11:07 AM, wrote: > I agree with Luis and Gulshan. Having a

Re: [elm-discuss] Proposal: Add Debug.breakpoint to core

2016-10-24 Thread Nick H
is just a convenience, > not a necessity. > > mandag 24. oktober 2016 19.34.53 UTC+2 skrev Nick H følgende: >> >> Don't forget, the time-travelling debug mode is coming in 0.18. Do you >> think setting breakpoints like this is still going to be useful? >> >> On Mon

Re: [elm-discuss] Proposal: Add Debug.breakpoint to core

2016-10-24 Thread Nick H
Don't forget, the time-travelling debug mode is coming in 0.18. Do you think setting breakpoints like this is still going to be useful? On Mon, Oct 24, 2016 at 5:59 AM, Robin Heggelund Hansen < skinney...@gmail.com> wrote: > Elm, as great as it is, doesn't save you from debugging every once in a

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-23 Thread Nick H
rap the records in union type > constructors." This is the idea I will be exploring next, thank you for the > recommendation. > > > > On Sunday, October 23, 2016 at 6:19:38 PM UTC-7, Nick H wrote: >> >> I guess you weren't explicitly defining type aliases for thos

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-23 Thread Nick H
I guess you weren't explicitly defining type aliases for those records. But still, I think you might be able to salvage the API if you wrap the records in union type constructors. On Sun, Oct 23, 2016 at 6:10 PM, Nick H <falling.maso...@gmail.com> wrote: > If you are trying to make a

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-23 Thread Nick H
If you are trying to make a recursive type definition, you need to use union types. E.G. This is not OK: type alias Session = { speaker : Speaker } type alias Speaker = { sessions : List Session } But this will compile. type Session = Session { speaker : Speaker } type Speaker = Speaker {

Re: [elm-discuss] Looking for subcomponent example to learn from

2016-10-23 Thread Nick H
Hmm, I haven't used that library, so I won't be of much help. On Sun, Oct 23, 2016 at 11:57 AM, Brian Marick <mar...@roundingpegs.com> wrote: > > On Oct 22, 2016, at 7:56 PM, Nick H <falling.maso...@gmail.com> wrote: > > Which of these elements can fire events? I

Re: [elm-discuss] Looking for subcomponent example to learn from

2016-10-22 Thread Nick H
Which of these elements can fire events? Is the text at the bottom the only place where the user can interact? If so, then the graphical elements up top can just be functions that take whatever data is needed to draw them. ivDrip : IvData -> Html a clock : Time -> Html a On Sat, Oct 22, 2016

Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Nick H
What if you added a third value to the ReadState type? type ReadState = Read | Unread | Marked Then your filtered view will show both Unread and Marked. When the user refreshes, you can map all the Marked items to Read. On Thu, Oct 20, 2016 at 12:43 AM, Jacky See wrote: >

Re: [elm-discuss] How to write function that updates arbitrary element of a record

2016-10-19 Thread Nick H
This kind of problem (access to arbitrary elements) is usually better solved by a Dict than a record. In this case, you could try something like: type NumberText = FloatText String | IntText String type alias Model = Dict Key NumberText type Msg = UpdateField Key String update : Msg -> Model

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Nick H
t; `function` bar corresponds to bar |> function foo rather than foo |> > function bar is wrong? > ​ > > 2016-10-19 9:55 GMT+02:00 Nick H <falling.maso...@gmail.com>: > >> N >> >> On Wed, Oct 19, 2016 at 12:34 AM, Janis Voigtländer < >> j

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Nick H
N On Wed, Oct 19, 2016 at 12:34 AM, Janis Voigtländer < janis.voigtlaen...@gmail.com> wrote: > > 2016-10-19 9:27 GMT+02:00 Nick H <falling.maso...@gmail.com>: > >> The only situation where backticks are useful is when you are doing a >> single funct

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Nick H
Re: primes. Totally agree with Peter. One prime is kinda nice for a temporary variable, but beyond that... you can add a short word to your variable name, and then you won't have to do any counting! Re: backticks. Evan's explanation from elm-dev: The backtick syntax is neat, but ultimately, it

Re: [elm-discuss] Offtopic Choo Framework

2016-10-17 Thread Nick H
What do you find hard about learning Elm? We want Elm to be friendly to beginners. It would be helpful to hear about your experience! On Mon, Oct 17, 2016 at 9:08 AM, António Ramos wrote: > Hello guys just trying to learm Elm but its not easy. > I just found this js

Re: [elm-discuss] Updating an image in the view.

2016-09-26 Thread Nick H
The URL can be changed dynamically, but if it doesn't change, you don't have to worry about the program re-generating the img element 30 times a second... that sort of thing gets optimized by the Virtual DOM. On Mon, Sep 26, 2016 at 8:50 PM, Nick H <falling.maso...@gmail.com> wrote: >

Re: [elm-discuss] Updating an image in the view.

2016-09-26 Thread Nick H
img element but I'm not sure how to get the image > data into that img element. > > On Monday, September 26, 2016 at 7:18:33 PM UTC-4, Nick H wrote: >> >> If all you are doing is loading an image from a URL, why don't you use an >> img <http://package.elm-lang.org

Re: [elm-discuss] Updating an image in the view.

2016-09-26 Thread Nick H
If all you are doing is loading an image from a URL, why don't you use an img element? Canvas sounds like overkill. On Sun, Sep 25, 2016 at 7:16 PM, Redvers Davies wrote: > > I'm still too early in elm to know

Re: [elm-discuss] Re: pattern matching on a field within a record

2016-09-24 Thread Nick H
Re: your initial post... you could rewrite the code as case Maybe.map .cell c of Just (Letter s) -> s _ -> "" Don't know if that's any easier to read, though. Regarding null_square: If you want to make sure that null_square is passed by reference, you can define it as a top-level

  1   2   >