[Haskell-cafe] "Lower case" infix type operator variables

Erik Hesselink hesselink at gmail.com
Wed Sep 3 07:19:02 UTC 2014


Hi Joseph,

The type operator type variable used to be possible, but this was
changed in (I think) 7.8. See the discussion in threads [0] and [1].
There were some proposals for alternate syntax for operator type
variables, but I don't think any of them were implemented. Currently,
the best you can do is infix textual names, something like:

    constA :: Arrow arr => b -> (a `arr` b)

Erik

[0] http://www.haskell.org/pipermail/glasgow-haskell-users/2012-January/021611.html
[1] http://www.haskell.org/pipermail/glasgow-haskell-users/2012-September/022845.html

On Wed, Sep 3, 2014 at 8:03 AM, Joseph Abrahamson <me at jspha.com> wrote:
> I spent a few moments confused by the fact the TypeOperators was
> insufficient to allow the following type to be parsed
>
>     constA :: Arrow (~>) => b -> (a ~> b)
>
> My current intuition is that since I *can* write things like
>
>     newtype (~>) a b = A (a -> b)
>
> there is clashing in the type operator space for “upper case” and “lower
> case” identifiers. Is it possible or advisable to mitigate this clash and
> provide some syntax for “type operator variables”?
> Joseph
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list