|
|
|
|
|
by klibertp
2952 days ago
|
|
I have a blog post from a few years back with a sample, here: https://klibert.pl/posts/avail-and-articulate-programming.ht... I'm pasting a link because I added on-hover popups explaining parts of the snippet, but here is the sample itself: Module "Hello World"
Uses
"Avail"
Entries
"Greet Router"
Body
Method "Greet Router" is [
socket ::= a client socket;
target ::= a socket address from <192, 168, 1, 1> and 80;
http_request ::= "GET / HTTP/1.1\n\n"→code points;
Connect socket to target;
Write http_request to socket;
resp_bytes ::= read at most 440 bytes from socket;
Print: "Router says: " ++ resp_bytes→string ++ "\n";
];
|
|