bizzlelude 4.20.2.0 → 4.20.2.0.1
raw patch · 4 files changed
+66/−6 lines, 4 files
Files
- bizzlelude.cabal +4/−4
- src/main/Data/Text/Word.hs +56/−0
- src/main/External.hs +1/−1
- src/main/Misc.hs +5/−1
bizzlelude.cabal view
@@ -1,6 +1,6 @@-Cabal-Version: 3.6+Cabal-Version: 3.8 Name: bizzlelude-Version: 4.20.2.0+Version: 4.20.2.0.1 License: BSD-3-Clause License-File: LICENSE.txt Author: Jason Bertsche@@ -18,9 +18,9 @@ library hs-source-dirs: src/main- exposed-modules: Prelude+ exposed-modules: Prelude, Data.Text.Word default-extensions: OverloadedStrings- default-language: Haskell2010+ default-language: GHC2024 other-modules: External, Misc, Tuple2, Tuple3, Tuple4 GHC-Options: -Wall
+ src/main/Data/Text/Word.hs view
@@ -0,0 +1,56 @@+{-# LANGUAGE NoImplicitPrelude #-}+module Data.Text.Word(center, chunksOf, compareLength, count, drop, dropEnd, findIndex, index, justifyLeft, justifyRight, length, replicate, splitAt, take, takeEnd, unfoldrN) where++import External(($), Bool, Char, fromIntegral, Maybe, Ordering, Text, Word)+import Misc((&>), map)++import qualified Data.Text as T+++center :: Word -> Char -> Text -> Text+center a b c = T.center (fromIntegral a) b c++chunksOf :: Word -> Text -> [Text]+chunksOf a b = T.chunksOf (fromIntegral a) b++compareLength :: Text -> Word -> Ordering+compareLength a b = T.compareLength a (fromIntegral b)++count :: Text -> Text -> Word+count a b = fromIntegral $ T.count a b++dropEnd :: Word -> Text -> Text+dropEnd a b = T.dropEnd (fromIntegral a) b++drop :: Word -> Text -> Text+drop a b = T.drop (fromIntegral a) b++findIndex :: (Char -> Bool) -> Text -> Maybe Word+findIndex f = (T.findIndex f) &> (map fromIntegral)++index :: Text -> Word -> Char+index a b = T.index a (fromIntegral b)++justifyLeft :: Word -> Char -> Text -> Text+justifyLeft a b c = T.justifyLeft (fromIntegral a) b c++justifyRight :: Word -> Char -> Text -> Text+justifyRight a b c = T.justifyRight (fromIntegral a) b c++length :: Text -> Word+length = T.length &> fromIntegral++replicate :: Word -> Text -> Text+replicate a b = T.replicate (fromIntegral a) b++splitAt :: Word -> Text -> (Text, Text)+splitAt a b = T.splitAt (fromIntegral a) b++takeEnd :: Word -> Text -> Text+takeEnd a b = T.takeEnd (fromIntegral a) b++take :: Word -> Text -> Text+take a b = T.take (fromIntegral a) b++unfoldrN :: Word -> (a -> Maybe (Char, a)) -> a -> Text+unfoldrN a f c = T.unfoldrN (fromIntegral a) f c
src/main/External.hs view
@@ -2,7 +2,7 @@ module External(module Control.Arrow, module Control.Applicative, module Control.Monad, module Control.Monad.IO.Class, module Control.Monad.State, module Data.Bifoldable, module Data.Bifunctor, module Data.Bool, module Data.ByteString, module Data.Char, module Data.Either, module Data.Eq, module Data.Foldable, module Data.Function, module Data.Functor, module Data.Int, module Data.IntSet, module Data.List.NonEmpty, module Data.Map, module Data.Maybe, module Data.Monoid, module Data.Ord, module Data.Semigroup, module Data.Set, module Data.Text, module Data.Traversable, module Data.Tuple, module Data.Validation, module Data.Void, module Data.Word, module Debug.Trace, module GHC.Base, module GHC.Enum, module GHC.Err, module GHC.Float, module GHC.IO, module GHC.Num, module GHC.Real, module GHC.Show, module Numeric, module System.IO.Error, module Text.Read) where import Control.Arrow((&&&), (***))-import Control.Applicative((<**>), Alternative((<|>), empty, many, some), Applicative((<*>), (<*), (*>), pure), liftA2, optional)+import Control.Applicative((<**>), Alternative((<|>), many, some), Applicative((<*>), (<*), (*>), pure), liftA2, optional) import Control.Monad((=<<), filterM, foldM, foldM_, forM, forM_, guard, join, mapM, mapM_, Monad((>>), (>>=), return), MonadPlus(), sequence, sequence_, unless, when) import Control.Monad.IO.Class(liftIO) import Control.Monad.State(evalState, execState, mapState, runState, State, withState)
src/main/Misc.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-missing-import-lists #-}-module Misc((|>), (&>), (&>=), (>>>), (>=>), (/#), asString, asPath, asText, showText, concat, error, fromEither, map, pam, (<&>), cartProduct, regexMatch, groupOn, return', scalaGroupBy, putStrFlush, traceLabel, unsafeRead, listDirsRecursively, uncurry5) where+module Misc((|>), (&>), (&>=), (>>>), (>=>), (/#), aempty, asString, asPath, asText, showText, concat, error, fromEither, map, pam, (<&>), cartProduct, regexMatch, groupOn, return', scalaGroupBy, putStrFlush, traceLabel, unsafeRead, listDirsRecursively, uncurry5) where import External @@ -8,6 +8,7 @@ import GHC.Real(Fractional((/)), realToFrac) +import qualified Control.Applicative as Apply import qualified Control.Arrow as CArrow import qualified Control.Monad as CMonad import qualified Data.Either as Either@@ -38,6 +39,9 @@ infixl 2 >>>, >=> infixl 1 |>++aempty :: Apply.Alternative f => f a+aempty = Apply.empty asString :: Text -> String asString = Text.unpack