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: Show and showList (Brandon Allbery)
2. Re: Defining an instance: Syntax that works exactly
sometimes (Karl Voelker)
3. Re: Defining an instance: Syntax that works exactly
sometimes (Kim-Ee Yeoh)
4. ghc failed to compile trifecta while installing idris
(Robert Dodier)
5. Re: ghc failed to compile trifecta while installing idris
(Sumit Sahrawat, Maths & Computing, IIT (BHU))
----------------------------------------------------------------------
Message: 1
Date: Fri, 23 Jan 2015 20:28:32 -0500
From: Brandon Allbery <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Show and showList
Message-ID:
<CAKFCL4WraKh6BQX9wucrCxYXW6U-5Bp-5yPBpDePDqhwa=1...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Fri, Jan 23, 2015 at 8:21 PM, Animesh Saxena <[email protected]>
wrote:
> It's the same problem now transfered to showList which will be declared
> differently for a list of int's or a list of chars, but still it outputs
> them differently as can be seen from the above code. How it is able to
> differentiate without throwing up the overlap error?
The key is that showList is defined on e.g. Int or Char, not [Int] or
[Char]. If we tried to do the "obvious" thing for a list, we'd define
instance Show a => Show [a] where ...
but then we have an overlap any time we try to define a different handler
for a specific list of things (in this case, instance Show [Char] would be
the overlapping instance we'd want, to produce the String representation).
We avoid this by building the representation for lists into the
representation for single items (thus, a showList method); we can provide a
default implementation of that method in the Show class to do the usual
brackets-and-commas representation, using the mechanism intended to allow
optimized versions of typeclass methods for particular types, and then
provide a specific implementation for instance Show Char without invoking
overlap.
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20150123/eb641dfe/attachment-0001.html>
------------------------------
Message: 2
Date: Fri, 23 Jan 2015 20:15:32 -0800
From: Karl Voelker <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Defining an instance: Syntax that
works exactly sometimes
Message-ID:
<1422072932.1088322.218161969.1c09f...@webmail.messagingengine.com>
Content-Type: text/plain; charset="us-ascii"
On Fri, Jan 23, 2015, at 12:01 PM, Brandon Allbery wrote:
> Usually extensions will be called out with a pragma
Unless you are looking at the source of a cabal package, in which case
they might be centralized in the .cabal file.
-Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20150123/8fb71fee/attachment-0001.html>
------------------------------
Message: 3
Date: Sat, 24 Jan 2015 11:37:29 +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] Defining an instance: Syntax that
works exactly sometimes
Message-ID:
<capy+zdrst-z5enwrfqhwn8qdmahnr4707fao2tfj8cm7xvw...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
> Is anything in the 98 report obsolete?
The base language is remarkably stable. Haskell 2010 removed (n+k) pattern
matching. And that's the only thing obsoleted over 12 years !
So it's all add, no removal.
A better question to ask is, what's the 20% of the report that's used 80%
of the time?
> Should I always look first in the 98 Report, and only if I don't find
something there then look in the User's Guide?
Sounds like a good plan. Over time, you'll understand what's haskell and
what are ghc extensions.
Humble advice: it's not enough to read the language def. You'll understand
better by reading the conference proceedings that made the language what it
is today.
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20150124/b1dfd058/attachment-0001.html>
------------------------------
Message: 4
Date: Sat, 24 Jan 2015 05:02:25 +0000 (UTC)
From: Robert Dodier <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] ghc failed to compile trifecta while
installing idris
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hi,
I'm trying to install Idris.
I am working on Ubuntu 14.04. ghc --version reports 7.6.3.
After installing Haskell via apt-get, I then executed cabal update,
which succeeded.
I then tried cabal install idris and it eventually failed while
trying to install trifecta.
I then tried cabal install -v3 idris and got the following info
about the trifecta problem, which I've appended to this message
as a PS.
Maybe I can patch Highlight.hs? How would I go about that?
Unpack the tar.gz, patch the file, and repack it?
For the record, I tried to follow the instructions at:
https://github.com/idris-lang/Idris-dev/wiki/Idris-on-Ubuntu
but ran into various errors, e.g., cabal install cabal-install
failed with ExitFailure 139.
Thanks for any advice.
best,
Robert Dodier
PS. The tail end of the output of cabal install -v3 idris:
[ 8 of 13] Compiling Text.Trifecta.Highlight (
src/Text/Trifecta/Highlight.hs, dist/build/Text/Trifecta/Highlight.o )
*** Parser:
*** Renamer/typechecker:
src/Text/Trifecta/Highlight.hs:46:15:
Ambiguous occurrence `Comment'
It could refer to either `Text.Blaze.Internal.Comment',
imported from `Text.Blaze.Internal' at
src/Text/Trifecta/Highlight.hs:35:1-26
or `Text.Parser.Token.Highlight.Comment',
imported from `Text.Parser.Token.Highlight' at
src/Text/Trifecta/Highlight.hs:36:1-34
Upsweep partially successful.
*** Deleting temp files:
Deleting: /tmp/ghc13030_0/ghc13030_0.s
Warning: deleting non-existent /tmp/ghc13030_0/ghc13030_0.s
link(batch): upsweep (partially) failed OR
Main.main not exported; not linking.
*** Deleting temp files:
Deleting: /tmp/ghc13030_0/ghc13030_0.hscpp
*** Deleting temp dirs:
Deleting: /tmp/ghc13030_0
/usr/bin/ghc returned ExitFailure 1
Failed to install trifecta-1.5
World file is already up to date.
cabal: Error: some packages failed to install:
idris-0.9.16 depends on trifecta-1.5 which failed to install.
trifecta-1.5 failed during the building phase. The exception was:
ExitFailure 1
------------------------------
Message: 5
Date: Sat, 24 Jan 2015 13:56:30 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
<[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] ghc failed to compile trifecta while
installing idris
Message-ID:
<CAJbEW8O_qE1Ci5LH00oEmgsDV+0=h+_Bvm9Xwwpc-qxTuTk-=g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Take a look here: https://github.com/ekmett/trifecta/issues/41
On 24 January 2015 at 10:32, Robert Dodier <[email protected]> wrote:
> Hi,
>
> I'm trying to install Idris.
>
> I am working on Ubuntu 14.04. ghc --version reports 7.6.3.
>
> After installing Haskell via apt-get, I then executed cabal update,
> which succeeded.
>
> I then tried cabal install idris and it eventually failed while
> trying to install trifecta.
>
> I then tried cabal install -v3 idris and got the following info
> about the trifecta problem, which I've appended to this message
> as a PS.
>
> Maybe I can patch Highlight.hs? How would I go about that?
> Unpack the tar.gz, patch the file, and repack it?
>
> For the record, I tried to follow the instructions at:
> https://github.com/idris-lang/Idris-dev/wiki/Idris-on-Ubuntu
> but ran into various errors, e.g., cabal install cabal-install
> failed with ExitFailure 139.
>
> Thanks for any advice.
>
> best,
>
> Robert Dodier
>
> PS. The tail end of the output of cabal install -v3 idris:
>
> [ 8 of 13] Compiling Text.Trifecta.Highlight (
> src/Text/Trifecta/Highlight.hs, dist/build/Text/Trifecta/Highlight.o )
> *** Parser:
> *** Renamer/typechecker:
>
> src/Text/Trifecta/Highlight.hs:46:15:
> Ambiguous occurrence `Comment'
> It could refer to either `Text.Blaze.Internal.Comment',
> imported from `Text.Blaze.Internal' at
> src/Text/Trifecta/Highlight.hs:35:1-26
> or `Text.Parser.Token.Highlight.Comment',
> imported from `Text.Parser.Token.Highlight' at
> src/Text/Trifecta/Highlight.hs:36:1-34
> Upsweep partially successful.
> *** Deleting temp files:
> Deleting: /tmp/ghc13030_0/ghc13030_0.s
> Warning: deleting non-existent /tmp/ghc13030_0/ghc13030_0.s
> link(batch): upsweep (partially) failed OR
> Main.main not exported; not linking.
> *** Deleting temp files:
> Deleting: /tmp/ghc13030_0/ghc13030_0.hscpp
> *** Deleting temp dirs:
> Deleting: /tmp/ghc13030_0
> /usr/bin/ghc returned ExitFailure 1
> Failed to install trifecta-1.5
> World file is already up to date.
> cabal: Error: some packages failed to install:
> idris-0.9.16 depends on trifecta-1.5 which failed to install.
> trifecta-1.5 failed during the building phase. The exception was:
> ExitFailure 1
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
--
Regards
Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20150124/263fd7ea/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 79, Issue 27
*****************************************