haskell-hvr / uuid

A Haskell library for creating, printing and parsing UUIDs
http://hackage.haskell.org/package/uuid
61 stars 38 forks source link

gunfold and gfoldl implementations for instance Data UUID #42

Closed ddssff closed 3 years ago

ddssff commented 6 years ago

I ran into a situation where a problem I was diagnosing was masked by this call to error "gunfold". This seems like a harmless enhancement to the instance, unless I'm mistaken. These definitions are adapted from those generated by DeriveDataTypeable.

ddssff commented 6 years ago

I suppose this will leak implementation details...

λ> fmap gshow (fromString "ed41b3df-e0e3-4b95-bcf7-6630691639b7")
Just "(ed41b3df-e0e3-4b95-bcf7-6630691639b7 (17096143434607184789) (13616464356485511607))"
phadej commented 3 years ago

As Data instance is manually written, as far as we keep the "fake constructor" stable, it's fine to have it. However what representation we should expose? Related to https://github.com/haskell-hvr/uuid/issues/33, they should be the same.

ddssff commented 3 years ago

I will consider this and get back to you in 2024. :-)