Re: [elm-discuss] What is the purpose of this board?

2016-07-13 Thread Will White
I think https://github.com/elm-lang/error-message-catalog/issues is the 
place for the error message.

On Monday, July 11, 2016 at 10:56:05 PM UTC+1, Nick H wrote:
>
> Please do not make a new thread to list them all. Most of them are likely 
> to have been brought up before.
>
> The most useful place for quality issues to be brought up is in the Github 
> issue tracker for the relevant project (in the example you mention above, 
> check the elm compiler project .) 
> But before posting the issue, do a search to see if it has been raised 
> before, and what the current status is.
>
> This mailing list also has a long history. Search for the topics you are 
> interested in  to 
> see what people have discussed in the past. If you want to continue an old 
> discussion, you can start a new thread, but try to build on what has 
> already been said.
>
>  The best threads are the ones that focus on a single topic. If you have 
> multiple things to bring up, start multiple threads.
>
> On Mon, Jul 11, 2016 at 2:41 PM, John Bugner  > wrote:
>
>> If you have taken the time to learn Elm to a level where you start to 
>>> understand its core values
>>>
>> I think I'm already at that point. I like that Elm values simplicity and 
>> clarity, even if it means bucking the current convention. For example, I 
>> think switching from the Haskellian keywords 'data' and 'type' to the more 
>> obvious keywords 'type' and 'type alias' was a move in the right direction. 
>> Talking about Haskell, I've explained to people before that 'data' defines 
>> a type and 'type' defines an alias, and it always confused them a little. 
>> ("Why doesn't 'type' just define a type?" they say.) Sure, it's too late to 
>> change it in Haskell now, but at least Elm got it right!
>>
>> I like that Evan has put so much effort into making the compiler give 
>> useful descriptions of errors and how to resolve them. But, I ran into this 
>> unhelpful error message the other day: 
>>
>> I need whitespace, but got stuck on what looks like a new declaration. 
>> You are
>> either missing some stuff in the declaration above or just need to add 
>> some
>> spaces here:
>>
>> 3| import ModuleToImport
>>^
>> I am looking for one of the following things:
>>
>> whitespace
>>
>>  
>> But what caused the error? Not the lack of whitespace! I just forgot to 
>> add an 'exposing' clause to 'module' declaration. Sure, the error says "You 
>> are
>> either missing some stuff in the declaration above", but it mentions 
>> needing whitespace three times, and needing an 'exposing' clause zero 
>> times. I could see a newbie to Elm getting confused and stuck on this error 
>> because of the unhelpful error message. I admit though that I'm not 
>> familiar with Elm's compiler, so I don't know how easy or hard it would be 
>> to change the error message, and what other situations it would affect.
>>
>> I have many other thoughts for small improvements like this. Should I 
>> simply make a new thread that lists them all? I fear a bit that people 
>> will think that I'm just splitting many petty hairs though.
>>
>> regarding (2) if one creates a project that follows the [elm packages 
>> guidelines](http://package.elm-lang.org/help/design-guidelines) all they 
>> have to do is just publish it and wait a little bit for the caches of the 
>> website to refresh. 
>> After publishing a package, you are able to use it (install it with 
>> elm-package) but it take a little bit of time until it is listed as a valid 
>> package.
>>
>> Also, concerning (2), 
>> https://github.com/elm-lang/elm-package/blob/master/README.md#publishing-packages
>>  
>> 
>>  
>>
>> Thank you, I will read those pages and try it out.
>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: [ANN] elm-mdl 6.0.0 released

2016-07-13 Thread Håkon Rossebø
You seem to use the demo folder "as is". The demo uses the Material source 
directly from source references in elm-package.json. To use it without 
source, you need to reference elm-mdl in elm-package.json like this

 "dependencies": {
   "debois/elm-dom": "1.2.0 <= v < 2.0.0",
   "debois/elm-mdl": "6.0.0 <= v < 7.0.0",
   "debois/elm-parts": "2.0.0 <= v < 3.0.0",



onsdag 13. juli 2016 06.44.27 UTC+2 skrev David Legard følgende:
>
> I've always wanted to check out this package, but it never compiles for me.
>
> After downloading the demo, I always see the message, on compile:
>
> I cannot find module 'Material'.
>
> Module 'Main' is trying to import it.
>
> Potential problems could be:
>   * Misspelled the module name
>   * Need to add a source directory or new dependency to elm-package.json
>
>

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] I dislike the names of certain standard library functions.

2016-07-13 Thread John Bugner
I dislike the names of certain standard library functions. Below, I list 
each one and explain why I dislike it.

(1) Basics.max, Basics.min, List.maximum, List.minimum
(a) The names 'max' and 'min' do not clearly convey what these functions 
do. When I see 'max 13 10' or '3 `max` 10', I think of the sentence '13 
maximum of 10', with 2 separate meanings, but both lead me astray! (I'm 
still not sure what phrase/sentence I'm supposed to think of that makes 
these function names make sense.
(i) I expect it to return 10; 'max' sets the upper bound, of course!
(ii) I expect it to return False, as if I was standing in front of an 
express checkout line, and checking whether I was under the limit.
(b) 'max' and 'min' are needlessly truncated, going against the Elm style 
guidelines 
( http://package.elm-lang.org/help/design-guidelines#use-human-readable-names 
):
>Abbreviations are generally a silly idea for an API. Having an API that is 
clear is more important than saving three or four characters by dropping 
letters from a name.
(c) I have a feeling that these names were kept just because that's what 
older languages (Haskell, C++, etc) have done. If Elm is serious about 
putting usability first, it shouldn't be afraid of breaking with the 
unclear past tradition to start a new clear tradition. (I note that Elm has 
already done this in the past when it replaced the keywords 'data' and 
'type' with 'type' and 'type alias'.)
(d) I suggest changing the names to 'greater', 'lesser', 'greatest', and 
'least'. These names clearly describe what each function does: It returns 
the *greater* or the *lesser* of 2 values, or the *greatest* or *least* of 
a list of values, and makes the connection with (>) and (<), which are 
pronounced  'greater than' and 'less than', more obvious.

(2) (&&), (||)
(a) These names needlessly use uncommon symbols where names of letters: 
('and' and 'or') would work perfectly fine. People already pronounce the 
functions that way anyways! (And if they don't, then they're probably 
confused, which just proves my point.) Again, this is against Elm style 
guidelines.
(b) The Bitwise module uses the names 'and', 'or', and 'xor' for its 
bitwise functions, but the boolean functions are '(&&)', '(||)', and 'xor'. 
Why do they share 'xor' but not the others? There should be one pattern, 
not two.
(c) Again, I think these functions are named this way to mimic older 
languages. Thus, I must ask, again, is Elm about putting usability first 
and making things clear? (especially for beginners who may never have 
programmed before), or maintaining the poorly-named status quo?

(3) List.member
(a) This function returns of boolean, but its name is a noun. How strange! 
I've seen coding standards that would never allow this, because a function 
that returns a boolean must be a *verb*, not a noun! When I read the name, 
I expect it to return an item from the list, not a boolean about whether a 
value is in the list.
(b) I suggest changing the name to 'isMember', 'isMemberOf', 'contains', or 
(what I think is the simplest) 'has'.
(c) A small downside: The last two don't work well as an infix function. I 
suppose 'member' is trying to look like JS and Python 'in', but I've never 
written 'member' (or Haskell 'elem') as an infix function.
(d) There could also be a dedicated function for 'not <<< has', (where 
(<<<) composes the functions correctly) which could be called 'lacks', 
because it's easier to think of the concept with one name instead of two 
combined. (I don't expect many people to agree with this though...)

(4) List.filter
(a) The problem is that I forget (more often than I would like to admit) 
whether the function filters the items by *keeping* the items that satisfy 
the predicate, or filters the items by *tossing out* the items that satisfy 
the predicate.
(b) I suggest the clearer and shorter names 'keep' or 'take'.
(c) A downside: For 'take', the old 'take' would have to change to 
'takeFront', 'takeFirst', or something else.
(d) There could also be a dedicated function for 'filter (not << f)', which 
could be called 'toss' (in the sense of 'throw away'), 'discard', or 'drop' 
(Again, the old 'drop' would have to change.), because, again, it's easier 
to think of the concept with one name instead of two combined. (Also, I 
think a name like Python's 'itertools.filterfalse' is unclear and 
annoyingly long.)
(e) Evan himself has already voiced his own distaste for the name 'filter' 
in this thread ( 
https://groups.google.com/forum/#!searchin/elm-discuss/filter$20list/elm-discuss/4PSA48ws5JU/nkEAXRLftEAJ
 
), but strangely, it seems that nothing ever happened afterwards! The 
thread just sorta fizzled out and people forgot about it. I bring this up 
again, because I strongly believe that a function this common and important 
should have a simple and clear name that doesn't confuse people. (Indeed, I 
would be fine with the names 'keepIf' and 'dropIf' for these functions as 
that thread sugg

[elm-discuss] Re: I dislike the names of certain standard library functions.

2016-07-13 Thread Maximilian Hoffmann
Thanks! This post was much better than the title suggested.

In my opinion these are all valid points, but not as urgent as other 
problems people currently have with Elm. I’m sure Evan will revisit the 
naming of functions once major pain points of the language have been 
addressed. From my experience the good thing about Elm is that it’s not 
afraid of making breaking changes (e.g. dropping FRP entirely in 0.17), so 
renaming the standard library is unlikely to be a problem if people agree 
there are better ones.

This will be the icing on the cake. I’m sure it will happen, but not now.

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Use Html special attributes which are not yet implemented in Elm

2016-07-13 Thread Diego Aviles
Hi there!

I've been interested in the Elm Architecture for a while and I've been 
given permisson from my team to work on a side project to test it out and 
see if we can start to implement Elm step by step. We are looking to create 
a more high-performance UI, but it's important that our rendered HTML and 
JS works with our existing stack of technologies, one of them being e.g. 
Bootstrap.

*Problem: *I currently have a very specific problem, but will try to avoid 
the XY problem and abstract it to a more general problem which could be 
useful for more people. I have the following HTML snippet:




Which I want to translate to elm (snippet):


[ button [type' "button, class "...", dataToggle "dropdown"] []


with the latter part of course not doing anything. I know there are some 
efforts to port bootstrap components 

 to elm and that I could emulate the same behaviour with an Elm Dropdown. But 
for compatibility purposes I wish I could just use special Attributes (e.g. 
"data-toggle", not yet implemented in Elm) to use bootstrap accordingly.


*Take on solution:* I tried to look in the elm-source code and write a 
*dataToggle 
Attribute *myself, but that did not work. *Question:* Is there a way to 
just pass attributes to elm and have it compile it to js to include such 
special Attributes? (Also for example when using React or other frameworks)

import Html exposing (Html, button, Attribute)
import Html.App as Html
import Html.Attributes exposing (..)
import Json.Encode as Json

...

[ button [class "example", dataToggle "dropdown"] []

...

stringProperty : String -> String -> Attribute msg
stringProperty name string =
  property name (Json.string string)

dataToggle : String -> Attribute msg
dataToggle value =
   stringProperty "data-toggle" value


Thanks in advance!

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: [ANN] elm-mdl 6.0.0 released

2016-07-13 Thread David Legard
OK, thanks.

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Use Html special attributes which are not yet implemented in Elm

2016-07-13 Thread Janis Voigtländer
It’s unclear, to me, from your message why neither
http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-Attributes#property
nor
http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-Attributes#attribute
lets you do what you want.
​

2016-07-13 12:03 GMT+02:00 Diego Aviles :

> Hi there!
>
> I've been interested in the Elm Architecture for a while and I've been
> given permisson from my team to work on a side project to test it out and
> see if we can start to implement Elm step by step. We are looking to create
> a more high-performance UI, but it's important that our rendered HTML and
> JS works with our existing stack of technologies, one of them being e.g.
> Bootstrap.
>
> *Problem: *I currently have a very specific problem, but will try to
> avoid the XY problem and abstract it to a more general problem which could
> be useful for more people. I have the following HTML snippet:
>
> 
>
>
> Which I want to translate to elm (snippet):
>
>
> [ button [type' "button, class "...", dataToggle "dropdown"] []
>
>
> with the latter part of course not doing anything. I know there are some 
> efforts to port bootstrap components 
> 
>  to elm and that I could emulate the same behaviour with an Elm Dropdown. But 
> for compatibility purposes I wish I could just use special Attributes (e.g. 
> "data-toggle", not yet implemented in Elm) to use bootstrap accordingly.
>
>
> *Take on solution:* I tried to look in the elm-source code and write a 
> *dataToggle
> Attribute *myself, but that did not work. *Question:* Is there a way to
> just pass attributes to elm and have it compile it to js to include such
> special Attributes? (Also for example when using React or other frameworks)
>
> import Html exposing (Html, button, Attribute)
> import Html.App as Html
> import Html.Attributes exposing (..)
> import Json.Encode as Json
>
> ...
>
> [ button [class "example", dataToggle "dropdown"] []
>
> ...
>
> stringProperty : String -> String -> Attribute msg
> stringProperty name string =
>   property name (Json.string string)
>
> dataToggle : String -> Attribute msg
> dataToggle value =
>stringProperty "data-toggle" value
>
>
> Thanks in advance!
>
> --
> 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 https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Use Html special attributes which are not yet implemented in Elm

2016-07-13 Thread Diego Aviles
The latter option is certainly what I was looking for and it works just 
fine. Thank you. I am mad with myself, spent to much time looking for a 
solution which basically had no real problem. It always boils down to: Read 
the Docs *completly* before Googling.

Herzlichen Dank!

Am Mittwoch, 13. Juli 2016 12:38:30 UTC+2 schrieb Janis Voigtländer:
>
> It’s unclear, to me, from your message why neither 
> http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-Attributes#property
>  
> nor 
> http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-Attributes#attribute
>  
> lets you do what you want.
> ​
>
> 2016-07-13 12:03 GMT+02:00 Diego Aviles  >:
>
>> Hi there!
>>
>> I've been interested in the Elm Architecture for a while and I've been 
>> given permisson from my team to work on a side project to test it out and 
>> see if we can start to implement Elm step by step. We are looking to create 
>> a more high-performance UI, but it's important that our rendered HTML and 
>> JS works with our existing stack of technologies, one of them being e.g. 
>> Bootstrap.
>>
>> *Problem: *I currently have a very specific problem, but will try to 
>> avoid the XY problem and abstract it to a more general problem which could 
>> be useful for more people. I have the following HTML snippet:
>>
>> 
>>
>>
>> Which I want to translate to elm (snippet):
>>
>>
>> [ button [type' "button, class "...", dataToggle "dropdown"] []
>>
>>
>> with the latter part of course not doing anything. I know there are some 
>> efforts to port bootstrap components 
>> 
>>  to elm and that I could emulate the same behaviour with an Elm Dropdown. 
>> But for compatibility purposes I wish I could just use special Attributes 
>> (e.g. "data-toggle", not yet implemented in Elm) to use bootstrap 
>> accordingly.
>>
>>
>> *Take on solution:* I tried to look in the elm-source code and write a 
>> *dataToggle 
>> Attribute *myself, but that did not work. *Question:* Is there a way to 
>> just pass attributes to elm and have it compile it to js to include such 
>> special Attributes? (Also for example when using React or other frameworks)
>>
>> import Html exposing (Html, button, Attribute)
>> import Html.App as Html
>> import Html.Attributes exposing (..)
>> import Json.Encode as Json
>>
>> ...
>>
>> [ button [class "example", dataToggle "dropdown"] []
>>
>> ...
>>
>> stringProperty : String -> String -> Attribute msg
>> stringProperty name string =
>>   property name (Json.string string)
>>
>> dataToggle : String -> Attribute msg
>> dataToggle value =
>>stringProperty "data-toggle" value
>>
>>
>> Thanks in advance!
>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: handling URL params in ELM

2016-07-13 Thread William Bailey
All good - phew.  Thanks Peter!  

So it turns out the urlParser you hand to Navigation.program gets invoked 
on the initial URL before the call to init happens, and the output of 
urlParser feed into init.  This was not obvious to me from the 
documentation nor the examples I found, which are more about setting the 
URL or responding to URL monkeying.

Here is the skeleton of how to do it, for anyone interested.

--bill

import Navigation

-- Test program to extract the deal value from a URL like:
--deepfinesse.com/demo.html?deal=AQ752.KJ.843.T96

-- Model will hold the deal (eg) "AQ752.KJ.843.T96"
type alias Model = String

-- Our urlUpdate is a NO-OP as we don't care to change the URL nor respond 
to URL monkeying
main =
  Navigation.program urlParser
{ init = init
, view = view
, update = update
, urlUpdate = (\_ model -> (model, Cmd.none))
, subscriptions = subscriptions
}

-- locRec is provided by the system and locRec.search looks like 
"?deal=AQ752.KJ.843.T96"
urlParser : Navigation.Parser String
urlParser =
  let
-- define our parsing function
extractDealFromUrl locRec =
  String.dropLeft 6 locRec.search
  in
Navigation.makeParser extractDealFromUrl

-- The system calls urlParser on the initial URL and passes the result to 
init
init : String -> (Model, Cmd Msg)
init dealFromUrl =
   (dealFromUrl, Cmd.none)

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: Sending messages up the component tree in Elm 0.17

2016-07-13 Thread Erik Lott
Sandi, one way to manage component to component communication is to use 
ports and subscriptions:
https://groups.google.com/d/msg/elm-discuss/i99LBvYSkpY/yQyk6WB0AAAJ

Hope that helps.

On Thursday, July 7, 2016 at 1:50:41 PM UTC-4, Sandi Dušić wrote:
>
> In Elm 0.16 the Architecture tutorial had one more button list example 
> 
>  (I 
> dug that up from an old commit), aside from this one 
> .
>  
> Each counter would have it's own remove button which would remove that 
> exact one when clicked, unlike in the simpler example with a sole remove 
> button that removes the first counter. This was accomplished by passing two 
> addresses to the counter view, one for it's own actions and another which 
> it's father component (CounterList) handled, used for signaling removal. 
>
> I did the exact same thing in my application. I have a bunch of small 
> components in a big component, and the big component needs to know when one 
> of the small ones has been clicked. How do you do this in 0.17? Is it 
> impossible, since they removed the example which is supposed to implement 
> it?
>
> This is the only thing I can think of: Add the message that needs to be 
> sent upwards to the big component to the message union of the small 
> component (in the CounterList, this would mean Counter.Msg has Remove). 
> When the big component gets a small component action, it would first check 
> with an if whether it's the one it needs to handle (if msg == 
> Counter.Remove then ...). If so, it can handle it (remove the Counter), 
> otherwise it would just regularly pass it to Counter.update.
>
> To me that seems like it goes against the principles of Elm Architecture. 
> You can no longer treat components (and especially their actions) like 
> black boxes, but rather you have to tear them apart in a way. They cannot 
> fully define their interface. I don't know, it's just weird.
>
> If there's a way to define custom subscriptions they might be leveraged to 
> solve this, but I don't see a way to do that in the API. I apologize if 
> this is a silly question, 0.17 is still new to me.
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Re: [ANN] elm-mdl 6.0.0 released

2016-07-13 Thread Søren Debois
Hi Dedo,

In the Mega Footer demo should some elements be dropdowns? They don't work
in current Chrome/OSX.

The “Dropdowns” are dropdowns only on small devices. If you resize your
browser, they should become proper dropdown.

Also, in Layout / Color, any color selection results in a transient blue
color flash. Any idea what might be causing that?

Changing the color scheme involves re-loading CSS. The browser seems to
revert to some default while waiting to load the color-scheme specific CSS
off Google’s servers.

(Changing the theme like the demo does is not something I envision doing in
production code.)

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: I dislike the names of certain standard library functions.

2016-07-13 Thread Galfarragem
I would add to the discussion also the abbreviations in types (Msg, Cmd ..)

( 
http://package.elm-lang.org/help/design-guidelines#use-human-readable-names
 )

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] List.sortBy browser dependance?

2016-07-13 Thread Mark Green
It appears that the functionality of List.sortBy is semi-browser dependent
when the sorting function is a partial ordering.

My current version of Firefox sorts according to the partial order, and
within ties, maintains the order from the original list. However, user
reports have been that some other browsers sort according to the partial
order and apply arbitrary order within ties, which is obviously problematic.

Is there a way around this and could a work-around be added to the library?

Mark

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] List.sortBy browser dependance?

2016-07-13 Thread Nick H
For a workaround, all you need to do is use List.sortWith instead.

sortBy uses JavaScript's native array sorting function under the hood. The
JS function is documented as being unstable

(order not preserved when two elements are equal). Sounds like it might be
good to add a documentation note.

On Wed, Jul 13, 2016 at 8:10 AM, Mark Green  wrote:

> It appears that the functionality of List.sortBy is semi-browser dependent
> when the sorting function is a partial ordering.
>
> My current version of Firefox sorts according to the partial order, and
> within ties, maintains the order from the original list. However, user
> reports have been that some other browsers sort according to the partial
> order and apply arbitrary order within ties, which is obviously problematic.
>
> Is there a way around this and could a work-around be added to the library?
>
> Mark
>
> --
> 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 https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] List.sortBy browser dependance?

2016-07-13 Thread Janis Voigtländer
Isn’t List.sortWith using exactly the same unstable JS sorting function
under the hood?
​

2016-07-13 17:22 GMT+02:00 Nick H :

> For a workaround, all you need to do is use List.sortWith instead.
>
> sortBy uses JavaScript's native array sorting function under the hood. The
> JS function is documented as being unstable
> 
> (order not preserved when two elements are equal). Sounds like it might be
> good to add a documentation note.
>
> On Wed, Jul 13, 2016 at 8:10 AM, Mark Green  wrote:
>
>> It appears that the functionality of List.sortBy is semi-browser
>> dependent when the sorting function is a partial ordering.
>>
>> My current version of Firefox sorts according to the partial order, and
>> within ties, maintains the order from the original list. However, user
>> reports have been that some other browsers sort according to the partial
>> order and apply arbitrary order within ties, which is obviously problematic.
>>
>> Is there a way around this and could a work-around be added to the
>> library?
>>
>> Mark
>>
>> --
>> 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 https://groups.google.com/d/optout.
>>
>
> --
> 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 https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] List.sortBy browser dependance?

2016-07-13 Thread Nick H
You're right. I was assuming that the problem was that we get different
behaviors in different browsers.

If your goal is to have identical results on all platforms, use sortWith
and specify a comparison function that never returns EQ.

But if your goal is to preserve the original order when elements are
identical, you can't do that with the standard library.

On Wed, Jul 13, 2016 at 8:40 AM, Janis Voigtländer <
janis.voigtlaen...@gmail.com> wrote:

> Isn’t List.sortWith using exactly the same unstable JS sorting function
> under the hood?
> ​
>
> 2016-07-13 17:22 GMT+02:00 Nick H :
>
>> For a workaround, all you need to do is use List.sortWith instead.
>>
>> sortBy uses JavaScript's native array sorting function under the hood.
>> The JS function is documented as being unstable
>> 
>> (order not preserved when two elements are equal). Sounds like it might be
>> good to add a documentation note.
>>
>> On Wed, Jul 13, 2016 at 8:10 AM, Mark Green  wrote:
>>
>>> It appears that the functionality of List.sortBy is semi-browser
>>> dependent when the sorting function is a partial ordering.
>>>
>>> My current version of Firefox sorts according to the partial order, and
>>> within ties, maintains the order from the original list. However, user
>>> reports have been that some other browsers sort according to the partial
>>> order and apply arbitrary order within ties, which is obviously problematic.
>>>
>>> Is there a way around this and could a work-around be added to the
>>> library?
>>>
>>> Mark
>>>
>>> --
>>> 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 https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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 https://groups.google.com/d/optout.
>>
>
> --
> 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 https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Markdown library

2016-07-13 Thread Esteban Manchado Velázquez
Hi,

I'm trying to use the Markdown library (evancz/elm-markdown) and I cannot 
seem to be able to make it work. I ran:

   elm-package install evancz/elm-markdown

and got version 3.0.0, apparently the only one that works with Elm 0.17, 
what I'm using. However, when I try to compile the project, it complains:

   elm-make: 
elm-stuff/build-artifacts/0.17.1/evancz/elm-markdown/3.0.0/Markdown.elmo: 
openFile: does not exist (No such file or directory)

The directory exists, but only has a file graph.dat. However, in 
elm-stuff/packages I can see what seems to be the whole distribution, with 
Markdown.elm and Native/Markdown.js.

Is that a bug somewhere, did I do something stupid?

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: List.sortBy browser dependance?

2016-07-13 Thread Frederick Yankowski


A workaround I’ve used to get stable sorting in Javascript is to add an 
artificial index, sort with that as a secondary sort parameter, and then 
strip that index off from the result.

To sort a list of int-pairs in Elm it could go like this:

stableSort : List (Int, Int) -> List (Int, Int)
stableSort ps =
  ps
  |> List.indexedMap (,)
  |> List.sortBy (\(i, (a, _)) -> (a, i))
  |> List.map snd

On Wednesday, July 13, 2016 at 10:10:57 AM UTC-5, Mark Green wrote:

It appears that the functionality of List.sortBy is semi-browser dependent 
> when the sorting function is a partial ordering.
>
​

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: Elm logo copyright / usage guidelines

2016-07-13 Thread Ray Toal
I'm bringing this up again because I'd like to use the Elm Logo in a book.

Do we bother Evan directly?


On Saturday, March 26, 2016 at 11:56:55 AM UTC-7, Erik Simmler wrote:
>
> Does anyone know the formal copyright status of the Elm logo?
>
> We'd like to put a modified version of the Elm logo on this page 
> http://exercism.io/languages with proper attribution here 
> https://github.com/exercism/exercism.io/blob/master/ATTRIBUTION.md
>
> Does anyone have any hints or existing usage guidelines before I bug Evan 
> directly? I assume he technically holds the copyright, but I wanted to 
> check in here first in case I'm missing something.
>
> Thanks!
>

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: I dislike the names of certain standard library functions.

2016-07-13 Thread danneu
I think it does more harm to redefine existing functions like `take` and 
`drop` which exist in other languages. Instead, it always seems better to 
introduce new names or reuse existing ones.

Elm does seem to have an issue with not only an ultra-conservative standard 
library but also an inconsistent one, like the lack of `List.singleton`. 

If the standard library sponged up the most uncontroversial low-hanging 
fruit from the *.Extra libraries, it'd be a nice quality of life 
improvement for all.

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: I dislike the names of certain standard library functions.

2016-07-13 Thread Ray Toal
There're a few good suggestions there.

One thing that caught my eye was 5a, (List.singleton). No lambda is 
needed singleton is just the function repeat 1. But yeah, consistency 
with the other collection types would be nice.

(And I'm sure #6 is a non-starter let's give beginners some credit for 
being able to learn a word. We all did. :) )

On Wednesday, July 13, 2016 at 1:31:37 AM UTC-7, John Bugner wrote:
>
> I dislike the names of certain standard library functions. Below, I list 
> each one and explain why I dislike it.
>
> (1) Basics.max, Basics.min, List.maximum, List.minimum
> (a) The names 'max' and 'min' do not clearly convey what these functions 
> do. When I see 'max 13 10' or '3 `max` 10', I think of the sentence '13 
> maximum of 10', with 2 separate meanings, but both lead me astray! (I'm 
> still not sure what phrase/sentence I'm supposed to think of that makes 
> these function names make sense.
> (i) I expect it to return 10; 'max' sets the upper bound, of course!
> (ii) I expect it to return False, as if I was standing in front of an 
> express checkout line, and checking whether I was under the limit.
> (b) 'max' and 'min' are needlessly truncated, going against the Elm style 
> guidelines ( 
> http://package.elm-lang.org/help/design-guidelines#use-human-readable-names 
> ):
> >Abbreviations are generally a silly idea for an API. Having an API that 
> is clear is more important than saving three or four characters by dropping 
> letters from a name.
> (c) I have a feeling that these names were kept just because that's what 
> older languages (Haskell, C++, etc) have done. If Elm is serious about 
> putting usability first, it shouldn't be afraid of breaking with the 
> unclear past tradition to start a new clear tradition. (I note that Elm has 
> already done this in the past when it replaced the keywords 'data' and 
> 'type' with 'type' and 'type alias'.)
> (d) I suggest changing the names to 'greater', 'lesser', 'greatest', and 
> 'least'. These names clearly describe what each function does: It returns 
> the *greater* or the *lesser* of 2 values, or the *greatest* or *least* of 
> a list of values, and makes the connection with (>) and (<), which are 
> pronounced  'greater than' and 'less than', more obvious.
>
> (2) (&&), (||)
> (a) These names needlessly use uncommon symbols where names of letters: 
> ('and' and 'or') would work perfectly fine. People already pronounce the 
> functions that way anyways! (And if they don't, then they're probably 
> confused, which just proves my point.) Again, this is against Elm style 
> guidelines.
> (b) The Bitwise module uses the names 'and', 'or', and 'xor' for its 
> bitwise functions, but the boolean functions are '(&&)', '(||)', and 'xor'. 
> Why do they share 'xor' but not the others? There should be one pattern, 
> not two.
> (c) Again, I think these functions are named this way to mimic older 
> languages. Thus, I must ask, again, is Elm about putting usability first 
> and making things clear? (especially for beginners who may never have 
> programmed before), or maintaining the poorly-named status quo?
>
> (3) List.member
> (a) This function returns of boolean, but its name is a noun. How strange! 
> I've seen coding standards that would never allow this, because a function 
> that returns a boolean must be a *verb*, not a noun! When I read the name, 
> I expect it to return an item from the list, not a boolean about whether a 
> value is in the list.
> (b) I suggest changing the name to 'isMember', 'isMemberOf', 'contains', 
> or (what I think is the simplest) 'has'.
> (c) A small downside: The last two don't work well as an infix function. I 
> suppose 'member' is trying to look like JS and Python 'in', but I've never 
> written 'member' (or Haskell 'elem') as an infix function.
> (d) There could also be a dedicated function for 'not <<< has', (where 
> (<<<) composes the functions correctly) which could be called 'lacks', 
> because it's easier to think of the concept with one name instead of two 
> combined. (I don't expect many people to agree with this though...)
>
> (4) List.filter
> (a) The problem is that I forget (more often than I would like to admit) 
> whether the function filters the items by *keeping* the items that satisfy 
> the predicate, or filters the items by *tossing out* the items that satisfy 
> the predicate.
> (b) I suggest the clearer and shorter names 'keep' or 'take'.
> (c) A downside: For 'take', the old 'take' would have to change to 
> 'takeFront', 'takeFirst', or something else.
> (d) There could also be a dedicated function for 'filter (not << f)', 
> which could be called 'toss' (in the sense of 'throw away'), 'discard', or 
> 'drop' (Again, the old 'drop' would have to change.), because, again, it's 
> easier to think of the concept with one name instead of two combined. 
> (Also, I think a name like Python's 'itertools.filterfalse' is unclear and 
> annoyingly long.)
> (e) Evan himself ha

[elm-discuss] Re: [ANN] elm-mdl 6.0.0 released

2016-07-13 Thread Aislan de Sousa Maia
The button's animations are buggy, right now. I'm using Firefox 47.0.

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Re: I dislike the names of certain standard library functions.

2016-07-13 Thread Max Goldstein
It's great that Elm can appeal to new programmers, but it's mainly 
targeting web developers. As such, things like max/min, ||/&&, and "string" 
are going to stick around. No need to reinvent what's been standard(-ish) 
since C.

The biggest name annoyance, IMHO, is *filter*. It doesn't immediately 
convey whether you're selecting in or out. For my money, Ruby got this one 
right: *select* and *reject*. They sound similar and they are similar, and 
the names convey which way the predicate goes. I wouldn't be adverse to 
stealing a few other Ruby or near-Ruby names; perhaps List.includes instead 
of member, and reduce to replace foldl (dropping foldr and renaming it fold 
could also work).

That said, I'm not convinced much of this will happen. Evan is a "big 
picture" guy, and this would break a lot of code, although deprecation 
(having both copies for awhile) could help.

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Improve Elm docs.

2016-07-13 Thread Nir Galon
Hi,
I'm a Python developer, and I"m just getting into elm.
I start by reading the documentation and I notice an error in core_language 
 page. I try to find the 
website source code and do a PR, but with no success (found the website 
source code, but the docs isn't there).
The error is in `Records` section, when it says `A record is a set of 
key-value pairs, similar to objects in JavaScript or Python.` - It's 
actually not true in Python, In Python key-value pairs called 
`dictionaries`.
So the true sentence should by: `A record is a set of key-value pairs, 
similar to objects in JavaScript and dictionaries in Python`.

I would appreciate any help on how to find the source code so I can do a PR 
and fix this.
Nir Galon

-- 
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 https://groups.google.com/d/optout.


[elm-discuss] Set.fromList crashing

2016-07-13 Thread Zachary Kessin
When I try to do Set.fromList on this list I am getting elm to crash with
this error I think its a sorting error. I have not had a chance to reduce
it down to a smaller case yet

TypeError: _p0 is undefined

if (_p0.ctor === 'RBEmpty_elm_builtin') {


["1271762438561282616_218752125","1287040804540231664_1677848937","1288548618290149758_2511941698","1288947417522063849_3108919599","1291471725586284461_1702392360","1292785630832658348_3501246668","1293313211663381941_1745411573","129177087941384_2133161","1293335126171936748_1514397658","1293335196183438381_2302853679","1293337174024764594_605353295","1293339271956828728_3537987797","1293341223607968157_1760727","1293341234119468014_2889219787","1293341248195402085_269177096","1293341522150232655_2101444328","1293341598570137104_1062880563","1293343106875326185_3273260","1293343277802389272_6026774","1293345284541576219_1660712096","1293347478120405230_1390290175","1293347480226651417_310632554","1293347548374920192_234991802","1293349192953984294_569632697","1293351678397363788_1928841879","1293355234764208046_1699171629","1293355566098024975_1698513599","1293358581315770177_3879224","1293361454354985345_2241249004","1293363598324419526_1005030389","1293364660036696805_2005812465","1293365327551470471_51961874","1293365704905209100_1226003196","1293365808529193836_246586106","1293366948104600957_3500079240","1293367015012938065_1077334376","1293367312111405949_1012088867","1293369398065613922_2224337803","1293369592126747760_3320531291","1293371438920710226_3320531291","1293371649147619807_1967962180","1293372453699770644_998494259","1293373609204639793_3320531291","1293374371562017510_2352004036","1293375457944704141_3320531291","1293375769297176490_21091863","1293381470555352120_2105449252","1293381473265355333_145717604","1293381802794474737_181746102","1293381861556788900_2105449252","1293383848096465835_449276965","1293384095761712584_50643","1293385824989481787_20811406","1293387716746109588_1699171629","1293389722135934286_1673831222","1293389841287016752_181920614","1293393698646599389_34850037","1293393732980970842_1170796077","1293393789637065759_2067117228","1293393841537496148_1972361324","1293395036880762547_174055835","1293395206338880684_1481220617","1293395874902328009_1138061234","1293395938504995431_2105449252","1293403631429506242_2025834471","1293405575908288311_7439158","1293405849981489972_247713440","1293405903576178412_381010358","1293406098468806121_11811747","1293407205941217185_426613819","1293409632463427825_9220337","1293411769117331728_18931218","1293411788335677100_2010143609","1293411883697500658_18931218","1293414089070131765_3322294631","1293414667951965710_2060708823","1293417699518735719_397891274","1293418002020421540_487351755","1293419904758534395_3146251739","1293419995934247649_519492512","1293421848239152787_336429428","1293422082708925467_306635303","1293422101852400619_2042539278","1293423827891761977_2947573039","1293423873844406127_257590060","1293423876461686145_1360804327","1293424121711219202_301909080","1293427703026574404_296821256","1293429059556449666_207850771","1293429802979627184_3152243858","1293429927626034472_857869776","1293432182593276598_321340221","1293432215082230189_294333532","1293433904212779845_943492134","1293433979046935096_332716890","1293435935027332654_2277647333","1293436122084844338_602925161","1293437844828537991_3531104977","1293452141163205176_2078553039","1293452175423179054_286078980","1293452232365154211_1023469721","1293457620719844791_3410264625","1293458020009131604_244545808","1293462260878262443_2271363950","1293464312966703351_265895878","1293466444218802226_2331674879","1293470120693698302_356554490","1293472239974863813_3085474270","1293473328959175532_2977935581","1293476279064741442_3540087645","1293476481104504206_2007850037","1293478290334293713_3018536772","129347835111735_3540430715","1293478468306137427_2029956804","1293481792980760915_3209932459","1293482433954443989_196310841","1293484719346568849_2124079246","1293485147224303424_2124079246","1293485309543488473_51107516","1293485558618409735_2124079246","1293486087360439952_16492719","1293486560704191059_2097321014","1293492612632496326_43944667","1293494634437315688_3485755829","1293496485627819199_961044326","1293496660312044851_1960576205","1293517047925431606_2225823845","1293523805310795678_310632554","1293525762959732271_22655085","1293527608688738611_267011651","1293527647208718456_1366772377","1293527706651053476_1384300629","1293580886717489354_24448188","1293582297513856830_25969915","1293595511140176754_3531104977","1293603723695872378_37523246","1293604216769703114_1834222053","1293604426946244423_20630012","1293605623203990923_1669846376","1293606377676060502_3540087645","1293606422924151392_20275043","1293608662119600729_1914995057","1293610482733035626_179401525","1293610683128228838_3535896799","1293610994479978566_24764025","1293629596478111393_194392688","1293630484294815096_31506416

Re: [elm-discuss] Improve Elm docs.

2016-07-13 Thread Peter Damoc
Hi Nir and welcome to Elm,

I also come from Python and I consider the statement to be correct.
Please notice that the word "similar" is used not "exactly". For accessing
purposes, Elm records behave similar enough to python objects.

If I have a python object with the fields "name" and "surname" I can access
those fields with user.name, user.surname.
If I have a python dictionary with the same keys, I access them with
user["name"] and user["surname"] which is a little bit different from Elm.





On Thu, Jul 14, 2016 at 8:20 AM, Nir Galon  wrote:

> Hi,
> I'm a Python developer, and I"m just getting into elm.
> I start by reading the documentation and I notice an error in
> core_language  page. I try
> to find the website source code and do a PR, but with no success (found the
> website source code, but the docs isn't there).
> The error is in `Records` section, when it says `A record is a set of
> key-value pairs, similar to objects in JavaScript or Python.` - It's
> actually not true in Python, In Python key-value pairs called
> `dictionaries`.
> So the true sentence should by: `A record is a set of key-value pairs,
> similar to objects in JavaScript and dictionaries in Python`.
>
> I would appreciate any help on how to find the source code so I can do a
> PR and fix this.
> Nir Galon
>
> --
> 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 https://groups.google.com/d/optout.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Improve Elm docs.

2016-07-13 Thread Janis Voigtländer
I would appreciate any help on how to find the source code so I can do a PR
and fix this.

https://github.com/evancz/guide.elm-lang.org
​

2016-07-14 7:20 GMT+02:00 Nir Galon :

> Hi,
> I'm a Python developer, and I"m just getting into elm.
> I start by reading the documentation and I notice an error in
> core_language  page. I try
> to find the website source code and do a PR, but with no success (found the
> website source code, but the docs isn't there).
> The error is in `Records` section, when it says `A record is a set of
> key-value pairs, similar to objects in JavaScript or Python.` - It's
> actually not true in Python, In Python key-value pairs called
> `dictionaries`.
> So the true sentence should by: `A record is a set of key-value pairs,
> similar to objects in JavaScript and dictionaries in Python`.
>
> I would appreciate any help on how to find the source code so I can do a
> PR and fix this.
> Nir Galon
>
> --
> 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 https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Set.fromList crashing

2016-07-13 Thread Janis Voigtländer
Try again with a *re-install* of version 4.0.2 of core. A bug like you
observe would occur in an intermittent state of core with toString (and
thus with Debug.log etc.) on any set. It was fixed in
https://github.com/elm-lang/core/commit/fd51917a77570b08d04e6809dd62ac8020c32ac7,
and version 4.0.2 of core was hot-fixed with that. Which means, depending
on when you last downloaded 4.0.2 of core, you might or you might not have
the erroneous version.

(All that, AFAIK.)
​

2016-07-14 7:37 GMT+02:00 Zachary Kessin :

> When I try to do Set.fromList on this list I am getting elm to crash with
> this error I think its a sorting error. I have not had a chance to reduce
> it down to a smaller case yet
>
> TypeError: _p0 is undefined
>
> if (_p0.ctor === 'RBEmpty_elm_builtin') {
>
>
>
> ["1271762438561282616_218752125","1287040804540231664_1677848937","1288548618290149758_2511941698","1288947417522063849_3108919599","1291471725586284461_1702392360","1292785630832658348_3501246668","1293313211663381941_1745411573","129177087941384_2133161","1293335126171936748_1514397658","1293335196183438381_2302853679","1293337174024764594_605353295","1293339271956828728_3537987797","1293341223607968157_1760727","1293341234119468014_2889219787","1293341248195402085_269177096","1293341522150232655_2101444328","1293341598570137104_1062880563","1293343106875326185_3273260","1293343277802389272_6026774","1293345284541576219_1660712096","1293347478120405230_1390290175","1293347480226651417_310632554","1293347548374920192_234991802","1293349192953984294_569632697","1293351678397363788_1928841879","1293355234764208046_1699171629","1293355566098024975_1698513599","1293358581315770177_3879224","1293361454354985345_2241249004","1293363598324419526_1005030389","1293364660036696805_2005812465","1293365327551470471_51961874","1293365704905209100_1226003196","1293365808529193836_246586106","1293366948104600957_3500079240","1293367015012938065_1077334376","1293367312111405949_1012088867","1293369398065613922_2224337803","1293369592126747760_3320531291","1293371438920710226_3320531291","1293371649147619807_1967962180","1293372453699770644_998494259","1293373609204639793_3320531291","1293374371562017510_2352004036","1293375457944704141_3320531291","1293375769297176490_21091863","1293381470555352120_2105449252","1293381473265355333_145717604","1293381802794474737_181746102","1293381861556788900_2105449252","1293383848096465835_449276965","1293384095761712584_50643","1293385824989481787_20811406","1293387716746109588_1699171629","1293389722135934286_1673831222","1293389841287016752_181920614","1293393698646599389_34850037","1293393732980970842_1170796077","1293393789637065759_2067117228","1293393841537496148_1972361324","1293395036880762547_174055835","1293395206338880684_1481220617","1293395874902328009_1138061234","1293395938504995431_2105449252","1293403631429506242_2025834471","1293405575908288311_7439158","1293405849981489972_247713440","1293405903576178412_381010358","1293406098468806121_11811747","1293407205941217185_426613819","1293409632463427825_9220337","1293411769117331728_18931218","1293411788335677100_2010143609","1293411883697500658_18931218","1293414089070131765_3322294631","1293414667951965710_2060708823","1293417699518735719_397891274","1293418002020421540_487351755","1293419904758534395_3146251739","1293419995934247649_519492512","1293421848239152787_336429428","1293422082708925467_306635303","1293422101852400619_2042539278","1293423827891761977_2947573039","1293423873844406127_257590060","1293423876461686145_1360804327","1293424121711219202_301909080","1293427703026574404_296821256","1293429059556449666_207850771","1293429802979627184_3152243858","1293429927626034472_857869776","1293432182593276598_321340221","1293432215082230189_294333532","1293433904212779845_943492134","1293433979046935096_332716890","1293435935027332654_2277647333","1293436122084844338_602925161","1293437844828537991_3531104977","1293452141163205176_2078553039","1293452175423179054_286078980","1293452232365154211_1023469721","1293457620719844791_3410264625","1293458020009131604_244545808","1293462260878262443_2271363950","1293464312966703351_265895878","1293466444218802226_2331674879","1293470120693698302_356554490","1293472239974863813_3085474270","1293473328959175532_2977935581","1293476279064741442_3540087645","1293476481104504206_2007850037","1293478290334293713_3018536772","129347835111735_3540430715","1293478468306137427_2029956804","1293481792980760915_3209932459","1293482433954443989_196310841","1293484719346568849_2124079246","1293485147224303424_2124079246","1293485309543488473_51107516","1293485558618409735_2124079246","1293486087360439952_16492719","1293486560704191059_2097321014","1293492612632496326_43944667","1293494634437315688_3485755829","1293496485627819199_961044326","1293496660312044851_1960576205","1293517047925431606_2225823845","1293523805310795678_310632554","1293525762959732271_22655085","1293527608688738611_267011651","129352

Re: [elm-discuss] Improve Elm docs.

2016-07-13 Thread Nir Galon
This is true, but I think in the docs, they are talk about the way of 
thinking of the records and not the access part.
Because if this is the case we can say it's also similar to java object, we 
also access their variables with the dot notation.
And PHP and C++ are a bit similar, but instead of a dot we use the arrow 
symbol.

That's why I think the emphasis here are on key-value pairs and not on the 
way you access their values.
Obviously, objects aren't the same as key-value pairs. And the way you 
access values in key-value pairs, or variables of an object is just depend 
on the specific syntax of the language.
The idea of objects or key-value pairs are bigger then the syntax of the 
language (it's like how you write an if statement in every other language, 
the syntax is a bit different but the idea is the same).

On Thursday, July 14, 2016 at 8:43:09 AM UTC+3, Peter Damoc wrote:
>
> Hi Nir and welcome to Elm, 
>
> I also come from Python and I consider the statement to be correct. 
> Please notice that the word "similar" is used not "exactly". For accessing 
> purposes, Elm records behave similar enough to python objects. 
>
> If I have a python object with the fields "name" and "surname" I can 
> access those fields with user.name, user.surname. 
> If I have a python dictionary with the same keys, I access them with 
> user["name"] and user["surname"] which is a little bit different from Elm. 
>
>
>
>
>
> On Thu, Jul 14, 2016 at 8:20 AM, Nir Galon  > wrote:
>
>> Hi,
>> I'm a Python developer, and I"m just getting into elm.
>> I start by reading the documentation and I notice an error in 
>> core_language  page. I try 
>> to find the website source code and do a PR, but with no success (found the 
>> website source code, but the docs isn't there).
>> The error is in `Records` section, when it says `A record is a set of 
>> key-value pairs, similar to objects in JavaScript or Python.` - It's 
>> actually not true in Python, In Python key-value pairs called 
>> `dictionaries`.
>> So the true sentence should by: `A record is a set of key-value pairs, 
>> similar to objects in JavaScript and dictionaries in Python`.
>>
>> I would appreciate any help on how to find the source code so I can do a 
>> PR and fix this.
>> Nir Galon
>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Improve Elm docs.

2016-07-13 Thread Nir Galon
Thank you very much!

On Thursday, July 14, 2016 at 8:55:09 AM UTC+3, Janis Voigtländer wrote:
>
> I would appreciate any help on how to find the source code so I can do a 
> PR and fix this.
>
> https://github.com/evancz/guide.elm-lang.org
> ​
>
> 2016-07-14 7:20 GMT+02:00 Nir Galon >:
>
>> Hi,
>> I'm a Python developer, and I"m just getting into elm.
>> I start by reading the documentation and I notice an error in 
>> core_language  page. I try 
>> to find the website source code and do a PR, but with no success (found the 
>> website source code, but the docs isn't there).
>> The error is in `Records` section, when it says `A record is a set of 
>> key-value pairs, similar to objects in JavaScript or Python.` - It's 
>> actually not true in Python, In Python key-value pairs called 
>> `dictionaries`.
>> So the true sentence should by: `A record is a set of key-value pairs, 
>> similar to objects in JavaScript and dictionaries in Python`.
>>
>> I would appreciate any help on how to find the source code so I can do a 
>> PR and fix this.
>> Nir Galon
>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/d/optout.


Re: [elm-discuss] Improve Elm docs.

2016-07-13 Thread Joey Eremondi
Key-value pairs is a misnomer. Records are name-value pairs, the same way
that you can give names to members of a Python objects. So while the docs
need to be fixed, I think the use of the term "key-value" pair is the
problem.

In Python, you can do myObject.foo, but not myObject."foo" or myObject.3 or
such. The same is true of Elm records: each field has a name, but you're
not doing lookup with arbitrary values. So I think the object metaphor is
much more accurate than the dictionary one.

Records in Elm are basically tuples where you give a name to each element.
You generally use them when you know ahead of time exactly which fields
(names) you will have.

Elm also has Dictionaries, which are much closer to Python dicts:
http://package.elm-lang.org/packages/elm-lang/core/latest/Dict
These you can add and take elements from at runtime, without changing the
type of the dict.

On Wed, Jul 13, 2016 at 11:17 PM, Nir Galon  wrote:

> Thank you very much!
>
> On Thursday, July 14, 2016 at 8:55:09 AM UTC+3, Janis Voigtländer wrote:
>>
>> I would appreciate any help on how to find the source code so I can do a
>> PR and fix this.
>>
>> https://github.com/evancz/guide.elm-lang.org
>> ​
>>
>> 2016-07-14 7:20 GMT+02:00 Nir Galon :
>>
>>> Hi,
>>> I'm a Python developer, and I"m just getting into elm.
>>> I start by reading the documentation and I notice an error in
>>> core_language  page. I
>>> try to find the website source code and do a PR, but with no success (found
>>> the website source code, but the docs isn't there).
>>> The error is in `Records` section, when it says `A record is a set of
>>> key-value pairs, similar to objects in JavaScript or Python.` - It's
>>> actually not true in Python, In Python key-value pairs called
>>> `dictionaries`.
>>> So the true sentence should by: `A record is a set of key-value pairs,
>>> similar to objects in JavaScript and dictionaries in Python`.
>>>
>>> I would appreciate any help on how to find the source code so I can do a
>>> PR and fix this.
>>> Nir Galon
>>>
>>> --
>>> 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...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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 https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/d/optout.