adop%ng(a(language(to(the(new(
world
@asyncio.coroutine
def test():
yield from asyncio.async(create())
yield from asyncio.async(write())
yield from asyncio.async(close())
yield from asyncio.sleep(2.0)
loop.stop()
(>>=)
• pure&func*ons:&(+) :: Int -> Int -> Int
• combinators:&fix f = f (fix f)
• HOFs:&unwords . map (++ ",") . words
• pa6ern&matching:&case x of Just y -> y
• ADTs:
data Tree a = Branch a (Tree a) (Tree a)
| Leaf
deriving (Functor)
• persistent)data)structures
newtype Process = Process ByteString
newtype Host = Host ByteString
newtype Addr = Addr (IP, ByteString)
data OpenFile = Connection Host Process Addr Addr
| Listen Host Process Addr
data IP = IP ByteString
| Any
type IPMap = Map IP Host