Commit f2305894 authored by Jurriën Stutterheim's avatar Jurriën Stutterheim

Add latest "Auction" example


git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@2735 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent e009e8ae
......@@ -2,17 +2,26 @@ module Auction
//:%s/<I\d*, E\d*>\|<\d*>//g
Start = 0
Start :: *World -> *World
Start world = startEngine [ publish "/" WebApp (\_ -> myTask)
, tonicPubTask "Auction"] world
//Start = 0
//myTask :: Task Int
//myTask = return 42 >>= return
myTask = return 42 >>= \_ -> return 24
import iTasks
import iTasks.Framework.Tonic
:: Bid =
{ user :: User
, ware :: String
, price :: Int
}
//:: Bid =
//{ user :: User
//, ware :: String
//, price :: Int
//}
derive class iTask Bid
//derive class iTask Bid
//auction :: (Bid -> Task Bid) User [User] Bid -> Task Bid
//auction bidf auctioneer bidders current =
......@@ -25,14 +34,14 @@ derive class iTask Bid
//False -> g bidf auctioneer bidders current
//in g bidf auctioneer bidders current
auction :: (Bid -> Task Bid) User [User] Bid -> Task Bid
auction bidf auctioneer bidders current =
anyTask [b @: bidf current \\ b <- [auctioneer : bidders]] >>= \newBid ->
case newBid.price > current.price of
True -> (\current -> auction bidf auctioneer bidders current) newBid
False -> case newBid.user == auctioneer of
True -> return current
False -> auction bidf auctioneer bidders current
//auction :: (Bid -> Task Bid) User [User] Bid -> Task Bid
//auction bidf auctioneer bidders current =
//anyTask [b @: bidf current \\ b <- [auctioneer : bidders]] >>= \newBid ->
//case newBid.price > current.price of
//True -> (\current -> auction bidf auctioneer bidders current) newBid
//False -> case newBid.user == auctioneer of
//True -> return current
//False -> auction bidf auctioneer bidders current
//auction :: (Bid -> Task Bid) User [User] Bid -> Task Bid
//auction bidf auctioneer bidders current =
......@@ -72,6 +81,30 @@ auction bidf auctioneer bidders current =
//(return current)
//(auction bidf auctioneer bidders current))
//auction :: (Bid -> Task Bid) User [User] Bid -> Task Bid
//auction bidf auctioneer bidders current =
//return { Bid | user = auctioneer, ware = "food", price = 42 } >>= \newBid ->
//if (newBid.price > current.price)
//(return newBid)
//(return newBid)
//auction bidf auctioneer bidders current =
//return 1 >>= \newBid ->
//if (newBid > current)
//(return newBid)
//(return newBid)
//auction = case x > y of
//True -> return 1
//False -> case x < y of
//True -> return 0
//False -> return 1
//where x = 1
//y = 2
//auction = case x > y of
//True -> return 1
//False -> return 0
//where x = 1
//y = 2
//auction :: Task Int
//auction = let x = 1
//in let y = 2
......@@ -80,3 +113,4 @@ auction bidf auctioneer bidders current =
//True -> return 1
//False -> return 0
//auction = if True (return 1) (return 0)
......@@ -236,6 +236,48 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.API.Core.Client.Component
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.API.Core.Client.Editlet
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.API.Core.Client.Interface
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.API.Core.CoreCombinators
Dir: {Application}/iTasks-SDK/Server
......@@ -363,7 +405,21 @@ OtherModules
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.Framework.ClientInterface
Name: iTasks.API.Extensions.Tonic.Toniclet
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.Framework.Client.LinkerSupport
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
......@@ -377,7 +433,7 @@ OtherModules
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.Framework.ClientSupport.ClientOverride
Name: iTasks.Framework.Client.Override
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
......@@ -614,6 +670,34 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.Framework.Tonic
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.Framework.Tonic.AbsSyn
Dir: {Application}/iTasks-SDK/Server
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: iTasks.Framework.UIDefinition
Dir: {Application}/iTasks-SDK/Server
......@@ -782,6 +866,20 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Data.Graph
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Data.IO
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
......@@ -838,6 +936,20 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Data.Set
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Data.SharedDataSource
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
......@@ -1076,6 +1188,51 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Text.Unicode
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Text.Unicode.Encodings.JS
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Text.Unicode.UChar
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
NeededObjFiles
ObjectFile: WCsubst.
ObjectFile: bsearch.
Module
Name: StdMaybe
Dir: {Application}/iTasks-SDK/Server/lib/Platform/OS-Independent/Deprecated/StdLib
......
......@@ -3,6 +3,8 @@ PROJ=Auction
default:
$(CPM) project $(PROJ).prj build
cp "Clean System Files/tonic-Auction.dot" .
cp "Clean System Files/tonic-Auction.json" .
force:
$(CPM) project $(PROJ).prj build --force
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment