[elm-discuss] timeout in unit test

2017-11-17 Thread Max Goldstein
No, there is no way to do this currently. You can open an issue on GitHub if you want to discuss further. -- 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] Re: Proposal: move Random.Extra.constant to Random

2017-10-26 Thread Max Goldstein
I also think it’s a good idea. I’ve brought it up with Evan and Richard before. But I can tell you from experience that getting changes merged into the Random module is very difficult. Also, shameless plug for mgold/elm-random-pcg, which includes this and many other useful functions built on a

[elm-discuss] Looking for pretty printers written in Elm?

2017-07-03 Thread Max Goldstein
Can you please tell us more about what you are trying to pretty print (JSON?) and why (restraints, assumptions, etc)? -- 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

[elm-discuss] Re: Rails integrations issues

2017-06-24 Thread Max Goldstein
Assuming that works as described, you should think about sending a PR upstream. -- 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

Re: [elm-discuss] Is it possible to write a general tree-fold function?

2017-06-09 Thread Max Goldstein
I will add that you are using z when you define _l and _r but you only need to use it once. Also, a good test case is to write an in-order traversal on a binary search tree that will return the keys in sorted order. -- You received this message because you are subscribed to the Google

Re: [elm-discuss] Platform.Cmd.batch executes commands in reverse order

2017-05-12 Thread Max Goldstein
"independently, concurrently, in the order they're provided" This is a contradiction. Even if the runtime started the tasks at the same time, the works they do can complete in any order. Either your code (Elm or otherwise) should work with any ordering, or you should sequence things in Elm

[elm-discuss] Re: Missing json decoding tool to decode multitouch events cleanly

2017-05-06 Thread Max Goldstein
What about something like this? decodeTouches : Decoder (List Touch) decodeTouches = Decode.field "length" Decode.int |> Decode.andThen (\len -> case len of 1 -> Decode.map (\a -> [ a ])

Re: [elm-discuss] List of all members of a union type

2017-05-03 Thread Max Goldstein
Building on Charles, how would this handle recursive union types? -- 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

Re: [elm-discuss] Literature reviews repo

2017-05-01 Thread Max Goldstein
Why don't you open a PR and see what people think? :) I'm also in favor of having a folder of sample apps to demonstrate the current best practice, and anything else that would be useful. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To

[elm-discuss] Literature review of requested features

2017-04-30 Thread Max Goldstein
I'm salvaging this idea from the "moving on" thread. Basically, some features like audio playback, binary data, task ports, and so on have been commonly requested. I'd like to propose that the advocates of these features do some of the pre-code legwork. This is more of a literature review than

[elm-discuss] Re: Looking for a better way to use `andThen` chains (and other beginner questions)

2017-04-23 Thread Max Goldstein
> > If you're looking for a somewhat broader background on data modeling in > Elm, this talk is a must-watch: Making Impossible States Impossible > Sorry, looks like the YouTube link got put at the top of the post. -- You received this message because you are subscribed to the Google Groups

[elm-discuss] Re: Looking for a better way to use `andThen` chains (and other beginner questions)

2017-04-23 Thread Max Goldstein
https://www.youtube.com/watch?v=IcgmSRJHu_8Instead of lists with numbered items, have you thought about using a dictionary ? Something like this? import Dict exposing (Dict) type alias No = Int type alias Game = { stars : Dict No

[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-23 Thread Max Goldstein
Yes, Ian is correct. Html.Attributes.map : (a -> msg) -> Attribute a -> Attribute msg Html.map : (a -> msg) -> Html a -> Html msg -- You

[elm-discuss] Re: Call of init function behaviour

2017-04-10 Thread Max Goldstein
init is not a function. It is a constant value. It will be evaluated immediately and, if you've wired things up right, referred to in main. If you have a message that triggers a state reset, it's not crazy to reuse the init value. But it sounds like it's getting used when you don't want it to

Re: [elm-discuss] Re: Post Examples of Painful Record Updates Here!

2017-03-20 Thread Max Goldstein
@art, I disagree about adding arbitrary expressions between { and |. You should use a let-binding for something like *Array.get (offset + i) arrayOfRecords |> Maybe.withDefault defaultRecord*. I know this is supposed to be pain points, not solutions, I'm going to try to coalesce some of the

[elm-discuss] Re: Unit testing questions and TDD

2017-03-16 Thread Max Goldstein
I'm not aware of any really good examples of full webapp tests; maybe it's time to write some? That said, Have you see strategies for effective testing ? It's been updated a bit on master since the last release. Is

[elm-discuss] Re: Request for idioms / announcement of a possible book

2017-03-14 Thread Max Goldstein
> 1. I have a chapter on `Maybe` that treats it as a type with several > idioms around it. Does the chapter make sense to you more experienced Elm > programmers? > In case you haven't heard me say it, *Maybe is a data structure*. Things like map and andThen make a lot of sense in that

[elm-discuss] Re: Decoder for Recursive Type

2017-03-12 Thread Max Goldstein
Try using Json.Decode.andThen to decode just the tag, and then with that information decide which other decode you want. You will be able to use decoders recursively this way because the self-reference will be inside a function. -- You received this message because you are subscribed to the

Re: [elm-discuss] Re: Divide by zero?

2017-02-20 Thread Max Goldstein
I don't think anyone likes that 2 // 0 == 0, but no one has a better idea. I don't like the idea of the standard libraries writing to the console in a way you can't turn off, but a console.warn statement might allow the bug to be caught in development. Although it would need a source map to be

Re: [elm-discuss] Is type inference in Elm fully decideable?

2017-02-20 Thread Max Goldstein
Records can still be useful in union types if you have more than a few fields, or multiple fields of the same type. Often you write a function that updates a record by looking at a select few fields and it never needs to know about others. Occasionally you will have multiple records of this

Re: [elm-discuss] Is type inference in Elm fully decideable?

2017-02-15 Thread Max Goldstein
I honestly don't know if your code "should" typecheck or not, but if it did, it wouldn't do anything more than what you already have. The function you pass would only have access to the rect field. I think this code would be simpler, and no less expressive, if the function argument was

Re: [elm-discuss] Starting Elm, need help understanding -> syntax

2017-02-13 Thread Max Goldstein
Yes, exactly, functions always take exactly one argument and return exactly one result. A few caveats, though. Either that argument or result can be a tuple or record that holds multiple values. And the result may itself be a function, hence currying. -- You received this message because

[elm-discuss] Re: Giving elm-vim some love

2017-02-05 Thread Max Goldstein
I would love to see better vim support, but I don't have the vimscript knowledge either to make it happen. -- 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

Re: [elm-discuss] Architecture Pattern: Separating Model and ViewState

2017-02-03 Thread Max Goldstein
No, it's not really an interest of mine anymore. In the year since this post I've refocused onto elm-test and its dependencies. I never got much evidence on whether this is a worthwhile pattern or not. -- You received this message because you are subscribed to the Google Groups "Elm Discuss"

[elm-discuss] Re: Svg without getBBox?

2017-02-02 Thread Max Goldstein
Try it with ports. If that's helpful, it could possibly be added to the DOM package: https://github.com/elm-lang/dom -- 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

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

2017-01-22 Thread Max Goldstein
> > I think the quantities you meant to compare are torque and energy (both of > which have units of force*length). > Yup, sorry. > Torque, although sometimes expressed as a scalar or a vector, is actually > best represented as a bivector (two components per spatial dimension in > whatever

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

2017-01-19 Thread Max Goldstein
As John Kelly pointed out to me in another thread, there's a trick called a "phantom type" that's possible in Elm. It's where a union type has a type variable that's not used on the right side. If you don't expose the constructor, you can use the type to only allow values that have come

[elm-discuss] Re: [early prototype] Elm-Data: a server loading code generator

2017-01-18 Thread Max Goldstein
Rupert, I've been doing something very similar and it is proving very worthwhile, > so I would encourage you to pursue this. > Thanks (: > For Elm, I output one (big) file called Model.elm, that gives me the data > model mapped onto Elm, and encoders and decoders for it. Then for each >

[elm-discuss] [early prototype] Elm-Data: a server loading code generator

2017-01-17 Thread Max Goldstein
Hi everyone, I've been thinking for several months now about a useful abstraction for loading data from the server. It's painful to work with HTTP and JSON directly because you lack: caching, logic to not send a request already in flight again, error handling, and so on. I came upon the idea

[elm-discuss] Re: Dealing with invalid state transitions

2017-01-17 Thread Max Goldstein
You could model your data using the RemoteData library on elm-package, and use the map function to apply changes only to loaded data. -- 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

Re: [elm-discuss] Re: Guidance for using "type alias" vs. single-constructor union types

2017-01-16 Thread Max Goldstein
I did not know F# supported that, which is good news. It means that there's feasible, theoretically sound way of solving this problem. In Elm, it would require making the mathematical operations aware of units and therefore even more "special" that the *number* not-a-typeclass. But units still

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

2017-01-16 Thread Max Goldstein
The function String -> a is called eval, and it's not coming to Elm because it would break all kinds of type guarantees. You can implement functions from String to a specific concrete type, although that type will have to have some notion of failure or emptiness if it's not wrapped in a Maybe

[elm-discuss] Re: Guidance for using "type alias" vs. single-constructor union types

2017-01-16 Thread Max Goldstein
It's tempting to want something like type clone Name = String type clone Currency = Int type alias Accounts = Dict Name Currency These hypothetical "type clones" would act like their base type until you tried to use them in nonsensical ways. But trying to define their behavior is tricky. The

Re: [elm-discuss] Re: [Suggestion] Type values and simplifying the language still

2017-01-15 Thread Max Goldstein
* rereads * Janis, you are incredibly good at telling people that they're wrong. Ah, I got caught up in the third paragraph about the native representation, and thought that those were Elm records, not JavaScript objects. Also, the phrase "No type value has more than one value", for all of its

[elm-discuss] Re: [Suggestion] Type values and simplifying the language still

2017-01-15 Thread Max Goldstein
First, I appreciate that this proposal is being made in the spirit of Elm: seeking to simplify the language, with reference to existing usage (red sentence in the first post), and trying to solve an existing problem (serialization of union types). It's clear that Maxime wants to learn and

[elm-discuss] Re: pattern match sum type inside a record inside a Maybe

2017-01-11 Thread Max Goldstein
What about: case Dict.get id model.displayables |> Maybe.map .view of -- 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.

[elm-discuss] Re: Type Alias Question

2017-01-07 Thread Max Goldstein
Maybe this will help: all record types already exist when the type checker starts. Even though there are no terms of that type, you could write x = { bar = "foo" } and that value will be assigned the type { bar : String }, notice the equals in the value and the colon in the type. So, type

[elm-discuss] Re: Type specific messages

2017-01-02 Thread Max Goldstein
This sounds fine to me. It's certainly a lot better than: type Msg = SwitchCowToExpandedReadOnly | SwitchCowToCollapsedReadOnly | SwitchCowToReadWrite | SwitchChickenToCollapsedReadOnly | ... I think it largely hinges on your ability to separate orthogonal behavior as separate types.

Re: [elm-discuss] Re: Feature: 'where' expressions (continued from GitHub)

2016-12-31 Thread Max Goldstein
I think it's pretty obvious at this point that this is another classic "internet argument" in which nothing is really resolved and no one changes their minds. That's because there isn't single concrete example or use-case that definitively proves one side is superior. In which case, things

[elm-discuss] Re: Feature: 'where' expressions (continued from GitHub)

2016-12-30 Thread Max Goldstein
> > Let/in leads to a sort of vertigal zig zagging as you need to jump to the > bottom then scan backwards for the supporting information. This seems subjective and somewhat dependent on code style. Do you have an example where sequentially reading the bindings causes confusion ("why would

[elm-discuss] Re: Feature: 'where' expressions (continued from GitHub)

2016-12-30 Thread Max Goldstein
Those in favor of where clauses, would you mind summarizing any arguments from the thread that do not rely on personal preference but concrete improvements to code readability or maintainability, in a way not achieved by Joey's suggestion? We are looking for code examples in which

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2016-12-28 Thread Max Goldstein
> > Task.succeed () |> Task.andThen \_ -> do hard stuff > Sorry, that should be Task.map not Task.andThen. -- 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

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2016-12-28 Thread Max Goldstein
Regarding the pain of wiring up a subscription port, have you seen Task.perform ? It allows you to do async work using no ports other than The Elm Architecture itself. As for doing pure but computationally intensive work

[elm-discuss] Re: Our little, failed Elm 0.18 deployment

2016-12-22 Thread Max Goldstein
If you have a polyfill to fix a 17 -> 18 regression, you should make a pull request to core, or at least write up a blog post explaining the problem and solution. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group

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

2016-12-20 Thread Max Goldstein
This restriction is annoying, but it's easy to relax later (from an API perspective, maybe not an implementation one). -- 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

Re: [elm-discuss] Formating numbers

2016-12-16 Thread Max Goldstein
You should go for it! Here's a guide I wrote on publishing a package: https://medium.com/@Max_Goldstein/how-to-publish-an-elm-package-3053b771e545?source=linkShare-a81ca980bdb1-1481936793 And here is a JS library that does formatting, which you can use for inspiration:

[elm-discuss] Re: How to use Dict.empty?

2016-12-11 Thread Max Goldstein
If you can isolate an sscce of the bad error message, you can report it to the catalog . -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this

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

2016-12-11 Thread Max Goldstein
You're going to be more specific about what concerns you about the current format. The Elm community likes to work together towards solutions, not get into debates. To that end, the tooling and conventions create a multi-layered system of documentation: As in any language, *code comments* are

[elm-discuss] How to use Dict.empty?

2016-12-11 Thread Max Goldstein
It would be helpful if you showed us more context, including the definitions of your record type aliases. -- 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

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

2016-12-09 Thread Max Goldstein
In addition to the underscore pattern (meh - makes it easy to forget about a case added later) and refactoring types, I can also recommend extracting a function. You still have to have n cases but each of them will be short. -- You received this message because you are subscribed to the

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

2016-12-09 Thread Max Goldstein
Fold takes arguments in the same order as update: the element and then the accumulator. Don't trust partial application of infix ops unless you know they are commutative. Write a lambda instead. -- You received this message because you are subscribed to the Google Groups "Elm Discuss"

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

2016-12-07 Thread Max Goldstein
You know about Json.Decode.andThen, right? It lets you chain callbacks that decode the JSON based on previous decoding passes. -- 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,

[elm-discuss] Re: Make `+12` mean 12, not `+ 12`

2016-12-07 Thread Max Goldstein
>From the title and first paragraph I thought you were proposing a language >change. But it looks like you're just talking about String.toInt. If that's >correct, it seems reasonable to allow this. (Perhaps hex as well?) -- You received this message because you are subscribed to the Google

[elm-discuss] Re: One month with Elm, two questions

2016-12-06 Thread Max Goldstein
Oops, that second annotation should be viewHelper : { a | name : String } -> Html Msg -- 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] Re: One month with Elm, two questions

2016-12-06 Thread Max Goldstein
I see now. You want to see a UI widget in many possible states for the purposes of seeing a visual regression. (By "widget", I mean some piece of HTML generated by a function, not the loaded word "component", which usually implies state. Although it could be either.) Without saying too much, I

[elm-discuss] Re: One month with Elm, two questions

2016-12-05 Thread Max Goldstein
Hi Frankie, thanks for trying Elm, glad you like it! > But why isn't the ability to create fuzzy records/data available outside > that package? What I usually do is to stub out the UI given a certain model > type. Being able to call fuzzy generators in my Main namespace to populate > the

Re: [elm-discuss] Re: Pattern matching using existing bound variables

2016-12-05 Thread Max Goldstein
That's exactly Maybe.withDefault "something", which is a great example of partial application. -- 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] Re: How to Modularize Big Files?

2016-12-02 Thread Max Goldstein
Yes, that is exactly the file structure I had in mind. Let me know if you run into trouble. If you extract another module, it should import Common and be imported by Main, just like View. Because of this 1-n-1 structure, I think of this as a diamond. -- You received this message because you

Re: [elm-discuss] Cmd.andThen

2016-11-30 Thread Max Goldstein
Austin, you're exactly correct. Cmd is meant to be passed out to the runtime, that's it. The reason Http allows you to skip Task is for learnability. You can make a simple request without learning what a Task is. But we shouldn't be hobbled by that when we want to compose different types of

Re: [elm-discuss] Cmd.andThen

2016-11-29 Thread Max Goldstein
Hmm. I want to say it's an issue with the library, but fixing it would involve changing a fair amount of code and using the low level Websocket API. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop

Re: [elm-discuss] Ducked Inference

2016-11-29 Thread Max Goldstein
It's an interesting perspective, but Matz is doing what's right for ruby. Ruby is dynamically typed; Elm is statically typed. Ruby is mature and has a lot of users counting on stability; Elm is pre-1.0 and has a smaller, more adventurous user base. Granted we have upgrade guides and elm-format

Re: [elm-discuss] Cmd.andThen

2016-11-29 Thread Max Goldstein
Http has an escape hatch to get a Task. Other libraries should do the same. Cmd is deliberately simple, with the hard work being done in Task. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving

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

2016-11-28 Thread Max Goldstein
Hi Matt! I looked at the documentation and these are my thoughts. - The last example has the Title line twice. Copypasta? - It looks like this only works well if Style is imported as a (..) import. I think you make a good case for this usually-discouraged feature. However, I think

[elm-discuss] Re: Random.list

2016-11-26 Thread Max Goldstein
Oh, and I'm obliged to say: this function will never terminate if you pass it the wrong predicate, so be careful about that! "Wrong" might mean unsatisfiable (or always satisfied, depending on how you want it to work), or not satisfied by any element generated, for example, (\n -> n > 100) for

[elm-discuss] Re: Random.list

2016-11-26 Thread Max Goldstein
You can do this, but you have to define something that *should* be defined for you (and is by random-extra and elm-random-pcg): Random.constant. import Random constant x = Random.map (always x) Random.bool listUntil : Random.Generator a -> (a -> Bool) -> Random.Generator (List a) listUntil

[elm-discuss] Whither Rationals?

2016-11-26 Thread Max Goldstein
What problem are you trying to solve that you can't do with Floats? -- 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

[elm-discuss] Re: How to use Navigation library

2016-11-25 Thread Max Goldstein
One of the main benefits of routing/navigation is that a user can bookmark or send a URL to someone else, and the website loads up in the correct state. Option number 1 seems like it would handle this case naturally. I'm not sure how it would work for option number 2. -- You received this

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

2016-11-24 Thread Max Goldstein
Regarding simple type systems, experiments, and language features for library authors -- finding the right abstraction is hard. In 0.18, there's an HTTP abstraction, so you can run requests in parallel (but not arbitrary effects: racing a file read and a file delete is a bad idea!). Then

Re: [elm-discuss] Elm experience - proposal for additions to List and Random core libraries

2016-11-22 Thread Max Goldstein
I think List.get has been avoided since it seems imperative, and requires the use of Maybes. If you expect an item to be there, use a different data structure, or use an Array which has better time complexity. I agree completely on Random.constant. Random.permutation is available in

Re: [elm-discuss] Unpublishing a package

2016-11-21 Thread Max Goldstein
What about a way to hide packages during search (unless you ask for them), but still be available to download? -- 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] Re: Proposal: Shorter qualified imports

2016-11-20 Thread Max Goldstein
It's tedious to write, and slightly tedious to read, but Elm thinks that *tedium is better than mystery* and anything implicit or shortcut-like would be mysterious. Elm also doesn't like having multiple ways to do things. -- You received this message because you are subscribed to the Google

[elm-discuss] Suggested edit to Json.Decode docs

2016-11-16 Thread Max Goldstein
That's probably an oversight. Yes, docs for core should not reference a third-party library. -- 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

Re: [elm-discuss] 0.18 Below the Hood

2016-11-15 Thread Max Goldstein
My impression is that it's a Haskell extension that's very commonly used. In the process of upgrading, I uncommented some signatures only for the compiler to tell me that they are incorrect, so this feature has been useful already. Oh, and almost forgot: flipping the argument order for

[elm-discuss] 0.18 Below the Hood

2016-11-15 Thread Max Goldstein
I'm personally looking forward to three longstanding bugs being fixed. First, recursive definitions like x = x are caught by the compiler. Second, a bug caching compiled forms of modules has been resolved, forcing a rebuild when necessary. Finally, let-bound values can be given type annotations

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

2016-11-15 Thread Max Goldstein
If someone was so tenuously commuted to Elm that this syntax removal drives them away, oh well. Yes, the Elm language is getting smaller. That's been true for a few releases now. Evan is trying to remove hurdles for new users (because we need a lot of new users!), not preserve legacy code (Elm

Re: [elm-discuss] port Maybe field behavior

2016-11-10 Thread Max Goldstein
I also think this is reasonable, although it's possible there's something I'm missing. -- 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] A spawned task cannot produce a result?

2016-11-10 Thread Max Goldstein
So, I'm mostly speculating here, but could you use Task.andThen to get the ID, which you then use to kill the task that updates the security token, if necessary? -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group

Re: [elm-discuss] Re: Is Elm really wrong?

2016-11-10 Thread Max Goldstein
Okay, fair enough, we shouldn't aspire to piss off anyone. Also, I apologize for speaking for everyone instead of just me. What I meant was, Elm needs to choose differently from Haskell, at least some of the time, or else there wouldn't be a reason for it to exist. And, what seems weak and

Re: [elm-discuss] Re: Is Elm really wrong?

2016-11-10 Thread Max Goldstein
"We" means the Elm community. I did not know that records are not comparable. I suppose they aren't useful as Dict keys, and we have sortBy .field for sorting lists of them. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from

[elm-discuss] Re: Is Elm really wrong?

2016-11-10 Thread Max Goldstein
More coherent post here... first, don't freak out, this is from April. I think I've seen it before. One argument that's at least worth debating is: There is no map function, but there are List.map, Dict.map, Array.map among > others, and none of them are related to one another. This is not

[elm-discuss] Re: Is Elm really wrong?

2016-11-10 Thread Max Goldstein
+1 to Peter's post, and relatedly: when is a 7-element tuple more useful than a record with named fields? For any purpose, not just comparison? -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving

Re: [elm-discuss] How do I subscribe to an event at a fixed point in time?

2016-11-08 Thread Max Goldstein
Could you run Time.now andThen calculate the amount of time left until expiry, then Process.sleep until then? -- 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

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-24 Thread Max Goldstein
I would love more Ruby-like names across the board, except for the presence of aliases, but Elm grew out of Haskell so it carries some of that history. It really comes down to what Evan wants to do. People come to Elm from many languages, and everyone has preferences. Changing things makes

[elm-discuss] Re: Naming functions

2016-10-24 Thread Max Goldstein
If you're going to refer to items by ID a lot, you should probably use a dictionary keyed on ID. Assuming items is a record with an id field: { model | items = model.items |> Dict.insert updatedItem.id updatedItem } -- You received this message because you are subscribed to the Google

[elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-20 Thread Max Goldstein
Normally I'm opposed to syntax or name changes. But I think this or some variation is a good idea. (Maybe foldl becomes fold, since it's usually the one you want.) That said, it's all subject to Evan's approval. -- You received this message because you are subscribed to the Google Groups

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

2016-10-19 Thread Max Goldstein
Hey folks, this really should be on the dev list. That said I agree with most of what's been said here. The place I'll miss primes the most is actually the grammatical possessive: root'sValue, etc. But that's not a huge deal. -- You received this message because you are subscribed to the

Re: [elm-discuss] Elm Test building custom generators

2016-10-16 Thread Max Goldstein
Fuzz.map4, which I think was only added in 2.1.0 so that's why Zachary didn't see it in August. -- 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

Re: [elm-discuss] Task.perform stops working when performed from an imported module

2016-10-10 Thread Max Goldstein
Well... what was the problem? -- 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: Why does this not work via record intersection

2016-10-09 Thread Max Goldstein
You need a rather non-obvious piece of syntax: make_xword : { a | rows : Int, cols : Int } -> Xword This basically means that the input is a record with rows and cols, and any other fields. The origin of this syntax is that any record *a*, as long as it's extended with these fields, is

Re: [elm-discuss] View: Model -> Html Msg

2016-10-08 Thread Max Goldstein
Syntactically, it's just like List Int. Msg is a type parameter of Html. Semantically, Html is not a data structure. It's a somewhat magical thing that can produce messages when the user interacts with it. The type parameter tells you what those messages are. -- You received this message

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Max Goldstein
Yes, Result is worth looking at. It's like Maybe, except the error case can carry some information too (usually a string). Task is used for asynchronous effects (e.g. HTTP requests) which often can fail in odd ways. I'd focus on Result for now, as all the tooling I'm about to mention is the

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

2016-10-05 Thread Max Goldstein
Thank you for your kind words, Joel. If 0.18 debugging totally breaks an animations, I'll think of something. These are some valid concerns but I haven't seen a smoking gun yet. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe

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

2016-10-05 Thread Max Goldstein
Zinggi: My objection is that the easing function is part of the logical identity of the animation. It's tedious to keep track of the function separately. Also, animation concepts like velocity and retargetting rely on the easing function. "The same animation with a different easing function"…

[elm-discuss] Re: How to decode a recursive JSON from a port?

2016-10-05 Thread Max Goldstein
To clarify Rupert: try removing the JSON.stringify call. Elm expects actual objects, not a string representation of objects. I think. -- 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

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

2016-10-04 Thread Max Goldstein
Serialization: animations are view state. They can safely be left out of a serialized and persisted model. Print out the model: True, but if you're using animation in an app, you're beyond poking at the model in the REPL. Harder to equate: My animation library provides an "equals" function. In

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

2016-10-04 Thread Max Goldstein
Hi, I'm the author of the second library you mentioned. It's natural to represent easing functions as, well, functions. One way to avoid this would be to change (or supplement) elm-community/easing-functions to contain a big union type of

[elm-discuss] Re: Is over-use of 'let... in' considered an anti-pattern?

2016-10-04 Thread Max Goldstein
> > ... anyway I hope you get the idea. > If the real code was this short, I'd suggest inlining it, but the real code is probably long enough to warrant this style. > they start to *resemble *OO/imperitive style variable assignments > But they're not. You can't assign to the same value more

[elm-discuss] Re: [ANN] typed-format 1.0.0

2016-10-03 Thread Max Goldstein
Looks like a good package, thanks for contributing! My feedback is, rather than have functions with many arguments that you have to name in the docs, why not take a record instead? You can even provide a default. prettyFloat

Re: [elm-discuss] Re: Random in 0.17 and purity

2016-09-25 Thread Max Goldstein
Hi Andrew, The official docs are harder to change than I'd like, but I welcome docs issues and PRs to my library: https://github.com/mgold/elm-random-pcg Eventually the RNG will replace core's, and hopefully I'll be able to update the docs at that time. -- You received this message

Re: [elm-discuss] Re: Random in 0.17 and purity

2016-09-25 Thread Max Goldstein
Hi Andrew, The official docs are harder to change than I'd like, but I welcome docs issues and PRs to my library: https://github.com/mgold/elm-random-pcg Eventually the RNG will replace core's, and hopefully I'll be able to update the docs at that time. -- You received this message

  1   2   >