Questions tagged [happstack]

Happstack is a fast and flexible Haskell web framework.

Happstack is a fast and flexible Haskell web framework.

111 questions
29
votes
7 answers

Installing Haskell packages on Mac

I can't seem to get a few Haskell packages to install on my Mac (10.6.8). I first tried Happstack and it failed and then I tried Snap. Sometimes when I run ghci I get a segmentation fault. Other times it works and goes like this: GHCi, version…
Jonovono
  • 3,437
  • 5
  • 42
  • 64
26
votes
1 answer

How can I check the client certificate using Snap

I know it's rarely used, but is it possible to access the client certificate in Snap? If not, is it possible using a different web stack?
J. Abrahamson
  • 72,246
  • 9
  • 135
  • 180
16
votes
2 answers

How can I implement HATEOAS in Haskell?

I have some old code which exposes services on a web API which works basically on HTTP verbs. I'd like to move this project to use hypermedia controls (HATEOAS). I'm wondering if there are any libraries already that support embedding links in…
opensourcegeek
  • 5,552
  • 7
  • 43
  • 64
9
votes
1 answer

What software is recommended for authentication using the Happstack web dev kit?

Last week three of us spent two days trying to build a simple web application using Happstack. One of our concerns is authentication, and it appears there was once a Happstack.Auth package that looks really good. Unfortunately the original project…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
8
votes
1 answer

How to create JSON Rest API with Happstack? JSON body?

I'm trying to create a JSON REST api using Happstack. It should allow POSTS with a JSON body. How can I do this? All the functions in happstack's API seem to look things up based on parameter name. It thinks the body is always url-encoded. If it…
Sean Clark Hess
  • 15,859
  • 12
  • 52
  • 100
8
votes
2 answers

How to use maybe monad inside another monad?

I have this code (inside happstack, but could be just the IO monad): accountHandler conn = do sessionId <- optional $ readCookieValue "sessionId" case sessionId of Nothing -> seeOther ("/" :: String) $ toResponse () Just s -> do …
Xavier Shay
  • 4,067
  • 1
  • 30
  • 54
8
votes
2 answers

Long polling in Yesod

Can I do long polling in Yesod, or any other Haskell web framework with comparable database facilities? To be precise, I want to delay a HTTP response until something interesting happens. There should also be a timeout after which the client will…
Adrian May
  • 2,127
  • 15
  • 24
7
votes
1 answer

Using values not from the application monad with Heist templates

I'm trying to write an application server using Happstack, Heist, and web-routes, but am having trouble figuring out how to let splices access values that don't originate from my application's monad stack. There are two situations where this comes…
Paul Kuliniewicz
  • 2,711
  • 18
  • 24
7
votes
2 answers

Haskell Webserver: maintaining application state

I'm trying to get more familiar with Haskell by developing web-app-ish services. Say I'm developing a web-server and I want to keep persistent state between requests; a counter, for instance. What is the Haskell way of doing things? I came across…
David
  • 2,533
  • 2
  • 18
  • 16
6
votes
1 answer

How do you deploy a Happstack application to production?

I can't seem find any documentation, any blogposts or other resources about this subject. From what I have seen so far there seems to be support for FastCGI but the project hasn't had a commit for 4 years. And then mod_proxy could probably be used.…
rzetterberg
  • 10,146
  • 4
  • 44
  • 54
5
votes
2 answers

How to create a Database Monad Stack in Happstack?

I want to create a Happstack application with lots of access to a database. I think that a Monad Stack with IO at the bottom and a Database Write-like monad on top (with log writer in the middle) will work to have a clear functions in each access,…
Zhen
  • 4,171
  • 5
  • 38
  • 57
5
votes
0 answers

How to resolve dependency tree with different version ranges of same packages?

I'm trying to set up a happstack-lite application using stack. I initialized project with these commands: stack new my-happstack cd my-happstack stack setup I changed package.yaml so it contains: dependencies: - base >= 4.7 && < 5 - happstack-lite…
Gera
  • 95
  • 4
5
votes
2 answers

Happstack-state concept and docs?

I'm starting making Haskell web server. I've decided to start with Happstack and Happstack-state. And I'm feeling hard to understand concept and attribute of Happstack-state. Is it a new kind of database? or Just object-graph like system? Can you…
eonil
  • 83,476
  • 81
  • 317
  • 516
5
votes
1 answer

With IxSet, can I build an Indexable wrapper around an arbitrary Indexable type?

What I'd like to be able to do is something like the following: import Data.IxSet newtype Key a = Key Integer deriving (Eq, Ord, Show) data Keyed a = Keyed { key :: (Key a), value :: a } deriving (Eq, Ord, Show) instance Indexable a =>…
Ben
  • 68,572
  • 20
  • 126
  • 174
5
votes
0 answers

happstack-server-tls only works with self-signed certificates

I am trying to create a web server using happstack-server-tls that will use a certificate signed by a private CA. Unfortunately, the TLS handshake only seems to succeed if I give the server a self-signed certificate. Wireshark shows that when my…
Paul Kuliniewicz
  • 2,711
  • 18
  • 24
1
2 3 4 5 6 7 8