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
elm-make issues :) > > On Friday, March 3, 2017 at 11:50:27 PM UTC+2, Nick H wrote: >> >> 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 al

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 wrote: > (and Attr is an alias for Html.Attributes) > > On Mon, Feb 27, 2017 at 10:16 AM, Nick H > wrote:

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 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 not work for me. > > Here is

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
g >> 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. elm-http was migrated fr

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 libraries. They seem

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

2017-01-22 Thread Nick H
(Two bivectors are equal when their parallelograms have equal areas and are in the same plane. That's where the redundancy comes in.) On Sun, Jan 22, 2017 at 11:09 PM, Nick H wrote: > In the same way that a vector is usually represented by a line segment, a > bivector can be repre

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] Modeling units of measure with phantom types

2017-01-22 Thread Nick H
Here: Is length*mass torque or momentum? > I think the quantities you meant to compare are torque and energy (both of which have units of force*length). The only reason I bring it up is because it points to some interesting design problems. Energy is always a scalar (one numeric component). Torq

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

2017-01-20 Thread Nick H
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 fun trying :-)

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 var

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 notation

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 wrote: > I would come down on the side of very very wrong. Functions can't be > converted into strings, and they can't be ch

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 a

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

2017-01-17 Thread Nick H
ssed? 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 soon, be

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 type

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 this error message: > > `

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] Random Examples (learning)

2017-01-02 Thread Nick H
The Random module has a lot of functions for building up more complicated random values from the primitives. So you usually shouldn't have to batch commands for this stuff. For example, you could use Random.pair type Msg = Roll | NewFaces (Int, Int) update msg model = case msg of Roll ->

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 Tu

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

2016-12-23 Thread Nick H
> the font, etc but it feels like re-inventing the wheel :/ > > On Thursday, December 22, 2016 at 5:44:26 PM UTC+1, Nick H wrote: >> >> 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

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 a

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 whether

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 Monday, December 12,

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 wrote: > There's nothing in the standard libraries (that I know of) to help with > number formatting. There

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 for

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 wrote: > If you want something that can hold arb

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? E

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, wh

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 ru

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 query strings that are

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 more specific about what conc

Re: [elm-discuss] Re: [elm-dev] Re: 0.17 Tasks vs Cmds

2016-12-10 Thread Nick H
So in your vision, it sounds like subscriptions would go away as well? Or would they become an abstraction for some sort of task port interaction? On Sat, Dec 10, 2016 at 2:34 PM, Mark Hamburg wrote: > In the case of ticks, what I gather from a read through of the code that > it does is guarante

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&c=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 wa

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 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 expect a -> b -> b

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 exp

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

2016-12-09 Thread Nick H
ight 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 someV

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 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 audio support yet, so that wou

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 checked hackage >

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 doing?

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

2016-12-09 Thread Nick H
You can also do equality tests on type values, which means in your first two cases you can use an if statement. if someValue == A then stuff1 else stuff2 This only works if your type values aren't storing any data. On Fri, Dec 9, 2016 at 7:25 AM, Petr Huřťák wrote: > Hi, > > I would like h

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 conn

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 wrote: > No traveling!? I think this should be called the Archeological Debugger. :) > > On Mon, Dec 5, 2016 at 1:35 PM, Nick H wrote: > >> Thanks for sharin

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 > the stack overflow. As th

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 debugger is running? I've heard

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 that with effects managers,

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 interfac

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 only returning commands i

Re: [elm-discuss] Ducked Inference

2016-11-29 Thread Nick H
"we can be stronger by being nicer" :-) I agree, I like type annotations. Important documentation that is checked by the compiler, and is right there in your code. Every time I've tried writing a lot of Elm or Haskell code without annotations, I've wound up with confusing compiler bugs. Because I

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 wrote: > There is no process for adding new packages

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

2016-11-29 Thread Nick H
There is no process for adding new packages to the whitelist. Everything on there, besides some newer elm-lang packages, has been around since version 0.16. But that aside, you should never use native modules if there is another option. On Tue, Nov 29, 2016 at 10:58 AM, Ed Ilyin wrote: > What i

Re: [elm-discuss] Inter triplets communication.

2016-11-29 Thread Nick H
2016 at 6:45 AM, 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 about this > &

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 elm-stuff/build-arti

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, focusing on > simplifying css as

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 lo

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", "Sub

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

2016-11-26 Thread Nick H
on. 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 is &

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 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 going to add much more. > > On Sun,

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 outputs 175K > (67K min

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 goin

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

2016-11-26 Thread Nick H
2016 at 12:57 PM, 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 is > > int : Int -> Rational > > Then converting back you have the normal round/

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 26,

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 chatte

Re: [elm-discuss] How to structure the code for a PersonSection widget?

2016-11-23 Thread Nick H
PersonType and PersonTypeSpecificValues can be combined into one type: type alias Model = { person : Person } type Person = Individual IndividualFields | Company CompanyFields As for how to handle model updates, I think there are a few things to consider. What types of updates are possi

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 add

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 a

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 which has no > payload. >

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

2016-11-21 Thread Nick H
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 the

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

2016-11-21 Thread Nick H
Nope. On Mon, Nov 21, 2016 at 10:27 AM, Rex van der Spuy wrote: > Hi Everyone, > > Is it possible to pass model properties as message arguments and use those > arguments to construct a new model? > > For example, the only difference between these two messages is the model's > properties: > >

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 `act

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

2016-11-20 Thread Nick H
"Nothing" and "Just 2" are noun phrases. "Something 2" is nonsense, from a grammatical point of view. How about we call it "The 2"? On Sun, Nov 20, 2016 at 9:33 AM, Will White wrote: > "Something 2" makes more sense to me in the context of Maybe than "Just 2". > > > On Sunday, November 20, 2016

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

2016-11-20 Thread Nick H
sing 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, Nick H a écrit :

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 Elm 0.18. I > wrote down

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

2016-11-19 Thread Nick H
time 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

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

2016-11-18 Thread Nick H
em, 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 wrote: >> >>> I h

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 (evancz/elm-http) I had been able

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

2016-11-18 Thread Nick H
n Fri, Nov 18, 2016 at 12:37 AM, Nick H wrote: > I am looking at the github page for that project, and it's > elm-package.json > <https://github.com/tortus/elm-array-2d/blob/5462efa4ebfd6e2600c5c227a8337f4258d44f08/elm-package.json> > says something different: > >

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 < 0.1

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 subscribed to the Googl

[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 subscriptio

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 wrote: > Thread... resurrected! > > Just wanted to mention that I took the game loop pattern and wrapped it

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 somet

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, y

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 wrote: > Embedding the code in its documentation is a very interesting idea. I can > see it being very useful for tutorials & libraries. (The examples wer

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 t

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 at

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 dri

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 over... > > If you're bringin

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

2016-11-06 Thread Nick H
able, 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 >>> function is creating a new mesh and passing

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 top-

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 "zip" function without a

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

2016-10-24 Thread Nick H
point function 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? >

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
cords 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 those record

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 wrote: > If you are trying to make a recursive type definition, you

  1   2   3   >