Context
The IHP Guide has a section that describes their use of hash symbols:
https://ihp.digitallyinduced.com/Guide/helpful-tips.html
It mentions the following:
Writing
#companyId
is equivalent to writingfromLabel @"companyId"
.
Experiment
In the example blog application, if I add the following to a view:
{get #title post}
The title of the post shows up as expected.
Now, if I add the following to the view instead:
{get (fromLabel @"title") post}
the page doesn't render properly and it gives me the following message:
Web/View/Posts/Show.hs:11:33
• 12:40:
|
12 | {get (fromLabel @"title") post}
| ^
"0\nSrcLoc \"\" 1 30\nParse error in expression: fromLabel@\"title\"\n"
Question
Based on the what is mentioned in the documentation cited above, it seemed that I could write:
get (fromLabel @"title") post
instead of:
get #title post
But that clearly does not work. :-)
So, what am I missing here? Is there a way to write:
get #title post
in terms of fromLabel
?
Update 1
As suggested by Fyodor in a comment below, I tried the following:
{show @Int 42}
This was the result:
Web/View/Posts/Show.hs:11:33
• 12:23:
|
12 | {show @Int 42}
| ^
"0\nSrcLoc \"\" 1 13\nParse error in expression: show@Int\n"