tibetan-utils 0.1.1.9 → 0.1.1.10
raw patch · 3 files changed
+10/−9 lines, 3 filesdep −eitherdep −text-showPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: either, text-show
API changes (from Hackage documentation)
- Text.Megaparsec.Lexer.Tibetan: readBo :: (Integral a) => String -> Maybe a
+ Text.Megaparsec.Lexer.Tibetan: readBo :: Integral a => String -> Maybe a
- TextShow.Data.Integral.Tibetan: builderBo :: (Integral a) => a -> Maybe Builder
+ TextShow.Data.Integral.Tibetan: builderBo :: Integral a => a -> Maybe Builder
Files
- src/Text/Megaparsec/Lexer/Tibetan.hs +4/−1
- src/TextShow/Data/Integral/Tibetan.hs +3/−3
- tibetan-utils.cabal +3/−5
src/Text/Megaparsec/Lexer/Tibetan.hs view
@@ -8,13 +8,16 @@ ) where import Control.Composition-import Data.Either.Combinators import qualified Data.Text as T import Data.Void import System.Environment import Text.Megaparsec import Text.Megaparsec.Char import Text.Megaparsec.Char.Tibetan++rightToMaybe :: Either a b -> Maybe b+rightToMaybe Left{} = Nothing+rightToMaybe (Right x) = Just x -- | Read a string in, returning integral value or error --
src/TextShow/Data/Integral/Tibetan.hs view
@@ -3,21 +3,21 @@ , showBo) where import qualified Data.Text.Lazy as TL-import TextShow+import Data.Text.Lazy.Builder (Builder, toLazyText, fromLazyText) -- | Display positive integer as a `String` -- -- > λ > showBo 312 -- > Just "༣༡༢" showBo :: Integer -> Maybe String-showBo = fmap toString . builderBo+showBo = fmap (TL.unpack.toLazyText) . builderBo -- | show a positive intgeger as text, return `Nothing` if that doesn't work builderBo :: (Integral a) => a -> Maybe Builder builderBo int | int >= 0 = Just . fromLazyText $ foldr (.) id (zipWith TL.replace- (map showT [0..9])+ (fmap showT [0..9]) ["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"]) (showT (fromIntegral int :: Integer)) | otherwise = Nothing
tibetan-utils.cabal view
@@ -1,9 +1,9 @@ cabal-version: >=1.10 name: tibetan-utils-version: 0.1.1.9+version: 0.1.1.10 license: BSD3 license-file: LICENSE-copyright: Copyright: (c) 2016-2018 Vanessa McHale+copyright: Copyright: (c) 2016-2019 Vanessa McHale maintainer: vamchale@gmail.com author: Vanessa McHale synopsis: Parse and display tibetan numerals@@ -30,9 +30,7 @@ base >=4.8 && <5, megaparsec >=7.0, text -any,- composition-prelude -any,- text-show >=3.3,- either -any+ composition-prelude -any test-suite tibetan-utils-test type: exitcode-stdio-1.0