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: Actions v. Functions (Antoine Latter)
2. Re: Actions v. Functions (MJ Williams)
3. Re: Actions v. Functions (Arjun Comar)
4. Re: Actions v. Functions (Brandon Allbery)
5. Re: Actions v. Functions (Rein Henrichs)
6. Re: Actions v. Functions (Heinrich Apfelmus)
----------------------------------------------------------------------
Message: 1
Date: Sat, 19 Oct 2013 15:44:15 -0500
From: Antoine Latter <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Actions v. Functions
Message-ID:
<cakjsnqehctexqs0x-up_yuyvp6riybu7kbrtzau_bvj0zth...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
What do you mean by "action"?
Antoine
On Fri, Oct 18, 2013 at 9:26 PM, MJ Williams
<[email protected]>wrote:
> Hello
> What are the formal properties of an action?
> How does an action differ from a function?
> Sincerely,
> Matthew
>
> ______________________________**_________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/**mailman/listinfo/beginners<http://www.haskell.org/mailman/listinfo/beginners>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20131019/2350a2e2/attachment-0001.html>
------------------------------
Message: 2
Date: Sat, 19 Oct 2013 22:09:01 +0100
From: MJ Williams <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Actions v. Functions
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
For example, `main = do input <- getLine ...', where `getLine' is an
action as distinguished from a function such as `main'. Other
examples of actions in Haskell include `print', `putStrLn' and any
process that reads from or writes to a file. Of course, the list of
actions doesn't end there, though the examples here should answer
your question.
Sincerely,
Matt
At 21:44 19/10/2013, you wrote:
>What do you mean by "action"?
>
>Antoine
>
>
>On Fri, Oct 18, 2013 at 9:26 PM, MJ Williams
><<mailto:[email protected]>[email protected]> wrote:
>Hello
>What are the formal properties of an action?
>How does an action differ from a function?
>Sincerely,
>Matthew
>
>_______________________________________________
>Beginners mailing list
><mailto:[email protected]>[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/20131019/8cef61f2/attachment-0001.html>
------------------------------
Message: 3
Date: Sat, 19 Oct 2013 18:10:18 -0400
From: Arjun Comar <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Actions v. Functions
Message-ID:
<cadjrcrwepsndzn1yuk4bpfctzizsobetqz7tek7cu8ety01...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Matt,
Start with the
Functors<http://learnyouahaskell.com/functors-applicative-functors-and-monoids>chapter
of LYAH and continue reading through the chapter on
Monads. <http://learnyouahaskell.com/a-fistful-of-monads>
Another very good resource is You Could Have Invented
Monads<http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html>
.
Arjun
On Sat, Oct 19, 2013 at 5:09 PM, MJ Williams
<[email protected]>wrote:
> For example, `main = do input <- getLine ...', where `getLine' is an
> action as distinguished from a function such as `main'. Other examples of
> actions in Haskell include `print', `putStrLn' and any process that reads
> from or writes to a file. Of course, the list of actions doesn't end there,
> though the examples here should answer your question.
> Sincerely,
> Matt
>
>
> At 21:44 19/10/2013, you wrote:
>
> What do you mean by "action"?
>
> Antoine
>
>
> On Fri, Oct 18, 2013 at 9:26 PM, MJ Williams <[email protected]>
> wrote:
> Hello
> What are the formal properties of an action?
> How does an action differ from a function?
> Sincerely,
> Matthew
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
> _______________________________________________
> 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/20131019/7b811485/attachment-0001.html>
------------------------------
Message: 4
Date: Sat, 19 Oct 2013 18:23:08 -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] Actions v. Functions
Message-ID:
<CAKFCL4VJUjA1kD29Tv6idA6nckjYX=snrknwm+s8qoew7mf...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Sat, Oct 19, 2013 at 5:09 PM, MJ Williams
<[email protected]>wrote:
> For example, `main = do input <- getLine ...', where `getLine' is an
> action as distinguished from a function such as `main'. Other examples of
> actions in Haskell include `print', `putStrLn' and
>
Actions aren't so much a formal thing as a conceptual "handle" to help with
understanding monads. In particular, what a particular action represents
depends on the monad, and in some cases on the particular implementation
(for example, an IO action in GHC is a partially applied function, but this
is an implementation detail that does nothing to help you understand how to
work with 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://www.haskell.org/pipermail/beginners/attachments/20131019/6a4d0e7a/attachment-0001.html>
------------------------------
Message: 5
Date: Sat, 19 Oct 2013 19:03:22 -0700
From: Rein Henrichs <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Actions v. Functions
Message-ID:
<cajp6g8wdwkbvc2vede733-ita_ceojmfsarbuwfdhzxcwrz...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
An action in this sense is just a function of type `Monad m => a -> m b'
(or one where the monad is specified, like `a -> IO b'). This type
signature fully specifies the "formal properties" of an action and shows
that actions do not differ from functions: they are merely functions of a
certain type.
On Sat, Oct 19, 2013 at 3:23 PM, Brandon Allbery <[email protected]>wrote:
> On Sat, Oct 19, 2013 at 5:09 PM, MJ Williams <
> [email protected]> wrote:
>
>> For example, `main = do input <- getLine ...', where `getLine' is an
>> action as distinguished from a function such as `main'. Other examples of
>> actions in Haskell include `print', `putStrLn' and
>>
>
> Actions aren't so much a formal thing as a conceptual "handle" to help
> with understanding monads. In particular, what a particular action
> represents depends on the monad, and in some cases on the particular
> implementation (for example, an IO action in GHC is a partially applied
> function, but this is an implementation detail that does nothing to help
> you understand how to work with it).
>
> --
> brandon s allbery kf8nh sine nomine
> associates
> [email protected]
> [email protected]
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
--
Best,
Rein Henrichs
http://reinh.com
c: 503.784.0697
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20131019/5cebfbeb/attachment-0001.html>
------------------------------
Message: 6
Date: Sun, 20 Oct 2013 12:16:24 +0200
From: Heinrich Apfelmus <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Actions v. Functions
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
Rein Henrichs wrote:
> An action in this sense is just a function of type `Monad m => a -> m b'
> (or one where the monad is specified, like `a -> IO b'). This type
> signature fully specifies the "formal properties" of an action and shows
> that actions do not differ from functions: they are merely functions of a
> certain type.
I generally use the word "action" to refer to values of type `IO a` (or
another monad). A value of type `a -> IO b` would be a function that
returns an action.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 64, Issue 31
*****************************************