haskell-snap-framework

Snap: compiled splices code example

こ雲淡風輕ζ 提交于 2019-12-04 11:26:26
I think I did asked a similar question some time ago but it was not answered due to unstable API. So I was waiting for the 0.13 to pass by. I am not sure if it is correct to bring up a similar question...? What is the alternative to interpreted runChildrenWith(Text) and mapSplices in the compiled splices world? (this combination seems to be the most common) I would really appreciate some code examples if possible. If I understand correctly, we get together all the application splices and then add them to the heistInit . Can anyone show how to do it please? Does the splice binding tag has to be

Installing Haskell packages on Mac

对着背影说爱祢 提交于 2019-12-03 05:36:38
问题 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 7.4.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> When trying to get Snap: .... .... .... Loading package

How to run Snap haskell webapp in production?

只愿长相守 提交于 2019-12-03 03:08:14
问题 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 if so how do I go about configuring it to run as a daemon of some sort? Any tips? Edit 2: On the wiki they say: snap-server is an HTTP server library that supports the interface defined in snap-core. While here, the haskell wiki about "Deployment

How to run Snap haskell webapp in production?

倖福魔咒の 提交于 2019-12-02 15:11:59
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 if so how do I go about configuring it to run as a daemon of some sort? Any tips? Edit 2: On the wiki they say: snap-server is an HTTP server library that supports the interface defined in snap-core. While here, the haskell wiki about "Deployment/Backend options for your haskell web code" says that Snap: includes its own server. see Web/Frameworks

How to show utf8 text with snap and heist?

半城伤御伤魂 提交于 2019-11-30 09:58:50
问题 I have used writeBS writeText from Snap and renderTemplate from heist but none of them seems to support unicode. site :: Snap () site = do ifTop (writeBS "你好世界") <|> route [("test", testSnap)] testSnap :: Snap () testSnap = do fromJust $ C.renderTemplate hs "test" -- test.tpl 你好世界 I expected it to output "你好世界" for the / or /test route, but in fact its output is just some messy code. 回答1: The problem here is not with writeBS or writeText. It's with the conversion used by the OverloadedStrings

Issue installing Snap on macOS Sierra

跟風遠走 提交于 2019-11-28 10:54:21
问题 I'm having trouble installing the Haskell framework Snap on macOS Sierra. Whenever I install it, I get the following message: Resolving dependencies... Configuring securemem-0.1.9... Configuring skein-1.0.9.4... Configuring configurator-0.3.0.0... Configuring cryptonite-0.24... Building configurator-0.3.0.0... Building securemem-0.1.9... Building skein-1.0.9.4... Failed to install configurator-0.3.0.0 Build log ( /Users/nicholas/.cabal/logs/ghc-8.2.1/configurator-0.3.0.0

Comparing Haskell's Snap and Yesod web frameworks

被刻印的时光 ゝ 提交于 2019-11-27 09:56:57
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. So, I'd like to understand what I'd be missing if I went with Snap instead. For example, doesn't look like database support is there. How about sessions? Other features? mightybyte Full disclosure: I'm one of the lead developers of Snap. First of all, let's talk about what Snap is. Right now the Snap team maintains five different projects on hackage