I've seen benchmarks on Yesod's homepage, but they are mostly for static files. And the benchmarks on Snap's website are outdated.
I'm trying to expose a Haskell module as a service. The server's logic is to receive the function name and arguments…
I was wondering if it is possible to match on PATCH requests in Happstack besides the fact that the Method datatype has no constructor for PATCH:
data Method
= GET | HEAD | POST | PUT | DELETE | TRACE | OPTIONS | CONNECT
However, there are…
This is a Haskell newb question probably to do with the IO() monad.
I've got a function in a Happstack.Server program that generates a response for a file upload.
postFile = do methodM POST
decodeBody filePolicy
(tmp,…
Why is it that I can't do
z = x?
but I can do this?
y s = x s
I'm a Haskell newbie
This is what I've been trying in GHCi:
Prelude> import Happstack.Server
Prelude Happstack.Server> let x s = ok $ toResponse $ "Some string"
Prelude…
Can anyone help me "translate" the below from happs to happstack:
module Main where
import HAppS.Server.AlternativeHTTP
import HAppS.Server.HTTP.AltFileServe
import Control.Monad.State
import Numeric
import Contracts
instance FromData ExContr…
I'm trying to store a counter of all 200 response codes in my happstack application.
module Main where
import Happstack.Server
import Control.Concurrent
import Control.Monad.IO.Class ( liftIO )
import Control.Monad
main :: IO ()
main = do
…
I'm trying to implement a simple request handler using Happstack:
main :: IO ()
main = simpleHTTP nullConf app
app :: ServerPart Response
app = msum [
dir "hello" $ method GET >> helloGet
, dir "hello" $ method POST >>…
So I have a project that I think is simple enough to learn with, but complex enough to be interesting that I would like to write using the Happstack library. At it's most fundamental level, this project would just be a fancy file server with some…
It seems I don't understand how text index in IxSet should work. Here, I created a unit-test that indexes items by tags field, and then query items by tag "tag". It should (from my perspective) give me back all 3 items (because they all have tag…
I'm reading some documentation on IxSet's http://happstack.com/docs/crashcourse/AcidState.html#ixset , and I was wondering about looking at source of Indexable typeclass which is imported from Data.IxSet.
So then I took a repository of Happstack and…
I'm trying to extend Happstack crash course blog with some additional functionality: displaying a list of all tags on home page.
My blog record looks like this:
data Blog = Blog
{ nextPostId :: PostId
, posts :: IxSet Post
, allTags…
I am writing a Happstack server and I have a MongoDB database to connect to. For that, I made a function to create a connection pool
type MongoPool = Pool IOError Pipe
withMongo :: (MongoPool -> IO a) -> IO ()
withMongo f = do
pool <- dbPool
…
The happstack tutorial provides the following sample:
main :: IO ()
main = simpleHTTP nullConf $ msum
[ do methodM GET
ok $ "You did a GET request.\n"
, do methodM POST
ok $ "You did a POST request.\n"
,…
I'm kind of a noob at Haskell, so I'm not entirely sure if this is a Happstack question or a general Haskell question.
Here's an example of the difficulty I'm having. This code "theoretically" renders some content, but actually throws an…