async def sleep_sort(numbers): async def sleep_add(number): await asyncio.sleep(number) result.append(number) result = [] await asyncio.wait([ sleep_add(number) for number in numbers ]) return result
contains :: (Ord a) => (Tree a) -> a -> Bool contains Nil _ = False contains (Node t1 v t2) x | x == v = True | x < v = contains t1 x | x > v = contains t2 x
How often does a cosmic ray affect RAM? 36 hours (for 16GB; "SEU at Ground Level", Eugene Normand) How long can an unpowered SSD keep data? 3 weeks - 1 year (Enterprise at 40ºC, Client at 30ºC; Intel/JEDEC) Does quantum tunneling affect CPUs? Continuously!
Abstract Define a contract - types, behaviour, exceptions Verify Write tests to keep the contract valid Forget Work with the contract, not the fine details
Types Start without types, progressively add with mypy Async Make it work synchronously first. Add async later. Speed Write slow, understandable code. Test it. Then improve it.