Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python to Haskell

Python to Haskell

Python is a terrific everyday tool for solving practical tasks, but there always was a missing thing here and there. Vlad has tried many languages during his career as an engineer, got excited with a functional programming community and settled with using Haskell as a prime-time instrument. Come to the talk to find out what's going on. In this talk passion is going to be (almost) purely technical and no hello worlds, promise.

Presented at PyCon Ukraine 2014

Volodymyr Kyrylov

November 02, 2014
Tweet

More Decks by Volodymyr Kyrylov

Other Decks in Programming

Transcript

  1. programming a = 1 # ... b = {'key': 1}

    # ... c = open('/System/Library/Kernels/kernel').read() # ... d = requests.get(url)
  2. 1950's'era'tools a = 1 # ... b = {'key': 1}

    # ... c = open('/System/Library/Kernels/kernel').read() # ... d = requests.get(url)
  3. 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()
  4. (>>=) • 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
  5. 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
  6. numCommonFriends x y = length <$> (intersect <$> friendsOf x

    <*> friendsOf y) λ :t (<*>) (<*>) :: Applicative f => f (a -> b) -> f a -> f b
  7. doing&ops • sta%c'binaries! • RTS'is'C • imporved'IO'manager'in'7.8 • lazy'evalua%on'impedes'Intel'reality •

    (say'something'bad'about'callbacks'here) • extended'DWARF'support'coming'in'7.10 • more'stuff'about'GHC/RTS'stacks