Last active
December 13, 2015 21:38
-
-
Save exterm/4978792 to your computer and use it in GitHub Desktop.
Type System restrictions: Haskell forces constructors to be unambigous, erlang (dialyzer) doesn't care.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data T1 = Bernd | Uwe | |
| data T2 = Bernd | Flo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1_types.hs:2:11: | |
| Multiple declarations of `Bernd' | |
| Declared at: 1_types.hs:1:11 | |
| 1_types.hs:2:11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -type t1() :: bernd | uwe | |
| -type t2() :: bernd | flo | |
| %% dialyzer accepts this without complaining and constructing contracts with these types works. | |
| %% bernd, uwe and flo are atoms, not constructors - but they're used for the same purpose. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment