darcs patch: switch WorkspaceId to String.

I don't know what folks will think of this, but I'd rather have WorkspaceId
be a String. Then we don't need to worry about associating Strings with
workspaces, and everything's pretty.
David
Mon Aug 20 04:36:58 PDT 2007 David Roundy

On Mon, Aug 20, 2007 at 04:44:47AM -0700, David Roundy wrote:
I don't know what folks will think of this, but I'd rather have WorkspaceId be a String. Then we don't need to worry about associating Strings with workspaces, and everything's pretty.
I'll have to rewrite for the 3rd time my function to have mod-, and mod-. the ion way, but that's ok...;-)
-- workspaces :: [WorkspaceId] -workspaces = [0..8] +workspaces = map (:"") ['1'..'9']
I find this a bit scary for someone new to Haskell, considered it is in the Config file. Anyway I'd suggest (:[]), still very scary, but probably more helpful to my ideal newcomer who's getting started with Haskell. Just my side note. Andrea

On Mon, Aug 20, 2007 at 02:01:22PM +0200, Andrea Rossato wrote:
On Mon, Aug 20, 2007 at 04:44:47AM -0700, David Roundy wrote:
I don't know what folks will think of this, but I'd rather have WorkspaceId be a String. Then we don't need to worry about associating Strings with workspaces, and everything's pretty.
I'll have to rewrite for the 3rd time my function to have mod-, and mod-. the ion way, but that's ok...;-)
These cycle through the workspaces? Shouldn't it work just the same? And perhaps you'd care to add it to XMonadContrib?
-workspaces = [0..8] +workspaces = map (:"") ['1'..'9']
I find this a bit scary for someone new to Haskell, considered it is in the Config file. Anyway I'd suggest (:[]), still very scary, but probably more helpful to my ideal newcomer who's getting started with Haskell.
Yeah, I wish this were prettier. We could also use workspaces = ["1","2","3","4","5","6","7","8","9"] which would make it perfectly obvious to non-haskellers how to edit the workspace names. I think might actually be ideal. The whole point of this change would be to allow users to name workspaces like "email", "web", etc if they wish. -- David Roundy http://www.darcs.net

On Mon, Aug 20, 2007 at 10:36:15AM -0400, David Roundy wrote:
These cycle through the workspaces? Shouldn't it work just the same? And perhaps you'd care to add it to XMonadContrib?
I'm lazy so it used the W constructor...;-) I changed it so now it will work with the new WorkspaceID type. I've just sent it.
Yeah, I wish this were prettier. We could also use
workspaces = ["1","2","3","4","5","6","7","8","9"]
I agree: it is more verbose but definitely better. Moreover it makes clear that you can use more meaningful values, as you pointed out. Andrea

Andrea Rossato wrote:
On Mon, Aug 20, 2007 at 04:44:47AM -0700, David Roundy wrote:
workspaces :: [WorkspaceId] -workspaces = [0..8] +workspaces = map (:"") ['1'..'9']
I find this a bit scary for someone new to Haskell, considered it is in the Config file. Anyway I'd suggest (:[]), still very scary, but probably more helpful to my ideal newcomer who's getting started with Haskell.
how about map show [1..9] , which actually kind of works for extension to numbers greater than 9? or add unnecessary parentheses if it seems clearer: map (show) [1..9] Isaac

On Monday 20 August 2007 06:44:47 David Roundy wrote:
I don't know what folks will think of this, but I'd rather have WorkspaceId be a String. Then we don't need to worry about associating Strings with workspaces, and everything's pretty.
David
Mon Aug 20 04:36:58 PDT 2007 David Roundy
* switch WorkspaceId to String.
Applied, thanks.
participants (5)
-
Andrea Rossato
-
David Roundy
-
David Roundy
-
Isaac Dupree
-
Spencer Janssen