fortytwo-1.0.3: Interactive terminal prompt

Safe HaskellSafe
LanguageHaskell2010

FortyTwo.Utils

Synopsis

Documentation

noBuffering :: IO () Source #

Disable the stdin stdout output buffering

restoreBuffering :: IO () Source #

Enaable the stdin stdout buffering

noEcho :: IO () Source #

Avoid echoing the user input

restoreEcho :: IO () Source #

Restore the user input echos

clearLines :: Int -> IO () Source #

Clear terminal lines from the current cursor position

map' :: (Int -> a -> b) -> [a] -> [b] Source #

Map a collection with an index

filter' :: Eq a => (Int -> a -> Bool) -> [a] -> [a] Source #

Filter a collection with index

getKey :: IO String Source #

Get the value of any keyboard press

flush :: IO () Source #

Flush the output buffer

getOptionsMeta :: Options -> (Int, Int, Maybe Int) Source #

Get useful informations from the options collection, like minVal, maxVal, activeIndex

getOptionsLines :: Options -> Int Source #

Get the amount of breaking lines needed to display all the options

stringsToOptions :: [String] -> Options Source #

Convert a string array to

focusOption :: Int -> Options -> Options Source #

Give the focus to a single option in the collection

addBreakingLinesSpacing :: String -> String -> String Source #

Normalise the select/multiselect multi lines adding the spaces to format them properly

toggleFocusedOption :: Int -> Options -> Options Source #

Toggle the isSelected flag for a single option

toCommaSeparatedString :: [String] -> String Source #

Print a list to comma separated

getOptionValue :: Option -> String Source #

Get the value of any option

getOptionIsFocused :: Option -> Bool Source #

Get the is focused attribute of any option

getOptionIsSelected :: Option -> Bool Source #

Get the is selected attribute of any option

getFocusedOptionIndex :: Options -> Maybe Int Source #

Get the index of the option selected

getSelecteOptionsIndexes :: Options -> [Int] Source #

Filter the indexes of the options selected