Gnzepwgc1ffuwqgmh3od
SkillsCast

Through a Glass, Abstractly: Lenses and the Power of Abstraction

12th October 2017 in London at CodeNode

There are 36 other SkillsCasts available from Haskell eXchange 2017

Please log in to watch this conference skillscast.

Https s3.amazonaws.com prod.tracker2 resource 41088130 skillsmatter conference skillscast o9nohu

Abstraction is a Haskell programmer's best friend. Our choice of good abstractions, identifying which details to hide from other parts of the system and which to expose in interfaces, is crucial to our ability to craft correct, concise and meaningful programs. Haskell gives us the ability to express abstractions at many levels without incurring significant performance penalties. But can it capture all the abstractions we might want?

The concept of lenses in general, and the lens library in particular, have revolutionised modern Haskell programming. The lens library is full of abstractions that allow expert users to write amazingly concise code, but these are sometimes baffling to the uninitiated. Not for nothing has the library been described as a separate language that happens to be embedded in Haskell. Significantly, the key concepts expressed in the library (optics such as lenses, traversals and prisms), are not in fact abstract data types. Rather, they are type synonyms, which expose the underlying implementation. This gives a lot of power and flexibility to combine optics, but allows implementation details to leak into inferred types and error messages.

In this talk, you will discover an attempt to capture optics such as lenses using abstract data types, while maintaining as far as possible the expressive power of the lens library. Clearly distinguishing between the interface and implementation of optics will help illuminate their nature and purpose. Moreover, I will reflect on the power and limitations of abstraction in Haskell itself.

This talk will be suitable for Haskell programmers of a range of skill levels. Only basic Haskell knowledge will be required, and familiarity with the lens library will not be assumed, although having been baffled by it at least once is a worthwhile experience for anyone.

YOU MAY ALSO LIKE:

Thanks to our sponsors

Through a Glass, Abstractly: Lenses and the Power of Abstraction

Adam Gundry

Adam currently works as a Haskell Consultant for Well-Typed LLP. He is a keen Haskell programmer, and completed a PhD in 2013 on combining Haskell with dependent types.

SkillsCast

Please log in to watch this conference skillscast.

Https s3.amazonaws.com prod.tracker2 resource 41088130 skillsmatter conference skillscast o9nohu

Abstraction is a Haskell programmer's best friend. Our choice of good abstractions, identifying which details to hide from other parts of the system and which to expose in interfaces, is crucial to our ability to craft correct, concise and meaningful programs. Haskell gives us the ability to express abstractions at many levels without incurring significant performance penalties. But can it capture all the abstractions we might want?

The concept of lenses in general, and the lens library in particular, have revolutionised modern Haskell programming. The lens library is full of abstractions that allow expert users to write amazingly concise code, but these are sometimes baffling to the uninitiated. Not for nothing has the library been described as a separate language that happens to be embedded in Haskell. Significantly, the key concepts expressed in the library (optics such as lenses, traversals and prisms), are not in fact abstract data types. Rather, they are type synonyms, which expose the underlying implementation. This gives a lot of power and flexibility to combine optics, but allows implementation details to leak into inferred types and error messages.

In this talk, you will discover an attempt to capture optics such as lenses using abstract data types, while maintaining as far as possible the expressive power of the lens library. Clearly distinguishing between the interface and implementation of optics will help illuminate their nature and purpose. Moreover, I will reflect on the power and limitations of abstraction in Haskell itself.

This talk will be suitable for Haskell programmers of a range of skill levels. Only basic Haskell knowledge will be required, and familiarity with the lens library will not be assumed, although having been baffled by it at least once is a worthwhile experience for anyone.

YOU MAY ALSO LIKE:

Thanks to our sponsors

About the Speaker

Through a Glass, Abstractly: Lenses and the Power of Abstraction

Adam Gundry

Adam currently works as a Haskell Consultant for Well-Typed LLP. He is a keen Haskell programmer, and completed a PhD in 2013 on combining Haskell with dependent types.

Photos