在ghci中加载以下代码
\n{-# OPTIONS_GHC -Wall #-}\n\n\n--following gives a type error about the arg int not str\nbug :: String -> Int -> Int \nbug str int = num \n where num = str * 10 + int \n\n-- the following gives a type error about the arg str as expected \nworks :: String -> Int -> Int \nworks str int = str * 10 + int\nRun Code Online (Sandbox Code Playgroud)\n这给出了以下错误:
\n:reload\n[1 of 1] Compiling Main ( bugTI.hs, interpreted )\n\nbugTI.hs:6:16: error:\n \xe2\x80\xa2 Couldn't …Run Code Online (Sandbox Code Playgroud) haskell ×1