So far I thought it was part of the key parameter, so that we know what template the key is part of (I’m not a Haskell pro - yet…).
It turns out that the
@<template_name> notation belongs to the function, and it’s called visible type application in Haskell.
Here is a description: Visible Type Application in GHC 8 (Kwang’s Haskell Blog).
Kwang illustrates its use by the following example, compare:
λ> id "a" "a" λ> id (3 :: Int) 3
With using visible type annotation it becomes simpler:
λ> :set -XTypeApplications λ> id @String "a" "a" λ> id @Int 3 3
fetchByKey, thinking that the
@<template_name> part belongs to the key argument, doesn’t cause a syntax error, because we don’t have parameters other than the key.
queryContractKey, which also has a
party parameter, we have to keep in mind that the
@<template_name> part must be written right after the function name, and this is the right syntax:
maybeDealer <- queryContractKey @Username [originator,operator] (operator, "DealerUser")