Contents

Description

Utility functions and re-exports for a more ergonomic developing experience. Users themselves will not find much use here.

Synopsis

Documentation

fi :: (Integral a, Num b) => a -> b Source #

Short for fromIntegral.

chunksOf :: Int -> [a] -> [[a]] Source #

Given a maximum length, splits a list into sublists

>>> chunksOf 5 (take 30 $repeat 'a') ["aaaaa","aaaaa","aaaaa","aaaaa","aaaaa","aaaaa"]  (.:) :: (a -> b) -> (c -> d -> a) -> c -> d -> b Source # Multivariant composition. f .: g ≡ (f .) . g ≡ \c d -> f (g c d) (!?) :: [a] -> Int -> Maybe a Source # Safe version of (!!). data NonEmpty a # Constructors  a :| [a] Instances Instances details  MonadFix NonEmpty Instance detailsDefined in Control.Monad.Fix Methodsmfix :: (a -> NonEmpty a) -> NonEmpty a Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => NonEmpty m -> mfoldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> mfoldr :: (a -> b -> b) -> b -> NonEmpty a -> b #foldr' :: (a -> b -> b) -> b -> NonEmpty a -> bfoldl :: (b -> a -> b) -> b -> NonEmpty a -> b #foldl' :: (b -> a -> b) -> b -> NonEmpty a -> bfoldr1 :: (a -> a -> a) -> NonEmpty a -> a #foldl1 :: (a -> a -> a) -> NonEmpty a -> a #toList :: NonEmpty a -> [a] #null :: NonEmpty a -> Bool #length :: NonEmpty a -> Int #elem :: Eq a => a -> NonEmpty a -> Bool #maximum :: Ord a => NonEmpty a -> a #minimum :: Ord a => NonEmpty a -> a #sum :: Num a => NonEmpty a -> a #product :: Num a => NonEmpty a -> a # Eq1 NonEmpty Instance detailsDefined in Data.Functor.Classes MethodsliftEq :: (a -> b -> Bool) -> NonEmpty a -> NonEmpty b -> Bool Ord1 NonEmpty Instance detailsDefined in Data.Functor.Classes MethodsliftCompare :: (a -> b -> Ordering) -> NonEmpty a -> NonEmpty b -> Ordering Read1 NonEmpty Instance detailsDefined in Data.Functor.Classes MethodsliftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmpty a)liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmpty a]liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmpty a)liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmpty a] Show1 NonEmpty Instance detailsDefined in Data.Functor.Classes MethodsliftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmpty a -> ShowSliftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmpty a] -> ShowS Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) # Instance detailsDefined in GHC.Base Methodspure :: a -> NonEmpty a #(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a # Instance detailsDefined in GHC.Base Methodsfmap :: (a -> b) -> NonEmpty a -> NonEmpty b #(<$) :: a -> NonEmpty b -> NonEmpty a # Instance detailsDefined in GHC.Base Methods(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty breturn :: a -> NonEmpty a # NFData1 NonEmpty Instance detailsDefined in Control.DeepSeq MethodsliftRnf :: (a -> ()) -> NonEmpty a -> () Instance detailsDefined in GHC.Base Methods(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #sconcat :: NonEmpty (NonEmpty a) -> NonEmpty astimes :: Integral b => b -> NonEmpty a -> NonEmpty a IsList (NonEmpty a) Instance detailsDefined in GHC.Exts Associated Typestype Item (NonEmpty a) MethodsfromList :: [Item (NonEmpty a)] -> NonEmpty afromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty atoList :: NonEmpty a -> [Item (NonEmpty a)] Generic (NonEmpty a) Instance detailsDefined in GHC.Generics Associated Typestype Rep (NonEmpty a) :: Type -> Type Methodsfrom :: NonEmpty a -> Rep (NonEmpty a) xto :: Rep (NonEmpty a) x -> NonEmpty a Read a => Read (NonEmpty a) Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (NonEmpty a) #readPrec :: ReadPrec (NonEmpty a)readListPrec :: ReadPrec [NonEmpty a] Show a => Show (NonEmpty a) Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> NonEmpty a -> ShowS #show :: NonEmpty a -> String #showList :: [NonEmpty a] -> ShowS # NFData a => NFData (NonEmpty a) Instance detailsDefined in Control.DeepSeq Methodsrnf :: NonEmpty a -> () Eq a => Eq (NonEmpty a) Instance detailsDefined in GHC.Base Methods(==) :: NonEmpty a -> NonEmpty a -> Bool #(/=) :: NonEmpty a -> NonEmpty a -> Bool # Ord a => Ord (NonEmpty a) Instance detailsDefined in GHC.Base Methodscompare :: NonEmpty a -> NonEmpty a -> Ordering #(<) :: NonEmpty a -> NonEmpty a -> Bool #(<=) :: NonEmpty a -> NonEmpty a -> Bool #(>) :: NonEmpty a -> NonEmpty a -> Bool #(>=) :: NonEmpty a -> NonEmpty a -> Bool #max :: NonEmpty a -> NonEmpty a -> NonEmpty a #min :: NonEmpty a -> NonEmpty a -> NonEmpty a # Generic1 NonEmpty Instance detailsDefined in GHC.Generics Associated Typestype Rep1 NonEmpty :: k -> Type Methodsfrom1 :: forall (a :: k). NonEmpty a -> Rep1 NonEmpty ato1 :: forall (a :: k). Rep1 NonEmpty a -> NonEmpty a type Item (NonEmpty a) Instance detailsDefined in GHC.Exts type Item (NonEmpty a) = a type Rep (NonEmpty a) Instance detailsDefined in GHC.Generics type Rep (NonEmpty a) = D1 ('MetaData "NonEmpty" "GHC.Base" "base" 'False) (C1 ('MetaCons ":|" ('InfixI 'LeftAssociative 9) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]))) type Rep1 NonEmpty Instance detailsDefined in GHC.Generics type Rep1 NonEmpty = D1 ('MetaData "NonEmpty" "GHC.Base" "base" 'False) (C1 ('MetaCons ":|" ('InfixI 'LeftAssociative 9) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))

