I hereby claim:
- I am saeidw on github.
- I am saeidw (https://keybase.io/saeidw) on keybase.
- I have a public key ASDnLvideBWBHvTG_rQjiZhSuhpejH-jwAAPU6__8-oZYgo
To claim this, I am signing this object:
<?php | |
namespace Z; | |
class TestClass { | |
public function __construct() {} | |
public function test() { return "test()"; } | |
} | |
namespace Q; | |
use Z\TestClass; |
# ----------------------------------------------------------------------------- | |
# A tree is either an empty node, or a node with a left and right sub-tree | |
class Empty(object): | |
pass | |
class Node(object): | |
def __init__(self, value, left, right): | |
self.value = value | |
self.left = left |
-- We can have a sum type where each constructor is a function: | |
data F = A (String -> Int) | |
| B (Int -> Int) | |
-- Now let's create a value of this type: | |
-- The `length` function has type `[a] -> Int` and since | |
-- `String` is a synonym for `[Char]` we can use `length` on strings | |
f :: F | |
f = A (length) |
<?php | |
// PROBLEM: I want to use type-hints to make sure the parameters of | |
// a function are all the right type. | |
function printColor(Color $theColor) { | |
echo "The color is " . $theColor->getValue() . PHP_EOL; | |
} | |
interface ValueType { |
<?php | |
$socket1 = new \Hoa\Socket\Client('tcp://172.16.3.76:5900'); | |
$socket1->connect(); | |
echo $socket1->read(6), PHP_EOL; | |
$socket2 = new \Hoa\Socket\Client('tcp://172.16.3.76:5900'); | |
$socket2->connect(); |
I hereby claim:
To claim this, I am signing this object: