我有一个旧的xmonad配置由我复制其他配置块。我对Haskell知之甚少,所以到目前为止我已经做到了最好。事情是较旧的编译器没有抱怨这条线有问题,但现在显示Ambigous类型变量错误。
我已经检查了其他关于类似问题的帖子,但仍然无法解决如何解决我的问题,所以如果有人能用任何答案来启发我,我将非常感谢。
第一个不明确的类型变量显示在此表达式之后:
xmonad $ defaultConfig
{ terminal = myTerminal
, workspaces = myWorkspaces
, keys = myKeys
, modMask = mymodMask
, layoutHook = myLayoutHook
, manageHook = manageSpawn <+> myManageHook
, logHook = myLogHook dzenLeftBar
, normalBorderColor = colorNormalBorder
, focusedBorderColor = colorFocusedBorder
, borderWidth = 0
, startupHook = myStartupHook }
错误是:
xmonad.hs:86:5: error:
* Ambiguous type variable `l10` arising from a use of `xmonad`
prevents the constraint `(LayoutClass
l10 GHC.Word.Word64)` from being solved.
Probable fix: use a type annotation to specify what `l10` should be.
以下表达式抛出第二个错误:
onWorkspaces ["7:media"] mediaLayout $
错误代码基本相同。
完整的配置文件是:https://paste.pound-python.org/show/BXD7gxeTXq14c5hQHwyK/
编译器中显示的错误如下:
xmonad.hs:86:5: error:
* Ambiguous type variable `l10` arising from a use of `xmonad`
prevents the constraint `(LayoutClass
l10 GHC.Word.Word64)` from being solved.
Probable fix: use a type annotation to specify what `l10` should be.
These potential instances exist:
instance (LayoutClass l a, LayoutClass r a) =>
LayoutClass (Choose l r) a
-- Defined in `XMonad.Layout`
instance LayoutClass Full a -- Defined in `XMonad.Layout`
instance LayoutClass l a => LayoutClass (Mirror l) a
-- Defined in `XMonad.Layout`
...plus four others
...plus five instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
* In a stmt of a 'do' block:
xmonad
$ defaultConfig
{terminal = myTerminal, workspaces = myWorkspaces, keys = myKeys,
modMask = mymodMask, layoutHook = myLayoutHook,
manageHook = manageSpawn <+> myManageHook,
logHook = myLogHook dzenLeftBar,
normalBorderColor = colorNormalBorder,
focusedBorderColor = colorFocusedBorder, borderWidth = 0,
startupHook = myStartupHook}
In the expression:
do { dzenLeftBar <- spawnPipe myXmonadBar;
dzenStatusBar <- spawnPipe myStatusBar;
dzenTrayBar <- spawnPipe myTrayBar;
dzenMpdBar <- spawnPipe myMpdBar;
.... }
In an equation for `main`:
main
= do { dzenLeftBar <- spawnPipe myXmonadBar;
dzenStatusBar <- spawnPipe myStatusBar;
dzenTrayBar <- spawnPipe myTrayBar;
.... }
xmonad.hs:180:17: error:
* Ambiguous type variable `l10` arising from a use of `onWorkspaces`
prevents the constraint `(LayoutClass
l10 Window)` from being solved.
Relevant bindings include
myLayoutHook :: XMonad.Layout.PerWorkspace.PerWorkspace
(ModifiedLayout
AvoidStruts
(Choose
(ModifiedLayout Spacing ResizableTall)
(Choose
(Mirror (ModifiedLayout Spacing ResizableTall))
(Choose
(ModifiedLayout XMonad.Layout.NoBorders.WithBorder Full)
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))))
(XMonad.Layout.PerWorkspace.PerWorkspace
(ModifiedLayout
AvoidStruts
(Choose
(ModifiedLayout
XMonad.Layout.NoBorders.WithBorder
(ModifiedLayout Spacing ResizableTall))
(Choose
(Mirror (ModifiedLayout Spacing ResizableTall))
(Choose
(ModifiedLayout XMonad.Layout.NoBorders.WithBorder Full)
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))))
(XMonad.Layout.PerWorkspace.PerWorkspace
(ModifiedLayout
AvoidStruts
(Choose
(ModifiedLayout XMonad.Layout.NoBorders.WithBorder Full)
(Choose
(ModifiedLayout Spacing ResizableTall)
(Choose
(Mirror (ModifiedLayout Spacing ResizableTall))
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))))
(XMonad.Layout.PerWorkspace.PerWorkspace
(ModifiedLayout
AvoidStruts
(Choose
(ModifiedLayout
XMonad.Layout.NoBorders.WithBorder
(ModifiedLayout Spacing ResizableTall))
(Choose
(Mirror (ModifiedLayout Spacing ResizableTall))
(Choose
(ModifiedLayout
XMonad.Layout.NoBorders.WithBorder Full)
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))))
(XMonad.Layout.PerWorkspace.PerWorkspace
(ModifiedLayout
AvoidStruts
(ModifiedLayout
XMonad.Layout.NoBorders.WithBorder
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))
(XMonad.Layout.PerWorkspace.PerWorkspace
l10
(XMonad.Layout.PerWorkspace.PerWorkspace
(ModifiedLayout
AvoidStruts
(ModifiedLayout
AddRoster
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))
(ModifiedLayout
AvoidStruts
(Choose
(ModifiedLayout
XMonad.Layout.NoBorders.WithBorder Full)
(Choose
(ModifiedLayout Spacing ResizableTall)
(Choose
(Mirror
(ModifiedLayout Spacing ResizableTall))
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
SimpleDecoration
XMonad.Layout.Decoration.DefaultShrinker)
(ModifiedLayout
XMonad.Actions.MouseResize.MouseResize
(ModifiedLayout
XMonad.Layout.WindowArranger.WindowArranger
SimpleFloat)))))))))))))
Window
(bound at xmonad.hs:174:1)
Probable fix: use a type annotation to specify what `l10` should be.
These potential instances exist:
instance (LayoutClass l a, LayoutClass r a) =>
LayoutClass (Choose l r) a
-- Defined in `XMonad.Layout`
instance LayoutClass Full a -- Defined in `XMonad.Layout`
instance LayoutClass l a => LayoutClass (Mirror l) a
-- Defined in `XMonad.Layout`
...plus four others
...plus five instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
* In the expression: onWorkspaces ["7:media"] mediaLayout
In the second argument of `($)`, namely
`onWorkspaces ["7:media"] mediaLayout
$ onWorkspaces ["8:com"] chatLayout $ simpLayout`
In the second argument of `($)`, namely
`onWorkspaces ["5:virt"] vBoxLayout
$ onWorkspaces ["7:media"] mediaLayout
$ onWorkspaces ["8:com"] chatLayout $ simpLayout`
xmonad.hs:202:15: error:
* Couldn't match expected type `ModifiedLayout
AddRoster
(ModifiedLayout
XMonad.Layout.Reflect.Reflect
(ModifiedLayout
AddRoster
(ModifiedLayout
TrackFloating
(ModifiedLayout
(XMonad.Layout.Decoration.Decoration
TabbedDecoration
XMonad.Layout.Decoration.DefaultShrinker)
XMonad.Layout.Simplest.Simplest))))
Window
-> t`
with actual type `ModifiedLayout
XMonad.Layout.NoBorders.WithBorder Full Window`
* The first argument of ($) takes one argument,
but its type `ModifiedLayout
XMonad.Layout.NoBorders.WithBorder Full Window`
has none
In the expression:
noBorders Full
$ withIM 0.11 (Role "gimp-toolbox")
$ reflectHoriz
$ withIM 0.15 (Role "gimp-dock") (trackFloating simpleTabbed)
In an equation for `mediaLayout`:
mediaLayout
= noBorders Full
$ withIM 0.11 (Role "gimp-toolbox")
$ reflectHoriz
$ withIM 0.15 (Role "gimp-dock") (trackFloating simpleTabbed)
* Relevant bindings include
mediaLayout :: t (bound at xmonad.hs:202:1)
Please check the file for errors.
答案 0 :(得分:0)
问题在于mediaLayout
定义,您将noBorders Full
应用于某些内容,但它是一种布局!你想要它是这样的吗?
mediaLayout = noBorders Full |||
( withIM 0.11 (Role "gimp-toolbox") $ reflectHoriz
$ withIM 0.15 (Role "gimp-dock") (trackFloating simpleTabbed)
)