notEmpty :: HasCallStack => [a] -> NonEmpty a Source #

fromList with a better error message. Useful to silence GHC's Pattern match(es) are non-exhaustive warning in places where the programmer knows it's always non-empty, but it's infeasible to express that in the type system.

A safe version of getWindowAttributes.

(Naïvely) turn a relative path into an absolute one.

• If the path starts with /, do nothing.
• If it starts with ~/, replace that with the actual home
• directory.
• Otherwise, prepend a / to the path.

Keys

Convert a full key combination; i.e., a KeyMask and KeySym pair, into a string.

Arguments

Convert a modifier mask into a useful string.

Strip numlock, capslock, mouse buttons and XKB group from a KeyMask, leaving only modifier keys like Shift, Control, Super, Hyper in the mask (hence the "Key" in "cleanKeyMask").

Core's cleanMask only strips the first two because key events from passive grabs (key bindings) are stripped of mouse buttons and XKB group by the X server already for compatibility reasons. For more info, see: https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Delivering_a_Key_or_Button_Event_to_a_Client

regularKeys :: [(String, KeySym)] Source #

A list of "regular" (extended ASCII) keys.

A list of all special key names and their associated KeySyms.

specialKeys :: [(String, KeySym)] Source #

A list of special key names and their corresponding KeySyms.

List of multimedia keys. If Xlib does not know about some keysym it's omitted from the list (stringToKeysym returns noSymbol in this case).

functionKeys :: [(String, KeySym)] Source #

A list pairing function key descriptor strings (e.g. "F2") with the associated KeySyms.

The specialized Screen derived from WindowSet.