On Nov 20, 2007 11:10 AM, David Roundy <droundy@darcs.net> wrote:
On Tue, Nov 20, 2007 at 11:07:50AM -0500, Brent Yorgey wrote:
> > I'd also add that I think it'd be handy to be able to give a list of
> > WorkspaceId rather than just one, so we could say
> >
> > onWorkspaces ["web","email","irc"] mytabbed $
> > onWorkspaces ["darcs","xmonad"] (mytabbed <-//> mytabbed ||| mytabbed) $
> > Full
> >
> > That'd be a stupid set of layouts, but you can see the idea:  most users
> > will have two or three sets of layouts, max, and will want to divy them up
> > among their workspaces.
>
> I thought of this, but the problem is the types.  What should the type of
> onWorkspaces be?  If you try to write this function, you get an infinite
> type error.  Unless there's some tricky type-hacking that can be done to get
> around it.

onWorkspaces
onWorkspaces :: (LayoutClass l1 a, LayoutClass l2 a)
               => [WorkspaceId] -- ^ the tag of workspaces to match
               -> (l1 a)      -- ^ layout to use on the matched workspace
               -> (l2 a)      -- ^ layout to use everywhere else
               -> PerWorkspace l1 l2 a


data PerWorkspace l1 l2 a = PerWorkspace [WorkspaceId]
                                       (Maybe Bool)
                                       (l1 a)
                                       (l2 a)
   deriving (Read, Show)

I think that's the key:  moving the functionality into the data type.

Ah, indeed!  Thanks.

-Brent