Package

purescript-emoji-splitter

Repository
opyapeus/purescript-emoji-splitter
License
MIT
Uploaded by
opyapeus
Published on
2019-08-03T15:43:29Z

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.