I understand basic type signatures like
myFunction :: Int -> String myFunction a = "Always produce this string"
But in the week 5 lesson, in Free.hs (and similar in the other hs files), I see this type signature (with implementation)
mint :: MintParams -> Contract w FreeSchema Text () mint mp = do let val = Value.singleton curSymbol (mpTokenName mp) (mpAmount mp) lookups = Constraints.mintingPolicy policy tx = Constraints.mustMintValue val ledgerTx <- submitTxConstraintsWith @Void lookups tx void $ awaitTxConfirmed $ getCardanoTxId ledgerTx Contract.logInfo @String $ printf "forged %s" (show val)
It appears that the function produces multiple different outputs. I cannot reproduce this structure on my own using simple code such as
myAttempt :: Int -> String String myAttempt a = "Make this" "Make that"
This causes the compiler to complain as follows
*JWB2> :l JWB2.hs [1 of 1] Compiling JWB2 ( JWB2.hs, interpreted ) JWB2.hs:48:21: error: • Expected kind ‘* -> *’, but ‘String’ has kind ‘*’ • In the type signature: myAttempt :: Int -> String String | 48 | myAttempt :: Int -> String String | ^^^^^^^^^^^^^ Failed, no modules loaded.
Is this a capability added thru one of the LANGUAGE declarations? Or Plutus modules? A partial function? Unique to do blocks? Related to Monads?
Various searches have not provided an explanation, but I'm sure someone here can!