Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/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: IO and purity (Kim-Ee Yeoh)
2. Re: How to "add column" to a Table? (Marcin Mrotek)
----------------------------------------------------------------------
Message: 1
Date: Sun, 26 Apr 2015 18:52:09 +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] IO and purity
Message-ID:
<CAPY+ZdQ4h_NgjMERyMc8NACs_Bop=u6iyyjluboqi-oxol7...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Sun, Apr 26, 2015 at 4:59 PM, Shishir Srivastava <
[email protected]> wrote:
> For e.g. the getLine function has the type IOString and it reads the
> input from the user. Now as I see it the output of getLine will always be
> same if the input remain same (i.e. for input "X" getLine will always
> return "X" ) which is the constraint on mathematical functions.
>
Notice that getLine is not a function. It is a value of type IO String.
In the misty dawn of Haskell, how you'd achieve the same thing as getLine
is to actually use Dialogue functions.
And yes, a value of type Dialogue is a bona fide function because Dialogue
is a type synonym for [Response] -> [Request].
You can read a bit about Haskell 1.2 and IO here:
http://r6.ca/blog/20110520T220201Z.html
Now Haskell 1.2 dates from 1992. Certainly it would be an experience
playing with it. Unfortunately, I know of no way to get hold of a compiler
or interpreter that old. You might want to query haskell-cafe.
Returning to getLine and monadic I/O, a question to contemplate is: how is
getLine different from an ordinary String, say "hello world"?
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150426/17bd68f6/attachment-0001.html>
------------------------------
Message: 2
Date: Sun, 26 Apr 2015 13:58:14 +0200
From: Marcin Mrotek <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] How to "add column" to a Table?
Message-ID:
<CAJcfPzkDASt_jRC2QuX8p24egsb-nQx3UmvBvPB=hqajy_p...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Hello,
Have a look at vinyl (https://hackage.haskell.org/package/vinyl) and
HList (https://hackage.haskell.org/package/HList), packages that
provide extensible records. I haven't used HList, but I can attest
vinyl is quite easy to use.
You can also have a look at
http://www.reddit.com/r/haskell/comments/32tdt6/functions_for_type_level_lists/
for some discussion regarding implementation of relational databases
in Haskell; I've linked to my (very) unfinished code there:
http://hub.darcs.net/mjm/relational/browse/src/Data/Relational feel
free to steal ideas :-P
Best regards,
Marcin Mrotek
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 82, Issue 37
*****************************************