Is there a general way to tell the number of parameters of a function in Haskell?
问题 I can tell the number of parameters of a function with the following code {-#Language MultiParamTypeClasses#-} {-#Language FunctionalDependencies#-} {-#Language UndecidableInstances#-} data Zero data Succ a class Number a instance Number Zero instance (Number a) => Number (Succ a) class NotFunction a instance NotFunction Int instance NotFunction Float instance NotFunction (IO a) class (Number n) => FunctionLevel f n | f -> n where functionLevel :: f -> n instance FunctionLevel Int Zero where