[GHC] #7015: Add support for 'static'
GHC
ghc-devs at haskell.org
Wed Aug 20 01:37:40 UTC 2014
#7015: Add support for 'static'
-------------------------------------+-------------------------------------
Reporter: edsko | Owner:
Type: feature | Status: patch
request | Milestone: 7.10.1
Priority: normal | Version: 7.4.2
Component: Compiler | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D119 |
-------------------------------------+-------------------------------------
Comment (by rodlogic):
I would just like to document another potential use case for this in
addition to the Cloud Haskell one: [http://haste-lang.org/haskell14.pdf A
Seamless, Client-Centric Programming Model for Type Safe Web
Applications].
I am thin on the details here since I just came across the paper, but the
idea is to provide an:
... alternative programming model based on Haskell, in which web
applications are written as a single program rather than as two
independent parts that just so happen to talk to each other.
And:
The remote function takes an arbitrary function, provided that all its
arguments as well as its return value are serializable through the
Serialize type class, and '''produces a typed identifier which may be used
to refer to the remote function'''. In this example, the type of greetings
is Remote (String → Server ()), indicating that the identifier refers to a
remote function with a single String argument and no return value. Remote
functions all live in the Server monad. The part of the program contained
within the App monad is executed on both the server and the client, albeit
with slightly different side effects, as described in section 3.
And here is a simple example:
{{{#!haskell
import Haste.App
helloServer :: String → Server ()
helloServer name = liftIO $ putStrLn (name ++ " says hello!")
main :: App Done
main = do
greetings ← remote helloServer
runClient $ do
name ← prompt "Hi there, what is your name?" onServer (greetings <.>
name)
}}}
I know this is not the core of the design space, but it is another
dimension to consider. For example, being able to customize the closure
serialization format could be an important requirement.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7015#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list