Skip to content

Commit

Permalink
cleanup: add Encoding class
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Sep 24, 2023
1 parent 06b6efe commit 772e74e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Extism.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module Extism (
pluginID,
unwrap,
ToBytes(..),
Encoding,
FromBytes(..),
JSONValue(..)
) where
Expand Down Expand Up @@ -152,6 +153,9 @@ class ToBytes a where
class FromBytes a where
fromBytes :: B.ByteString -> Result a

-- Encoding is used to indicate a type implements both `ToBytes` and `FromBytes`
class (ToBytes a, FromBytes a) => Encoding a where

instance ToBytes B.ByteString where
toBytes x = x

Expand Down

0 comments on commit 772e74e

Please sign in to comment.