* Tony Morris tonymor...@gmail.com [2011-01-08 12:56:28+1000]
I am wondering if it possible to generalise catMaybes:
(Something f, SomethingElse t) = t (f a) - t a
I have being doing some gymnastics with Traversable and Foldable and a
couple of other things from category-extras to no
On Sat, 8 Jan 2011, Roman Cheplyaka wrote:
I think catMaybes deserves its own typeclass, which would represent
truncatable structures:
class Truncatable struct where
catMaybes :: struct (Maybe a) - Maybe a
But catMaybes has the type
catMaybes :: struct (Maybe a) - struct a
for
* Henning Thielemann lemm...@henning-thielemann.de [2011-01-08 12:06:33+0100]
On Sat, 8 Jan 2011, Roman Cheplyaka wrote:
I think catMaybes deserves its own typeclass, which would represent
truncatable structures:
class Truncatable struct where
catMaybes :: struct (Maybe a) -
On Fri, 7 Jan 2011, Brandon S Allbery KF8NH wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 1/7/11 21:56 , Tony Morris wrote:
I am wondering if it possible to generalise catMaybes:
(Something f, SomethingElse t) = t (f a) - t a
I have being doing some gymnastics with Traversable
On 8 Jan 2011, at 11:14, Henning Thielemann wrote:
For me, the solutions of Dave Menendez make most sense: Generalize
Maybe to Foldable and List to MonadPlus.
What has it to do with monads? There's no bind in sight.
Alternative is certainly a more general alternative, but then I
would
On Sat, 8 Jan 2011, Conor McBride wrote:
On 8 Jan 2011, at 11:14, Henning Thielemann wrote:
For me, the solutions of Dave Menendez make most sense: Generalize Maybe to
Foldable and List to MonadPlus.
What has it to do with monads? There's no bind in sight.
I see a '=' in front of each of
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 1/8/11 07:11 , Conor McBride wrote:
On 8 Jan 2011, at 11:14, Henning Thielemann wrote:
For me, the solutions of Dave Menendez make most sense: Generalize Maybe
to Foldable and List to MonadPlus.
What has it to do with monads? There's no bind
On 8 Jan 2011, at 15:27, Henning Thielemann wrote:
On Sat, 8 Jan 2011, Conor McBride wrote:
On 8 Jan 2011, at 11:14, Henning Thielemann wrote:
For me, the solutions of Dave Menendez make most sense: Generalize
Maybe to Foldable and List to MonadPlus.
What has it to do with monads?
On Sat, 8 Jan 2011, Conor McBride wrote:
Of course, there is an alternative generalisation.
[] and Maybe are both Foldable, hence so is their composition.
There's got to be a thing of type
collapse :: (Foldable f, Alternative a) = f x - a x
which would do the job.
Nice! It would be
On Sat, Jan 8, 2011 at 12:05 PM, Conor McBride
co...@strictlypositive.org wrote:
On 8 Jan 2011, at 15:27, Henning Thielemann wrote:
On Sat, 8 Jan 2011, Conor McBride wrote:
On 8 Jan 2011, at 11:14, Henning Thielemann wrote:
For me, the solutions of Dave Menendez make most sense:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Thanks guys for all the solutions. A slight correction below.
On 09/01/11 03:54, David Menendez wrote:
Naturally, if you also have pure and fmap, you also have a monad.
You have a pointed functor but not necessarily a monad. There are many
pointed
On Sat, Jan 8, 2011 at 5:07 PM, Tony Morris tonymor...@gmail.com wrote:
Thanks guys for all the solutions. A slight correction below.
On 09/01/11 03:54, David Menendez wrote:
Naturally, if you also have pure and fmap, you also have a monad.
You have a pointed functor but not necessarily a
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I am wondering if it possible to generalise catMaybes:
(Something f, SomethingElse t) = t (f a) - t a
I have being doing some gymnastics with Traversable and Foldable and a
couple of other things from category-extras to no avail. Perhaps
someone
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 1/7/11 21:56 , Tony Morris wrote:
I am wondering if it possible to generalise catMaybes:
(Something f, SomethingElse t) = t (f a) - t a
I have being doing some gymnastics with Traversable and Foldable and a
couple of other things from
On Fri, Jan 7, 2011 at 9:56 PM, Tony Morris tonymor...@gmail.com wrote:
I am wondering if it possible to generalise catMaybes:
(Something f, SomethingElse t) = t (f a) - t a
I have being doing some gymnastics with Traversable and Foldable and a
couple of other things from category-extras
15 matches
Mail list logo