¤ Fudget Library 0.18.4 Reference Manual ¤

Created from the Fudget Library sources on 2023-06-21 17:48

Beginner's Index

Sections


GuiElems

Buttons:
data Click = ...
buttonF :: Graphic lbl => lbl -> F Click Click
radioGroupF :: (Graphic lbl, Eq alt) => [(alt, lbl)] -> alt -> F alt alt
toggleButtonF :: Graphic lbl => lbl -> F Bool Bool
Data entry fields:
intInputF :: F Int Int
passwdInputF :: F String String
stringInputF :: F String String
Decoration:
labAboveF :: Graphic p => p -> F c d -> F c d
labBelowF :: Graphic p => p -> F c d -> F c d
labLeftOfF :: Graphic p => p -> F c d -> F c d
labRightOfF :: Graphic p => p -> F c d -> F c d
labelF :: Graphic a1 => a1 -> F a2 b
Displaying and interacting with lists:
type PickListRequest a = ListRequest a
pickListF :: (a -> String) -> F (PickListRequest a) (InputMsg (Int, a))
Displaying text:
moreF :: F [String] (InputMsg (Int, String))
moreFileF :: F String (InputMsg (Int, String))
moreFileShellF :: F String (InputMsg (Int, String))
moreShellF :: String -> F [String] (InputMsg (Int, String))
Displays:
displayF :: Graphic g => F g void
intDispF :: F Int b
Menus:
menuF :: (Graphic mlbl, Graphic albl) => mlbl -> [(alt, albl)] -> F alt alt
popupMenuF :: (Eq b1, Graphic b1) => [(a, b1)] -> F c b2 -> F ([(a, b1)]  c) (a  b2)
Pop-up windows:
data ConfirmMsg = ...
confirmPopupF :: Graphic msg => F msg (msg, ConfirmMsg)
messagePopupF :: Graphic msg => F msg (msg, Click)
passwdPopupF :: String -> F (Maybe String, Maybe String) ((Maybe String, Maybe String), String)
stringPopupF :: String -> F (Maybe String, Maybe String) ((Maybe String, Maybe String), String)
Sound:
bellF :: F ho ho
Terminating the program:
quitF :: F ans ho

Combinators

Abstract fudgets: from stream processors:
absF :: SP a b -> F a b
Abstract fudgets: stateful:
mapstateF :: (t -> a -> (t, [b])) -> t -> F a b
Abstract fudgets: stateless:
concatMapF :: (a -> [b]) -> F a b
mapF :: (a -> b) -> F a b
Plumbing: circular connections:
loopF :: F a a -> F a a
loopLeftF :: F (a  b) (a  c) -> F b c
loopOnlyF :: F a a -> F a b
loopRightF :: F (a  b) (c  b) -> F a c
loopThroughRightF :: F (a  b) (c  d) -> F c a -> F b d
Plumbing: serial composition:
serCompF :: F a1 b -> F a2 a1 -> F a2 b
Plumbing: tagged parallel composition:
compF :: F a b -> F c d -> F (a  c) (b  d)
listF :: Eq a => [(a, F b c)] -> F (a, b) (a, c)
Plumbing: untagged parallel composition:
untaggedListF :: [F a b] -> F a b
The Fudget type:
data F hi ho = ...
The identity fudget:
idF :: F b b

InfixOps

Plumbing: serial composition:
>==< :: F a1 b -> F a2 a1 -> F a2 b
Plumbing: tagged parallel composition:
>+< :: F a b -> F c d -> F (a  c) (b  d)
Plumbing: untagged parallel composition:
>*< :: F c ho -> F c ho -> F c ho

Layout

A spacer that centers a box in the available space:
centerS :: Spacer
GUI fudget placement:
data Placer = ...
placerF :: Placer -> F a b -> F a b
GUI fudget spacing:
data Spacer = ...
spacerF :: Spacer -> F a b -> F a b
Placer modifying combinators:
flipP :: Placer -> Placer
revP :: Placer -> Placer
Placers: linear layouts:
horizontalP :: Placer
horizontalP' :: Distance -> Placer
verticalP :: Placer
verticalP' :: Distance -> Placer
Placers: matrixes and tables:
matrixP :: Int -> Placer
tableP :: Int -> Placer
Spacers that add margins to boxes:
type Distance = Int
marginS :: Distance -> Spacer

