on master help sign in
Collected language PRAGMAs and removed debugging comments
a463bb1Ahmad Salim Al-Sibahi
src/Idris/AbsSyntax.hs+1−2
@@ -6,8 +6,7 @@ License : BSD3
6Maintainer : The Idris Community.
6Maintainer : The Idris Community.
7-}
7-}
8
8
9−{-# LANGUAGE DeriveFunctor #-}
9+{-# LANGUAGE DeriveFunctor, PatternGuards #-}
10−{-# LANGUAGE PatternGuards #-}
11
10
12module Idris.AbsSyntax(
11module Idris.AbsSyntax(
13 module Idris.AbsSyntax
12 module Idris.AbsSyntax
src/Idris/AbsSyntaxTree.hs+1−4
@@ -6,10 +6,7 @@ License : BSD3
6Maintainer : The Idris Community.
6Maintainer : The Idris Community.
7-}
7-}
8
8
9−{-# LANGUAGE DeriveDataTypeable #-}
9+{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveGeneric, PatternGuards #-}
10−{-# LANGUAGE DeriveFunctor #-}
11−{-# LANGUAGE DeriveGeneric #-}
12−{-# LANGUAGE PatternGuards #-}
13
10
14module Idris.AbsSyntaxTree where
11module Idris.AbsSyntaxTree where
15
12
src/Idris/Docs.hs+1−3
@@ -6,9 +6,7 @@ License : BSD3
6Maintainer : The Idris Community.
6Maintainer : The Idris Community.
7-}
7-}
8
8
9−{-# LANGUAGE DeriveFunctor #-}
9+{-# LANGUAGE DeriveFunctor, MultiWayIf, PatternGuards #-}
10−{-# LANGUAGE MultiWayIf #-}
11−{-# LANGUAGE PatternGuards #-}
12{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
10{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
13
11
14module Idris.Docs (
12module Idris.Docs (
src/Idris/Interactive.hs−13
@@ -52,31 +52,18 @@ caseSplitAt fn updatefile l n
52
52
53addClauseFrom :: FilePath -> Bool -> Int -> Name -> Idris ()
53addClauseFrom :: FilePath -> Bool -> Int -> Name -> Idris ()
54addClauseFrom fn updatefile l n = do
54addClauseFrom fn updatefile l n = do
55−{-
56− runIO . traceIO $ "addClauseFrom: " ++ show (M.fromList
57− [ ("fn", fn)
58− , ("updatefile", show updatefile)
59− , ("line", show l)
60− , ("name", show n)
61− ])
62−-}
63 -- if a definition already exists, add missing cases rather than
55 -- if a definition already exists, add missing cases rather than
64 -- adding a new definition.
56 -- adding a new definition.
65 ist <- getIState
57 ist <- getIState
66 cl <- getInternalApp fn l
58 cl <- getInternalApp fn l
67−-- runIO . traceIO $ "cl = " ++ show cl
68 let fulln = getAppName cl
59 let fulln = getAppName cl
69−-- runIO . traceIO $ "fulln = " ++ show fulln
70−
71 let metavars = lookup fulln (idris_metavars ist)
60 let metavars = lookup fulln (idris_metavars ist)
72−-- runIO . traceIO $ "metavars = " ++ show metavars
73 case metavars of
61 case metavars of
74 Nothing -> addMissing fn updatefile l n
62 Nothing -> addMissing fn updatefile l n
75 Just _ -> do
63 Just _ -> do
76 src <- runIO $ readSource fn
64 src <- runIO $ readSource fn
77 let (before, tyline : later) = splitAt (l-1) (lines src)
65 let (before, tyline : later) = splitAt (l-1) (lines src)
78 let indent = getIndent 0 (show n) tyline
66 let indent = getIndent 0 (show n) tyline
79−-- runIO . traceIO $ "getIndent => " ++ show indent
80 cl <- getClause l fulln n fn
67 cl <- getClause l fulln n fn
81 -- add clause before first blank line in 'later'
68 -- add clause before first blank line in 'later'
82 let (nonblank, rest) = span (not . all isSpace) (tyline:later)
69 let (nonblank, rest) = span (not . all isSpace) (tyline:later)