f-o-a-m / kepler

A Haskell framework that facilitates writing ABCI applications
https://kepler.dev
Apache License 2.0
34 stars 10 forks source link

Change the RawKey class from Iso to Lens' #255

Open martyall opened 3 years ago

martyall commented 3 years ago

We currently have

class RawKey a where
  rawKey :: Iso a ByteString

but we really don't ever use the from rawKey :: RawKey a => ByteString -> a method at all. We should change the class to

class RawKey a where
  rawKey :: a -> ByteString
UnitylChaos commented 3 years ago

Might this create a problem with #254 though? I assume currently we never read key bytes from store and deserialize into the type, but when iterating through the Map presumably we would need to be able to turn those bytes back into keys.