The prototype package

[Tags: bsd3, library]

prototype-based programming on Haskell

You can download source codes by git.

git clone git://github.com/YoshikuniJujo/prototype.git prototype

Example code

 module Main where

 import Control.Prototype

 main :: IO ()
 main = fmap fst $ flip runPT initPTEnv $ do
	dog <- clone object
	name <- makeMember "name"
	setName <- setMethod dog "setName" $ \this [ n ] -> do
		setMember this name n
		return [ ]
	sit <- setMethod dog "sit" $ \this _ -> do
		n <- member this name
		liftPT $ putStrLn $ fromPrimStr n ++ " sitting."
	myDog <- clone dog
	method myDog setName [ primStr "John" ]
	method myDog sit [ ]
	return ()

Another sample

 module Main where

 import MyToolkit

 main :: IO ()
 main = runToolKit $ do
	( textView, setText, setContentView ) <- importMyToolkit
	myTV <- clone textView
	method myTV setText [ primStr "Hello, world!" ]
	method myTV setContentView [ ]
	return ()

Properties

Versions0.1, 0.2, 0.3, 0.4.1, 0.5.0, 0.5.3
Dependenciesbase (>3 && <5), monads-tf
LicenseBSD3
AuthorYoshikuni Jujo <PAF01143@nifty.ne.jp>
MaintainerYoshikuni Jujo <PAF01143@nifty.ne.jp>
Stabilityexperimental
CategoryDevelopment
Upload dateWed Aug 10 06:40:56 UTC 2011
Uploaded byYoshikuniJujo
Downloads356 total (25 in last 30 days)

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees