elm-format Hashdict documentation
parent
fcc7699a44
commit
da81a09eb8
|
@ -56,18 +56,17 @@ example, this can be useful when every user is identifiable by their username:
|
||||||
|
|
||||||
users : Hashdict User
|
users : Hashdict User
|
||||||
users =
|
users =
|
||||||
Hashdict.fromList .name
|
Hashdict.fromList .name
|
||||||
[ User "Alice" 28 1.65
|
[ User "Alice" 28 1.65
|
||||||
, User "Bob" 19 1.82
|
, User "Bob" 19 1.82
|
||||||
, User "Chuck" 33 1.75
|
, User "Chuck" 33 1.75
|
||||||
]
|
]
|
||||||
|
|
||||||
type alias User =
|
type alias User =
|
||||||
{ name : String
|
{ name : String
|
||||||
, age : Int
|
, age : Int
|
||||||
, height : Float
|
, height : Float
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
In the example listed above, the users are stored by their username, which means
|
In the example listed above, the users are stored by their username, which means
|
||||||
that all you need to know is the value "Alice" to retrieve all the information
|
that all you need to know is the value "Alice" to retrieve all the information
|
||||||
|
|
Loading…
Reference in New Issue