[Haskell-cafe] Pointless functors

2009-03-13 Thread Martijn van Steenbergen
Bonjour café, Are there any functors f for which no point/pure/return :: a - f a exists? Thank you, Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Ross Paterson
On Fri, Mar 13, 2009 at 03:18:15PM +0100, Martijn van Steenbergen wrote: Are there any functors f for which no point/pure/return :: a - f a exists? No. Choose an arbitrary element shape :: f () and define point x = fmap (const x) shape ___

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Eugene Kirpichov
'An arbitrary element' means 'undefined will suffice' point x = fmap (const x) undefined 2009/3/13 Ross Paterson r...@soi.city.ac.uk: On Fri, Mar 13, 2009 at 03:18:15PM +0100, Martijn van Steenbergen wrote: Are there any functors f for which no point/pure/return :: a - f a exists? No.  

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Conor McBride
On 13 Mar 2009, at 14:32, Ross Paterson wrote: On Fri, Mar 13, 2009 at 03:18:15PM +0100, Martijn van Steenbergen wrote: Are there any functors f for which no point/pure/return :: a - f a exists? No. Choose an arbitrary element shape :: f () and define point x = fmap (const x)

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Brent Yorgey
On Fri, Mar 13, 2009 at 02:32:23PM +, Ross Paterson wrote: On Fri, Mar 13, 2009 at 03:18:15PM +0100, Martijn van Steenbergen wrote: Are there any functors f for which no point/pure/return :: a - f a exists? No. Choose an arbitrary element shape :: f () and define point x =

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Martijn van Steenbergen
Eugene Kirpichov wrote: 'An arbitrary element' means 'undefined will suffice' point x = fmap (const x) undefined Prelude fmap (const True) undefined :: [Bool] *** Exception: Prelude.undefined Or is that not what you mean? Martijn. ___

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Brent Yorgey
On Fri, Mar 13, 2009 at 05:35:31PM +0300, Eugene Kirpichov wrote: 'An arbitrary element' means 'undefined will suffice' point x = fmap (const x) undefined This is false. Prelude fmap (const 1) [()] [1] Prelude fmap (const 1) undefined *** Exception: Prelude.undefined -Brent

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Robin Green
For most functors, that is equivalent to point x = undefined But by that logic, everything is a member of every typeclass... -- Robin On Fri, 13 Mar 2009 17:35:31 +0300 Eugene Kirpichov ekirpic...@gmail.com wrote: 'An arbitrary element' means 'undefined will suffice' point x = fmap (const

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Robin Green
On Fri, 13 Mar 2009 14:32:23 + Ross Paterson r...@soi.city.ac.uk wrote: On Fri, Mar 13, 2009 at 03:18:15PM +0100, Martijn van Steenbergen wrote: Are there any functors f for which no point/pure/return :: a - f a exists? No. Choose an arbitrary element shape :: f () and define

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Eugene Kirpichov
Well, yes; then, that means that an arbitrary element is also false: you can't just take an arbitrary element and hope that works well. Then the original question must be reformulated: - Are there any functors for which there exists at least one non-bottom value of type 'f a' for some a, but

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Dan Doel
On Thursday 12 March 2009 10:30:47 pm Robin Green wrote: For most functors, that is equivalent to point x = undefined But by that logic, everything is a member of every typeclass... There are some cases where expected laws will prevent that. For instance, If you try to make a monad like:

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Ross Paterson
On Fri, Mar 13, 2009 at 04:11:57PM +0100, Martijn van Steenbergen wrote: Eugene Kirpichov wrote: 'An arbitrary element' means 'undefined will suffice' point x = fmap (const x) undefined Prelude fmap (const True) undefined :: [Bool] *** Exception: Prelude.undefined Or is that not what you

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Matthew Brecknell
Ross Paterson wrote: No. Choose an arbitrary element shape :: f () and define point x = fmap (const x) shape Interesting. Is the arbitrariness of the shape some sort of evidence that Pointed is not really a very useful class in its own right? Certainly, the shape does matter if you

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Jonathan Cast
On Sat, 2009-03-14 at 02:12 +1000, Matthew Brecknell wrote: Ross Paterson wrote: No. Choose an arbitrary element shape :: f () and define point x = fmap (const x) shape Interesting. Is the arbitrariness of the shape some sort of evidence that Pointed is not really a very useful

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Ross Paterson
On Sat, Mar 14, 2009 at 02:12:45AM +1000, Matthew Brecknell wrote: Ross Paterson wrote: No. Choose an arbitrary element shape :: f () and define point x = fmap (const x) shape Interesting. Is the arbitrariness of the shape some sort of evidence that Pointed is not really a very