I have the following inside an HSX expression:
<a href={StudentsAction
(get #nameSort model)
(get #_currentFilter model)
Nothing
Nothing}>
Last Name
</a>
With that, it's not clear which parameters of StudentsAction
are getting which values. So I'd prefer something like this:
<a href={StudentsAction {
sortOrder = (get #nameSort model),
currentFilter = (get #_currentFilter model),
searchString = Nothing,
pageIndex = Nothing } }>
Last Name
</a>
However, that results in a parse error.
I can construct the record outside the HSX with something like this:
instance View IndexView where
html IndexView { .. } =
let sortLastName = StudentsAction {
sortOrder = (get #nameSort model),
currentFilter = (get #_currentFilter model),
searchString = Nothing,
pageIndex = Nothing }
in
[hsx|
<nav>
...
<a href={sortLastName}>Last Name</a>
and that works fine, but I'd prefer to have it inline.
Is there a way to have the expression work inline? I'm guessing the inner braces are messing with the HSX parser? Perhaps they need to be escaped?