chshersh / iris

🌈 Haskell CLI Framework supporting Command Line Interface Guidelines
https://hackage.haskell.org/package/iris
Mozilla Public License 2.0
173 stars 21 forks source link

Add 'Emoji' type #109

Open chshersh opened 1 year ago

chshersh commented 1 year ago

I would like to add the emoji type that contains a textual alternative so the printing functions could decide how to print it based on the terminal support.

I imagine having the following type:

data Emoji = Emoji
    { emojiMain :: Text
    , emojiAlt :: Text
    }

with the intended usage like this:

success, failure, process :: Emoji
success = Iris.Emoji "✅  " "OK "
failure = Iris.Emoji "⛔  " "NO "
process = Iris.Emoji "📥  " ".. "

I propose creating a separate Iris.Emoji module where the Emoji definition with the documentation can be put.

So far, no function for outputting an emoji is required.