Type Level "Application" Operator

Edward Kmett ekmett at gmail.com
Wed Nov 2 22:27:59 UTC 2016


On Wed, Nov 2, 2016 at 3:11 PM, Index Int <vlad.z.4096 at gmail.com> wrote:

> Edward, I don't quite follow why you think that (.) is needed here.
> Monad transformers take two parameters, so your example is not
> type-correct, whereas the original one is.
>

Indeed, I appear to have hyper-corrected that example.

-Edward

On Wed, Nov 2, 2016 at 5:24 PM, Edward Kmett <ekmett at gmail.com> wrote:
> > +1, but the operator you're looking for in App there would actually be a
> > type level version of (.).
> >
> > type App a = ExceptT Err $ ReaderT Config $ LogT Text $ IO a
> >
> > type App = ExceptT Err . ReaderT Config . LogT Text . IO
> >
> > which would need
> >
> > type (.) f g x = f (g x)
> > infixr 9 .
> >
> > to parse
> >
> > -Edward
> >
> > On Tue, Nov 1, 2016 at 7:13 PM, Elliot Cameron <eacameron at gmail.com>
> wrote:
> >>
> >> Folks,
> >>
> >> Has there been a discussion about adding a type-level operator "$" that
> >> just mimics "$" at the value level?
> >>
> >> type f $ x = f x
> >> infixr 0 $
> >>
> >> Things like monad transformer stacks would look more "stack-like" with
> >> this:
> >>
> >> type App = ExceptT Err $ ReaderT Config $ LogT Text IO
> >>
> >> Elliot Cameron
> >>
> >> _______________________________________________
> >> Libraries mailing list
> >> Libraries at haskell.org
> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >>
> >
> >
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20161102/8c13e9aa/attachment-0001.html>


More information about the Libraries mailing list