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 runProt initProtEnv $ do
	( dog, setName, sit ) <- package "dog" $ do
		dog <- clone object
		name	<- makeMember "name"
		setName	<- makeMember "setName"
		sit	<- makeMember "sit"
		setMethod dog setName $ \this [ n ] -> do
			setMember this name n
			return [ ]
		setMethod dog sit $ \this _ -> do
			n <- member this name
			liftProt $ putStrLn $ fromPrimStr n ++ " sitting."
			return [ ]
		return ( dog, setName, sit )
	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 dateFri Aug 12 05:55:18 UTC 2011
Uploaded byYoshikuniJujo
Downloads466 total (46 in last 30 days)

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees