Created
April 9, 2017 07:35
-
-
Save mamachanko/1c3a38f3707fb4e6540f2ad1ecf45638 to your computer and use it in GitHub Desktop.
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 This exposing (..) | |
import Date | |
import Dict | |
type alias Entry = | |
{ date : Date.Date | |
, text : String | |
} | |
groupByDate : List Entry -> List ( Date.Date, List Entry ) | |
groupByDate entries = | |
groupByDate_ entries Dict.empty | |
-- groupByDate_ : List Entry -> Dict.Dict Date.Date List Entry -> List ( Date.Date, List Entry ) | |
-- ^ does not compile | |
-- groupByDate_ : List Entry -> Dict.Dict comparable v -> List ( Date.Date, List Entry ) | |
-- ^ does not compile either | |
groupByDate_ entries result = | |
Dict.toList result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment