Functional Programming
A teaser
A type system
A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute.
Система типов — это гибко управляемый синтаксический метод доказательства отсутствия в программе определенных видов поведения при помощи классификации выражений языка по разновидностям вычисляемых ими значений.
Types and Programming Languages
Benjamin C. Pierce
2002
Static vs Dynamic,
Strong vs Weak
© Cartesian Closed Comic
... PROFIT?
- Guarantees
- Code coverage
- Modelling the domain
- Compilation to native code
- Powerful run-time system
Still have to test though...
And prototyping can be painful.
data DisplayAccounts
= DisplaySingle AccountInfo
| DisplayMulti [AccountInfo]
Python
Any namedtuple can be accidentally compared to any other with the same number of fields.
@dataclass
class InventoryItem:
'''Class for keeping track of an item in inventory.'''
name: str
unit_price: float
quantity_on_hand: int = 0
-- | Class for keeping track of an item in inventory.
data InventoryItem =
InventoryItem
{ name :: Text
, unitPrice :: Double
, quantityOnHand :: Int
}
Production
- Blockchain
- Formal verification
- Providing some guarantees to conventional languages
- Bioinformatics
- Tesla! (data processing)
Jobs at Serokell!
- Haskell developer (intern+)
- DevOps engineer (NixOS)
- Frontend developer (JS / TS, your choice)
jobs@serokell.io
Functional Programming
By Maxim Koltsov
Functional Programming
- 1,201