(: Aiche Tee Tee Pee :)
Perhaps the first webserver in Tree Calculus? Sure, it's married to a Haskell IO runtime... but we're managing all of the actual webserver semantics in tricu! This includes a demo Arboricx application server that is capable of storing and serving bundles.
This commit is contained in:
17
lib/io.tri
17
lib/io.tri
@@ -20,6 +20,15 @@ writeFile = p c : pair 21 (pair p c)
|
||||
putBytes = bs : pair 12 bs
|
||||
writeBytes = p c : pair 22 (pair p c)
|
||||
|
||||
listDirectory = p : pair 23 p
|
||||
renameFile = old new : pair 24 (pair old new)
|
||||
createDirectory = p : pair 25 p
|
||||
deleteFile = p : pair 26 p
|
||||
fileExists = p : pair 27 p
|
||||
|
||||
sha256Hex = bs : pair 28 bs
|
||||
currentTime = pair 29 t
|
||||
|
||||
ask = pair 30 t
|
||||
local = f action : pair 31 (pair f action)
|
||||
|
||||
@@ -102,6 +111,14 @@ onReadFile = path : onResult (readFile path)
|
||||
|
||||
onWriteFile = path contents : onResult (writeFile path contents)
|
||||
|
||||
onListDirectory = path : onResult (listDirectory path)
|
||||
onRenameFile = old new : onResult (renameFile old new)
|
||||
onCreateDirectory = path : onResult (createDirectory path)
|
||||
onDeleteFile = path : onResult (deleteFile path)
|
||||
onFileExists = path : onResult (fileExists path)
|
||||
onSha256Hex = bs : onResult (sha256Hex bs)
|
||||
onCurrentTime = onResult currentTime
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Convenience helpers for the common cases
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user