4 ms·
I'm farther from an expert than you. I tried (and failed) to find a less confusing way... One thing I see people doing when they have real gnarly type signatur
by m-j-fox 9y ago
I'm farther from an expert than you. I tried (and failed) to find a less confusing way...
One thing I see people doing when they have real gnarly type signature is to concentrate the horror in one place and paint a veneer of simplicity elsewhere:
type Get stateType returnType
= forall monad.
(SpockState monad ~ stateType, MonadIO monad, HasSpock monad)
=> monad returnType
Then elsewhere:
getBlockChain :: Get BlockChainState [Block]
getLatestBlock :: Get BlockChainState Block
This may only help superficially as type errors will still be hard-to-understand.
- aviaviavi 9y agoAh, I think this is a better though! If you got this working, feel free to open up a PR. Or I can look into it when I get time.