Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  emacs + ghc-mod + cabal repl (Mateusz Kowalczyk)
   2. Re:  emacs + ghc-mod + cabal repl (Mateusz Kowalczyk)
   3.  do Haskell programs have fewer bugs? (Dennis Raddle)
   4. Re:  Ambiguous type variables (Kim-Ee Yeoh)
   5. Re:  Ambiguous type variables (David McBride)
   6. Re:  do Haskell programs have fewer bugs? (Nadir Sampaoli)


----------------------------------------------------------------------

Message: 1
Date: Wed, 19 Mar 2014 12:22:52 +0000
From: Mateusz Kowalczyk <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] emacs + ghc-mod + cabal repl
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

On 19/03/14 10:53, Miguel Negr?o wrote:
> Em 18-03-2014 18:47, Miguel Negr?o escreveu:
> 
> Following that, a couple more questions:
> 
> Is it possible to have the haddock help for functions displayed inside
> emacs (no browser) ?

Not that I know of. GHCi doesn't support it (yet, maybe it will in the
future) and Haskell interface files don't store this information so
various tools can't get at it. I'm not aware of any tools that read the
Haddock interface files and give you the docs that way. If
someone/myself decides to go through with putting the Haddock strings
into .hi files, reading documentation in your editor might become
possible but I wouldn't hold my breath as it is completely in the ?it'd
be cool if we had this? stage.

> How does one jump to the defition of a symbol ?

I use hasktags to generate the TAGS table and then use find-tag (bound
to M-.) to jump to things. It works fine but it does tend to screw up
sometimes. Of course it will only work if your definition is in the
generated table, it won't do things like jumping to definitions in the
libraries you use etc. I imagine that you could have a massive TAGS
table generated from all your sources but I doubt it'd scale very well
and would be close to impossible to maintain.

It'd be great if we had something like Agda, where all the source is
available so we can jump to anything at all, but we don't.

> 
> thanks,
> Miguel
> 
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
> 


-- 
Mateusz K.


------------------------------

Message: 2
Date: Wed, 19 Mar 2014 12:38:53 +0000
From: Mateusz Kowalczyk <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] emacs + ghc-mod + cabal repl
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

On 19/03/14 12:22, Mateusz Kowalczyk wrote:
> On 19/03/14 10:53, Miguel Negr?o wrote:
>> Em 18-03-2014 18:47, Miguel Negr?o escreveu:
>>
>> Following that, a couple more questions:
>>
>> Is it possible to have the haddock help for functions displayed inside
>> emacs (no browser) ?
> 
> Not that I know of. GHCi doesn't support it (yet, maybe it will in the
> future) and Haskell interface files don't store this information so
> various tools can't get at it. I'm not aware of any tools that read the
> Haddock interface files and give you the docs that way. If
> someone/myself decides to go through with putting the Haddock strings
> into .hi files, reading documentation in your editor might become
> possible but I wouldn't hold my breath as it is completely in the ?it'd
> be cool if we had this? stage.

As a quick follow-up, it might be that Haddock itself will provide an
interface to its own interface files and then various tools (and GHCi)
can use that instead. Again, just ideas atm.

> 
>> How does one jump to the defition of a symbol ?
> 
> I use hasktags to generate the TAGS table and then use find-tag (bound
> to M-.) to jump to things. It works fine but it does tend to screw up
> sometimes. Of course it will only work if your definition is in the
> generated table, it won't do things like jumping to definitions in the
> libraries you use etc. I imagine that you could have a massive TAGS
> table generated from all your sources but I doubt it'd scale very well
> and would be close to impossible to maintain.
> 
> It'd be great if we had something like Agda, where all the source is
> available so we can jump to anything at all, but we don't.
> 
>>
>> thanks,
>> Miguel
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
> 
> 


-- 
Mateusz K.


------------------------------

