Re: Adding an ignore function to Control.Monad

On Fri, Jul 10, 2009 at 10:10 PM, Don Stewart
## Control.Monad.void m a -> m () Don Stewart Iavor Diatchki
For whatever it's worth, I prefer void as well, for the exact reason Don said. Indeed, 'ignore' indicates to me that the argument won't even be evaluated: it'll be ignored, and skipped. But it is, and only part --- the result --- is ignored. What about 'void' with functors? Jeff Wheeler

On Sat, Jul 11, 2009 at 9:35 AM, Jeff Wheeler
On Fri, Jul 10, 2009 at 10:10 PM, Don Stewart
wrote: ## Control.Monad.void m a -> m () Don Stewart Iavor Diatchki
For whatever it's worth, I prefer void as well, for the exact reason Don said. Indeed, 'ignore' indicates to me that the argument won't even be evaluated: it'll be ignored, and skipped. But it is, and only part --- the result --- is ignored.
I also think void is clearer than ignore. -- Johan

Johan Tibell wrote:
[...]
I also think void is clearer than ignore.
So do I. Another point is, that it's familiar from other languages; a function "void f(...)" doesn't return anything but may have an effect on the environment. Stephan -- Früher hieß es ja: Ich denke, also bin ich. Heute weiß man: Es geht auch so. - Dieter Nuhr

Johan Tibell wrote:
[...]
I also think void is clearer than ignore.
So do I. Another point is, that it's familiar from other languages; a function "void f(...)" doesn't return anything but may have an effect on the environment.
+1. Regards, Malcolm

Stephan Friedrichs wrote:
Johan Tibell wrote:
[...]
I also think void is clearer than ignore.
So do I. Another point is, that it's familiar from other languages; a function "void f(...)" doesn't return anything but may have an effect on the environment.
That depends on what languages you are familiar with, of course. To me void is a type (C/C++) while ignore is a function (OCaml) ;-) /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

Hello Magnus, Sunday, July 12, 2009, 12:12:01 PM, you wrote:
That depends on what languages you are familiar with, of course. To me void is a type (C/C++) while ignore is a function (OCaml) ;-)
you can write "(void)" :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Sun, 12 Jul 2009, Magnus Therning wrote:
Stephan Friedrichs wrote:
Johan Tibell wrote:
[...]
I also think void is clearer than ignore.
So do I. Another point is, that it's familiar from other languages; a function "void f(...)" doesn't return anything but may have an effect on the environment.
That depends on what languages you are familiar with, of course. To me void is a type (C/C++) while ignore is a function (OCaml) ;-)
In the Modula-II derivative Cluster it is named FORGET, in Modula-3 it is named EVAL. http://www.henning-thielemann.de/Cluster/Handbuch.pdf http://www.cs.tut.fi/lintula/manual/modula3/m3defn/html/eval.html

On Saturday 11 July 2009 3:35:27 am Jeff Wheeler wrote:
On Fri, Jul 10, 2009 at 10:10 PM, Don Stewart
wrote: ## Control.Monad.void m a -> m () Don Stewart Iavor Diatchki
For whatever it's worth, I prefer void as well, for the exact reason Don said. Indeed, 'ignore' indicates to me that the argument won't even be evaluated: it'll be ignored, and skipped. But it is, and only part --- the result --- is ignored.
What about 'void' with functors?
Perhaps it should be noted that 'void' is sometimes associated with the type: data Void the 'empty' type (which isn't empty in Haskell). In typical catamorphism style, void would be its eliminator: void :: forall a. Void -> a void _ = undefined -- if you're writing Agda -- void () This, doesn't see much use in Haskell, though, so perhaps it's irrelevant. -- Dan
participants (8)
-
Bulat Ziganshin
-
Dan Doel
-
Henning Thielemann
-
Jeff Wheeler
-
Johan Tibell
-
Magnus Therning
-
Malcolm Wallace
-
Stephan Friedrichs