I am rendering Hamlet templates using the Runtime module. The following works as promised with the example data:
let hamletDataMap = Map.fromList
[ ("name", "Michael")
, ("hungry", toHamletData True) -- always True
, ("foods", toHamletData
[ "Apples"
, "Bananas"
, "Carrots"
])
]
But I can't see any way for me to render nested data. For instance if I have a list of metadata of various fruits, I would like to do something like:
let hamletDataMap = Map.fromList
[ ("name", "Michael")
, ("hungry", toHamletData True) -- always True
, ("fruits", toHamletData
[ [ ("name", "apple")
, ("taste", "sour")
]
, [ ("name", "..")
, ("taste", "...")
]
])
]
In the Text.Hamlet.RT
there is the HDList [HamletMap]
which looks kindof strange but still promising. I can creates instances of HDList
but it gives me type mismatch HamletData
with actual type RT.HamletData url0
.
I'm thankful for any ideas or suggestions.