Tom Ellis | 7 Oct 11:40 2013
Picon

Lenses that work with Arrows

Dear all,

I introduce a very simple extension to the Lens datatype from Control.Lens
that allows it to work with Arrows:

    https://gist.github.com/tomjaguarpaw/6865080

I would particularly like to discuss this with authors of Control.Lens to
see if such an idea is suitable for inclusion in their library.

I have also started a Reddit discussion here:

    http://www.reddit.com/r/haskell/comments/1nwetz/lenses_that_work_with_arrows/

Tom
Niklas Haas | 7 Oct 19:14 2013
Picon

Re: Lenses that work with Arrows

On Mon, 7 Oct 2013 10:40:13 +0100, Tom Ellis <tom-lists-haskell-cafe-2013 <at> jaguarpaw.co.uk> wrote:
> Dear all,
> 
> I introduce a very simple extension to the Lens datatype from Control.Lens
> that allows it to work with Arrows:
> 
>     https://gist.github.com/tomjaguarpaw/6865080
> 
> I would particularly like to discuss this with authors of Control.Lens to
> see if such an idea is suitable for inclusion in their library.
> 
> I have also started a Reddit discussion here:
> 
>     http://www.reddit.com/r/haskell/comments/1nwetz/lenses_that_work_with_arrows/
> 
> Tom
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

The reason we don't tend to have combinators like ‘view’ or ‘over’
generalized in their return profunctor like that is because you very
quickly run into type ambiguity issues.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Tom Ellis | 7 Oct 19:22 2013
Picon

Re: Lenses that work with Arrows

On Mon, Oct 07, 2013 at 07:14:44PM +0200, Niklas Haas wrote:
> On Mon, 7 Oct 2013 10:40:13 +0100, Tom Ellis <tom-lists-haskell-cafe-2013 <at> jaguarpaw.co.uk> wrote:
> > I introduce a very simple extension to the Lens datatype from Control.Lens
> > that allows it to work with Arrows:
> > 
> >     https://gist.github.com/tomjaguarpaw/6865080
> 
> The reason we don't tend to have combinators like ‘view’ or ‘over’
> generalized in their return profunctor like that is because you very
> quickly run into type ambiguity issues.

Perhaps I didn't explain clearly what I am asking for.  The crux of the
issue is whether it is possible *at all* to write the function

    overArr :: Arrow arr => Lens s t a b -> arr a b -> arr s t

not whether it should be merged with over.

Tom
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Tom Ellis | 7 Oct 20:57 2013
Picon

Re: Lenses that work with Arrows

On Mon, Oct 07, 2013 at 06:22:33PM +0100, Tom Ellis wrote:
> On Mon, Oct 07, 2013 at 07:14:44PM +0200, Niklas Haas wrote:
> > On Mon, 7 Oct 2013 10:40:13 +0100, Tom Ellis <tom-lists-haskell-cafe-2013 <at> jaguarpaw.co.uk> wrote:
> > > I introduce a very simple extension to the Lens datatype from Control.Lens
> > > that allows it to work with Arrows:
> > > 
> > >     https://gist.github.com/tomjaguarpaw/6865080
> > 
> > The reason we don't tend to have combinators like ‘view’ or ‘over’
> > generalized in their return profunctor like that is because you very
> > quickly run into type ambiguity issues.
> 
> Perhaps I didn't explain clearly what I am asking for.  The crux of the
> issue is whether it is possible *at all* to write the function
> 
>     overArr :: Arrow arr => Lens s t a b -> arr a b -> arr s t
> 
> not whether it should be merged with over.

Edward Kmett has answered in the affirmative, which pleases me greatly!

    http://www.reddit.com/r/haskell/comments/1nwetz/lenses_that_work_with_arrows/ccmtfkj
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane