Timeline for How do the type systems in functional languages differ from those in OO languages?
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 11, 2020 at 2:31 | history | edited | Jörg W Mittag | CC BY-SA 4.0 | added 1632 characters in body |
| Apr 10, 2018 at 6:15 | comment | added | Jay | This is the most gangster answer in the history of stack. Great stuff and thank you @JörgWMittag | |
| Apr 19, 2017 at 21:09 | comment | added | Jörg W Mittag | @supercat: Yes, a → Bool is a polymorphic function which takes an a and returns a Bool, () → Bool is a function which has no arguments and returns a Bool; they are completely different. | |
| Apr 19, 2017 at 21:06 | comment | added | supercat | @ShreevatsaR: My point is that a function which is declared as bool->bool but ignores its parameter and always returns false could be passed to a function that expects a bool->bool function, which would not be the case for a ()->bool function. Unless I misread what you were trying to say, you seemed to be suggesting that a function which ignored its argument would be equivalent to one which simply didn't take an argument in the first place. Or does a->bool have a meaning different from ()->bool? | |
| Apr 19, 2017 at 20:43 | comment | added | ShreevatsaR | @supercat I don't understand what you mean: a function which didn't have any declared parameters wouldn't be a Bool->Bool function; it would be a ()->Bool function. | |
| Apr 19, 2017 at 19:09 | comment | added | supercat | A bool->bool function which ignores its input and always returns true or false may be passed to code that expects a bool->bool function; such code might not be able to accept a function which didn't have any declared parameters. | |
| Apr 19, 2017 at 18:05 | history | edited | Jörg W Mittag | CC BY-SA 3.0 | added 281 characters in body |
| Apr 19, 2017 at 17:51 | history | answered | Jörg W Mittag | CC BY-SA 3.0 |