getPara :: (Num [Char]) => [Char] -> Integer -> [Char]
getPara "" _ = ""
getPara str nr
| (nr == 0 ) && ((head str) == ')' ) = ')' : getPara "" 0
| ( nr == 0 ) && ( (head str) == '(' ) = '(' : (getPara (tail str) 0)
| (nr /= 0 ) && ( (head str) == '(') = (getPara (tail str) nr-1)
| (nr == 0 ) && ( (head str) /= '(' ) = (head str) : (getPara (tail str) 0 )
| otherwise = (getPara (tail str) nr)
私がやろうとしているのは、文字列から括弧のnrセットを取得することであり、取得するエラーは次のとおりです。
Illegal Haskell 98 class constraint in type declaration
*** Expression : getPara
*** Type : Num [Char] => [Char] -> Integer -> [Char]
何が問題ですか?