{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE DeriveFunctor #-}
module XMonad.StackSet (
StackSet(..), Workspace(..), Screen(..), Stack(..), RationalRect(..),
new, view, greedyView,
lookupWorkspace,
screens, workspaces, allWindows, currentTag,
peek, index, integrate, integrate', differentiate,
focusUp, focusDown, focusUp', focusDown', focusMaster, focusWindow,
tagMember, renameTag, ensureTags, member, findTag, mapWorkspace, mapLayout,
insertUp, delete, delete', filter,
swapUp, swapDown, swapMaster, shiftMaster, modify, modify', float, sink,
shift, shiftWin,
abort
) where
import Prelude hiding (filter)
import Control.Applicative.Backwards (Backwards (Backwards, forwards))
import Data.Foldable (foldr, toList)
import Data.Maybe (listToMaybe,isJust,fromMaybe)
import qualified Data.List as L (deleteBy,find,splitAt,filter,nub)
import Data.List ( (\\) )
import qualified Data.List.NonEmpty as NE
import Data.List.NonEmpty (NonEmpty((:|)))
import qualified Data.Map as M (Map,insert,delete,empty)
data StackSet i l a sid sd =
StackSet { forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current :: !(Screen i l a sid sd)
, forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
visible :: [Screen i l a sid sd]
, forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
hidden :: [Workspace i l a]
, forall i l a sid sd. StackSet i l a sid sd -> Map a RationalRect
floating :: M.Map a RationalRect
} deriving (Int -> StackSet i l a sid sd -> ShowS
[StackSet i l a sid sd] -> ShowS
StackSet i l a sid sd -> String
(Int -> StackSet i l a sid sd -> ShowS)
-> (StackSet i l a sid sd -> String)
-> ([StackSet i l a sid sd] -> ShowS)
-> Show (StackSet i l a sid sd)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall i l a sid sd.
(Show i, Show l, Show sid, Show sd, Show a) =>
Int -> StackSet i l a sid sd -> ShowS
forall i l a sid sd.
(Show i, Show l, Show sid, Show sd, Show a) =>
[StackSet i l a sid sd] -> ShowS
forall i l a sid sd.
(Show i, Show l, Show sid, Show sd, Show a) =>
StackSet i l a sid sd -> String
$cshowsPrec :: forall i l a sid sd.
(Show i, Show l, Show sid, Show sd, Show a) =>
Int -> StackSet i l a sid sd -> ShowS
showsPrec :: Int -> StackSet i l a sid sd -> ShowS
$cshow :: forall i l a sid sd.
(Show i, Show l, Show sid, Show sd, Show a) =>
StackSet i l a sid sd -> String
show :: StackSet i l a sid sd -> String
$cshowList :: forall i l a sid sd.
(Show i, Show l, Show sid, Show sd, Show a) =>
[StackSet i l a sid sd] -> ShowS
showList :: [StackSet i l a sid sd] -> ShowS
Show, ReadPrec [StackSet i l a sid sd]
ReadPrec (StackSet i l a sid sd)
Int -> ReadS (StackSet i l a sid sd)
ReadS [StackSet i l a sid sd]
(Int -> ReadS (StackSet i l a sid sd))
-> ReadS [StackSet i l a sid sd]
-> ReadPrec (StackSet i l a sid sd)
-> ReadPrec [StackSet i l a sid sd]
-> Read (StackSet i l a sid sd)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
ReadPrec [StackSet i l a sid sd]
forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
ReadPrec (StackSet i l a sid sd)
forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
Int -> ReadS (StackSet i l a sid sd)
forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
ReadS [StackSet i l a sid sd]
$creadsPrec :: forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
Int -> ReadS (StackSet i l a sid sd)
readsPrec :: Int -> ReadS (StackSet i l a sid sd)
$creadList :: forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
ReadS [StackSet i l a sid sd]
readList :: ReadS [StackSet i l a sid sd]
$creadPrec :: forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
ReadPrec (StackSet i l a sid sd)
readPrec :: ReadPrec (StackSet i l a sid sd)
$creadListPrec :: forall i l a sid sd.
(Read i, Read l, Read sid, Read sd, Read a, Ord a) =>
ReadPrec [StackSet i l a sid sd]
readListPrec :: ReadPrec [StackSet i l a sid sd]
Read, StackSet i l a sid sd -> StackSet i l a sid sd -> Bool
(StackSet i l a sid sd -> StackSet i l a sid sd -> Bool)
-> (StackSet i l a sid sd -> StackSet i l a sid sd -> Bool)
-> Eq (StackSet i l a sid sd)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall i l a sid sd.
(Eq i, Eq l, Eq sid, Eq sd, Eq a) =>
StackSet i l a sid sd -> StackSet i l a sid sd -> Bool
$c== :: forall i l a sid sd.
(Eq i, Eq l, Eq sid, Eq sd, Eq a) =>
StackSet i l a sid sd -> StackSet i l a sid sd -> Bool
== :: StackSet i l a sid sd -> StackSet i l a sid sd -> Bool
$c/= :: forall i l a sid sd.
(Eq i, Eq l, Eq sid, Eq sd, Eq a) =>
StackSet i l a sid sd -> StackSet i l a sid sd -> Bool
/= :: StackSet i l a sid sd -> StackSet i l a sid sd -> Bool
Eq)
data Screen i l a sid sd = Screen { forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace :: !(Workspace i l a)
, forall i l a sid sd. Screen i l a sid sd -> sid
screen :: !sid
, forall i l a sid sd. Screen i l a sid sd -> sd
screenDetail :: !sd }
deriving (Int -> Screen i l a sid sd -> ShowS
[Screen i l a sid sd] -> ShowS
Screen i l a sid sd -> String
(Int -> Screen i l a sid sd -> ShowS)
-> (Screen i l a sid sd -> String)
-> ([Screen i l a sid sd] -> ShowS)
-> Show (Screen i l a sid sd)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall i l a sid sd.
(Show i, Show l, Show a, Show sid, Show sd) =>
Int -> Screen i l a sid sd -> ShowS
forall i l a sid sd.
(Show i, Show l, Show a, Show sid, Show sd) =>
[Screen i l a sid sd] -> ShowS
forall i l a sid sd.
(Show i, Show l, Show a, Show sid, Show sd) =>
Screen i l a sid sd -> String
$cshowsPrec :: forall i l a sid sd.
(Show i, Show l, Show a, Show sid, Show sd) =>
Int -> Screen i l a sid sd -> ShowS
showsPrec :: Int -> Screen i l a sid sd -> ShowS
$cshow :: forall i l a sid sd.
(Show i, Show l, Show a, Show sid, Show sd) =>
Screen i l a sid sd -> String
show :: Screen i l a sid sd -> String
$cshowList :: forall i l a sid sd.
(Show i, Show l, Show a, Show sid, Show sd) =>
[Screen i l a sid sd] -> ShowS
showList :: [Screen i l a sid sd] -> ShowS
Show, ReadPrec [Screen i l a sid sd]
ReadPrec (Screen i l a sid sd)
Int -> ReadS (Screen i l a sid sd)
ReadS [Screen i l a sid sd]
(Int -> ReadS (Screen i l a sid sd))
-> ReadS [Screen i l a sid sd]
-> ReadPrec (Screen i l a sid sd)
-> ReadPrec [Screen i l a sid sd]
-> Read (Screen i l a sid sd)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
ReadPrec [Screen i l a sid sd]
forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
ReadPrec (Screen i l a sid sd)
forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
Int -> ReadS (Screen i l a sid sd)
forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
ReadS [Screen i l a sid sd]
$creadsPrec :: forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
Int -> ReadS (Screen i l a sid sd)
readsPrec :: Int -> ReadS (Screen i l a sid sd)
$creadList :: forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
ReadS [Screen i l a sid sd]
readList :: ReadS [Screen i l a sid sd]
$creadPrec :: forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
ReadPrec (Screen i l a sid sd)
readPrec :: ReadPrec (Screen i l a sid sd)
$creadListPrec :: forall i l a sid sd.
(Read i, Read l, Read a, Read sid, Read sd) =>
ReadPrec [Screen i l a sid sd]
readListPrec :: ReadPrec [Screen i l a sid sd]
Read, Screen i l a sid sd -> Screen i l a sid sd -> Bool
(Screen i l a sid sd -> Screen i l a sid sd -> Bool)
-> (Screen i l a sid sd -> Screen i l a sid sd -> Bool)
-> Eq (Screen i l a sid sd)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall i l a sid sd.
(Eq i, Eq l, Eq a, Eq sid, Eq sd) =>
Screen i l a sid sd -> Screen i l a sid sd -> Bool
$c== :: forall i l a sid sd.
(Eq i, Eq l, Eq a, Eq sid, Eq sd) =>
Screen i l a sid sd -> Screen i l a sid sd -> Bool
== :: Screen i l a sid sd -> Screen i l a sid sd -> Bool
$c/= :: forall i l a sid sd.
(Eq i, Eq l, Eq a, Eq sid, Eq sd) =>
Screen i l a sid sd -> Screen i l a sid sd -> Bool
/= :: Screen i l a sid sd -> Screen i l a sid sd -> Bool
Eq)
data Workspace i l a = Workspace { forall i l a. Workspace i l a -> i
tag :: !i, forall i l a. Workspace i l a -> l
layout :: l, forall i l a. Workspace i l a -> Maybe (Stack a)
stack :: Maybe (Stack a) }
deriving (Int -> Workspace i l a -> ShowS
[Workspace i l a] -> ShowS
Workspace i l a -> String
(Int -> Workspace i l a -> ShowS)
-> (Workspace i l a -> String)
-> ([Workspace i l a] -> ShowS)
-> Show (Workspace i l a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall i l a.
(Show i, Show l, Show a) =>
Int -> Workspace i l a -> ShowS
forall i l a.
(Show i, Show l, Show a) =>
[Workspace i l a] -> ShowS
forall i l a. (Show i, Show l, Show a) => Workspace i l a -> String
$cshowsPrec :: forall i l a.
(Show i, Show l, Show a) =>
Int -> Workspace i l a -> ShowS
showsPrec :: Int -> Workspace i l a -> ShowS
$cshow :: forall i l a. (Show i, Show l, Show a) => Workspace i l a -> String
show :: Workspace i l a -> String
$cshowList :: forall i l a.
(Show i, Show l, Show a) =>
[Workspace i l a] -> ShowS
showList :: [Workspace i l a] -> ShowS
Show, ReadPrec [Workspace i l a]
ReadPrec (Workspace i l a)
Int -> ReadS (Workspace i l a)
ReadS [Workspace i l a]
(Int -> ReadS (Workspace i l a))
-> ReadS [Workspace i l a]
-> ReadPrec (Workspace i l a)
-> ReadPrec [Workspace i l a]
-> Read (Workspace i l a)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall i l a.
(Read i, Read l, Read a) =>
ReadPrec [Workspace i l a]
forall i l a.
(Read i, Read l, Read a) =>
ReadPrec (Workspace i l a)
forall i l a.
(Read i, Read l, Read a) =>
Int -> ReadS (Workspace i l a)
forall i l a. (Read i, Read l, Read a) => ReadS [Workspace i l a]
$creadsPrec :: forall i l a.
(Read i, Read l, Read a) =>
Int -> ReadS (Workspace i l a)
readsPrec :: Int -> ReadS (Workspace i l a)
$creadList :: forall i l a. (Read i, Read l, Read a) => ReadS [Workspace i l a]
readList :: ReadS [Workspace i l a]
$creadPrec :: forall i l a.
(Read i, Read l, Read a) =>
ReadPrec (Workspace i l a)
readPrec :: ReadPrec (Workspace i l a)
$creadListPrec :: forall i l a.
(Read i, Read l, Read a) =>
ReadPrec [Workspace i l a]
readListPrec :: ReadPrec [Workspace i l a]
Read, Workspace i l a -> Workspace i l a -> Bool
(Workspace i l a -> Workspace i l a -> Bool)
-> (Workspace i l a -> Workspace i l a -> Bool)
-> Eq (Workspace i l a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall i l a.
(Eq i, Eq l, Eq a) =>
Workspace i l a -> Workspace i l a -> Bool
$c== :: forall i l a.
(Eq i, Eq l, Eq a) =>
Workspace i l a -> Workspace i l a -> Bool
== :: Workspace i l a -> Workspace i l a -> Bool
$c/= :: forall i l a.
(Eq i, Eq l, Eq a) =>
Workspace i l a -> Workspace i l a -> Bool
/= :: Workspace i l a -> Workspace i l a -> Bool
Eq)
data RationalRect = RationalRect !Rational !Rational !Rational !Rational
deriving (Int -> RationalRect -> ShowS
[RationalRect] -> ShowS
RationalRect -> String
(Int -> RationalRect -> ShowS)
-> (RationalRect -> String)
-> ([RationalRect] -> ShowS)
-> Show RationalRect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RationalRect -> ShowS
showsPrec :: Int -> RationalRect -> ShowS
$cshow :: RationalRect -> String
show :: RationalRect -> String
$cshowList :: [RationalRect] -> ShowS
showList :: [RationalRect] -> ShowS
Show, ReadPrec [RationalRect]
ReadPrec RationalRect
Int -> ReadS RationalRect
ReadS [RationalRect]
(Int -> ReadS RationalRect)
-> ReadS [RationalRect]
-> ReadPrec RationalRect
-> ReadPrec [RationalRect]
-> Read RationalRect
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS RationalRect
readsPrec :: Int -> ReadS RationalRect
$creadList :: ReadS [RationalRect]
readList :: ReadS [RationalRect]
$creadPrec :: ReadPrec RationalRect
readPrec :: ReadPrec RationalRect
$creadListPrec :: ReadPrec [RationalRect]
readListPrec :: ReadPrec [RationalRect]
Read, RationalRect -> RationalRect -> Bool
(RationalRect -> RationalRect -> Bool)
-> (RationalRect -> RationalRect -> Bool) -> Eq RationalRect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RationalRect -> RationalRect -> Bool
== :: RationalRect -> RationalRect -> Bool
$c/= :: RationalRect -> RationalRect -> Bool
/= :: RationalRect -> RationalRect -> Bool
Eq)
data Stack a = Stack { forall a. Stack a -> a
focus :: !a
, forall a. Stack a -> [a]
up :: [a]
, forall a. Stack a -> [a]
down :: [a] }
deriving (Int -> Stack a -> ShowS
[Stack a] -> ShowS
Stack a -> String
(Int -> Stack a -> ShowS)
-> (Stack a -> String) -> ([Stack a] -> ShowS) -> Show (Stack a)
forall a. Show a => Int -> Stack a -> ShowS
forall a. Show a => [Stack a] -> ShowS
forall a. Show a => Stack a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Stack a -> ShowS
showsPrec :: Int -> Stack a -> ShowS
$cshow :: forall a. Show a => Stack a -> String
show :: Stack a -> String
$cshowList :: forall a. Show a => [Stack a] -> ShowS
showList :: [Stack a] -> ShowS
Show, ReadPrec [Stack a]
ReadPrec (Stack a)
Int -> ReadS (Stack a)
ReadS [Stack a]
(Int -> ReadS (Stack a))
-> ReadS [Stack a]
-> ReadPrec (Stack a)
-> ReadPrec [Stack a]
-> Read (Stack a)
forall a. Read a => ReadPrec [Stack a]
forall a. Read a => ReadPrec (Stack a)
forall a. Read a => Int -> ReadS (Stack a)
forall a. Read a => ReadS [Stack a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Stack a)
readsPrec :: Int -> ReadS (Stack a)
$creadList :: forall a. Read a => ReadS [Stack a]
readList :: ReadS [Stack a]
$creadPrec :: forall a. Read a => ReadPrec (Stack a)
readPrec :: ReadPrec (Stack a)
$creadListPrec :: forall a. Read a => ReadPrec [Stack a]
readListPrec :: ReadPrec [Stack a]
Read, Stack a -> Stack a -> Bool
(Stack a -> Stack a -> Bool)
-> (Stack a -> Stack a -> Bool) -> Eq (Stack a)
forall a. Eq a => Stack a -> Stack a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Stack a -> Stack a -> Bool
== :: Stack a -> Stack a -> Bool
$c/= :: forall a. Eq a => Stack a -> Stack a -> Bool
/= :: Stack a -> Stack a -> Bool
Eq, (forall a b. (a -> b) -> Stack a -> Stack b)
-> (forall a b. a -> Stack b -> Stack a) -> Functor Stack
forall a b. a -> Stack b -> Stack a
forall a b. (a -> b) -> Stack a -> Stack b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Stack a -> Stack b
fmap :: forall a b. (a -> b) -> Stack a -> Stack b
$c<$ :: forall a b. a -> Stack b -> Stack a
<$ :: forall a b. a -> Stack b -> Stack a
Functor)
instance Foldable Stack where
toList :: forall a. Stack a -> [a]
toList = Stack a -> [a]
forall a. Stack a -> [a]
integrate
foldr :: forall a b. (a -> b -> b) -> b -> Stack a -> b
foldr a -> b -> b
f b
z = (a -> b -> b) -> b -> [a] -> b
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr a -> b -> b
f b
z ([a] -> b) -> (Stack a -> [a]) -> Stack a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> [a]
forall a. Stack a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList
instance Traversable Stack where
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Stack a -> f (Stack b)
traverse a -> f b
f Stack a
s =
(b -> [b] -> [b] -> Stack b) -> [b] -> b -> [b] -> Stack b
forall a b c. (a -> b -> c) -> b -> a -> c
flip b -> [b] -> [b] -> Stack b
forall a. a -> [a] -> [a] -> Stack a
Stack
([b] -> b -> [b] -> Stack b) -> f [b] -> f (b -> [b] -> Stack b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Backwards f [b] -> f [b]
forall {k} (f :: k -> *) (a :: k). Backwards f a -> f a
forwards ((a -> Backwards f b) -> [a] -> Backwards f [b]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (f b -> Backwards f b
forall {k} (f :: k -> *) (a :: k). f a -> Backwards f a
Backwards (f b -> Backwards f b) -> (a -> f b) -> a -> Backwards f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> f b
f) (Stack a -> [a]
forall a. Stack a -> [a]
up Stack a
s))
f (b -> [b] -> Stack b) -> f b -> f ([b] -> Stack b)
forall a b. f (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a -> f b
f (Stack a -> a
forall a. Stack a -> a
focus Stack a
s)
f ([b] -> Stack b) -> f [b] -> f (Stack b)
forall a b. f (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (a -> f b) -> [a] -> f [b]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse a -> f b
f (Stack a -> [a]
forall a. Stack a -> [a]
down Stack a
s)
abort :: String -> a
abort :: forall a. String -> a
abort String
x = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String
"xmonad: StackSet: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
x
new :: (Integral s) => l -> [i] -> [sd] -> StackSet i l a s sd
new :: forall s l i sd a.
Integral s =>
l -> [i] -> [sd] -> StackSet i l a s sd
new l
l (i
wid:[i]
wids) (sd
m:[sd]
ms) | [sd] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [sd]
ms Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= [i] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [i]
wids
= Screen i l a s sd
-> [Screen i l a s sd]
-> [Workspace i l a]
-> Map a RationalRect
-> StackSet i l a s sd
forall i l a sid sd.
Screen i l a sid sd
-> [Screen i l a sid sd]
-> [Workspace i l a]
-> Map a RationalRect
-> StackSet i l a sid sd
StackSet Screen i l a s sd
forall {a}. Screen i l a s sd
cur [Screen i l a s sd]
forall {a}. [Screen i l a s sd]
visi ((i -> Workspace i l a) -> [i] -> [Workspace i l a]
forall a b. (a -> b) -> [a] -> [b]
map i -> Workspace i l a
forall {i} {a}. i -> Workspace i l a
ws [i]
unseen) Map a RationalRect
forall k a. Map k a
M.empty
where ws :: i -> Workspace i l a
ws i
i = i -> l -> Maybe (Stack a) -> Workspace i l a
forall i l a. i -> l -> Maybe (Stack a) -> Workspace i l a
Workspace i
i l
l Maybe (Stack a)
forall a. Maybe a
Nothing
([i]
seen, [i]
unseen) = Int -> [i] -> ([i], [i])
forall a. Int -> [a] -> ([a], [a])
L.splitAt ([sd] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [sd]
ms) [i]
wids
Screen i l a s sd
cur:[Screen i l a s sd]
visi = Workspace i l a -> s -> sd -> Screen i l a s sd
forall i l a sid sd.
Workspace i l a -> sid -> sd -> Screen i l a sid sd
Screen (i -> Workspace i l a
forall {i} {a}. i -> Workspace i l a
ws i
wid) s
0 sd
m Screen i l a s sd -> [Screen i l a s sd] -> [Screen i l a s sd]
forall a. a -> [a] -> [a]
: [ Workspace i l a -> s -> sd -> Screen i l a s sd
forall i l a sid sd.
Workspace i l a -> sid -> sd -> Screen i l a sid sd
Screen (i -> Workspace i l a
forall {i} {a}. i -> Workspace i l a
ws i
i) s
s sd
sd | (i
i, s
s, sd
sd) <- [i] -> [s] -> [sd] -> [(i, s, sd)]
forall a b c. [a] -> [b] -> [c] -> [(a, b, c)]
zip3 [i]
seen [s
1..] [sd]
ms ]
new l
_ [i]
_ [sd]
_ = String -> StackSet i l a s sd
forall a. String -> a
abort String
"non-positive argument to StackSet.new"
view :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
view :: forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
view i
i StackSet i l a s sd
s
| i
i i -> i -> Bool
forall a. Eq a => a -> a -> Bool
== StackSet i l a s sd -> i
forall i l a s sd. StackSet i l a s sd -> i
currentTag StackSet i l a s sd
s = StackSet i l a s sd
s
| Just Screen i l a s sd
x <- (Screen i l a s sd -> Bool)
-> [Screen i l a s sd] -> Maybe (Screen i l a s sd)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
L.find ((i
ii -> i -> Bool
forall a. Eq a => a -> a -> Bool
==)(i -> Bool)
-> (Screen i l a s sd -> i) -> Screen i l a s sd -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag(Workspace i l a -> i)
-> (Screen i l a s sd -> Workspace i l a) -> Screen i l a s sd -> i
forall b c a. (b -> c) -> (a -> b) -> a -> c
.Screen i l a s sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace) (StackSet i l a s sd -> [Screen i l a s sd]
forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
visible StackSet i l a s sd
s)
= StackSet i l a s sd
s { current = x, visible = current s : L.deleteBy (equating screen) x (visible s) }
| Just Workspace i l a
x <- (Workspace i l a -> Bool)
-> [Workspace i l a] -> Maybe (Workspace i l a)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
L.find ((i
ii -> i -> Bool
forall a. Eq a => a -> a -> Bool
==)(i -> Bool) -> (Workspace i l a -> i) -> Workspace i l a -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag) (StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
hidden StackSet i l a s sd
s)
= StackSet i l a s sd
s { current = (current s) { workspace = x }
, hidden = workspace (current s) : L.deleteBy (equating tag) x (hidden s) }
| Bool
otherwise = StackSet i l a s sd
s
where equating :: (t -> a) -> t -> t -> Bool
equating t -> a
f t
x t
y = t -> a
f t
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== t -> a
f t
y
greedyView :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
greedyView :: forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
greedyView i
w StackSet i l a s sd
ws
| (Workspace i l a -> Bool) -> [Workspace i l a] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any Workspace i l a -> Bool
forall {l} {a}. Workspace i l a -> Bool
wTag (StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
hidden StackSet i l a s sd
ws) = i -> StackSet i l a s sd -> StackSet i l a s sd
forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
view i
w StackSet i l a s sd
ws
| (Just Screen i l a s sd
s) <- (Screen i l a s sd -> Bool)
-> [Screen i l a s sd] -> Maybe (Screen i l a s sd)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
L.find (Workspace i l a -> Bool
forall {l} {a}. Workspace i l a -> Bool
wTag (Workspace i l a -> Bool)
-> (Screen i l a s sd -> Workspace i l a)
-> Screen i l a s sd
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Screen i l a s sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace) (StackSet i l a s sd -> [Screen i l a s sd]
forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
visible StackSet i l a s sd
ws)
= StackSet i l a s sd
ws { current = (current ws) { workspace = workspace s }
, visible = s { workspace = workspace (current ws) }
: L.filter (not . wTag . workspace) (visible ws) }
| Bool
otherwise = StackSet i l a s sd
ws
where wTag :: Workspace i l a -> Bool
wTag = (i
w i -> i -> Bool
forall a. Eq a => a -> a -> Bool
== ) (i -> Bool) -> (Workspace i l a -> i) -> Workspace i l a -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag
lookupWorkspace :: Eq s => s -> StackSet i l a s sd -> Maybe i
lookupWorkspace :: forall s i l a sd. Eq s => s -> StackSet i l a s sd -> Maybe i
lookupWorkspace s
sc StackSet i l a s sd
w = [i] -> Maybe i
forall a. [a] -> Maybe a
listToMaybe [ Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag Workspace i l a
i | Screen Workspace i l a
i s
s sd
_ <- StackSet i l a s sd -> Screen i l a s sd
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current StackSet i l a s sd
w Screen i l a s sd -> [Screen i l a s sd] -> [Screen i l a s sd]
forall a. a -> [a] -> [a]
: StackSet i l a s sd -> [Screen i l a s sd]
forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
visible StackSet i l a s sd
w, s
s s -> s -> Bool
forall a. Eq a => a -> a -> Bool
== s
sc ]
with :: b -> (Stack a -> b) -> StackSet i l a s sd -> b
with :: forall b a i l s sd.
b -> (Stack a -> b) -> StackSet i l a s sd -> b
with b
dflt Stack a -> b
f = b -> (Stack a -> b) -> Maybe (Stack a) -> b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe b
dflt Stack a -> b
f (Maybe (Stack a) -> b)
-> (StackSet i l a s sd -> Maybe (Stack a))
-> StackSet i l a s sd
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Workspace i l a -> Maybe (Stack a)
forall i l a. Workspace i l a -> Maybe (Stack a)
stack (Workspace i l a -> Maybe (Stack a))
-> (StackSet i l a s sd -> Workspace i l a)
-> StackSet i l a s sd
-> Maybe (Stack a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Screen i l a s sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace (Screen i l a s sd -> Workspace i l a)
-> (StackSet i l a s sd -> Screen i l a s sd)
-> StackSet i l a s sd
-> Workspace i l a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a s sd -> Screen i l a s sd
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current
modify :: Maybe (Stack a) -> (Stack a -> Maybe (Stack a)) -> StackSet i l a s sd -> StackSet i l a s sd
modify :: forall a i l s sd.
Maybe (Stack a)
-> (Stack a -> Maybe (Stack a))
-> StackSet i l a s sd
-> StackSet i l a s sd
modify Maybe (Stack a)
d Stack a -> Maybe (Stack a)
f StackSet i l a s sd
s = StackSet i l a s sd
s { current = (current s)
{ workspace = (workspace (current s)) { stack = with d f s }}}
modify' :: (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' :: forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' Stack a -> Stack a
f = Maybe (Stack a)
-> (Stack a -> Maybe (Stack a))
-> StackSet i l a s sd
-> StackSet i l a s sd
forall a i l s sd.
Maybe (Stack a)
-> (Stack a -> Maybe (Stack a))
-> StackSet i l a s sd
-> StackSet i l a s sd
modify Maybe (Stack a)
forall a. Maybe a
Nothing (Stack a -> Maybe (Stack a)
forall a. a -> Maybe a
Just (Stack a -> Maybe (Stack a))
-> (Stack a -> Stack a) -> Stack a -> Maybe (Stack a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> Stack a
f)
peek :: StackSet i l a s sd -> Maybe a
peek :: forall i l a s sd. StackSet i l a s sd -> Maybe a
peek = Maybe a -> (Stack a -> Maybe a) -> StackSet i l a s sd -> Maybe a
forall b a i l s sd.
b -> (Stack a -> b) -> StackSet i l a s sd -> b
with Maybe a
forall a. Maybe a
Nothing (a -> Maybe a
forall a. a -> Maybe a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> Maybe a) -> (Stack a -> a) -> Stack a -> Maybe a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> a
forall a. Stack a -> a
focus)
integrate :: Stack a -> [a]
integrate :: forall a. Stack a -> [a]
integrate (Stack a
x [a]
l [a]
r) = [a] -> [a]
forall a. [a] -> [a]
reverse [a]
l [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++ a
x a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a]
r
integrate' :: Maybe (Stack a) -> [a]
integrate' :: forall a. Maybe (Stack a) -> [a]
integrate' = [a] -> (Stack a -> [a]) -> Maybe (Stack a) -> [a]
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] Stack a -> [a]
forall a. Stack a -> [a]
integrate
differentiate :: [a] -> Maybe (Stack a)
differentiate :: forall a. [a] -> Maybe (Stack a)
differentiate [] = Maybe (Stack a)
forall a. Maybe a
Nothing
differentiate (a
x:[a]
xs) = Stack a -> Maybe (Stack a)
forall a. a -> Maybe a
Just (Stack a -> Maybe (Stack a)) -> Stack a -> Maybe (Stack a)
forall a b. (a -> b) -> a -> b
$ a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
x [] [a]
xs
filter :: (a -> Bool) -> Stack a -> Maybe (Stack a)
filter :: forall a. (a -> Bool) -> Stack a -> Maybe (Stack a)
filter a -> Bool
p (Stack a
f [a]
ls [a]
rs) = case (a -> Bool) -> [a] -> [a]
forall a. (a -> Bool) -> [a] -> [a]
L.filter a -> Bool
p (a
fa -> [a] -> [a]
forall a. a -> [a] -> [a]
:[a]
rs) of
a
f':[a]
rs' -> Stack a -> Maybe (Stack a)
forall a. a -> Maybe a
Just (Stack a -> Maybe (Stack a)) -> Stack a -> Maybe (Stack a)
forall a b. (a -> b) -> a -> b
$ a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
f' ((a -> Bool) -> [a] -> [a]
forall a. (a -> Bool) -> [a] -> [a]
L.filter a -> Bool
p [a]
ls) [a]
rs'
[] -> case (a -> Bool) -> [a] -> [a]
forall a. (a -> Bool) -> [a] -> [a]
L.filter a -> Bool
p [a]
ls of
a
f':[a]
ls' -> Stack a -> Maybe (Stack a)
forall a. a -> Maybe a
Just (Stack a -> Maybe (Stack a)) -> Stack a -> Maybe (Stack a)
forall a b. (a -> b) -> a -> b
$ a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
f' [a]
ls' []
[] -> Maybe (Stack a)
forall a. Maybe a
Nothing
index :: StackSet i l a s sd -> [a]
index :: forall i l a s sd. StackSet i l a s sd -> [a]
index = [a] -> (Stack a -> [a]) -> StackSet i l a s sd -> [a]
forall b a i l s sd.
b -> (Stack a -> b) -> StackSet i l a s sd -> b
with [] Stack a -> [a]
forall a. Stack a -> [a]
integrate
focusUp :: StackSet i l a s sd -> StackSet i l a s sd
focusUp :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
focusUp = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' Stack a -> Stack a
forall a. Stack a -> Stack a
focusUp'
focusDown :: StackSet i l a s sd -> StackSet i l a s sd
focusDown :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
focusDown = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' Stack a -> Stack a
forall a. Stack a -> Stack a
focusDown'
swapUp :: StackSet i l a s sd -> StackSet i l a s sd
swapUp :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
swapUp = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' Stack a -> Stack a
forall a. Stack a -> Stack a
swapUp'
swapDown :: StackSet i l a s sd -> StackSet i l a s sd
swapDown :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
swapDown = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' (Stack a -> Stack a
forall a. Stack a -> Stack a
reverseStack (Stack a -> Stack a) -> (Stack a -> Stack a) -> Stack a -> Stack a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> Stack a
forall a. Stack a -> Stack a
swapUp' (Stack a -> Stack a) -> (Stack a -> Stack a) -> Stack a -> Stack a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> Stack a
forall a. Stack a -> Stack a
reverseStack)
focusUp' :: Stack a -> Stack a
focusUp' :: forall a. Stack a -> Stack a
focusUp' (Stack a
t (a
l:[a]
ls) [a]
rs) = a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
l [a]
ls (a
ta -> [a] -> [a]
forall a. a -> [a] -> [a]
:[a]
rs)
focusUp' (Stack a
t [] [a]
rs) = a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
x [a]
xs []
where (a
x :| [a]
xs) = NonEmpty a -> NonEmpty a
forall a. NonEmpty a -> NonEmpty a
NE.reverse (a
t a -> [a] -> NonEmpty a
forall a. a -> [a] -> NonEmpty a
:| [a]
rs)
focusDown' :: Stack a -> Stack a
focusDown' :: forall a. Stack a -> Stack a
focusDown' = Stack a -> Stack a
forall a. Stack a -> Stack a
reverseStack (Stack a -> Stack a) -> (Stack a -> Stack a) -> Stack a -> Stack a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> Stack a
forall a. Stack a -> Stack a
focusUp' (Stack a -> Stack a) -> (Stack a -> Stack a) -> Stack a -> Stack a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stack a -> Stack a
forall a. Stack a -> Stack a
reverseStack
swapUp' :: Stack a -> Stack a
swapUp' :: forall a. Stack a -> Stack a
swapUp' (Stack a
t (a
l:[a]
ls) [a]
rs) = a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
t [a]
ls (a
la -> [a] -> [a]
forall a. a -> [a] -> [a]
:[a]
rs)
swapUp' (Stack a
t [] [a]
rs) = a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
t ([a] -> [a]
forall a. [a] -> [a]
reverse [a]
rs) []
reverseStack :: Stack a -> Stack a
reverseStack :: forall a. Stack a -> Stack a
reverseStack (Stack a
t [a]
ls [a]
rs) = a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
t [a]
rs [a]
ls
focusWindow :: (Eq s, Eq a, Eq i) => a -> StackSet i l a s sd -> StackSet i l a s sd
focusWindow :: forall s a i l sd.
(Eq s, Eq a, Eq i) =>
a -> StackSet i l a s sd -> StackSet i l a s sd
focusWindow a
w StackSet i l a s sd
s | a -> Maybe a
forall a. a -> Maybe a
Just a
w Maybe a -> Maybe a -> Bool
forall a. Eq a => a -> a -> Bool
== StackSet i l a s sd -> Maybe a
forall i l a s sd. StackSet i l a s sd -> Maybe a
peek StackSet i l a s sd
s = StackSet i l a s sd
s
| Bool
otherwise = StackSet i l a s sd
-> Maybe (StackSet i l a s sd) -> StackSet i l a s sd
forall a. a -> Maybe a -> a
fromMaybe StackSet i l a s sd
s (Maybe (StackSet i l a s sd) -> StackSet i l a s sd)
-> Maybe (StackSet i l a s sd) -> StackSet i l a s sd
forall a b. (a -> b) -> a -> b
$ do
i
n <- a -> StackSet i l a s sd -> Maybe i
forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Maybe i
findTag a
w StackSet i l a s sd
s
StackSet i l a s sd -> Maybe (StackSet i l a s sd)
forall a. a -> Maybe a
forall (m :: * -> *) a. Monad m => a -> m a
return (StackSet i l a s sd -> Maybe (StackSet i l a s sd))
-> StackSet i l a s sd -> Maybe (StackSet i l a s sd)
forall a b. (a -> b) -> a -> b
$ (StackSet i l a s sd -> Bool)
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall a. (a -> Bool) -> (a -> a) -> a -> a
until ((a -> Maybe a
forall a. a -> Maybe a
Just a
w Maybe a -> Maybe a -> Bool
forall a. Eq a => a -> a -> Bool
==) (Maybe a -> Bool)
-> (StackSet i l a s sd -> Maybe a) -> StackSet i l a s sd -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a s sd -> Maybe a
forall i l a s sd. StackSet i l a s sd -> Maybe a
peek) StackSet i l a s sd -> StackSet i l a s sd
forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
focusUp (i -> StackSet i l a s sd -> StackSet i l a s sd
forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
view i
n StackSet i l a s sd
s)
screens :: StackSet i l a s sd -> [Screen i l a s sd]
screens :: forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
screens StackSet i l a s sd
s = StackSet i l a s sd -> Screen i l a s sd
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current StackSet i l a s sd
s Screen i l a s sd -> [Screen i l a s sd] -> [Screen i l a s sd]
forall a. a -> [a] -> [a]
: StackSet i l a s sd -> [Screen i l a s sd]
forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
visible StackSet i l a s sd
s
workspaces :: StackSet i l a s sd -> [Workspace i l a]
workspaces :: forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
workspaces StackSet i l a s sd
s = Screen i l a s sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace (StackSet i l a s sd -> Screen i l a s sd
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current StackSet i l a s sd
s) Workspace i l a -> [Workspace i l a] -> [Workspace i l a]
forall a. a -> [a] -> [a]
: (Screen i l a s sd -> Workspace i l a)
-> [Screen i l a s sd] -> [Workspace i l a]
forall a b. (a -> b) -> [a] -> [b]
map Screen i l a s sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace (StackSet i l a s sd -> [Screen i l a s sd]
forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
visible StackSet i l a s sd
s) [Workspace i l a] -> [Workspace i l a] -> [Workspace i l a]
forall a. [a] -> [a] -> [a]
++ StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
hidden StackSet i l a s sd
s
allWindows :: Eq a => StackSet i l a s sd -> [a]
allWindows :: forall a i l s sd. Eq a => StackSet i l a s sd -> [a]
allWindows = [a] -> [a]
forall a. Eq a => [a] -> [a]
L.nub ([a] -> [a])
-> (StackSet i l a s sd -> [a]) -> StackSet i l a s sd -> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Workspace i l a -> [a]) -> [Workspace i l a] -> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Maybe (Stack a) -> [a]
forall a. Maybe (Stack a) -> [a]
integrate' (Maybe (Stack a) -> [a])
-> (Workspace i l a -> Maybe (Stack a)) -> Workspace i l a -> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Workspace i l a -> Maybe (Stack a)
forall i l a. Workspace i l a -> Maybe (Stack a)
stack) ([Workspace i l a] -> [a])
-> (StackSet i l a s sd -> [Workspace i l a])
-> StackSet i l a s sd
-> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
workspaces
currentTag :: StackSet i l a s sd -> i
currentTag :: forall i l a s sd. StackSet i l a s sd -> i
currentTag = Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag (Workspace i l a -> i)
-> (StackSet i l a s sd -> Workspace i l a)
-> StackSet i l a s sd
-> i
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Screen i l a s sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace (Screen i l a s sd -> Workspace i l a)
-> (StackSet i l a s sd -> Screen i l a s sd)
-> StackSet i l a s sd
-> Workspace i l a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a s sd -> Screen i l a s sd
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current
tagMember :: Eq i => i -> StackSet i l a s sd -> Bool
tagMember :: forall i l a s sd. Eq i => i -> StackSet i l a s sd -> Bool
tagMember i
t = i -> [i] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
elem i
t ([i] -> Bool)
-> (StackSet i l a s sd -> [i]) -> StackSet i l a s sd -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Workspace i l a -> i) -> [Workspace i l a] -> [i]
forall a b. (a -> b) -> [a] -> [b]
map Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag ([Workspace i l a] -> [i])
-> (StackSet i l a s sd -> [Workspace i l a])
-> StackSet i l a s sd
-> [i]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
workspaces
renameTag :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd
renameTag :: forall i l a s sd.
Eq i =>
i -> i -> StackSet i l a s sd -> StackSet i l a s sd
renameTag i
o i
n = (Workspace i l a -> Workspace i l a)
-> StackSet i l a s sd -> StackSet i l a s sd
forall i l a s sd.
(Workspace i l a -> Workspace i l a)
-> StackSet i l a s sd -> StackSet i l a s sd
mapWorkspace Workspace i l a -> Workspace i l a
forall {l} {a}. Workspace i l a -> Workspace i l a
rename
where rename :: Workspace i l a -> Workspace i l a
rename Workspace i l a
w = if Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag Workspace i l a
w i -> i -> Bool
forall a. Eq a => a -> a -> Bool
== i
o then Workspace i l a
w { tag = n } else Workspace i l a
w
ensureTags :: Eq i => l -> [i] -> StackSet i l a s sd -> StackSet i l a s sd
ensureTags :: forall i l a s sd.
Eq i =>
l -> [i] -> StackSet i l a s sd -> StackSet i l a s sd
ensureTags l
l [i]
allt StackSet i l a s sd
st = [i] -> [i] -> StackSet i l a s sd -> StackSet i l a s sd
forall {i} {a} {sid} {sd}.
Eq i =>
[i] -> [i] -> StackSet i l a sid sd -> StackSet i l a sid sd
et [i]
allt ((Workspace i l a -> i) -> [Workspace i l a] -> [i]
forall a b. (a -> b) -> [a] -> [b]
map Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag (StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
workspaces StackSet i l a s sd
st) [i] -> [i] -> [i]
forall a. Eq a => [a] -> [a] -> [a]
\\ [i]
allt) StackSet i l a s sd
st
where et :: [i] -> [i] -> StackSet i l a sid sd -> StackSet i l a sid sd
et [] [i]
_ StackSet i l a sid sd
s = StackSet i l a sid sd
s
et (i
i:[i]
is) [i]
rn StackSet i l a sid sd
s | i
i i -> StackSet i l a sid sd -> Bool
forall i l a s sd. Eq i => i -> StackSet i l a s sd -> Bool
`tagMember` StackSet i l a sid sd
s = [i] -> [i] -> StackSet i l a sid sd -> StackSet i l a sid sd
et [i]
is [i]
rn StackSet i l a sid sd
s
et (i
i:[i]
is) [] StackSet i l a sid sd
s = [i] -> [i] -> StackSet i l a sid sd -> StackSet i l a sid sd
et [i]
is [] (StackSet i l a sid sd
s { hidden = Workspace i l Nothing : hidden s })
et (i
i:[i]
is) (i
r:[i]
rs) StackSet i l a sid sd
s = [i] -> [i] -> StackSet i l a sid sd -> StackSet i l a sid sd
et [i]
is [i]
rs (StackSet i l a sid sd -> StackSet i l a sid sd)
-> StackSet i l a sid sd -> StackSet i l a sid sd
forall a b. (a -> b) -> a -> b
$ i -> i -> StackSet i l a sid sd -> StackSet i l a sid sd
forall i l a s sd.
Eq i =>
i -> i -> StackSet i l a s sd -> StackSet i l a s sd
renameTag i
r i
i StackSet i l a sid sd
s
mapWorkspace :: (Workspace i l a -> Workspace i l a) -> StackSet i l a s sd -> StackSet i l a s sd
mapWorkspace :: forall i l a s sd.
(Workspace i l a -> Workspace i l a)
-> StackSet i l a s sd -> StackSet i l a s sd
mapWorkspace Workspace i l a -> Workspace i l a
f StackSet i l a s sd
s = StackSet i l a s sd
s { current = updScr (current s)
, visible = map updScr (visible s)
, hidden = map f (hidden s) }
where updScr :: Screen i l a sid sd -> Screen i l a sid sd
updScr Screen i l a sid sd
scr = Screen i l a sid sd
scr { workspace = f (workspace scr) }
mapLayout :: (l -> l') -> StackSet i l a s sd -> StackSet i l' a s sd
mapLayout :: forall l l' i a s sd.
(l -> l') -> StackSet i l a s sd -> StackSet i l' a s sd
mapLayout l -> l'
f (StackSet Screen i l a s sd
v [Screen i l a s sd]
vs [Workspace i l a]
hs Map a RationalRect
m) = Screen i l' a s sd
-> [Screen i l' a s sd]
-> [Workspace i l' a]
-> Map a RationalRect
-> StackSet i l' a s sd
forall i l a sid sd.
Screen i l a sid sd
-> [Screen i l a sid sd]
-> [Workspace i l a]
-> Map a RationalRect
-> StackSet i l a sid sd
StackSet (Screen i l a s sd -> Screen i l' a s sd
forall {i} {a} {sid} {sd}.
Screen i l a sid sd -> Screen i l' a sid sd
fScreen Screen i l a s sd
v) ((Screen i l a s sd -> Screen i l' a s sd)
-> [Screen i l a s sd] -> [Screen i l' a s sd]
forall a b. (a -> b) -> [a] -> [b]
map Screen i l a s sd -> Screen i l' a s sd
forall {i} {a} {sid} {sd}.
Screen i l a sid sd -> Screen i l' a sid sd
fScreen [Screen i l a s sd]
vs) ((Workspace i l a -> Workspace i l' a)
-> [Workspace i l a] -> [Workspace i l' a]
forall a b. (a -> b) -> [a] -> [b]
map Workspace i l a -> Workspace i l' a
forall {i} {a}. Workspace i l a -> Workspace i l' a
fWorkspace [Workspace i l a]
hs) Map a RationalRect
m
where
fScreen :: Screen i l a sid sd -> Screen i l' a sid sd
fScreen (Screen Workspace i l a
ws sid
s sd
sd) = Workspace i l' a -> sid -> sd -> Screen i l' a sid sd
forall i l a sid sd.
Workspace i l a -> sid -> sd -> Screen i l a sid sd
Screen (Workspace i l a -> Workspace i l' a
forall {i} {a}. Workspace i l a -> Workspace i l' a
fWorkspace Workspace i l a
ws) sid
s sd
sd
fWorkspace :: Workspace i l a -> Workspace i l' a
fWorkspace (Workspace i
t l
l Maybe (Stack a)
s) = i -> l' -> Maybe (Stack a) -> Workspace i l' a
forall i l a. i -> l -> Maybe (Stack a) -> Workspace i l a
Workspace i
t (l -> l'
f l
l) Maybe (Stack a)
s
member :: Eq a => a -> StackSet i l a s sd -> Bool
member :: forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Bool
member a
a StackSet i l a s sd
s = Maybe i -> Bool
forall a. Maybe a -> Bool
isJust (a -> StackSet i l a s sd -> Maybe i
forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Maybe i
findTag a
a StackSet i l a s sd
s)
findTag :: Eq a => a -> StackSet i l a s sd -> Maybe i
findTag :: forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Maybe i
findTag a
a StackSet i l a s sd
s = [i] -> Maybe i
forall a. [a] -> Maybe a
listToMaybe
[ Workspace i l a -> i
forall i l a. Workspace i l a -> i
tag Workspace i l a
w | Workspace i l a
w <- StackSet i l a s sd -> [Workspace i l a]
forall i l a sid sd. StackSet i l a sid sd -> [Workspace i l a]
workspaces StackSet i l a s sd
s, a -> Maybe (Stack a) -> Bool
forall {a}. Eq a => a -> Maybe (Stack a) -> Bool
has a
a (Workspace i l a -> Maybe (Stack a)
forall i l a. Workspace i l a -> Maybe (Stack a)
stack Workspace i l a
w) ]
where has :: a -> Maybe (Stack a) -> Bool
has a
_ Maybe (Stack a)
Nothing = Bool
False
has a
x (Just (Stack a
t [a]
l [a]
r)) = a
x a -> [a] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` (a
t a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a]
l [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++ [a]
r)
insertUp :: Eq a => a -> StackSet i l a s sd -> StackSet i l a s sd
insertUp :: forall a i l s sd.
Eq a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
insertUp a
a StackSet i l a s sd
s = if a -> StackSet i l a s sd -> Bool
forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Bool
member a
a StackSet i l a s sd
s then StackSet i l a s sd
s else StackSet i l a s sd
insert
where insert :: StackSet i l a s sd
insert = Maybe (Stack a)
-> (Stack a -> Maybe (Stack a))
-> StackSet i l a s sd
-> StackSet i l a s sd
forall a i l s sd.
Maybe (Stack a)
-> (Stack a -> Maybe (Stack a))
-> StackSet i l a s sd
-> StackSet i l a s sd
modify (Stack a -> Maybe (Stack a)
forall a. a -> Maybe a
Just (Stack a -> Maybe (Stack a)) -> Stack a -> Maybe (Stack a)
forall a b. (a -> b) -> a -> b
$ a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
a [] []) (\(Stack a
t [a]
l [a]
r) -> Stack a -> Maybe (Stack a)
forall a. a -> Maybe a
Just (Stack a -> Maybe (Stack a)) -> Stack a -> Maybe (Stack a)
forall a b. (a -> b) -> a -> b
$ a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
a [a]
l (a
ta -> [a] -> [a]
forall a. a -> [a] -> [a]
:[a]
r)) StackSet i l a s sd
s
delete :: (Ord a) => a -> StackSet i l a s sd -> StackSet i l a s sd
delete :: forall a i l s sd.
Ord a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
delete a
w = a -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
Ord a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
sink a
w (StackSet i l a s sd -> StackSet i l a s sd)
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
Eq a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
delete' a
w
delete' :: (Eq a) => a -> StackSet i l a s sd -> StackSet i l a s sd
delete' :: forall a i l s sd.
Eq a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
delete' a
w StackSet i l a s sd
s = StackSet i l a s sd
s { current = removeFromScreen (current s)
, visible = map removeFromScreen (visible s)
, hidden = map removeFromWorkspace (hidden s) }
where removeFromWorkspace :: Workspace i l a -> Workspace i l a
removeFromWorkspace Workspace i l a
ws = Workspace i l a
ws { stack = stack ws >>= filter (/=w) }
removeFromScreen :: Screen i l a sid sd -> Screen i l a sid sd
removeFromScreen Screen i l a sid sd
scr = Screen i l a sid sd
scr { workspace = removeFromWorkspace (workspace scr) }
float :: Ord a => a -> RationalRect -> StackSet i l a s sd -> StackSet i l a s sd
float :: forall a i l s sd.
Ord a =>
a -> RationalRect -> StackSet i l a s sd -> StackSet i l a s sd
float a
w RationalRect
r StackSet i l a s sd
s = StackSet i l a s sd
s { floating = M.insert w r (floating s) }
sink :: Ord a => a -> StackSet i l a s sd -> StackSet i l a s sd
sink :: forall a i l s sd.
Ord a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
sink a
w StackSet i l a s sd
s = StackSet i l a s sd
s { floating = M.delete w (floating s) }
swapMaster :: StackSet i l a s sd -> StackSet i l a s sd
swapMaster :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
swapMaster = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' ((Stack a -> Stack a)
-> StackSet i l a s sd -> StackSet i l a s sd)
-> (Stack a -> Stack a)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall a b. (a -> b) -> a -> b
$ \Stack a
c -> case Stack a
c of
Stack a
_ [] [a]
_ -> Stack a
c
Stack a
t (a
l:[a]
ls) [a]
rs -> a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
t [] ([a]
xs [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++ a
x a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a]
rs) where (a
x :| [a]
xs) = NonEmpty a -> NonEmpty a
forall a. NonEmpty a -> NonEmpty a
NE.reverse (a
l a -> [a] -> NonEmpty a
forall a. a -> [a] -> NonEmpty a
:| [a]
ls)
shiftMaster :: StackSet i l a s sd -> StackSet i l a s sd
shiftMaster :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
shiftMaster = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' ((Stack a -> Stack a)
-> StackSet i l a s sd -> StackSet i l a s sd)
-> (Stack a -> Stack a)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall a b. (a -> b) -> a -> b
$ \Stack a
c -> case Stack a
c of
Stack a
_ [] [a]
_ -> Stack a
c
Stack a
t [a]
ls [a]
rs -> a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
t [] ([a] -> [a]
forall a. [a] -> [a]
reverse [a]
ls [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++ [a]
rs)
focusMaster :: StackSet i l a s sd -> StackSet i l a s sd
focusMaster :: forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
focusMaster = (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
(Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
modify' ((Stack a -> Stack a)
-> StackSet i l a s sd -> StackSet i l a s sd)
-> (Stack a -> Stack a)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall a b. (a -> b) -> a -> b
$ \Stack a
c -> case Stack a
c of
Stack a
_ [] [a]
_ -> Stack a
c
Stack a
t (a
l:[a]
ls) [a]
rs -> a -> [a] -> [a] -> Stack a
forall a. a -> [a] -> [a] -> Stack a
Stack a
x [] ([a]
xs [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++ a
t a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a]
rs) where (a
x :| [a]
xs) = NonEmpty a -> NonEmpty a
forall a. NonEmpty a -> NonEmpty a
NE.reverse (a
l a -> [a] -> NonEmpty a
forall a. a -> [a] -> NonEmpty a
:| [a]
ls)
shift :: (Ord a, Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
shift :: forall a s i l sd.
(Ord a, Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
shift i
n StackSet i l a s sd
s = StackSet i l a s sd
-> (a -> StackSet i l a s sd) -> Maybe a -> StackSet i l a s sd
forall b a. b -> (a -> b) -> Maybe a -> b
maybe StackSet i l a s sd
s (\a
w -> i -> a -> StackSet i l a s sd -> StackSet i l a s sd
forall a s i l sd.
(Ord a, Eq s, Eq i) =>
i -> a -> StackSet i l a s sd -> StackSet i l a s sd
shiftWin i
n a
w StackSet i l a s sd
s) (StackSet i l a s sd -> Maybe a
forall i l a s sd. StackSet i l a s sd -> Maybe a
peek StackSet i l a s sd
s)
shiftWin :: (Ord a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd
shiftWin :: forall a s i l sd.
(Ord a, Eq s, Eq i) =>
i -> a -> StackSet i l a s sd -> StackSet i l a s sd
shiftWin i
n a
w StackSet i l a s sd
s = case a -> StackSet i l a s sd -> Maybe i
forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Maybe i
findTag a
w StackSet i l a s sd
s of
Just i
from | i
n i -> StackSet i l a s sd -> Bool
forall i l a s sd. Eq i => i -> StackSet i l a s sd -> Bool
`tagMember` StackSet i l a s sd
s Bool -> Bool -> Bool
&& i
n i -> i -> Bool
forall a. Eq a => a -> a -> Bool
/= i
from -> i -> StackSet i l a s sd -> StackSet i l a s sd
forall {s} {l} {sd}.
Eq s =>
i -> StackSet i l a s sd -> StackSet i l a s sd
go i
from StackSet i l a s sd
s
Maybe i
_ -> StackSet i l a s sd
s
where go :: i -> StackSet i l a s sd -> StackSet i l a s sd
go i
from = i
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall i s l a sd.
(Eq i, Eq s) =>
i
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
onWorkspace i
n (a -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
Eq a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
insertUp a
w) (StackSet i l a s sd -> StackSet i l a s sd)
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall b c a. (b -> c) -> (a -> b) -> a -> c
. i
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall i s l a sd.
(Eq i, Eq s) =>
i
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
onWorkspace i
from (a -> StackSet i l a s sd -> StackSet i l a s sd
forall a i l s sd.
Eq a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
delete' a
w)
onWorkspace :: (Eq i, Eq s) => i -> (StackSet i l a s sd -> StackSet i l a s sd)
-> (StackSet i l a s sd -> StackSet i l a s sd)
onWorkspace :: forall i s l a sd.
(Eq i, Eq s) =>
i
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
onWorkspace i
n StackSet i l a s sd -> StackSet i l a s sd
f StackSet i l a s sd
s = i -> StackSet i l a s sd -> StackSet i l a s sd
forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
view (StackSet i l a s sd -> i
forall i l a s sd. StackSet i l a s sd -> i
currentTag StackSet i l a s sd
s) (StackSet i l a s sd -> StackSet i l a s sd)
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a s sd -> StackSet i l a s sd
f (StackSet i l a s sd -> StackSet i l a s sd)
-> (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd
-> StackSet i l a s sd
forall b c a. (b -> c) -> (a -> b) -> a -> c
. i -> StackSet i l a s sd -> StackSet i l a s sd
forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
view i
n (StackSet i l a s sd -> StackSet i l a s sd)
-> StackSet i l a s sd -> StackSet i l a s sd
forall a b. (a -> b) -> a -> b
$ StackSet i l a s sd
s