I've been playing around with the relationship between monoids and monads
(see
http://www.jonmsterling.com/posts/2012-01-12-unifying-monoids-and-monads-with-polymorphic-kinds.htmland
http://blog.sigfpe.com/2008/11/from-monoids-to-monads.html), and I put
together my own implementation which I'm quit
On Tuesday 24 January 2012, 04:39:03, Ryan Ingram wrote:
> At the end of that paste, I prove the three Haskell monad laws from the
> functor laws and "monoid"-ish versions of the monad laws, but my proofs
> all rely on a property of natural transformations that I'm not sure how
> to prove; given
>
On Mon, Jan 23, 2012 at 8:05 PM, Daniel Fischer <
daniel.is.fisc...@googlemail.com> wrote:
> On Tuesday 24 January 2012, 04:39:03, Ryan Ingram wrote:
> > At the end of that paste, I prove the three Haskell monad laws from the
> > functor laws and "monoid"-ish versions of the monad laws, but my pro
Have you tried generating a free theorem for :-> ? (I haven't as I'm writing
from my phone)
24.01.2012, в 9:06, Ryan Ingram написал(а):
> On Mon, Jan 23, 2012 at 8:05 PM, Daniel Fischer
> wrote:
> On Tuesday 24 January 2012, 04:39:03, Ryan Ingram wrote:
> > At the end of that paste, I prove
On Mon, Jan 23, 2012 at 09:06:52PM -0800, Ryan Ingram wrote:
> On Mon, Jan 23, 2012 at 8:05 PM, Daniel Fischer <
> daniel.is.fisc...@googlemail.com> wrote:
>
> > On Tuesday 24 January 2012, 04:39:03, Ryan Ingram wrote:
> > > At the end of that paste, I prove the three Haskell monad laws from the
>
I tried the free theorem generator (
http://www-ps.iai.uni-bonn.de/cgi-bin/free-theorems-webui.cgi) and it
wouldn't let me use generic functors, but playing with [] and Maybe leads
me to believe that the free theorem for :-> is
forall f :: m :-> n, forall g :: a -> b, g strict and total
fmap g . f
On 1/23/12 10:39 PM, Ryan Ingram wrote:
type m :-> n = (forall x. m x -> n x)
class Functor f where fmap :: forall a b. (a -> b) -> f a -> f b
-- Functor identity law: fmap id = id
-- Functor composition law fmap (f . g) = fmap f . fmap g
Given Functors m and n, natural
I know a bit of category theory, but I'm trying to look at it from a
fundamental perspective; I know that I intend (m :-> n) to mean "natural
transformation from functor m to functor n", but the type itself (forall x.
m x -> n x) doesn't necessarily enforce that.
However, the type of natural trans
On 1/27/12 7:56 PM, Ryan Ingram wrote:
Thus, you can in principle define plenty of natural transformations which
do not have the type f :: forall X. M X -> N X.
Can you suggest one? I don't see how you can get around f needing to act
at multiple types since it can occur before and after g's f
Ryan Ingram wrote:
However, the type of natural transformations comes with a free theorem, for
example
concat :: [[a]] -> [a]
has the free theorem
forall f :: a -> b, f strict and total, fmap f . concat = concat . fmap
(fmap f)
The strictness condition is needed; consider
broke
10 matches
Mail list logo