Containers

Scroll bars:
hScrollF :: F b d -> F b d
scrollF :: F b d -> F b d
vScrollF :: F b d -> F b d
Shell (top level) windows:
shellF :: String -> F c d -> F c d

StreamProc

Stream processor basics:
data SP a b = ...
Stream processor equivalents of some common list processing functions:
chopSP :: ((b -> SP a b) -> SP a b) -> SP a b
concatMapAccumlSP :: (t -> a -> (t, [b])) -> t -> SP a b
concatMapSP :: (t -> [b]) -> SP t b
concatSP :: SP [b] b
filterSP :: (b -> Bool) -> SP b b
idSP :: SP b b
idempotSP :: Eq a => SP a a
mapAccumlSP :: (t -> a -> (t, b)) -> t -> SP a b
mapSP :: (t -> b) -> SP t b
splitAtElemSP :: (a -> Bool) -> Cont (SP a b) [a]
zipSP :: [a] -> SP b (a, b)

InOut

A fudget that outputs ticks after specific delays and/or at specific intervals:
data Tick = ...
timerF :: F (Maybe (Int, Int)) Tick
File system access:
readDirF :: F String (String, IOError  [String])
readFileF :: F String (String, IOError  String)
writeFileF :: F (String, String) (String, IOError  ())

LowLevel

The combinator that connects the main fudget to the Haskell I/O system:
fudlogue :: F a b -> IO ()

Types

Buttons:
data Click = ...
Pop-up windows:
data ConfirmMsg = ...
Stream processor basics:
data SP a b = ...
The Fudget type:
data F hi ho = ...
type FCommand a = Message TCommand a
type FEvent a = Message TEvent a
type FSP hi ho = SP (FEvent hi) (FCommand ho)
type Fudget a b = F a b
type TCommand = (Path, FRequest)
type TEvent = (Path, FResponse)

FudUtilities

Various utility functions for pairs and lists:
aboth :: (t -> b) -> (t, t) -> (b, b)
anth :: Int -> (a -> a) -> [a] -> [a]
gmap :: Foldable t1 => (t2 -> [a] -> [a]) -> (t3 -> t2) -> t1 t3 -> [a]
issubset :: (Foldable t1, Foldable t2, Eq a) => t1 a -> t2 a -> Bool
lhead :: [a1] -> [a2] -> [a2]
loop :: (t -> t) -> t
lsplit :: [a1] -> [a2] -> ([a2], [a2])
ltail :: [a1] -> [a2] -> [a2]
mapPair :: (t1 -> a, t2 -> b) -> (t1, t2) -> (a, b)
number :: Int -> [a] -> [(Int, a)]
oo :: (t1 -> t2) -> (t3 -> t4 -> t1) -> t3 -> t4 -> t2
pair :: a -> b -> (a, b)
pairwith :: (t -> b) -> t -> (t, b)
part :: (a -> Bool) -> [a] -> ([a], [a])
remove :: Eq t => t -> [t] -> [t]
replace :: Eq a => (a, b) -> [(a, b)] -> [(a, b)]
segments :: (a -> Bool) -> [a] -> [[a]]
setFst :: (a1, b) -> a2 -> (a2, b)
setSnd :: (a, b1) -> b2 -> (a, b2)
swap :: (b, a) -> (a, b)
unionmap :: (Foldable t1, Eq a) => (t2 -> [a]) -> t1 t2 -> [a]

Debug

A fudget that shows the high level input and output of a fudget on the standard error output:
spyF :: (Show b, Show a1) => F a1 b -> F a1 b
An identity fudget that copies messages to the standard error output:
teeF :: (b -> String) -> String -> F b b

ContribFudgets

Menus:
menuF :: Eq a => Menu a -> F a a