Questions tagged [happstack]

Happstack is a fast and flexible Haskell web framework.

Happstack is a fast and flexible Haskell web framework.

111 questions
0
votes
2 answers

Run HAppStack app withot cabal

I'm trying out HAppStack. I installed HAppStack and created a project: happstack new project web. New folder 'web' created with project guestbook under it. So now I want to run it. The only way I could do it is run cabal install. But I want to run…
demi
  • 5,384
  • 6
  • 37
  • 57
0
votes
4 answers

Why is web routing not always automated?

What is the purpose of manual web routing? Why doesn't everyone just automatically map between URLs and module/method/function names? I would argue that you can start with fully automatic mapping, and then you can just use Apache mod_rewrite or…
Robin Green
  • 32,079
  • 16
  • 104
  • 187
0
votes
1 answer

Haskell web routes example with Happstack and blaze is not showing two different URLs

I've already done the the Happstack crash course and had working reform and web routes examples. I'm trying to combine the two like so, but showURL Home and showURL Login show the same URL for my example application. Here is the example…
DetriusXii
  • 31
  • 1
  • 4
0
votes
1 answer

(How) can I host a Haskell website build on Windows on CentOS / Ubuntu?

I've built a website in Haskell (using Happstack) that I now want to host somewhere. I built it on Windows, using ghc to produce a file called website.exe. It's my first program in Haskell, and first website, but works very well when I run the .exe…
David
  • 309
  • 1
  • 9
0
votes
1 answer

How to get value out of nested synonym type

I have defined my own type called CtrlV: {-# LANGUAGE TemplateHaskell #-} import Data.Data (Data, Typeable) import Happstack.Server (Response, ServerPartT) import Web.Routes (RouteT) import Web.Routes.TH (derivePathInfo) type App = ServerPartT…
alex.b
  • 184
  • 1
  • 2
  • 15
0
votes
2 answers

The order of functions' execution in a high order function

I have a function here (map (\ (a, b) -> dir a b) $ routes where routes is a list of tuples and it contains routes = [... ("graph-fb", seeOther redirectUrlGraphEmail $ toResponse ""), ("post-fb", seeOther…
Mia.M
  • 97
  • 1
  • 1
  • 8
0
votes
1 answer

Does each Route include its Request and the Response returned by the Server?

For each dir.. , it is a Route which takes in a Request and returns a Response created by the Server. I am wondering if the Request and the Response included in each line of the code. Thanks in advance! simpleHTTP serverConf $ do decodeBody…
Mia.M
  • 97
  • 1
  • 1
  • 8
0
votes
1 answer

Haskell Blaze HTML

been writing an application that consumes JSON data and then displays it using Happstack. helloBlaze :: ServerPart Response helloBlaze = ok $ toResponse $ appTemplate "Hello, Blaze!" [H.meta ! A.name "keywords" …
user4828533
0
votes
1 answer

Haskell Happstack, can I use a string with html tags as response?

module Main where import Happstack.Lite import Text.Html main :: IO () main = serve Nothing $ msum [ nullDir >> ok homePage , notFound page404 ] homePage :: Response homePage =…
Larry
  • 858
  • 10
  • 16
0
votes
1 answer

Haskell Happstack

trying to use happstack, got it to install correctly on windows but now it's chucking out some errors when I compile my test class any input would be appreciated. module Main where import Happstack.Server import Text.Blaze ((!)) import…
user4201880
0
votes
1 answer

Happstack: Empty Cookies

I am trying to access the rqCookies attribute of a Request in Happstack Server, however I continue to get an empty list, when there are cookies that are in the request headers. I have also tried to use the readCookieValue function, but this cannot…
Citronen
  • 4,050
  • 4
  • 16
  • 20
0
votes
1 answer

backend serving currenttime (in json) in haskell

I want to write a simple webserver in haskell which provides the current time. The time should be returned in json format. Here is what I have so far: {-# LANGUAGE DeriveDataTypeable #-} import Happstack.Server import Text.JSON.Generic import…
fuji
  • 1,173
  • 1
  • 10
  • 27
0
votes
2 answers

How to carry non-Acidic value in Happstack?

I've read Happstack crashcourse. My web server has almost exact way described in the section Passing multiple AcidState handles around transparently Problem I have is that, I have value which is non-acidic, but want to access within the Happstack…
katsu
  • 13
  • 2
0
votes
1 answer

Happstack.lite tutorial failing to compile with "Illegal type signature: `String'"

I've been following this Happstack.Lite tutorial: http://www.happstack.com/page/view-page-slug/9/happstack-lite-tutorial with much success but I can't seem to get past this compile error: $ ghc crashcourse.hs -o crashcourse [1 of 1] Compiling Main …
Kevin Pluck
  • 641
  • 5
  • 14
0
votes
1 answer

How can I separate a route fall through and a index page visit in Happstack?

I want the user to be able to visit myserver.com and come to the index route. And I want to show the list page when they visit myserver.com/pages. However if the user visits an invalid url such as myserver.com/invalidpath/blabla it falls through to…
rzetterberg
  • 10,146
  • 4
  • 44
  • 54