Compare commits

...

2 commits

Author SHA1 Message Date
05428fa520 WIP: Implement wordWrap 2023-08-25 23:13:00 +02:00
9b6b126a7b floke: Simplify packages function 2023-08-24 21:04:50 +02:00
2 changed files with 11 additions and 2 deletions

View file

@ -62,8 +62,7 @@
devShells.default = haskellPackages.shellFor { devShells.default = haskellPackages.shellFor {
inherit (self.checks.${system}.pre-commit-check) shellHook; inherit (self.checks.${system}.pre-commit-check) shellHook;
packages = _: packages = _: [ self.packages.${system}.default ];
pkgs.lib.filter (x: x != null) [ self.packages.${system}.default ];
withHoogle = true; withHoogle = true;

View file

@ -1,6 +1,8 @@
-- | Internal module in order to facilitate testability. -- | Internal module in order to facilitate testability.
module HCat.Internal where 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@ takes a list of strings and returns a single FilePath if there was exactly one element.
-- --
-- >>> parseArgs ["foo"] -- >>> parseArgs ["foo"]
@ -28,3 +30,11 @@ chunksOf n xs@(_ : _)
| otherwise = | otherwise =
let (chunk, rest) = splitAt n xs let (chunk, rest) = splitAt n xs
in chunk : chunksOf n rest 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