
For better or worse depending on your POV I find that I spend a lot of time
looking at the implementations of many libraries I employ in larger
projects.
There are certainly some surprises when a program doesn't execute in the
time or memory that I expected, and having the library source available can
be invaluable for determining why.
Cheers,
Darren
On Mar 19, 2014 11:21 AM, "Nadir Sampaoli"
Hello,
Il 19/mar/2014 18:09 "Dennis Raddle"
ha scritto: I was thinking about why it seems I can write Haskell code without bugs
in a much easier way than imperative languages. Part of it is the strict type-checking, but I think there is something more.
As a beginner I find that the type system is my best friend. I spend most of the time in the repl trying function compositions until GHCi likes them. At that point, like I often read from expert haskellers' conversations, "if it typechecks it's most likely correct".
It's the potential for conciseness. I work hard when programming in
Haskell to take advantage of language features that make my program concise.
As the saying goes, less code means less potential for bugs :)
Somehow this leads me to think about it in a certain way. I know I'm on
track as it gets smaller and smaller. And as it gets smaller, it leads me to think about my logic's cases and things like that. Certain patterns show up and I think about what those patterns mean for the structure of my problem.
By the time I'm done with all that, I've analyzed my problem much more
thoroughly than I would ever do in an imperative language.
Dennis
As someone who is still struggling to get past that learning phase where you only solve "simple" (usually one-liner) exercises, I'd like to ask you (and anyone reading this) how do you reason at a larger level? At the function level Haskell feels like piping shell commands (which I find nice): a chain of successive transformations. How do you work at a larger (module/project) level? Do you need to have mastered all the main monads (beyond list amd maybe) and monad transformers?
Sorry for the long rant. And thanks for the interesting discussion.
-- Nadir
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners