问题是<代码>min。 有两个论点(至少是两个论点),但你只提出具体论点;你希望<条码>最低条码>,该文本在名单上运作。
Specifically, this error occurs because GHCi tries to print out the result of the expressions you evaluate, but in this case, you ve applied min
to one argument, producing another function.1 GHCi dutifully tries to print this out, but it fails, because functions are not an instance of Show
, the standard type-class for things that can be represented as strings for display.
1 In Haskell, all functions take one argument, and functions of multiple arguments are built up from functions returning other functions; for instance, a function adding two integers might have the type Integer -> Integer -> Integer
, which is Integer -> (Integer -> Integer)
— a function taking an Integer and returning another function which itself takes an Integer, and returns an Integer. Thankfully, you don t have to think about this in such explicit terms very often, or it d get very confusing!