Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change fixity of function type (->)?

Doing some type-level computation I've come to a point where I want to change the fixity of -> because it can't be mixed with left associative type operators of fixity 0. I know it doesn't work outright with the TypeOperators extension and infixr 1 ->, because it only returns the error parse error on input ‘->’.

Is there any extension or other means to modify the fixity of the function type operator?

like image 682
Shou Avatar asked Mar 20 '15 02:03

Shou


1 Answers

You can make a synonym:

{-# LANGUAGE TypeOperators #-}

infixr 1 ~>
type (~>) = (->)
like image 173
user3237465 Avatar answered Oct 19 '22 21:10

user3237465