Erlang Type Overview Can we add compile-time types to Erlang? Optional Types Dialyzer Proper Conclusion Optional Type Specification in Erlang Andreas Pauley – @apauley Lambda Luminaries – @lambdaluminary November 11, 2013 Andreas Pauley – @apauley Types in Erlang
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Optional Type Specification in Erlang
Andreas Pauley – @apauley
Lambda Luminaries – @lambdaluminary
November 11, 2013
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Table of Contents
1 Erlang Type Overview
2 Can we add compile-time types to Erlang?
3 Optional Types
4 Dialyzer
5 Proper
6 Conclusion
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Dynamic, but strong
example({}) ->
"empty tuple";
example(List) when is_list(List) ->
length(List);
example(_Else) ->
another_return_type.
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Dynamic, but strong
3> 5 + "6".
** exception error: an error occurred when evaluating
an arithmetic expression
in operator +/2
called as 5 + "6"
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Table of Contents
1 Erlang Type Overview
2 Can we add compile-time types to Erlang?
3 Optional Types
4 Dialyzer
5 Proper
6 Conclusion
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Yes and No :-/
The Haskell giants Simon Marlow and Philip Wadler spentover a year developing a static type system for Erlang (circa1997).
Only a subset of the language could be type-checked.
Process types and inter-process messages could not betype-checked.
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Yes and No :-/
The Haskell giants Simon Marlow and Philip Wadler spentover a year developing a static type system for Erlang (circa1997).
Only a subset of the language could be type-checked.
Process types and inter-process messages could not betype-checked.
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Yes and No :-/
The Haskell giants Simon Marlow and Philip Wadler spentover a year developing a static type system for Erlang (circa1997).
Only a subset of the language could be type-checked.
Process types and inter-process messages could not betype-checked.
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?
Optional TypesDialyzerProper
Conclusion
Table of Contents
1 Erlang Type Overview
2 Can we add compile-time types to Erlang?
3 Optional Types
4 Dialyzer
5 Proper
6 Conclusion
Andreas Pauley – @apauley Types in Erlang
Erlang Type OverviewCan we add compile-time types to Erlang?