boccato 2017-02-10 16:16:46
Sry to bother, can anyone help me with this: https://gist.github.com/boccato/f9b833d7372118f121b842d1a58fcd85
boccato 2017-02-10 16:19:23
The test was working before I included the withTempFile line.
boccato 2017-02-10 16:20:04
I am not sure how I would make WaiSession an instance of MonadMask, or if this even makes sense.
geekosaur 2017-02-10 16:22:27
I suspect the real problem is that `shouldRespondWith` is not applying to what you think it should, and that's confusing the web framework
boccato 2017-02-10 16:23:30
How so?
geekosaur 2017-02-10 16:23:31
*possibly* this is closer to what you need: (withTempFile "." "bla.txt" $ \file _ -> delete "bla") `shouldRespondWith` 200
geekosaur 2017-02-10 16:25:05
because you applied shouldRespondWith to the delete operation, so it's trying to use the WaiSession as the test framework and that would be a type error. If I'm reading it correctly, that is
markasoftware 2017-02-10 16:27:14
is it possible to do high-performance text processing in haskell?
markasoftware 2017-02-10 16:27:26
for, like, 200gb of data
markasoftware 2017-02-10 16:27:29
faster than node or awk
boccato 2017-02-10 16:27:48
geekosaur: same error
geekosaur 2017-02-10 16:27:52
if you use Data.Text and a reasonable streaming I/O abstraction (that is, pipes or conduit), I'd expect so
boccato 2017-02-10 16:28:26
The code is easier to understand though, which is a win :)
geekosaur 2017-02-10 16:28:32
boccato, then the problem is likely that you are not in a place where you can do withTempFile
geekosaur 2017-02-10 16:28:42
but I don;t know enough to help with that
boccato 2017-02-10 16:29:49
=) thanks for trying, I think I need to understand what is MonadMask for and why is it there... but I have a feeling I am going the wrong way
geekosaur 2017-02-10 16:30:29
yeh, that's where I stop being able to figue out what's going on too >.>
geekosaur 2017-02-10 16:32:05
I presume it's part of the test framework. "mask" usually means something about exceptions, so probably it wants to restrict exceptions to the test and not have them leak into the test framework itself --- but I don't know
boccato 2017-02-10 16:34:55
I think the MonadMask comes from the withTempFile function.
boccato 2017-02-10 16:35:15
@type withTempFile
lambdabot 2017-02-10 16:35:17
error: Variable not in scope: withTempFile
boccato 2017-02-10 16:36:41
:: (MonadIO m, MonadMask m) => String -> (FilePath -> Handle -> m a) -> m a
barrucadu 2017-02-10 16:37:57
liftIO (withTempFile "." "bla.txt" $ \file _ -> delete "bla") `shouldRespondWith` 200 -- might work, the liftIO will force it to use IO, which is both a MonadIO and a MonadMask
barrucadu 2017-02-10 16:38:14
MonadMask comes from the exceptions package
barrucadu 2017-02-10 16:38:33
https://hackage.haskell.org/package/exceptions-0.8.3/docs/Control-Monad-Catch.html#t:MonadMask
geekosaur 2017-02-10 16:42:40
actually I would expect that to fail
geekosaur 2017-02-10 16:42:55
because yes the withTempFile will work, but now the delete is not in WAI
geekosaur 2017-02-10 16:43:10
it's in IO and won't work from there
boccato 2017-02-10 16:43:49
it fails
boccato 2017-02-10 16:44:08
Couldn't match type 'WaiSession' with 'IO'
boccato 2017-02-10 16:45:03
I think the lambda should be returning an IO for this to work isn't it?