Message: 3
Date: Wed, 19 Mar 2014 10:09:48 -0700
From: Dennis Raddle <[email protected]>
To: Haskell Beginners <[email protected]>
Subject: [Haskell-beginners] do Haskell programs have fewer bugs?
Message-ID:
        <CAKxLvopgjbzKKmfzvKk4JaCtb9PhTLq7nWC8akpjKP-WkQT-=g...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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. It's the potential for
conciseness. I work hard when programming in Haskell to take advantage of
language features that make my program concise. 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140319/1d7b74c0/attachment-0001.html>

------------------------------

Message: 4
Date: Thu, 20 Mar 2014 00:51:06 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Ambiguous type variables
Message-ID:
        <CAPY+ZdQgi9GrAXr8ypcakogw8_PR4vta=_cwp_bbetsi7l7...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Wed, Mar 19, 2014 at 8:47 AM, Dennis Raddle <[email protected]>wrote:

> Do the easiest one first and optimize later?


Yes.

Fwiw, iterating in the zone doesn't even feel like iterating.


> I'm not even sure which is easiest as I don't think there is a list
> element replacement function in the libraries.


It's a one-liner.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140320/b409a692/attachment-0001.html>

------------------------------

Message: 5
Date: Wed, 19 Mar 2014 14:15:34 -0400
From: David McBride <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Ambiguous type variables
Message-ID:
        <CAN+Tr42d9ecCRSREm1to2uDgVJSSVXW4Y7G_Z-=nnss62_g...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

You might try Data.Sequence.  Its update/take/drop/index etc all have nice
performance and you can use Foldable.toList to convert it to a list
whenever you feel a pressing need to use list pattern matching without
sacrificing much performance.


On Tue, Mar 18, 2014 at 9:47 PM, Dennis Raddle <[email protected]>wrote:

> I have another question, speaking of optimizing too soon. My data
> structures will be things like rows of musical notes, implementable easily
> as lists of lists. But I will often need to do things like replace one
> element in a list. Should I use Array's? As I see it, lists get me certain
> simplicity, and many operations using the natural syntax will be concise.
> But then I'll have to do searches or random access and replacement.
>
> What criteria does one use to make decisions like this? Do the easiest one
> first and optimize later? I'm not even sure which is easiest as I don't
> think there is a list element replacement function in the libraries.
>
>
> On Mon, Mar 17, 2014 at 3:56 PM, Dennis Raddle <[email protected]>wrote:
>
>>
>>
>>
>> On Mon, Mar 17, 2014 at 1:28 PM, Kim-Ee Yeoh <[email protected]> wrote:
>>
>>>
>>> On Tue, Mar 18, 2014 at 2:14 AM, Dennis Raddle 
>>> <[email protected]>wrote:
>>>
>>>> class Bt d c memo | d -> c, d -> memo where
>>>
>>>
>>> Could you also say something about the instances you intend to implement
>>> for this typeclass?
>>>
>>> If there's only 1, which the statement of the problem suggests as much,
>>> you can dispense of the typeclass entirely and just work with plain
>>> functions!
>>>
>>> Could be that you want something working first and generalize /
>>> polymorphize later.
>>>
>>
>>
>> I don't know yet how I want to represent the solution being searched for;
>> i.e. I don't know how I want to represent musical structures, and I need
>> the freedom to try different ones without rewriting my code. I also wanted
>> to implement a few toy problems to do testing on my algorithm.
>>
>> But, you are absolutely right that I am generalizing too quickly. I
>> worked on a toy problem today and had several insights. I noticed that some
>> problems have specifics that don't fit the same mold.
>>  -Dennis
>>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140319/470d3010/attachment-0001.html>

------------------------------

Message: 6
Date: Wed, 19 Mar 2014 19:21:39 +0100
From: Nadir Sampaoli <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] do Haskell programs have fewer bugs?
Message-ID:
        <CAFYwTdQV=udb_rcuyhn9smsmnlog7pzfz1yl6qttyypgc8o...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello,

Il 19/mar/2014 18:09 "Dennis Raddle" <[email protected]> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140319/edf824bd/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 69, Issue 26
*****************************************

Reply via email to