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. Monad transformers (Andrew Bernard)
2. Re: Monad transformers (Brandon Allbery)
3. Re: Config data (Andrew Bernard)
4. Re: Monad transformers (Martin Vlk)
5. Re: Monad transformers (Ramakrishnan Muthukrishnan)
6. Re: Monad transformers ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Sat, 19 Sep 2015 11:00:25 +1000
From: Andrew Bernard <[email protected]>
To: <[email protected]>
Subject: [Haskell-beginners] Monad transformers
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Greetings All,
While I admire Haskell enormously, as a an intermediate beginner I find it
difficult to know what is normal Haskell style for real world programming. On
the subject of monad transformers, the paper by Martin Grab?mller titled 'Monad
Transformers Step by Step' gives an example of an evaluator using monad
transformers with the following type:
type Eval6 ? = ReaderT Env (ErrorT String (WriterT [String] (StateT Integer
IO))) ?
Is this how normal Haskell is developed and written in practice? I find the
type and the function impenetrably dense and difficult to understand. Should I
be aspiring to have my functions look and work like this? Of course it depends
on what you want to do, but the essence of the question is, does Haskell
ultimately end up looking like this for any real programming, beyond textbook
list manipulation functions?
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150919/3f69a422/attachment-0001.html>
------------------------------
Message: 2
Date: Fri, 18 Sep 2015 21:30:38 -0400
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] Monad transformers
Message-ID:
<CAKFCL4URqGF=eryfdeesvke_k51vk362nnoxe5jeuw7swz6...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Fri, Sep 18, 2015 at 9:00 PM, Andrew Bernard <[email protected]>
wrote:
> Is this how normal Haskell is developed and written in practice? I find
> the type and the function impenetrably dense and difficult to understand.
> Should I be aspiring to have my functions look and work like this? Of
> course it depends on what you want to do, but the essence of the question
> is, does Haskell ultimately end up looking like this for any real
> programming, beyond textbook list manipulation functions?
If you need that, then yes. If not, then no.
Usually that kind of thing is packaged up in higher level libraries; the
type Eval6 would be exposed, the underlying stuff is used internally and
you would not normally need to know or care about it unless you were
specifically working on the internals of that library. Most applications
you would write, you only care about Eval6 and any functions exported along
with it.
That said, I think in most cases you would use a newtype and derive through
MonadReader, MonadError, MonadState, and MonadIO so you can ignore
precisely how the type was built and just use it.
--
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://mail.haskell.org/pipermail/beginners/attachments/20150918/a0116403/attachment-0001.html>
------------------------------
Message: 3
Date: Sat, 19 Sep 2015 11:32:02 +1000
From: Andrew Bernard <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Config data
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Greetings,
Better style in functional programming is to be as stateless as possible.
Reverting to using global state, your life would be easier coding in Python.
Isn?t this a classic use for a Reader monad, which is for the purpose of
passing an environment around without having to do so explicitly?
Andrew
On 7/06/2015, 05:07, "Beginners on behalf of mike h"
<[email protected] on behalf of [email protected]> wrote:
Global state is an option - thanks. Didn't think Haskell allowed this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150919/51c7b2c9/attachment-0001.html>
------------------------------
Message: 4
Date: Sat, 19 Sep 2015 06:30:18 +0000
From: Martin Vlk <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Monad transformers
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
Hi, I am also something of a beginner in Haskell and have to say I am
slowly getting to see that many things that once looked impenetrable are
starting to clear up for me.
I am basically developing the intuitions that work in the Haskell world
- different intuitions from those I acquired when I worked using
imperative languages.
So possibly even advanced Haskell code is not impenetrable by nature -
it's just different - and once you get over the initial difficulty it'll
then look clear and not that dense at all?
Martin
Andrew Bernard:
> Greetings All,
>
> While I admire Haskell enormously, as a an intermediate beginner I find it
> difficult to know what is normal Haskell style for real world programming. On
> the subject of monad transformers, the paper by Martin Grab?mller titled
> 'Monad Transformers Step by Step' gives an example of an evaluator using
> monad transformers with the following type:
>
> type Eval6 ? = ReaderT Env (ErrorT String (WriterT [String] (StateT Integer
> IO))) ?
>
> Is this how normal Haskell is developed and written in practice? I find the
> type and the function impenetrably dense and difficult to understand. Should
> I be aspiring to have my functions look and work like this? Of course it
> depends on what you want to do, but the essence of the question is, does
> Haskell ultimately end up looking like this for any real programming, beyond
> textbook list manipulation functions?
>
> Andrew
>
>
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
------------------------------
Message: 5
Date: Sat, 19 Sep 2015 12:30:22 +0530
From: Ramakrishnan Muthukrishnan <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Monad transformers
Message-ID:
<1442646022.1439455.387904993.7bd3c...@webmail.messagingengine.com>
Content-Type: text/plain; charset="utf-8"
On Sat, Sep 19, 2015, at 06:30 AM, Andrew Bernard wrote:
> Greetings All,
>
> While I admire Haskell enormously, as a an intermediate beginner I
> find it difficult to know what is normal Haskell style for real world
> programming. On the subject of monad transformers, the paper by Martin
> Grab?mller titled 'Monad Transformers Step by Step' gives an example
> of an evaluator using monad transformers with the following type:
>
> type Eval6 ? = ReaderT Env (ErrorT String (WriterT [String] (StateT
> Integer IO))) ?
I felt the same too when I looked at that paper and read some other
Haskell code. But in my own little practice, I haven't written such type
signatures.
One of the talks that can help you get rid of the fear is this one by
Brian Hurt. It certainly helped me and I used a few Monad Transformers
after that talk to make my code cleaner. Encourage you to have a look.
<https://www.youtube.com/watch?v=8t8fjkISjus>
Cheers and happy hacking!
--
Ramakrishnan
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150919/0e3f3302/attachment-0001.html>
------------------------------
Message: 6
Date: Sat, 19 Sep 2015 07:15:53 +0000
From: [email protected]
To: [email protected]
Cc: [email protected]
Subject: Re: [Haskell-beginners] Monad transformers
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Hi. I am a beginner too.
For the most part I agree with you, except that Haskell is, in my opinion, a
dense language per se.
Haskell is more poetry than prose; you do not read/write a poem like a novel.
Whether you are new to this language or master it, it is dense.
Guillaume
<www.lthr.xyz>
Saturday, Sep 19, 2015 8:30 AM Martin Vlk wrote:
> Hi, I am also something of a beginner in Haskell and have to say I am
> slowly getting to see that many things that once looked impenetrable are
> starting to clear up for me.
>
> I am basically developing the intuitions that work in the Haskell world
> - different intuitions from those I acquired when I worked using
> imperative languages.
>
> So possibly even advanced Haskell code is not impenetrable by nature -
> it's just different - and once you get over the initial difficulty it'll
> then look clear and not that dense at all?
>
> Martin
>
> Andrew Bernard:
>> Greetings All,
>>
>> While I admire Haskell enormously, as a an intermediate beginner I find it
>> difficult to know what is normal Haskell style for real world programming.
>> On the subject of monad transformers, the paper by Martin Grab?mller titled
>> 'Monad Transformers Step by Step' gives an example of an evaluator using
>> monad transformers with the following type:
>>
>> type Eval6 ? = ReaderT Env (ErrorT String (WriterT [String] (StateT Integer
>> IO))) ?
>>
>> Is this how normal Haskell is developed and written in practice? I find the
>> type and the function impenetrably dense and difficult to understand. Should
>> I be aspiring to have my functions look and work like this? Of course it
>> depends on what you want to do, but the essence of the question is, does
>> Haskell ultimately end up looking like this for any real programming, beyond
>> textbook list manipulation functions?
>>
>> Andrew
>>
>>
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
--
Sent from Whiteout Mail - https://whiteout.io
My PGP key: https://keys.whiteout.io/[email protected]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 528 bytes
Desc: not available
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150919/a95300c8/attachment.sig>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 87, Issue 10
*****************************************