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: Problem installing EclipseFp in Eclipse (Robert Weisser)
2. Re: replacing fold with scan! (Zhi An Ng)
3. Re: Problem installing EclipseFp in Eclipse (Vlatko Basic)
----------------------------------------------------------------------
Message: 1
Date: Thu, 01 May 2014 05:19:39 +0200
From: "Robert Weisser" <[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell" <[email protected]>
Subject: Re: [Haskell-beginners] Problem installing EclipseFp in
Eclipse
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Brent: Thanks to you as well, especially since (3) involves the least effort.
----- Original Message -----
From: Brent Yorgey
Sent: 04/30/14 08:40 PM
To: [email protected]
Subject: Re: [Haskell-beginners] Problem installing EclipseFp in Eclipse
There's no particular need for SourceGraph and definitely no need for
cabal-dev. I say try (3). On Thu, May 01, 2014 at 12:18:05AM +0200, Robert
Weisser wrote: > I decided to try out Eclipse with the EclipseFP plug-in for
Haskell. > I downloaded Eclipse, and then started to install EclipseFP. At >
some point, I got a screen which said that I needed to install > buildwrapper
and scion-browser. It offered to install both > of them, and optionally install
hoogle, hlint, stylish-haskell, > SourceGraph, and cabal-dev. The option to
install the additional > items was pre-checked. I left it checked. The
installation of > buildwrapper, etc. took a long time. It seemed to be going
well > until I saw the messages below, which say that installing SourceGraph >
will likely break several other packages, most of which were part > of the
EclipseFP installation. > > I am not a complete novice with Haskell but I am a
complete novice > with Cabal. I'm not sure what to do. Here are some options I
have
> considered: > > 1. Use --force-reinstalls and hope for the best. > > 2. Try
> to resolve the problem with Cabal, although I don't know to > do this. > >
> 3. Use EclipseFP without SourceGraph and cabal-dev. > > 4. Use EclipseFP
> without SourceGraph, but install cabal-dev using > cabal on the command
> line. > > 5. Forget about Eclipse altogether, and go back to using vim. > >
> Any advice would be appreciated. > > By the way, I am using Haskell Platform
> 7.6.3. > > Here are the messages I saw in the Eclipse console window: > >
> <terminated> Installing executable SourceGraph > > Resolving dependencies...
> > In order, the following would be installed: > asn1-types-0.2.3 (new
> package) > asn1-encoding-0.8.1.3 (new package) > asn1-parse-0.8.1 (new
> package) > bktrees-0.3.1 (new package) > byteable-0.1.1 (new package) >
> cereal-0.4.0.1 (new package) > colour-2.3.3 (new package) > cpphs-1.18.2
> (new version) > crypto-pubkey-types-0.4.2.2 (new package) >
> cryptohash-0.11.4 (new package) > digest-0.0.1.2
(new package) > dlist-0.5 (new version) > aeson-0.7.0.3 (reinstall) changes:
dlist-0.7.0.1 -> 0.5 > data-default-instances-dlist-0.0.1 (reinstall) changes:
dlist-0.7.0.1 -> 0.5 > data-default-0.5.3 (reinstall) > cookie-0.4.1.1 (new
package) > haskell-src-exts-1.13.5 (new version) > hslua-0.3.12 (new package) >
mime-types-0.1.0.4 (new package) > multiset-0.2.2 (new package) >
pandoc-types-1.12.3.2 (new package) > pem-0.2.2 (new package) > polyparse-1.8
(new version) > publicsuffixlist-0.1 (new package) > http-client-0.3.2 (new
package) > regex-pcre-builtin-0.94.4.8.8.34 (new package) >
highlighting-kate-0.5.6.1 (new package) > resourcet-0.4.10.2 (new version) >
securemem-0.1.3 (new package) > crypto-cipher-types-0.0.9 (new package) >
cipher-aes-0.2.7 (new package) > cipher-rc4-0.1.4 (new package) >
crypto-random-0.0.7 (new package) > cprng-aes-0.5.2 (new package) >
crypto-numbers-0.2.3 (new package) > crypto-pubkey-0.2.4 (new package) >
socks-0.5.4 (new package) > temporary-1.1.2.5 (
new package) > text-stream-decode-0.1.0.5 (new package) > conduit-1.0.17.1
(new version) > http-client-conduit-0.2.0.1 (new package) >
wl-pprint-text-1.1.0.2 (new package) > graphviz-2999.16.0.0 (new package) >
x509-1.4.11 (new package) > x509-store-1.4.4 (new package) > x509-system-1.4.5
(new package) > x509-validation-1.5.0 (new package) > tls-1.2.6 (new package) >
connection-0.2.1 (new package) > http-client-tls-0.2.1.1 (new package) >
http-conduit-2.0.0.10 (new package) > xml-1.3.13 (new package) >
texmath-0.6.6.1 (new package) > yaml-0.8.8.2 (reinstall) changes: conduit-1.1.1
-> 1.0.17.1, resourcet-1.1.2 > -> 0.4.10.2 > zip-archive-0.2.2.1 (new package)
> pandoc-1.12.3.3 (new package) > Graphalyze-0.14.0.2 (new package) >
SourceGraph-0.7.0.5 (new package) > cabal: The following packages are likely to
be broken by the reinstalls: > stylish-haskell-0.5.10.0 > scion-browser-0.3.1 >
persistent-template-1.3.1.3 > persistent-sqlite-1.3.0.5 > persistent-1.3.0.6 >
buildwrapper-0.8.0 >
dynamic-cabal-0.3.1 > Use --force-reinstalls if you want to install anyway. >
_______________________________________________ > Beginners mailing list >
[email protected] > http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ 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/20140501/a8ead8f6/attachment-0001.html>
------------------------------
Message: 2
Date: Thu, 1 May 2014 12:31:38 +0800
From: Zhi An Ng <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] replacing fold with scan!
Message-ID:
<cacgwx5eck_dex4kcwtm3azc2w-g58_yl_0-_mki5bg5bohs...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
??
Hi,
The types of `foldr` and `scanr` are different:
> :t scanr
scanr :: (a -> b -> b) -> b -> [a] -> [b]
> :t foldr
foldr :: (a -> b -> b) -> b -> [a] -> b
I believe the reason is that `scanr` does something like a prefix sum,
https://en.wikipedia.org/wiki/Prefix_sum
So to get this to work, you need to change the type signature of filter''
filter'' :: (a -> Bool) -> [a] -> [[a]]
That's all.
Anyway you can try entering the definition of filter'' into ghci, and use
:t to let ghc figure our the type for you as well :)
Best,
Zhi An
On Thu, May 1, 2014 at 10:42 AM, raffa f <[email protected]> wrote:
> hi everyone! here's my new problem. i wrote my version of filter:
>
> filter' :: (a -> Bool) -> [a] -> [a]
> filter' f = foldr (\x acc -> if f x then x:acc else acc) []
>
> and it works! however, i wanted to use scan too. so i just replaced foldr
> with scanr, to see what would happen:
>
> filter'' :: (a -> Bool) -> [a] -> [a]
> filter'' f = scanr (\x acc -> if f x then x:acc else acc) []
>
> but that doesn't work! ghci gives me this:
>
> folds.hs:15:59:
> Couldn't match expected type `a' with actual type `[a0]'
> `a' is a rigid type variable bound by
> the type signature for filter'' :: (a -> Bool) -> [a] -> [a]
> at folds.hs:14:13
> In the second argument of `scanr', namely `[]'
> In the expression:
> scanr (\ x acc -> if f x then x : acc else acc) []
> In an equation for filter'':
> filter'' f = scanr (\ x acc -> if f x then x : acc else acc) []
> Failed, modules loaded: none.
>
> the problem seems to be with the start value of [], it seems? i don't
> understand, i thought scan and fold worked pretty much the same. i learned
> about these functions today, so i'm still trying to wrap my head around
> them...
>
> thank you!
>
> _______________________________________________
> 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/20140501/1a2a112e/attachment-0001.html>
------------------------------
Message: 3
Date: Thu, 01 May 2014 09:59:36 +0200
From: Vlatko Basic <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Problem installing EclipseFp in
Eclipse
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140501/925fadb7/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 71, Issue 2
****************************************