Search code examples
haskellhappstack

Happstack - hello world server


main = simpleHTTP nullConf $ ok "Hello, World!"

i am a newbie trying out haskell with happstack-server. In this hello world program, i got these doubts:

1) Server's default configuration, nullConf, where is it defined? at least it is not there in $HOME/.cabal/Happstack/Server.hs

2) What does $ symbol in the middle of function arguments mean?

3) Is there any way, i can force cabal to download source libraries instead of compiled haskell binaries? That will help me a lot in source code debugging.


Solution

  • 1) Both simpleHTTP and nullConf will be defined in whatever library you're importing.

    2) The $ symbol is mentioned in a dozen Haskell tutorials and Stack Overflow questions; basically it allows you to avoid putting stuff in brackets.

    3) Cabal already downloads everything as source code. But it immediately compiles it into binaries and then deletes the sources. However, if you read the package documentation on Hackage, every page has a "Source Code" link that will show you syntax-highlighted code, right in your browser. (Just make sure you're reading the same package version as the one you have installed!)