-
Thanks for the cool library. I have this piece of code, i can't really make much sense of the type errors. I'm not sure where to start to figure this out. Is it my code that is a problem or am i using sandwhich library code in the wrong way? I'm surprised by the first error about Any pointers to get this to work would be appreciated type MonadPipe m = (HasCallStack, MonadIO m, MonadError Error m)
B.connect :: MonadPipe m => HasCallStack => ValidatedConfig -> m Pipe
connect :: TopSpec
connect = do
describe "Connect" $ do
let config :: B.Config = def
case B.validateConfig config of
V.Failure err -> expectationFailure $ show err -- Line 31
V.Success vconf -> do
it "connects" $ do
pipe <- B.connect vconf -- Line 34
pure () errors
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The first error is because you're calling For the second error, I'm not sure what |
Beta Was this translation helpful? Give feedback.
The first error is because you're calling
expectationFailure
outside of anExampleT
. In general all the actual effectful test code should be wrapped init
blocks--if you move theit
line to just after thedescribe
line then it should work.For the second error, I'm not sure what
MonadPipe
is but it's possible we don't have suitable instances yet forExampleT
. It's possible we could add aMonadError
instance if that's all it needs. Are you trying to use this? It seems all that needs isMonadIO
.