Do more with your types: GADTs and LiquidHaskell
Автор: Xebia Functional (formerly 47 Degrees)
Загружено: 2020-08-25
Просмотров: 3559
One of the main selling points of Haskell is its strong type system. How can you squeeze it even further, and go beyond the type systems limits? And when should you do that?
This talk provides an introduction about two seemingly disparaging topics, which share a common goal: to provide a more expressive type language to be more precise in describing values. On the one hand, we have Generalized Algebraic Data Types (GADTs for short), a very popular GHC extension. On the other hand, we have LiquidHaskell, a plug-in for the GHC compiler which adds support for so-called refinement types.
Both approaches give you tools to prevent the hideous “head applied to an empty list” problem without having to manually check for emptiness. Instead, we make our tools more aware of the shape of the values (the length of the list, in this case), so it can automatically check whether calls to head are correct at compile-time.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: