[Haskell-beginners] Re: monad nomad gonad gomad

prad prad at towardsfreedom.com
Sat Aug 14 22:52:34 EDT 2010

On Sat, 14 Aug 2010 18:28:03 -0700
Michael Mossey <mpm at alumni.caltech.edu> wrote:

> Finally, yes Haskell complains about type-related faults in
> identifiers you don't use... because it is trying to help you find
> your mistakes. How does it know it wasn't a mistake on your part?
> This is an advantage over script languages.
wow! this is amazing!
i guess when you understand the compiler's intentions, you acquire a
powerful ally!

experimenting in another file, i did something similar:

gtKys conn = do
    z <- readFile "monads.txt"
    r <- quickQuery conn "select key from main" []
    --return $ concat $ map (map fromSql) r
    manip z 

manip f = do
    let wL = words f
    putStrLn $ show wL

this works fine, even though the r quickQuery line is never used.
so i guess one has to try to figure out how to work with the compiler.

part of the feeling i'm getting is that a function should only do one
thing and i likely try to squeeze too much into it.

i'm used to using a lot of print statements to figure out errors, but
may be the idea here is not to make errors because you're functions are
written correctly and are precise.

i'll rethink what i'm writing and how.

In friendship,

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's

More information about the Beginners mailing list