1
愚蠢的簡單xmonad.hs問題...startupHook - 曖昧類型變量
import XMonad
myTerminal = "gnome-terminal"
startupHook = do { spawn "/usr/bin/feh --bg-fill /home/abennett/wallpaper.jpg" }
main = xmonad defaults
defaults = defaultConfig {
terminal = myTerminal
}
拋出這個錯誤:
Error detected while loading xmonad configuration file: /home/abennett/.xmonad/xmonad.hs xmonad.hs:4:20: Ambiguous type variable `m0' in the constraint: (MonadIO m0) arising from a use of `spawn' Possible cause: the monomorphism restriction applied to the following: Main.startupHook :: m0() (bound at xmonad.hs:4:1) Probable fix: give these definition(s) an explicit type signature or use -XNoMonomorphismRestriction In a stmt of a 'do' block: spawn "/usr/bin/feh --bg-fill /home/abennett/wallpaper.jpg" In the expression: do { spawn "/usr/bin/feh --bg-fill /home/abennett/wallpaper.jpg" } In an equation for `Main.startupHook': Main.startupHook = do { spawn "/usr/bin/feh --bg-fill /home/abennett/wallpaper.jpg" } Please check the file for errors
我試過的東西像startupHook = startup
然後startup = do { spawn "stuff" }
,但是那並不是」不管工作。
謝謝,這正是我需要的 – Systemspoet 2014-08-29 12:48:43