Right now, the remote class accepts arbitrary Text. Both for reasons of documentation, and ensuring that we're expressing our intent, this should be strengthened at the type level.
Solution
Use the existing CID type newtype CID = CID { unaddress :: Text }
ipfsCat :: Text -> m (Either ClientError File.Serialized)
ipfsPin :: Text -> m (Either ClientError Pin.Response)
ipfsUnpin :: Text -> Bool -> m (Either ClientError Pin.Response)
should read
ipfsCat :: CID -> m (Either ClientError File.Serialized)
ipfsPin :: CID -> m (Either ClientError Pin.Response)
ipfsUnpin :: CID -> Bool -> m (Either ClientError Pin.Response)
Problem
Right now, the remote class accepts arbitrary
Text
. Both for reasons of documentation, and ensuring that we're expressing our intent, this should be strengthened at the type level.Solution
Use the existing CID type
newtype CID = CID { unaddress :: Text }
should read