Commit cc63cc9c authored by John van Groningen's avatar John van Groningen
Browse files

Use strict maybe types in TCPIP library examples

parent b7959bd8
......@@ -34,7 +34,7 @@ loop listener channels console world
= unzip3 channels
glue = (TCP_Listeners [listener]) :^: (TCP_RChannels rChans)
([(who,what):_],glue, _, world)
= selectChannel_MT Nothing glue Void world
= selectChannel_MT ?None glue Void world
((TCP_Listeners [listener:_]) :^: (TCP_RChannels rChans))
= glue
channels = zip3 sChans rChans nicknames
......@@ -43,7 +43,7 @@ loop listener channels console world
| who==0
# (tReport, mbNewMember, listener, world)
= receive_MT (Just 0) listener world
= receive_MT (?Just 0) listener world
| tReport<>TR_Success // the potential new member changed it's mind
= loop listener channels console world
# (_,{sChannel,rChannel}) = fromJust mbNewMember
......
......@@ -30,7 +30,7 @@ Start world
// connect
# (tReport, mbDuplexChan, world)
= connectTCP_MT (Just (15*ticksPerSecond))
= connectTCP_MT (?Just (15*ticksPerSecond))
(fromJust mbIPAddr, port) world
| tReport<>TR_Success
#! console = fwrites ( server+++" does not respond on port "
......@@ -46,7 +46,7 @@ Start world
// receive answer
(tReport, mbBs, rc, world) = receive_MT (Just (20*ticksPerSecond)) rc world
(tReport, mbBs, rc, world) = receive_MT (?Just (20*ticksPerSecond)) rc world
console = case tReport of
TR_Success -> fwrites (toString (fromJust mbBs)) console
_ -> fwrites (server+++" does not send anything (timeout expired)")
......
......@@ -29,7 +29,7 @@ Start world
// connect
# (tReport, mbDuplexChan, world)
= connectTCP_MT (Just (15*ticksPerSecond))
= connectTCP_MT (?Just (15*ticksPerSecond))
(fromJust mbIPAddr, echoPort) world
| tReport<>TR_Success
#! console = fwrites ( server+++" does not respond on port "
......
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