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.  List syntax (Stayvoid)
   2. Re:  List syntax (Brandon Allbery)
   3. Re:  List syntax (Stayvoid)
   4. Re:  List syntax (Lyndon Maydwell)
   5. Re:  List syntax (Christian Maeder)
   6.  cabal / haddock: view source with API (Christopher Howard)


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

Message: 1
Date: Fri, 27 Jul 2012 17:27:25 +0400
From: Stayvoid <[email protected]>
Subject: [Haskell-beginners] List syntax
To: [email protected]
Message-ID:
        <CAK5fS_Hat3Or=jzw6qe3hwtvudyombn_wp0egkne81qkvvw...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Why can't we do this: [LT..GT]?
The following works:
['a'..'e']
['a' .. 'e']
[LT .. GT]

Cheers



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

Message: 2
Date: Fri, 27 Jul 2012 10:49:58 -0400
From: Brandon Allbery <[email protected]>
Subject: Re: [Haskell-beginners] List syntax
To: Stayvoid <[email protected]>
Cc: [email protected]
Message-ID:
        <CAKFCL4W=1ue-ovo6ozhzpvjz3cuxxvte5xf-t9ozwkw5-1h...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Fri, Jul 27, 2012 at 9:27 AM, Stayvoid <[email protected]> wrote:

> Why can't we do this: [LT..GT]?
>

Because "LT.." is the operator (.) in the module LT, and is unexpected
there.

-- 
brandon s allbery                                      [email protected]
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120727/62630d12/attachment-0001.htm>

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

Message: 3
Date: Fri, 27 Jul 2012 18:53:47 +0400
From: Stayvoid <[email protected]>
Subject: Re: [Haskell-beginners] List syntax
To: [email protected]
Message-ID:
        <cak5fs_frd398fbsk3jfkwzmve0xc78yzxi1fn06m93zy-n3...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Thanks.



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

Message: 4
Date: Fri, 27 Jul 2012 23:01:20 +0800
From: Lyndon Maydwell <[email protected]>
Subject: Re: [Haskell-beginners] List syntax
To: Stayvoid <[email protected]>, Beginners Haskell
        <[email protected]>
Message-ID:
        <cam5qztxbdej4q8jpqkaxtzm6-ptxcznnd0033wrvcp2feqj...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Fri, Jul 27, 2012 at 10:52 PM, Stayvoid <[email protected]> wrote:
> Thanks.
>
> P.S. I think that you should send your answer to the list to show the
> others that this issue is solved.


Ah, I thought I replied to all. Well, here is my reply for the record :-)


Here's what I'm describing in a GHCi session:

>  ? [LT..GT]
>
> <interactive>:2:2:
>     Failed to load interface for `LT'
>     Use -v to see a list of the files searched for.
>
> <interactive>:2:2:
>     A section must be enclosed in parentheses thus: (LT.. GT)

I'm assuming that this was the error that you encountered when you
tried to use the syntax [LT..GT].

In my example I used a renamed module, but this also makes sense for a
module imported the usual way. I renamed the module so you could see
directly how an ambiguity could occur for 'LT'.

If you import a module you can rename it by using the 'as' keyword, in
this case, 'LT'. There is now an ambiguity between 'LT' = "less than"
and 'LT' = "Data.List".

>  ? import qualified Data.List as LT
>
>  ? :i LT.map
> map :: (a -> b) -> [a] -> [b]         -- Defined in `GHC.Base'

Here is a demonstration of the renamed module in action.

>  ? :i LT..
>
> Top level:
>     Failed to load interface for `LT'
>     Use -v to see a list of the files searched for.

And here is what I think is causing your error to be thrown - The
symbol '.' is being searched for in module LT in the same manner that
'map' was in the previous example, now given that there is no LT
module, it is failing.

This ambiguity might seem annoying, but it's not too bad since you can
just put some spaces in to resolve it.



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

Message: 5
Date: Fri, 27 Jul 2012 17:52:06 +0200
From: Christian Maeder <[email protected]>
Subject: Re: [Haskell-beginners] List syntax
To: Lyndon Maydwell <[email protected]>
Cc: Beginners Haskell <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

In fact there is no ambiguity (but ghc does not bother to resolve this).

No legal expression can start with a (qualified) symbol like ".", so 
since you used square brackets rather than round ones (to make a 
section) the resolution could be unique (by accepting an otherwise 
illegal source).

C.

Am 27.07.2012 17:01, schrieb Lyndon Maydwell:
> On Fri, Jul 27, 2012 at 10:52 PM, Stayvoid <[email protected]> wrote:
>> Thanks.
>>
>> P.S. I think that you should send your answer to the list to show the
>> others that this issue is solved.
>
>
> Ah, I thought I replied to all. Well, here is my reply for the record :-)
>
>
> Here's what I'm describing in a GHCi session:
>
>>   ? [LT..GT]
>>
>> <interactive>:2:2:
>>      Failed to load interface for `LT'
>>      Use -v to see a list of the files searched for.
>>
>> <interactive>:2:2:
>>      A section must be enclosed in parentheses thus: (LT.. GT)
>
> I'm assuming that this was the error that you encountered when you
> tried to use the syntax [LT..GT].
>
> In my example I used a renamed module, but this also makes sense for a
> module imported the usual way. I renamed the module so you could see
> directly how an ambiguity could occur for 'LT'.
>
> If you import a module you can rename it by using the 'as' keyword, in
> this case, 'LT'. There is now an ambiguity between 'LT' = "less than"
> and 'LT' = "Data.List".
>
>>   ? import qualified Data.List as LT
>>
>>   ? :i LT.map
>> map :: (a -> b) -> [a] -> [b]         -- Defined in `GHC.Base'
>
> Here is a demonstration of the renamed module in action.
>
>>   ? :i LT..
>>
>> Top level:
>>      Failed to load interface for `LT'
>>      Use -v to see a list of the files searched for.
>
> And here is what I think is causing your error to be thrown - The
> symbol '.' is being searched for in module LT in the same manner that
> 'map' was in the previous example, now given that there is no LT
> module, it is failing.
>
> This ambiguity might seem annoying, but it's not too bad since you can
> just put some spaces in to resolve it.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>




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

Message: 6
Date: Fri, 27 Jul 2012 18:36:26 -0800
From: Christopher Howard <[email protected]>
Subject: [Haskell-beginners] cabal / haddock: view source with API
To: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Hi. I've been familiarizing myself with cabal (great system, btw) and
learned that I could get haddock documentation built with each package
with --enable-documentation (or adjusting the config file). I think that
is great because I prefer having the API on my own system rather than
having to surf to hackage every time. However, one difference I've
noticed is that at hackage, I can click on the "source" buttons and see
the source for each element, whereas on the local documentation this
functionality is not available. Is it possible to configure my local
cabal / haddock to do this as well?

-- 
frigidcode.com
indicium.us

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120727/37051637/attachment-0001.pgp>

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

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


End of Beginners Digest, Vol 49, Issue 30
*****************************************

Reply via email to