aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src
diff options
context:
space:
mode:
authorƁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-06 13:10:09 +0200
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-08-21 18:22:34 +0100
commitac1894067ce7bc5c34f1cd4d70c9e7fbeb6ae6dc (patch)
treeb2489fa46b96273cb61a4604de3aa344b120bfdc /haddock-api/src
parent809a24cc74b4ca23e69f2f4a857e31c5a440b436 (diff)
Add support for sugaring built-in function syntax.
Diffstat (limited to 'haddock-api/src')
-rw-r--r--haddock-api/src/Haddock/Interface/Specialize.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Interface/Specialize.hs b/haddock-api/src/Haddock/Interface/Specialize.hs
index ddae2b93..d6466570 100644
--- a/haddock-api/src/Haddock/Interface/Specialize.hs
+++ b/haddock-api/src/Haddock/Interface/Specialize.hs
@@ -147,7 +147,10 @@ sugarTuples typ =
sugarOperators :: NamedThing name => HsType name -> HsType name
sugarOperators (HsAppTy (L _ (HsAppTy (L loc (HsTyVar name)) la)) lb)
- | isSymOcc $ getOccName name = mkHsOpTy la (L loc name) lb
+ | isSymOcc $ getOccName name' = mkHsOpTy la (L loc name) lb
+ | isBuiltInSyntax name' && getOccString name == "(->)" = HsFunTy la lb
+ where
+ name' = getName name
sugarOperators typ = typ