为什么模式匹配不能共享 where 子句?

eii*_*000 5 syntax haskell scope pattern-matching

我写了这个但它无法编译

\n\n
import Data.Maybe\nfunc Nothing Nothing = func2 "hello" "world"\nfunc x       y       = func2 "hello" "world"\n  where func2 a b = a ++ b\nmain = print $ func Nothing Nothing\n
Run Code Online (Sandbox Code Playgroud)\n\n
\n
test.hs:2:24: error:\n    \xe2\x80\xa2 Variable not in scope: func2 :: [Char] -> [Char] -> [Char]\n    \xe2\x80\xa2 Perhaps you meant \xe2\x80\x98func\xe2\x80\x99 (line 2)\n
Run Code Online (Sandbox Code Playgroud)\n
\n\n

我用守卫重写了它并且它起作用了。但我想知道为什么会这样。

\n