[commit: ghc] master: add type annotations to SrcLoc functions (1cf7fc0)

git at git.haskell.org git at git.haskell.org
Mon Jun 15 01:33:07 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1cf7fc0f182602b18ac04427b248f0374d2e626e/ghc

>---------------------------------------------------------------

commit 1cf7fc0f182602b18ac04427b248f0374d2e626e
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Sun Jun 14 20:30:29 2015 -0500

    add type annotations to SrcLoc functions
    
    Because sometimes types make more sense than docs.
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D983


>---------------------------------------------------------------

1cf7fc0f182602b18ac04427b248f0374d2e626e
 compiler/parser/Parser.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index b88a3b1..682b342 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -3207,12 +3207,15 @@ sL span a = span `seq` a `seq` L span a
 
 -- replaced last 3 CPP macros in this file
 {-# INLINE sL0 #-}
+sL0 :: a -> Located a
 sL0 = L noSrcSpan       -- #define L0   L noSrcSpan
 
 {-# INLINE sL1 #-}
+sL1 :: Located a -> b -> Located b
 sL1 x = sL (getLoc x)   -- #define sL1   sL (getLoc $1)
 
 {-# INLINE sLL #-}
+sLL :: Located a -> Located b -> c -> Located c
 sLL x y = sL (comb2 x y) -- #define LL   sL (comb2 $1 $>)
 
 {- Note [Adding location info]



More information about the ghc-commits mailing list