Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  emacs + ghc-mod + cabal repl (Miguel Negr?o)
   2.  scotty - autorefresh / reload (Miroslav Karpis)
   3. Re:  scotty - autorefresh / reload (Ben Kolera)


----------------------------------------------------------------------

Message: 1
Date: Wed, 19 Mar 2014 10:53:14 +0000
From: Miguel Negr?o <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] emacs + ghc-mod + cabal repl
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Em 18-03-2014 18:47, Miguel Negr?o escreveu:

Following that, a couple more questions:

Is it possible to have the haddock help for functions displayed inside
emacs (no browser) ?
How does one jump to the defition of a symbol ?

thanks,
Miguel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140319/6e6ef63a/attachment-0001.sig>

------------------------------

Message: 2
Date: Wed, 19 Mar 2014 11:55:22 +0100
From: Miroslav Karpis <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] scotty - autorefresh / reload
Message-ID: <cf4f362a.7675%[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi, please is there a way how I could autorefresh / reload the page in
scotty?


A small example, where I would like to see that the time refreshes every
second:

{-# LANGUAGE OverloadedStrings #-}

import Web.Scotty
import Control.Monad.Trans (liftIO)
import qualified Data.Text.Lazy as L (Text, pack)

import Data.Time.Clock

main = scotty 3005 $ do
get "/" $ do
time <- liftIO getTime
html time


getTime :: IO L.Text
getTime = do
utcTime <- getCurrentTime
let timeText = L.pack $ show utcTime
return timeText


Cheers,
M.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140319/5d3c680f/attachment-0001.html>

------------------------------

Message: 3
Date: Wed, 19 Mar 2014 21:11:56 +1000
From: Ben Kolera <[email protected]>
To: Begginers Help Haskell <[email protected]>
Subject: Re: [Haskell-beginners] scotty - autorefresh / reload
Message-ID:
        <capmqrp-jg9j6m5uej2zyuv-gu-wu7sggswdbnryyzybq3xx...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

If you explicitly want to avoid JavaScript / XHR you could use a meta
refresh attribute in your HTML page:

http://en.m.wikipedia.org/wiki/Meta_refresh

Cheers,
Ben
On 19 Mar 2014 20:55, "Miroslav Karpis" <[email protected]> wrote:

> Hi, please is there a way how I could autorefresh / reload the page in
> scotty?
>
>
> A small example, where I would like to see that the time refreshes every
> second:
>
> {-# LANGUAGE OverloadedStrings #-}
>
> import Web.Scotty
> import Control.Monad.Trans (liftIO)
> import qualified Data.Text.Lazy as L (Text, pack)
>
> import Data.Time.Clock
>
> main = scotty 3005 $ do
> get "/" $ do
> time <- liftIO getTime
> html time
>
>
> getTime :: IO L.Text
> getTime = do
> utcTime <- getCurrentTime
> let timeText = L.pack $ show utcTime
> return timeText
>
>
> Cheers,
> M.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140319/e46b7e8b/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 69, Issue 25
*****************************************

Reply via email to