Skip to content

Instantly share code, notes, and snippets.

@exarkun
Created May 21, 2023 20:16
Show Gist options
  • Save exarkun/17f9a5bd01eda35eb6632dff862b7bae to your computer and use it in GitHub Desktop.
Save exarkun/17f9a5bd01eda35eb6632dff862b7bae to your computer and use it in GitHub Desktop.
class DangerouslyShow s where
dangerouslyShow :: s -> T.Text
class (Show c, DangerouslyShow c) => Capability c where
parse :: B.ByteString -> Either e c
class (MonadIO m, Capability v) => VerifyCapability m v where
verify :: v -> m Bool
class (MonadIO m, Capability r, VerifyCapability m v) => ReadCapability m v r | r -> v where
decodeMaybe :: r -> [B.ByteString] -> m (Maybe B.ByteString)
diminish :: r -> v -- Could not deduce (ReadCapability m0 v r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment