Skip to content

Instantly share code, notes, and snippets.

@exarkun
Created May 21, 2023 20:16
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