Sometimes response type to an endpoint is a list wrapped into newtype. If you want to use buildListForResponse you need to write something like this:
instance Buildable (ForResponseLog FileSummary) where
build (ForResponseLog (FileSummary items)) =
buildListForResponse (take 5) (ForResponseLog items)
I think we can define a version of buildListForResponse that takes ForResponseLog a such that a is coercible to [x]. Maybe we don't even need a separate function for that and can generalize buildListForResponse because [x] is coercible to [x]. Or maybe we can generalize it somehow differently so support other data types such as Vector. Or maybe this case is not so frequent and we don't to generalize anything 🤷
Sometimes response type to an endpoint is a list wrapped into
newtype. If you want to usebuildListForResponseyou need to write something like this:I think we can define a version of
buildListForResponsethat takesForResponseLog asuch thatais coercible to[x]. Maybe we don't even need a separate function for that and can generalizebuildListForResponsebecause[x]is coercible to[x]. Or maybe we can generalize it somehow differently so support other data types such asVector. Or maybe this case is not so frequent and we don't to generalize anything 🤷