Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ulid support #4

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Add ulid support #4

merged 1 commit into from
Mar 1, 2024

Conversation

newhoggy
Copy link
Member

No description provided.

src/Data/RdsData/Decode/Array.hs Show resolved Hide resolved
textToUlid :: Text -> Either Text ULID
textToUlid t =
case ULID.decode 26 t of
(n, ""):_ -> ULID.ulidFromInteger n
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be pattern matching on the singleton list? Although it's only possible for this function to return []or [val].

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched the code to use the Read instance with avoids having to deal with the list.

@newhoggy newhoggy merged commit 1ebeb90 into main Mar 1, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants