WIP: Implement wordWrap

This commit is contained in:
Alexander Kobjolke 2023-08-25 23:13:00 +02:00
parent 67b691d410
commit 4e3feae5e6

View file

@ -1,6 +1,8 @@
-- | Internal module in order to facilitate testability.
module HCat.Internal where
import Data.Text (Text)
-- | @parseArgs@ takes a list of strings and returns a single FilePath if there was exactly one element.
--
-- >>> parseArgs ["foo"]
@ -28,3 +30,11 @@ chunksOf n xs@(_ : _)
| otherwise =
let (chunk, rest) = splitAt n xs
in chunk : chunksOf n rest
-- | @wordWrap@ splits the given Text if it is longer than the given margin.
--
-- >>> :set -XOverloadedStrings
-- >>> wordWrap 3 $ "abcdef"
-- ["abc", "def"]
wordWrap :: Int -> Text -> [Text]
wordWrap = undefined