Polymorphwhat?

…or just watch this Python sketch.

Subtype polymorphism

Ad-hoc polymorphism

Parametric polymorphism

Row polymorphism

  • We inform the compiler that the function accepts a parameter of type ^a, which has to expose certain property (Volume in our case). This is a so-called constraint.
  • We use that property in the body of the function
  • And then we return the object of type ^a wrapped in an Option.

Static and dynamic polymorphism

So, why are they all called the same?

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Demystifying Database Systems, Part 4: Isolation levels vs. Consistency levels

Education: April 2021 Live, Instructor Led Sessions (Americas)

Blocksite-Way to achieve more in less time with BlockSite’s ‘Scheduling’

What does a wedding cake and an IT project have in common?

Grab a Coffee and Let Python Fill Out a Form for You

About Go Language — An Overview

Give a new life to your ageing Moto G

Run your Laravel application on the Swoole server with Laravel-Octane.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Paweł Bańka

Paweł Bańka

More from Medium

Articulation point

Prim’s Algorithm

String view in a Nutshell

DIJKSTRA ALGORITHM