Questions tagged [haskell-snap-framework]

Snap is a simple web development framework, written in the Haskell programming language.

Snap is a simple web development framework for unix systems, written in the Haskell programming language. Snap has a high level of test coverage and is well-documented. Features include:

  • A fast HTTP server library with an optional high-concurrency backend using the libev event loop library
  • A sensible and clean monad for web programming
  • An HTML-based templating system for generating pages
  • A flexible system called snaplets for allowing web applications to be reused in a composable fashion.
232 questions
234
votes
4 answers

Comparing Haskell's Snap and Yesod web frameworks

The two Haskell web frameworks in the news recently are Yesod (at 0.8) and Snap (at 0.4). It's quite obvious that Yesod currently supports a lot more features than Snap. However, I can't stand the syntax Yesod uses for its HTML, CSS and Javascript.…
Muchin
  • 4,887
  • 4
  • 23
  • 25
37
votes
5 answers

How to remove a snap application (docker) completely

I made the mistake of installing Docker via Snap... Once I realised that snap hadn't permissions to run in my working directory (on a different partition), I removed it. Now I can't use docker after I've installed it via apt-get. Please help. I've…
invisiblegaudi
  • 373
  • 1
  • 3
  • 6
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
28
votes
3 answers

How to run Snap haskell webapp in production?

I've installed Snap/Haskell on my production Ubuntu server (on EC2), and checked-out my project - but how do I run it? I mean, locally, I run it from command line: project-name -p 8000 Does snap come with it's own web-server (it looks like it), and…
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
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
17
votes
2 answers

Snap tutorial and advice

Can anybody suggest me serious tutorial on Snap or book? Can you share your impressions about Snap? I have experience with web programming, but I started learn Haskell and it is great, so I want to wrote site using my new favorite language?
Damir
  • 54,277
  • 94
  • 246
  • 365
16
votes
0 answers

Type safe RPC call example from GHCJS client to Yesod/Snap/Servant

I have two, related questions about RPC call to Yesod/Snap/Servant: Say I have a function on the server, written in Haskell, compiled by GHC: add x y = x+y+42 How can: I call this function from the client (the client is also written in Haskell,…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
11
votes
2 answers

In Haskell, how can I abort a calculation when a web client disconnects

I have a Haskell-based web service that performs a calculation that for some input can take a really long time to finish. ("really long" here means over a minute) Because performing that calculation takes all the CPU available on the server, I place…
Daniel Martin
  • 23,083
  • 6
  • 50
  • 70
10
votes
3 answers

What is <|> in haskell?

I am still learning haskell and looking at the snap web framework. In their hello world example there is a thingy that looks like <|> site :: Snap () site = ifTop (writeBS "hello world") <|> route [ ("foo", writeBS "bar") ,…
Fresheyeball
  • 29,567
  • 20
  • 102
  • 164
10
votes
2 answers

Digestive Functors with a variable number of subforms (Snap/Heist)

I'm working on porting a site from PHP to Snap w/ Heist. I've ported some of the simpler forms to using Digestive Functors successfully, but now I have to do the tricky ones that require the use of subforms. This application manages producing…
cimmanon
  • 67,211
  • 17
  • 165
  • 171
9
votes
1 answer

Haskell, Snap: Simple snaplet construction. When do we use snaplet and when library?

I am trying to understand simple snaplet construction. Also, when do I actually need to make a snaplet and when a simple side library? And if I do need one how do I make it out of a library? For example, I have a bunch of DB functions where I wrap…
r.sendecky
  • 9,933
  • 9
  • 34
  • 62
9
votes
2 answers

How do i fix the snapd.socket no such file or directory error on MxLinux?

I've been trying to install a couple of apps using sudo snap install But whenever I try this I always get the same error: error: cannot communicate with server: Post http://localhost/v2/snaps/standard-notes: dial unix /run/snapd.socket:…
Shadoww
  • 111
  • 1
  • 1
  • 6
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

How to avoid converting among different 'string' types in haskell, using snapframework?

I want to produce the decoded result for POST data. Much code is 'wasted' in converting 'string'. That makes code ugly. Any better solutions? import Codec.Binary.Url (decode') import qualified Data.ByteString.Lazy.Char8 as L…
wenlong
  • 1,434
  • 1
  • 13
  • 22
6
votes
3 answers

Heist: How do I insert a dynamic list of sub-templates into a template?

I am writing a site for online surveys. I have a list of questions that all go on one html page and the list is of unknown length. Each question has the form stored in template qu1.tpl and the page is qu.tpl. Now I want to: replace some names in…
maf
  • 71
  • 2
1
2 3
15 16