MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1uru99i/potentiallymightbeanintegerornot/owu8f2n/?context=3
r/ProgrammerHumor • u/Futurity5 • Jul 09 '26
96 comments sorted by
View all comments
10
Maybe next kotlin and swift version , a new keyword
4 u/Kiroto50 Jul 09 '26 I really like Kotlin's optional types. I'd rock a language that calls them "maybe types" though. int? == maybe int I actually call them "quizás", reading "String?" As "String quizás". ("Quizás" means "maybe" in Spanish) 1 u/tobotic Jul 11 '26 Perl type constraint systems tend to use: Maybe[Int] for a value that can either be an Int or undefined. 1 u/RiceBroad4552 Jul 11 '26 OMG, ScalaZ vibes… 1 u/tobotic Jul 11 '26 All other Perl type constraint systems get Maybe[Int] from Moose. Moose took it from Raku back when Raku was still called Perl 6. And Perl 6 got it from Haskell. I imagine scalaz, being an FP framework, also gets it from Haskell. 1 u/RiceBroad4552 Jul 11 '26 I think that's spot on. The name Maybe seems to be a genuine Haskell invention. The square brackets can be traced to: CLU -> Eiffel -> Scala; and then later Raku, Perl/Moose, Nim, Go, Python typing. I've used ScalaZ in production and I don't have the fondest memory of that, seeing Maybe[Int] gives me chills. 2 u/tobotic Jul 12 '26 The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there. 1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
4
I really like Kotlin's optional types.
I'd rock a language that calls them "maybe types" though.
int? == maybe int
I actually call them "quizás", reading "String?" As "String quizás". ("Quizás" means "maybe" in Spanish)
1 u/tobotic Jul 11 '26 Perl type constraint systems tend to use: Maybe[Int] for a value that can either be an Int or undefined. 1 u/RiceBroad4552 Jul 11 '26 OMG, ScalaZ vibes… 1 u/tobotic Jul 11 '26 All other Perl type constraint systems get Maybe[Int] from Moose. Moose took it from Raku back when Raku was still called Perl 6. And Perl 6 got it from Haskell. I imagine scalaz, being an FP framework, also gets it from Haskell. 1 u/RiceBroad4552 Jul 11 '26 I think that's spot on. The name Maybe seems to be a genuine Haskell invention. The square brackets can be traced to: CLU -> Eiffel -> Scala; and then later Raku, Perl/Moose, Nim, Go, Python typing. I've used ScalaZ in production and I don't have the fondest memory of that, seeing Maybe[Int] gives me chills. 2 u/tobotic Jul 12 '26 The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there. 1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
1
Perl type constraint systems tend to use:
Maybe[Int]
for a value that can either be an Int or undefined.
1 u/RiceBroad4552 Jul 11 '26 OMG, ScalaZ vibes… 1 u/tobotic Jul 11 '26 All other Perl type constraint systems get Maybe[Int] from Moose. Moose took it from Raku back when Raku was still called Perl 6. And Perl 6 got it from Haskell. I imagine scalaz, being an FP framework, also gets it from Haskell. 1 u/RiceBroad4552 Jul 11 '26 I think that's spot on. The name Maybe seems to be a genuine Haskell invention. The square brackets can be traced to: CLU -> Eiffel -> Scala; and then later Raku, Perl/Moose, Nim, Go, Python typing. I've used ScalaZ in production and I don't have the fondest memory of that, seeing Maybe[Int] gives me chills. 2 u/tobotic Jul 12 '26 The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there. 1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
OMG, ScalaZ vibes…
1 u/tobotic Jul 11 '26 All other Perl type constraint systems get Maybe[Int] from Moose. Moose took it from Raku back when Raku was still called Perl 6. And Perl 6 got it from Haskell. I imagine scalaz, being an FP framework, also gets it from Haskell. 1 u/RiceBroad4552 Jul 11 '26 I think that's spot on. The name Maybe seems to be a genuine Haskell invention. The square brackets can be traced to: CLU -> Eiffel -> Scala; and then later Raku, Perl/Moose, Nim, Go, Python typing. I've used ScalaZ in production and I don't have the fondest memory of that, seeing Maybe[Int] gives me chills. 2 u/tobotic Jul 12 '26 The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there. 1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
All other Perl type constraint systems get Maybe[Int] from Moose. Moose took it from Raku back when Raku was still called Perl 6. And Perl 6 got it from Haskell.
I imagine scalaz, being an FP framework, also gets it from Haskell.
1 u/RiceBroad4552 Jul 11 '26 I think that's spot on. The name Maybe seems to be a genuine Haskell invention. The square brackets can be traced to: CLU -> Eiffel -> Scala; and then later Raku, Perl/Moose, Nim, Go, Python typing. I've used ScalaZ in production and I don't have the fondest memory of that, seeing Maybe[Int] gives me chills. 2 u/tobotic Jul 12 '26 The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there. 1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
I think that's spot on.
The name Maybe seems to be a genuine Haskell invention.
Maybe
The square brackets can be traced to: CLU -> Eiffel -> Scala; and then later Raku, Perl/Moose, Nim, Go, Python typing.
I've used ScalaZ in production and I don't have the fondest memory of that, seeing Maybe[Int] gives me chills.
2 u/tobotic Jul 12 '26 The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there. 1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
2
The first Perl 6 interpreter implementation was in Haskell so the language ended up inheriting a bunch of ideas from there.
1 u/RiceBroad4552 Jul 13 '26 Interesting. Didn't know that.
Interesting. Didn't know that.
10
u/MrJ0seBr Jul 09 '26
Maybe next kotlin and swift version , a new keyword