module TextShow.Data.Integral.Tibetan ( builderBo
, showBo) where
import qualified Data.Text.Lazy as TL
import Data.Text.Lazy.Builder (Builder, toLazyText, fromLazyText)
showBo :: Integer -> Maybe String
showBo = fmap (TL.unpack.toLazyText) . builderBo
builderBo :: (Integral a) => a -> Maybe Builder
builderBo int
| int >= 0 = Just . fromLazyText $ foldr (.) id
(zipWith TL.replace
(fmap showT [0..9])
["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"])
(showT (fromIntegral int :: Integer))
| otherwise = Nothing
showT = TL.pack . show