What is wrong with this function ?
test :: Show s => s
test = "asdasd"
String is an instance of the Show
class, so it seems correct.
The error is
srcMain.hs:224:7:
Couldn't match expected type `s' against inferred type `[Char]'
`s' is a rigid type variable bound by
the type signature for `test' at srcMain.hs:223:13
In the expression: "asdasd"
In the definition of `test': test = "asdasd"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…