|
Hi, Haskell newbie here. I was wondering why main doesn't have a [String] -> IO () type signature like other programming languages, like C/C++ or Java. It would be pretty cool, thanks to pattern matching, to be able to do things like this:code:
Smoke_Max fucked around with this message at 15:42 on Jun 3, 2015 |
# ¿ Jun 3, 2015 15:38 |
|
|
# ¿ May 3, 2024 00:08 |
|
I find refinement typing (such as LiquidHaskell) to be a pretty good compromise between power and usability. Just being able to say simple things like "this integer argument is positive and less than 100" without having to pass around a billion proofs between functions is great for me.
Smoke_Max fucked around with this message at 14:32 on Dec 18, 2016 |
# ¿ Dec 18, 2016 14:19 |
|
I just read about the FTP controversy in Haskell and it seemed to me to have been a solid move, but one detail is still nagging me. What's the rationale behind (,)'s Foldable instance? I understand how it works, but why is it even defined? Is it a case of "because we can"? I honestly cannot see much use for it besides creating confusion (length (1, 2) = 1 says hi). Personally, by making well typed code do the wrong thing, all it does for me is make me less confident in the type checker. (As an aside, why did it stop at (,)? What about (,,), (,,,), etc.?)
|
# ¿ Mar 22, 2017 04:04 |