/purescript-emoji-splitter

Split emojis into emoji list. 😍🏳️‍🌈👨🏻‍🌾☝🏿

Primary LanguagePureScriptMIT LicenseMIT

Emoji Splitter

Build status

Split emojis into emoji list.

> import Data.String.CodeUnits (toCharArray)
> toCharArray "😍🏳️‍🌈👨🏻‍🌾☝🏿"
['�','','','','','','','','','','','','','','','','','']

> import Data.String.CodePoints (singleton, toCodePointArray)
> singleton <$> toCodePointArray "😍🏳️‍🌈👨🏻‍🌾☝🏿"
["😍","🏳","","","🌈","👨","🏻","","🌾","","🏿"]

> import Data.String.EmojiSplitter (splitEmoji)
> splitEmoji "😍🏳️‍🌈👨🏻‍🌾☝🏿"
(Right ["😍","🏳️‍🌈","👨🏻‍🌾","☝🏿"])

※ Only emoji unicodes are supported.

Reference: UTS #51: Unicode Emoji #EBNF_and_Regex

Installation

bower install purescript-emoji-splitter

Documentation

Module documentation is published on Pursuit.