agentm / agentm/project-m36

Atomable for types without access to constructors

Offen
#207 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Haskell
Sterne
952
Forks
50
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I am trying to store the [`UUID`](https://hackage.haskell.org/package/uuid-1.3.13/docs/Data-UUID.html) type, but I can't work out a principled way to write an Atomable instance for it.

I can convert it to a Bytestring in Atomable, and then store that, but, aside from this being somewhat inefficient, there is no pure way to convert a Bytestring back to a UUID, as it may fail to parse, and the fromAtom function does not allow for failure of any kind. Of course I can simply use `error` but I don't like the idea that my data can then get into a completely failing state, if somehow a bad UUID bytestring gets persisted.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.