Closed donatello closed 6 years ago
You are better off just doing this:
instance Store UUID where
size = ConstSize 16
poke uuid =
case toWords uuid of
(w1, w2, w3, w4) -> poke w1 >> poke w2 >> poke w3 >> poke w4
peek = fromWords <$> peek <*> peek <*> peek <*> peek
Yep, @jm4games 's suggestion is close to what I've used previously. GHC probably inlines the toWords / fromWords, but you can also import Data.UUID.Types.Internal
and directly use the UUID
constructor.
I tried something along the lines of:
but I get: