News for hackers. Stuff that matters.
Re:Kotlin: The Problem with null by brabel on Saturday January 13, 2018 @04:39AM (#16138923)
Wouldn't this let me call `fn true false` or `fn "hi" 2`? Or the second declaration takes the inferred type of the arguments from the first one?
Re:Kotlin: The Problem with null by andolanra on Saturday January 13, 2018 @05:43AM (#16139053)
This isn't two functions: it's actually one function defined by cases. You can think of it as equivalent to

    fn x y = case (x, y) of
      (Just q, Just z) -> q + z
      (_, _) -> 0
but the case becomes implicit in the repetition of the function name at the top level of indentation.
Re:Kotlin: The Problem with null by dllthomas on Saturday January 13, 2018 @12:11PM (#16140260)
> at the top level of indentation

At the same level, really - it works in a let or a where as well.