Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- groups :: Int -> [a] -> [[a]]
- delete1 :: Eq a => a -> [a] -> Maybe [a]
- index :: Int -> [a] -> Maybe a
- select :: Int -> [a] -> (a, [a])
- init' :: [a] -> [a]
- chooseTwo :: [a] -> [(a, a)]
- seconds :: Int -> Int
- shuffleIO :: [a] -> IO [a]
- shuffle :: RandomGen g => [a] -> g -> ([a], g)
- shuffle' :: RandomGen g => Int -> [a] -> g -> ([a], g)
- centerText :: Int -> String -> String
- leftPadText :: Int -> String -> String
- rightPadText :: Int -> String -> String
Documentation
groups :: Int -> [a] -> [[a]] Source
groups
breaks a list into sublists of the given size. The final resulting
group may contain fewer elements than the given size.
Property: For all positive n. concat (groups n xs) == xs
select :: Int -> [a] -> (a, [a]) Source
Extract an element from a list by index returning that element and the remaining list.
shuffle :: RandomGen g => [a] -> g -> ([a], g) Source
shuffle
shuffles the elements of a list using the given random generator.
centerText :: Int -> String -> String Source
centerText
centers the given string in a field of @width characters.
leftPadText :: Int -> String -> String Source
centerText
right-aligns the given string in a field of @width characters.
rightPadText :: Int -> String -> String Source
centerText
left-aligns the given string in a field of @width characters.