[Haskell-cafe] What is this applicative functor?

Gershom B gershomb at gmail.com
Wed Feb 1 18:50:31 UTC 2017


Indeed a very interesting type!

In the spirit of the “twisting pointers” paper’s construction of applicative structure from semi-direct products [1], I would speculate that this is a form of applicative created from the _direct product_ of two underlying applicatives that share some sort of mutually distributive relationship… (in this case, identity and list), with one of the actions being trivial.

Somethign that might be enlightening, again following twisted pointers, is to reformulate the Applicative Functor instance as a Monoidal Functor instance...

[1] http://ozark.hendrix.edu/~yorgey/pub/twisted.pdf

Cheers,
Gershom

On February 1, 2017 at 1:16:08 PM, Simon Jakobi via Haskell-Cafe (haskell-cafe at haskell.org) wrote:
> Hi Joachim,
>  
> that's a very interesting type, thanks for sharing it!
>  
> Please note that in the rendering of the package description at
> http://hackage.haskell.org/package/successors, the <*> is slightly
> mangled.
>  
> Cheers,
> Simon
>  
> 2017-02-01 18:39 GMT+01:00 Joachim Breitner :
> > Hi,
> >
> > Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner:
> >> Hi,
> >>
> >> David wrote:
> >> > How about this?
> >> >
> >> > hd (OneStep x xs) = x
> >> >
> >> > instance Monad OneStep where
> >> > OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys)
> >> > where
> >> > OneStep y ys = f x
> >> >
> >> > Not sure if it’s good for anything, but it seems valid and consistent
> >> > based on a preliminary investigation.
> >>
> >>
> >> Yes, this looks reasonable. Did you happen to already work through the
> >> monad laws?
> >
> > Just did, all looks fine:
> > https://github.com/nomeata/haskell-successors/blob/c1fd614cb0fc3e3b5dbf0338f835a91ea78e0b63/src/Control/Applicative/Successors.hs#L82  
> >
> > Uploaded to http://hackage.haskell.org/package/successors in case
> > someone wants to play with it.
> >
> > Greetings,
> > Joachim
> > --
> > Joachim “nomeata” Breitner
> > mail at joachim-breitner.dehttps://www.joachim-breitner.de/
> > XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
> > Debian Developer: nomeata at debian.org
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > To (un)subscribe, modify options or view archives go to:
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> > Only members subscribed via the mailman list are allowed to post.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



More information about the Haskell-Cafe mailing list