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: Haskell type system (Robert Ziemba)
2. $= operator (Nathan Holden)
3. examples of Crypto (Kui Ma)
4. Re: $= operator (Alexander Dunlap)
5. Better way to retrieve data strucures from sql-db?
(Roman Naumann)
6. Re: examples of Crypto (Michael Snoyman)
7. Anyone use haskell + cassandra? (Joe Van Dyk)
8. Finance.Quote.Yahoo (Hong Yang)
----------------------------------------------------------------------
Message: 1
Date: Sun, 27 Sep 2009 10:40:48 -0700
From: Robert Ziemba <[email protected]>
Subject: Re: [Haskell-beginners] Haskell type system
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
I have found this online book to be fairly easy to understand
http://book.realworldhaskell.org/read/types-and-functions.html
<http://book.realworldhaskell.org/read/types-and-functions.html>Take a look
at the section called "The type of a function with more than one argument"
and also follow the link to "Partial function application and currying"
If you decide to use this book, I would recommend reading the entire thing.
I tried to skip around at first, but got lost pretty quickly. The author
does a good job of adding complexity step by step, so it might be best to
start from the beginning.
On Sun, Sep 27, 2009 at 3:22 AM, informationen <[email protected]> wrote:
> Hi,
>
> i am trying to understand the Haskell type system. I thought i understood
> it
> quite well until i encountered the three following exercises. As you can
> see, i
> have the answers already. But i don't understand, why they are correct.
>
> Could anybody tell me a good place where i could learn how to answers these
> kind
> of questions correctly or could give me some explanations, why these
> answers are
> correct?
>
> Any help is highly appreciated.
>
> Kind regards
>
> Chris
> Two functions f and g with the following signatures are given:
> f :: a -> a
> g :: b -> c -> b
>
> A) Give the type of the following expressions:
>
> 1) g [False] True :: 2) g [] True :: 3) g (f True) :: 4) g f
> ::
> Answers:
>
> 1 [Boolean] 2) [a] 3) c -> Bool
> 4) c -> (a -> a)1) g f 1
> B) Which of the following statements is correct?
>
> 2) g (f 1) is type correct
> 3) g . (f 1) is type correct
> 4) g . f 1 is type correct
> 5) (g . f) 1 is type correct
> 6) none of the expressions is correct
>
> Answers:
> 1,2 and 5 are correct.
>
> C) A function h is given as: h p x = p (f x). Which of the following
> statements is correct.
>
> 1) h :: a -> b -> a -> b
> 2) h :: (a -> a) -> a -> a
> 3) h :: (a -> b) -> a -> b
> 4) h is equivalent to h' with h' p = p . f
> 5) h is equivalent to h' with h' p = p f
> 5) h is equivalent to h' with h' p x = p f x
>
> Answers:
> (I am not sure, if i remember correctly, but 3) and 4) should be
> correct.)
>
>
> _______________________________________________
> 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/20090927/cdfba994/attachment-0001.html
------------------------------
Message: 2
Date: Sun, 27 Sep 2009 23:08:11 -0400
From: Nathan Holden <[email protected]>
Subject: [Haskell-beginners] $= operator
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
I was reading Eleara examples out of Hackage, and I kept noticing lines like
this:
> t <- get GLFW.time
> GLFW.time $= 0
Most of the rest of it made more-or-less sense (I mean, there IS a reason
I'm still asking questions to beginners!) but I couldn't seem to find
anything about it on my usual reference sources, and it's uses don't make
that much sense to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20090927/83978194/attachment-0001.html
------------------------------
Message: 3
Date: Mon, 28 Sep 2009 11:27:53 +0800
From: Kui Ma <[email protected]>
Subject: [Haskell-beginners] examples of Crypto
To: <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="gb2312"
Hello,
I want some examples to learn the package of Crypto, anyone knows where I can
find them? Thank you in advance!
Regards,
kui
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces.
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20090927/635e1ec9/attachment-0001.html
------------------------------
Message: 4
Date: Sun, 27 Sep 2009 21:04:41 -0700
From: Alexander Dunlap <[email protected]>
Subject: Re: [Haskell-beginners] $= operator
To: Nathan Holden <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
On Sun, Sep 27, 2009 at 8:08 PM, Nathan Holden <[email protected]> wrote:
> I was reading Eleara examples out of Hackage, and I kept noticing lines like
> this:
>
>>Â Â t <- get GLFW.time
>>Â Â GLFW.time $= 0
>
> Most of the rest of it made more-or-less sense (I mean, there IS a reason
> I'm still asking questions to beginners!) but I couldn't seem to find
> anything about it on my usual reference sources, and it's uses don't make
> that much sense to me.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
That's not an Elerea operator; that's from OpenGL. Roughly speaking,
it means "set" - change the value of a setting or variable of some
sort.
I'm also working on familiarizing myself with FRP and Elerea, so good luck!
Alex
------------------------------
Message: 5
Date: Mon, 28 Sep 2009 18:55:00 +0200
From: Roman Naumann <[email protected]>
Subject: [Haskell-beginners] Better way to retrieve data strucures
from sql-db?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
The following function converts the data read from an sql database to a
player data structure.
toPlayer :: [SqlValue] -> Player
toPlayer sx = Player {
plID = fromSql (sx!!0),
plAccount = fromSql (sx!!1),
plForename = fromSql (sx!!2),
plSurename = fromSql (sx!!3),
plPos_x = fromSql (sx!!4),
plPos_y = fromSql (sx!!5)
}
It appears to me, that I have to write this boilerplate code every time
I introduce a new data structure that has to be read from the sql
database. Can you think of a way to automate this?
Thanks for your replies,
Roman Naumann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url :
http://www.haskell.org/pipermail/beginners/attachments/20090928/23ead438/signature-0001.bin
------------------------------
Message: 6
Date: Mon, 28 Sep 2009 19:36:39 +0200
From: Michael Snoyman <[email protected]>
Subject: Re: [Haskell-beginners] examples of Crypto
To: Kui Ma <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
I use it in clientsession: http://hackage.haskell.org/package/clientsession.
Let me know if I can be of some assistance.
Michael
2009/9/28 Kui Ma <[email protected]>
>
> Hello,
>
> I want some examples to learn the package of Crypto, anyone knows where I
> can find them? Thank you in advance!
>
> Regards,
> kui
>
> ------------------------------
> Invite your mail contacts to join your friends list with Windows Live
> Spaces. It's easy! Try
> it!<http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us>
>
> _______________________________________________
> 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/20090928/f4e3f04b/attachment-0001.html
------------------------------
Message: 7
Date: Mon, 28 Sep 2009 10:47:12 -0700
From: Joe Van Dyk <[email protected]>
Subject: [Haskell-beginners] Anyone use haskell + cassandra?
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
I'm thinking of using Haskell + Cassandra + Rails to build a
horizontally-scalable web app. Haskell + Cassandra would power the
webservice that Rails communicates with.
Has anyone done anything like that?
--
Joe Van Dyk
http://fixieconsulting.com
------------------------------
Message: 8
Date: Mon, 28 Sep 2009 14:22:40 -0500
From: Hong Yang <[email protected]>
Subject: [Haskell-beginners] Finance.Quote.Yahoo
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
Hi All,
I was using a modified version of Finance.Quote.Yahoo module (I only added
"setproxy"), and got unwanted print on the screen. My questions are as
follows:
1) How can I get rid of this screen print? (I guess HTTP package called by
the Finance.Quote.Yahoo module internally prints those info. Should I
temporarily turn off STDOUT then turn it on? How to do this?)
2) "ghc-pkg list" shows HTTP-4000.0.8. How come the output shows
"HTTP-4000.0.5"?
Thanks,
Hong
P.S. The following is the screen output:
Sending:
GET http://download.finance.yahoo.com/d/quotes.csv?s=BAX&f=l1 HTTP/1.1
Content-Length: 0
User-Agent: hs-HTTP-4000.0.5
Host: download.finance.yahoo.com
proxy uri host: xxxproxy, port: :74
Creating new connection to xxxproxy:74
Received:
HTTP/1.1 200 OK
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Transfer-Encoding: chunked
Via: 1.1 SAUSISA02
Date: Mon, 28 Sep 2009 18:49:43 GMT
Content-Type: application/octet-stream
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM
DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND
PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
Cache-Control: private
Content-Length: 7
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20090928/c500bf96/attachment.html
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 15, Issue 18
*****************************************