| 58 | |

| 59 | EDIT: For completeness sake here's the code I was compiling: |

| 60 | |

| 61 | {{{ |

| 62 | {-# LANGUAGE GADTs, Arrows, NullaryTypeClasses #-} |

| 63 | {-# LANGUAGE RebindableSyntax #-} |

| 64 | module T7828 where |

| 65 | |

| 66 | import Prelude (Either(..), flip, Int, return) |

| 67 | |

| 68 | import Control.Category (Category) |

| 69 | import Control.Arrow (Arrow) |

| 70 | |

| 71 | test :: Foo a => R a a |

| 72 | test = proc n -> returnA -< n |

| 73 | |

| 74 | instance Category R where |

| 75 | instance Arrow R where |

| 76 | |

| 77 | class Foo a where |

| 78 | |

| 79 | data R a b where |

| 80 | Id :: R a a |

| 81 | Comp :: R b c -> R a b -> R a c |

| 82 | Arr :: (a -> b) -> R a b |

| 83 | Split :: R b c -> R b' c' -> R (b,b') (c,c') |

| 84 | |

| 85 | infixr 1 >>> |

| 86 | infixr 3 *** |

| 87 | |

| 88 | arr :: (a -> b) -> R a b |

| 89 | arr = Arr |

| 90 | |

| 91 | first :: R b c -> R (b, d) (c, d) |

| 92 | first = (*** Id) |

| 93 | |

| 94 | (***) :: R b c -> R b' c' -> R (b,b') (c,c') |

| 95 | (***) = Split |

| 96 | |

| 97 | (>>>) :: R a b -> R b c -> R a c |

| 98 | (>>>) = flip Comp |

| 99 | |

| 100 | returnA :: R a a |

| 101 | returnA = Id |

| 102 | }}} |