snowchecked-0.0.1.0: A checksummed variation on Twitter's Snowflake UID generation algorithm
Safe HaskellNone
LanguageHaskell2010

Data.Snowchecked.Encoding.Text

Description

This module provides a generalized conversion function between a Flake and all types that are members of both FromText and ToText. It is specialized for the strict Text and String types. It is marked as incoherent due to the constraint being no smaller than the instance type, so it is undecidable.

To specify how you want the conversion to be performed, you need to wrap the text-like type the Base16 constructor. Other encodings (eg: Base64) may be added later.

Note that when converting to a Flake, the implementation silently discards characters other than digits, a-f, and A-F. This allows you to apply formatting to the Flake.

Documentation

Orphan instances