dialyzer: will it ever catch out of bounds errors like this?

Roger Larsson roger.larsson@REDACTED
Thu Jun 22 23:25:46 CEST 2006


-module(bounds).
-export([wrong/0, harder/1]).

wrong() -> lists:nth(4, [1, 2, 3]).

triple(X) -> lists:duplicate(3, X).
harder(X) -> lists:nth(4, triple(X)).


As wanted in "The Next Mainstream Programming Language"
http://www.st.cs.uni-sb.de/edu/seminare/2005/advanced-fp/docs/sweeny.pdf
(Haskell for Next Generation Games)

/RogerL



More information about the erlang-questions mailing list