2

I was wondering about syntax I am not used to in the off-chain code.

What does @ mean in the following context? logInfo @String $ printf "made a gift"

What does .\/ mean in the following context? type GiftSchema = Endpoint "give" Integer .\/ Endpoint "grab" ()

I guess that it has to do to the multiple GHC extensions invoked in Plutus code but I do not have the time to understand each and everyone of them.

1 Answer 1

4

@String is from TypeApplications. logInfo has type logInfo :: forall a effs. Member (LogMsg a) effs => a -> Eff effs (), so logInfo @String fixes a to be String. (That this is needed here is because of another extension OverloadedStrings, so "made a gift" is not necessarily of type String)

.\/ is not from an extension, but an operator defined by the row-types library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.