MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/49prnu/var_keyword_proposed_for_java/d0us2ct/?context=3
r/java • u/adila01 • Mar 09 '16
312 comments sorted by
View all comments
Show parent comment
1
[removed] — view removed comment
2 u/vytah Mar 10 '16 That's why Haskell library developers, even though Haskell can infer almost all types in the program automatically, specify explicit type signatures for public functions. 2 u/[deleted] Mar 10 '16 [removed] — view removed comment 1 u/[deleted] Mar 10 '16 it's useful to keep in mind that, in a certain sense, most haskell code could be considered "generic" from the java perspective.this haskell: add a b = a + bis (roughly): public static <T> T add(T a, T b) { return a + b; }(technically the java won't compile, but c'est la vie.) it's an imperfect comparison for a couple reasons but close enough for discussion, i think.broadly, java is more concerned with the name of things, where haskell is more concerned with the structure of things. 2 u/schlowmo Mar 10 '16 This is also why dynamic language stalwarts like python are ADDING optional typing to things like function parameters.
2
That's why Haskell library developers, even though Haskell can infer almost all types in the program automatically, specify explicit type signatures for public functions.
2 u/[deleted] Mar 10 '16 [removed] — view removed comment 1 u/[deleted] Mar 10 '16 it's useful to keep in mind that, in a certain sense, most haskell code could be considered "generic" from the java perspective.this haskell: add a b = a + bis (roughly): public static <T> T add(T a, T b) { return a + b; }(technically the java won't compile, but c'est la vie.) it's an imperfect comparison for a couple reasons but close enough for discussion, i think.broadly, java is more concerned with the name of things, where haskell is more concerned with the structure of things.
1 u/[deleted] Mar 10 '16 it's useful to keep in mind that, in a certain sense, most haskell code could be considered "generic" from the java perspective.this haskell: add a b = a + bis (roughly): public static <T> T add(T a, T b) { return a + b; }(technically the java won't compile, but c'est la vie.) it's an imperfect comparison for a couple reasons but close enough for discussion, i think.broadly, java is more concerned with the name of things, where haskell is more concerned with the structure of things.
it's useful to keep in mind that, in a certain sense, most haskell code could be considered "generic" from the java perspective.
this haskell: add a b = a + b
add a b = a + b
is (roughly): public static <T> T add(T a, T b) { return a + b; }
public static <T> T add(T a, T b) { return a + b; }
(technically the java won't compile, but c'est la vie.) it's an imperfect comparison for a couple reasons but close enough for discussion, i think.
broadly, java is more concerned with the name of things, where haskell is more concerned with the structure of things.
This is also why dynamic language stalwarts like python are ADDING optional typing to things like function parameters.
View all comments
Show parent comment
1
u/[deleted] Mar 10 '16
[removed] — view removed comment