Use a template for rendering title and subtitle of the item card

Introduces `ItemTemplate` to conveniently create strings given an
item.
This commit is contained in:
Eike Kettner
2020-11-29 20:15:00 +01:00
parent 2aecf08706
commit 81a136d915
3 changed files with 414 additions and 11 deletions

View File

@ -6,6 +6,7 @@ module Util.List exposing
, findNext
, findPrev
, get
, sliding
)
@ -88,3 +89,17 @@ dropRight n list =
List.reverse list
|> List.drop n
|> List.reverse
sliding : (a -> a -> b) -> List a -> List b
sliding f list =
let
windows =
case list of
_ :: xs ->
List.map2 Tuple.pair list xs
_ ->
[]
in
List.map (\( e1, e2 ) -> f e1 e2) windows