Created
May 13, 2018 17:32
-
-
Save wknapik/e88bac3644eed3ce4a2f7668f449aac5 to your computer and use it in GitHub Desktop.
List.sortBy produces different order between Chromium/Chrome and Firefox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (..) | |
import Html exposing (div, text) | |
import List | |
import Tuple | |
main = | |
Html.beginnerProgram { model = [], view = view, update = (\_ -> \x -> x) } | |
view _ = | |
div [] <| List.map (div [] << List.singleton << text << Tuple.first) (List.sortBy Tuple.second tuples) | |
tuples = | |
[ ( "1", "foo" ) | |
, ( "2", "bar" ) | |
, ( "3", "foo" ) | |
, ( "4", "foo" ) | |
, ( "5", "foo" ) | |
, ( "6", "baz" ) | |
, ( "7", "foo" ) | |
, ( "8", "quux" ) | |
, ( "9", "foo" ) | |
, ( "10", "foo" ) | |
, ( "11", "foo" ) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chromium/Chrome 66.0.3359.139:
Firefox 59.0.2:
Tested on Linux.