git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #2470 from kRITZCREEK/psc-ide-cleanup
2353a39Phil Freeman
psc-ide-client/Main.hs−1
@@ -1,4 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2module Main where
1module Main where
3
2
4import Prelude ()
3import Prelude ()
src/Language/PureScript/AST/Operators.hs−2
@@ -1,5 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−
3-- |
1-- |
4-- Operators fixity and associativity
2-- Operators fixity and associativity
5--
3--
src/Language/PureScript/AST/SourcePos.hs−2
@@ -1,5 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−
3-- |
1-- |
4-- Source position information
2-- Source position information
5--
3--
src/Language/PureScript/Docs/Convert.hs−2
@@ -1,5 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−
3-- | Functions for converting PureScript ASTs into values of the data types
1-- | Functions for converting PureScript ASTs into values of the data types
4-- from Language.PureScript.Docs.
2-- from Language.PureScript.Docs.
5
3
src/Language/PureScript/Docs/Types.hs−2
@@ -1,5 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−
3module Language.PureScript.Docs.Types
1module Language.PureScript.Docs.Types
4 ( module Language.PureScript.Docs.Types
2 ( module Language.PureScript.Docs.Types
5 , module ReExports
3 , module ReExports
src/Language/PureScript/Ide.hs+4−5
@@ -12,7 +12,6 @@
12-- Interface for the psc-ide-server
12-- Interface for the psc-ide-server
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16{-# LANGUAGE PackageImports #-}
15{-# LANGUAGE PackageImports #-}
17{-# LANGUAGE TemplateHaskell #-}
16{-# LANGUAGE TemplateHaskell #-}
18
17
@@ -110,7 +109,7 @@ findPursuitPackages (PursuitQuery q) =
110 PursuitResult <$> liftIO (findPackagesForModuleIdent q)
109 PursuitResult <$> liftIO (findPackagesForModuleIdent q)
111
110
112printModules :: Ide m => m Success
111printModules :: Ide m => m Success
113−printModules = ModuleList . map runModuleNameT <$> getLoadedModulenames
112+printModules = ModuleList . map P.runModuleName <$> getLoadedModulenames
114
113
115outputDirectory :: Ide m => m FilePath
114outputDirectory :: Ide m => m FilePath
116outputDirectory = do
115outputDirectory = do
@@ -175,12 +174,12 @@ loadModules moduleNames = do
175 efiles <- traverse readExternFile efPaths
174 efiles <- traverse readExternFile efPaths
176 traverse_ insertExterns efiles
175 traverse_ insertExterns efiles
177
176
178− -- We parse all source files, log eventual parse failures if the debug flag
177+ -- We parse all source files, log eventual parse failures and insert the
179− -- was set and insert the succesful parses into the state.
178+ -- successful parses into the state.
180 (failures, allModules) <-
179 (failures, allModules) <-
181 partitionEithers <$> (traverse parseModule =<< findAllSourceFiles)
180 partitionEithers <$> (traverse parseModule =<< findAllSourceFiles)
182 unless (null failures) $
181 unless (null failures) $
183− $(logDebug) ("Failed to parse: " <> show failures)
182+ $(logWarn) ("Failed to parse: " <> show failures)
184 traverse_ insertModule allModules
183 traverse_ insertModule allModules
185
184
186 -- Finally we kick off the worker with @async@ and return the number of
185 -- Finally we kick off the worker with @async@ and return the number of
src/Language/PureScript/Ide/CaseSplit.hs+4−6
@@ -12,8 +12,6 @@
12-- Casesplitting and adding function clauses
12-- Casesplitting and adding function clauses
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16−
17module Language.PureScript.Ide.CaseSplit
15module Language.PureScript.Ide.CaseSplit
18 ( WildcardAnnotations()
16 ( WildcardAnnotations()
19 , explicitAnnotations
17 , explicitAnnotations
@@ -84,9 +82,9 @@ splitTypeConstructor = go []
84 go _ _ = throwError (GeneralError "Failed to read TypeConstructor")
82 go _ _ = throwError (GeneralError "Failed to read TypeConstructor")
85
83
86prettyCtor :: WildcardAnnotations -> Constructor -> Text
84prettyCtor :: WildcardAnnotations -> Constructor -> Text
87−prettyCtor _ (ctorName, []) = runProperNameT ctorName
85+prettyCtor _ (ctorName, []) = P.runProperName ctorName
88prettyCtor wsa (ctorName, ctorArgs) =
86prettyCtor wsa (ctorName, ctorArgs) =
89− "("<> runProperNameT ctorName <> " "
87+ "("<> P.runProperName ctorName <> " "
90 <> T.unwords (map (prettyPrintWildcard wsa) ctorArgs) <>")"
88 <> T.unwords (map (prettyPrintWildcard wsa) ctorArgs) <>")"
91
89
92prettyPrintWildcard :: WildcardAnnotations -> P.Type -> Text
90prettyPrintWildcard :: WildcardAnnotations -> P.Type -> Text
@@ -111,9 +109,9 @@ addClause :: (MonadError PscIdeError m) => Text -> WildcardAnnotations -> m [Tex
111addClause s wca = do
109addClause s wca = do
112 (fName, fType) <- parseTypeDeclaration' s
110 (fName, fType) <- parseTypeDeclaration' s
113 let args = splitFunctionType fType
111 let args = splitFunctionType fType
114− template = runIdentT fName <> " " <>
112+ template = P.runIdent fName <> " " <>
115 T.unwords (map (prettyPrintWildcard wca) args) <>
113 T.unwords (map (prettyPrintWildcard wca) args) <>
116− " = ?" <> (T.strip . runIdentT $ fName)
114+ " = ?" <> (T.strip . P.runIdent $ fName)
117 pure [s, template]
115 pure [s, template]
118
116
119parseType' :: (MonadError PscIdeError m) =>
117parseType' :: (MonadError PscIdeError m) =>
src/Language/PureScript/Ide/Command.hs−3
@@ -12,9 +12,6 @@
12-- Datatypes for the commands psc-ide accepts
12-- Datatypes for the commands psc-ide accepts
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16−
17−
18module Language.PureScript.Ide.Command where
15module Language.PureScript.Ide.Command where
19
16
20import Protolude
17import Protolude
src/Language/PureScript/Ide/Completion.hs−1
@@ -1,4 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2module Language.PureScript.Ide.Completion
1module Language.PureScript.Ide.Completion
3 ( getCompletions
2 ( getCompletions
4 , getExactMatches
3 , getExactMatches
src/Language/PureScript/Ide/Conversions.hs+4−16
@@ -15,27 +15,15 @@
15module Language.PureScript.Ide.Conversions where
15module Language.PureScript.Ide.Conversions where
16
16
17import Control.Lens.Iso
17import Control.Lens.Iso
18−import Data.Text (lines, strip, unwords)
18+import Data.Text (lines, strip, unwords, pack)
19import qualified Language.PureScript as P
19import qualified Language.PureScript as P
20import Protolude
20import Protolude
21
21
22−runProperNameT :: P.ProperName a -> Text
23−runProperNameT = toS . P.runProperName
24−
25properNameT :: Iso' (P.ProperName a) Text
22properNameT :: Iso' (P.ProperName a) Text
26−properNameT = iso (toS . P.runProperName) (P.ProperName . toS)
23+properNameT = iso P.runProperName P.ProperName
27−
28−runIdentT :: P.Ident -> Text
29−runIdentT = toS . P.runIdent
30
24
31identT :: Iso' P.Ident Text
25identT :: Iso' P.Ident Text
32−identT = iso (toS . P.runIdent) (P.Ident . toS)
26+identT = iso P.runIdent P.Ident
33−
34−runOpNameT :: P.OpName a -> Text
35−runOpNameT = toS . P.runOpName
36−
37−runModuleNameT :: P.ModuleName -> Text
38−runModuleNameT = toS . P.runModuleName
39
27
40prettyTypeT :: P.Type -> Text
28prettyTypeT :: P.Type -> Text
41−prettyTypeT = unwords . map strip . lines . toS . P.prettyPrintType
29+prettyTypeT = unwords . map strip . lines . pack . P.prettyPrintType
src/Language/PureScript/Ide/Error.hs−1
@@ -12,7 +12,6 @@
12-- Error types for psc-ide
12-- Error types for psc-ide
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16module Language.PureScript.Ide.Error
15module Language.PureScript.Ide.Error
17 ( PscIdeError(..)
16 ( PscIdeError(..)
18 ) where
17 ) where
src/Language/PureScript/Ide/Externs.hs+2−3
@@ -12,7 +12,6 @@
12-- Handles externs files for psc-ide
12-- Handles externs files for psc-ide
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE RecordWildCards #-}
16{-# LANGUAGE PackageImports #-}
15{-# LANGUAGE PackageImports #-}
17
16
18module Language.PureScript.Ide.Externs
17module Language.PureScript.Ide.Externs
@@ -133,13 +132,13 @@ annotateModule (defs, types) (moduleName, decls) =
133 IdeDeclDataConstructor dtor ->
132 IdeDeclDataConstructor dtor ->
134 annotateValue (dtor ^. ideDtorName . properNameT) (IdeDeclDataConstructor dtor)
133 annotateValue (dtor ^. ideDtorName . properNameT) (IdeDeclDataConstructor dtor)
135 IdeDeclTypeClass i ->
134 IdeDeclTypeClass i ->
136− annotateType (runProperNameT i) (IdeDeclTypeClass i)
135+ annotateType (i ^. properNameT) (IdeDeclTypeClass i)
137 IdeDeclValueOperator op ->
136 IdeDeclValueOperator op ->
138 annotateValue (op ^. ideValueOpAlias & valueOperatorAliasT) (IdeDeclValueOperator op)
137 annotateValue (op ^. ideValueOpAlias & valueOperatorAliasT) (IdeDeclValueOperator op)
139 IdeDeclTypeOperator op ->
138 IdeDeclTypeOperator op ->
140 annotateType (op ^. ideTypeOpAlias & typeOperatorAliasT) (IdeDeclTypeOperator op)
139 annotateType (op ^. ideTypeOpAlias & typeOperatorAliasT) (IdeDeclTypeOperator op)
141 where
140 where
142− annotateFunction x = IdeDeclarationAnn (ann { annLocation = Map.lookup (Left (runIdentT x)) defs
141+ annotateFunction x = IdeDeclarationAnn (ann { annLocation = Map.lookup (Left (P.runIdent x)) defs
143 , annTypeAnnotation = Map.lookup x types
142 , annTypeAnnotation = Map.lookup x types
144 })
143 })
145 annotateValue x = IdeDeclarationAnn (ann {annLocation = Map.lookup (Left x) defs})
144 annotateValue x = IdeDeclarationAnn (ann {annLocation = Map.lookup (Left x) defs})
src/Language/PureScript/Ide/Filter.hs−1
@@ -13,7 +13,6 @@
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15{-# LANGUAGE GeneralizedNewtypeDeriving #-}
15{-# LANGUAGE GeneralizedNewtypeDeriving #-}
16−{-# LANGUAGE OverloadedStrings #-}
17
16
18module Language.PureScript.Ide.Filter
17module Language.PureScript.Ide.Filter
19 ( Filter
18 ( Filter
src/Language/PureScript/Ide/Imports.hs−2
@@ -12,8 +12,6 @@
12-- Provides functionality to manage imports
12-- Provides functionality to manage imports
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16−
17module Language.PureScript.Ide.Imports
15module Language.PureScript.Ide.Imports
18 ( addImplicitImport
16 ( addImplicitImport
19 , addImportForIdentifier
17 , addImportForIdentifier
src/Language/PureScript/Ide/Matcher.hs−1
@@ -14,7 +14,6 @@
14
14
15{-# LANGUAGE FlexibleInstances #-}
15{-# LANGUAGE FlexibleInstances #-}
16{-# LANGUAGE GeneralizedNewtypeDeriving #-}
16{-# LANGUAGE GeneralizedNewtypeDeriving #-}
17−{-# LANGUAGE OverloadedStrings #-}
18
17
19module Language.PureScript.Ide.Matcher
18module Language.PureScript.Ide.Matcher
20 ( Matcher
19 ( Matcher
src/Language/PureScript/Ide/Pursuit.hs−2
@@ -12,8 +12,6 @@
12-- Pursuit client for psc-ide
12-- Pursuit client for psc-ide
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16−
17module Language.PureScript.Ide.Pursuit
15module Language.PureScript.Ide.Pursuit
18 ( searchPursuitForDeclarations
16 ( searchPursuitForDeclarations
19 , findPackagesForModuleIdent
17 , findPackagesForModuleIdent
src/Language/PureScript/Ide/Rebuild.hs+1−5
@@ -1,8 +1,5 @@
1−{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE PackageImports #-}
1{-# LANGUAGE PackageImports #-}
3−{-# LANGUAGE RecordWildCards #-}
4{-# LANGUAGE TemplateHaskell #-}
2{-# LANGUAGE TemplateHaskell #-}
5−{-# LANGUAGE TupleSections #-}
6
3
7module Language.PureScript.Ide.Rebuild
4module Language.PureScript.Ide.Rebuild
8 ( rebuildFile
5 ( rebuildFile
@@ -20,7 +17,6 @@ import Language.PureScript.Errors.JSON
20import Language.PureScript.Ide.Error
17import Language.PureScript.Ide.Error
21import Language.PureScript.Ide.State
18import Language.PureScript.Ide.State
22import Language.PureScript.Ide.Types
19import Language.PureScript.Ide.Types
23−import Language.PureScript.Ide.Util
24import System.IO.UTF8 (readUTF8FileT)
20import System.IO.UTF8 (readUTF8FileT)
25
21
26-- | Given a filepath performs the following steps:
22-- | Given a filepath performs the following steps:
@@ -96,7 +92,7 @@ rebuildModuleOpen makeEnv externs m = do
96 throwError (GeneralError "Failed when rebuilding with open exports")
92 throwError (GeneralError "Failed when rebuilding with open exports")
97 Right result -> do
93 Right result -> do
98 $(logDebug)
94 $(logDebug)
99− ("Setting Rebuild cache: " <> runModuleNameT (P.efModuleName result))
95+ ("Setting Rebuild cache: " <> P.runModuleName (P.efModuleName result))
100 cacheRebuild result
96 cacheRebuild result
101
97
102-- | Parameters we can access while building our @MakeActions@
98-- | Parameters we can access while building our @MakeActions@
src/Language/PureScript/Ide/Reexports.hs+1−4
@@ -13,9 +13,6 @@
13-- Resolves reexports for psc-ide
13-- Resolves reexports for psc-ide
14-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
15
15
16−{-# LANGUAGE OverloadedStrings #-}
17−{-# LANGUAGE RecordWildCards #-}
18−
19module Language.PureScript.Ide.Reexports
16module Language.PureScript.Ide.Reexports
20 ( resolveReexports
17 ( resolveReexports
21 , prettyPrintReexportResult
18 , prettyPrintReexportResult
@@ -53,7 +50,7 @@ prettyPrintReexportResult f ReexportResult{..}
53 | otherwise =
50 | otherwise =
54 "Failed to resolve reexports for "
51 "Failed to resolve reexports for "
55 <> f reResolved
52 <> f reResolved
56− <> foldMap (\(mn, ref) -> runModuleNameT mn <> show ref) reFailed
53+ <> foldMap (\(mn, ref) -> P.runModuleName mn <> show ref) reFailed
57
54
58-- | Whether any Refs couldn't be resolved
55-- | Whether any Refs couldn't be resolved
59reexportHasFailures :: ReexportResult a -> Bool
56reexportHasFailures :: ReexportResult a -> Bool
src/Language/PureScript/Ide/SourceFile.hs+10−12
@@ -12,8 +12,6 @@
12-- Getting declarations from PureScript sourcefiles
12-- Getting declarations from PureScript sourcefiles
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16−
17module Language.PureScript.Ide.SourceFile
15module Language.PureScript.Ide.SourceFile
18 ( parseModule
16 ( parseModule
19 , getImportsForFile
17 , getImportsForFile
@@ -60,9 +58,9 @@ getImportsForFile fp = do
60 where
58 where
61 mkModuleImport (mn, importType', qualifier) =
59 mkModuleImport (mn, importType', qualifier) =
62 ModuleImport
60 ModuleImport
63− (runModuleNameT mn)
61+ (P.runModuleName mn)
64 importType'
62 importType'
65− (runModuleNameT <$> qualifier)
63+ (P.runModuleName <$> qualifier)
66 unwrapPositionedImport (mn, it, q) = (mn, unwrapImportType it, q)
64 unwrapPositionedImport (mn, it, q) = (mn, unwrapImportType it, q)
67 unwrapImportType (P.Explicit decls) = P.Explicit (map unwrapPositionedRef decls)
65 unwrapImportType (P.Explicit decls) = P.Explicit (map unwrapPositionedRef decls)
68 unwrapImportType (P.Hiding decls) = P.Hiding (map unwrapPositionedRef decls)
66 unwrapImportType (P.Hiding decls) = P.Hiding (map unwrapPositionedRef decls)
@@ -101,18 +99,18 @@ extractSpans ss d = case d of
101 P.PositionedDeclaration ss' _ d' ->
99 P.PositionedDeclaration ss' _ d' ->
102 extractSpans ss' d'
100 extractSpans ss' d'
103 P.ValueDeclaration i _ _ _ ->
101 P.ValueDeclaration i _ _ _ ->
104− [(Left (runIdentT i), ss)]
102+ [(Left (P.runIdent i), ss)]
105 P.TypeSynonymDeclaration name _ _ ->
103 P.TypeSynonymDeclaration name _ _ ->
106− [(Right (runProperNameT name), ss)]
104+ [(Right (P.runProperName name), ss)]
107 P.TypeClassDeclaration name _ _ _ members ->
105 P.TypeClassDeclaration name _ _ _ members ->
108− (Right (runProperNameT name), ss) : concatMap (extractSpans' ss) members
106+ (Right (P.runProperName name), ss) : concatMap (extractSpans' ss) members
109 P.DataDeclaration _ name _ ctors ->
107 P.DataDeclaration _ name _ ctors ->
110− (Right (runProperNameT name), ss)
108+ (Right (P.runProperName name), ss)
111− : map (\(cname, _) -> (Left (runProperNameT cname), ss)) ctors
109+ : map (\(cname, _) -> (Left (P.runProperName cname), ss)) ctors
112 P.ExternDeclaration ident _ ->
110 P.ExternDeclaration ident _ ->
113− [(Left (runIdentT ident), ss)]
111+ [(Left (P.runIdent ident), ss)]
114 P.ExternDataDeclaration name _ ->
112 P.ExternDataDeclaration name _ ->
115− [(Right (runProperNameT name), ss)]
113+ [(Right (P.runProperName name), ss)]
116 _ -> []
114 _ -> []
117 where
115 where
118 -- We need this special case to be able to also get the position info for
116 -- We need this special case to be able to also get the position info for
@@ -123,5 +121,5 @@ extractSpans ss d = case d of
123 P.PositionedDeclaration ssP' _ dP' ->
121 P.PositionedDeclaration ssP' _ dP' ->
124 extractSpans' ssP' dP'
122 extractSpans' ssP' dP'
125 P.TypeDeclaration ident _ ->
123 P.TypeDeclaration ident _ ->
126− [(Left (runIdentT ident), ssP)]
124+ [(Left (P.runIdent ident), ssP)]
127 _ -> []
125 _ -> []
src/Language/PureScript/Ide/State.hs+1−2
@@ -12,7 +12,6 @@
12-- Functions to access psc-ide's state
12-- Functions to access psc-ide's state
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16{-# LANGUAGE PackageImports #-}
15{-# LANGUAGE PackageImports #-}
17{-# LANGUAGE TemplateHaskell #-}
16{-# LANGUAGE TemplateHaskell #-}
18
17
@@ -194,7 +193,7 @@ populateStage3 = do
194 let message duration = "Finished populating Stage3 in " <> displayTimeSpec duration
193 let message duration = "Finished populating Stage3 in " <> displayTimeSpec duration
195 results <- logPerf message (liftIO (atomically (populateStage3STM st)))
194 results <- logPerf message (liftIO (atomically (populateStage3STM st)))
196 traverse_
195 traverse_
197− (logWarnN . prettyPrintReexportResult (runModuleNameT . fst))
196+ (logWarnN . prettyPrintReexportResult (P.runModuleName . fst))
198 (filter reexportHasFailures results)
197 (filter reexportHasFailures results)
199
198
200-- | STM version of populateStage3
199-- | STM version of populateStage3
src/Language/PureScript/Ide/Types.hs+3−4
@@ -25,7 +25,6 @@ import Data.Aeson
25import qualified Data.Map.Lazy as M
25import qualified Data.Map.Lazy as M
26import qualified Language.PureScript as P
26import qualified Language.PureScript as P
27import qualified Language.PureScript.Errors.JSON as P
27import qualified Language.PureScript.Errors.JSON as P
28−import Language.PureScript.Ide.Conversions
29
28
30type ModuleIdent = Text
29type ModuleIdent = Text
31
30
@@ -212,9 +211,9 @@ instance ToJSON ModuleImport where
212 ] ++ map (\x -> "qualifier" .= x) (maybeToList qualifier)
211 ] ++ map (\x -> "qualifier" .= x) (maybeToList qualifier)
213
212
214identifierFromDeclarationRef :: P.DeclarationRef -> Text
213identifierFromDeclarationRef :: P.DeclarationRef -> Text
215−identifierFromDeclarationRef (P.TypeRef name _) = runProperNameT name
214+identifierFromDeclarationRef (P.TypeRef name _) = P.runProperName name
216−identifierFromDeclarationRef (P.ValueRef ident) = runIdentT ident
215+identifierFromDeclarationRef (P.ValueRef ident) = P.runIdent ident
217−identifierFromDeclarationRef (P.TypeClassRef name) = runProperNameT name
216+identifierFromDeclarationRef (P.TypeClassRef name) = P.runProperName name
218identifierFromDeclarationRef _ = ""
217identifierFromDeclarationRef _ = ""
219
218
220data Success =
219data Success =
src/Language/PureScript/Ide/Util.hs+10−12
@@ -12,8 +12,6 @@
12-- Generally useful functions
12-- Generally useful functions
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15−{-# LANGUAGE OverloadedStrings #-}
16−
17module Language.PureScript.Ide.Util
15module Language.PureScript.Ide.Util
18 ( identifierFromIdeDeclaration
16 ( identifierFromIdeDeclaration
19 , unwrapMatch
17 , unwrapMatch
@@ -48,9 +46,9 @@ identifierFromIdeDeclaration d = case d of
48 IdeDeclType t -> t ^. ideTypeName . properNameT
46 IdeDeclType t -> t ^. ideTypeName . properNameT
49 IdeDeclTypeSynonym s -> s ^. ideSynonymName . properNameT
47 IdeDeclTypeSynonym s -> s ^. ideSynonymName . properNameT
50 IdeDeclDataConstructor dtor -> dtor ^. ideDtorName . properNameT
48 IdeDeclDataConstructor dtor -> dtor ^. ideDtorName . properNameT
51− IdeDeclTypeClass name -> runProperNameT name
49+ IdeDeclTypeClass name -> P.runProperName name
52− IdeDeclValueOperator op -> op ^. ideValueOpName & runOpNameT
50+ IdeDeclValueOperator op -> op ^. ideValueOpName & P.runOpName
53− IdeDeclTypeOperator op -> op ^. ideTypeOpName & runOpNameT
51+ IdeDeclTypeOperator op -> op ^. ideTypeOpName & P.runOpName
54
52
55discardAnn :: IdeDeclarationAnn -> IdeDeclaration
53discardAnn :: IdeDeclarationAnn -> IdeDeclaration
56discardAnn (IdeDeclarationAnn _ d) = d
54discardAnn (IdeDeclarationAnn _ d) = d
@@ -70,13 +68,13 @@ completionFromMatch (Match (m, IdeDeclarationAnn ann decl)) =
70 IdeDeclType t -> (t ^. ideTypeName . properNameT, t ^. ideTypeKind & P.prettyPrintKind & toS )
68 IdeDeclType t -> (t ^. ideTypeName . properNameT, t ^. ideTypeKind & P.prettyPrintKind & toS )
71 IdeDeclTypeSynonym s -> (s ^. ideSynonymName . properNameT, s ^. ideSynonymType & prettyTypeT)
69 IdeDeclTypeSynonym s -> (s ^. ideSynonymName . properNameT, s ^. ideSynonymType & prettyTypeT)
72 IdeDeclDataConstructor d -> (d ^. ideDtorName . properNameT, d ^. ideDtorType & prettyTypeT)
70 IdeDeclDataConstructor d -> (d ^. ideDtorName . properNameT, d ^. ideDtorType & prettyTypeT)
73− IdeDeclTypeClass name -> (runProperNameT name, "class")
71+ IdeDeclTypeClass name -> (P.runProperName name, "class")
74 IdeDeclValueOperator (IdeValueOperator op ref precedence associativity typeP) ->
72 IdeDeclValueOperator (IdeValueOperator op ref precedence associativity typeP) ->
75− (runOpNameT op, maybe (showFixity precedence associativity (valueOperatorAliasT ref) op) prettyTypeT typeP)
73+ (P.runOpName op, maybe (showFixity precedence associativity (valueOperatorAliasT ref) op) prettyTypeT typeP)
76 IdeDeclTypeOperator (IdeTypeOperator op ref precedence associativity kind) ->
74 IdeDeclTypeOperator (IdeTypeOperator op ref precedence associativity kind) ->
77− (runOpNameT op, maybe (showFixity precedence associativity (typeOperatorAliasT ref) op) (toS . P.prettyPrintKind) kind)
75+ (P.runOpName op, maybe (showFixity precedence associativity (typeOperatorAliasT ref) op) (toS . P.prettyPrintKind) kind)
78
76
79− complModule = runModuleNameT m
77+ complModule = P.runModuleName m
80
78
81 complType = maybe complExpandedType prettyTypeT (annTypeAnnotation ann)
79 complType = maybe complExpandedType prettyTypeT (annTypeAnnotation ann)
82
80
@@ -89,17 +87,17 @@ completionFromMatch (Match (m, IdeDeclarationAnn ann decl)) =
89 P.Infix -> "infix"
87 P.Infix -> "infix"
90 P.Infixl -> "infixl"
88 P.Infixl -> "infixl"
91 P.Infixr -> "infixr"
89 P.Infixr -> "infixr"
92− in T.unwords [asso, show p, r, "as", runOpNameT o]
90+ in T.unwords [asso, show p, r, "as", P.runOpName o]
93
91
94valueOperatorAliasT
92valueOperatorAliasT
95 :: P.Qualified (Either P.Ident (P.ProperName 'P.ConstructorName)) -> Text
93 :: P.Qualified (Either P.Ident (P.ProperName 'P.ConstructorName)) -> Text
96valueOperatorAliasT i =
94valueOperatorAliasT i =
97− toS (P.showQualified (either P.runIdent P.runProperName) i)
95+ P.showQualified (either P.runIdent P.runProperName) i
98
96
99typeOperatorAliasT
97typeOperatorAliasT
100 :: P.Qualified (P.ProperName 'P.TypeName) -> Text
98 :: P.Qualified (P.ProperName 'P.TypeName) -> Text
101typeOperatorAliasT i =
99typeOperatorAliasT i =
102− toS (P.showQualified P.runProperName i)
100+ P.showQualified P.runProperName i
103
101
104encodeT :: (ToJSON a) => a -> Text
102encodeT :: (ToJSON a) => a -> Text
105encodeT = toS . decodeUtf8 . encode
103encodeT = toS . decodeUtf8 . encode
src/Language/PureScript/Interactive.hs−4
@@ -1,8 +1,4 @@
1{-# LANGUAGE DoAndIfThenElse #-}
1{-# LANGUAGE DoAndIfThenElse #-}
2−{-# LANGUAGE FlexibleContexts #-}
3−{-# LANGUAGE MultiParamTypeClasses #-}
4−{-# LANGUAGE TupleSections #-}
5−{-# LANGUAGE DataKinds #-}
6
2
7module Language.PureScript.Interactive
3module Language.PureScript.Interactive
8 ( handleCommand
4 ( handleCommand
src/Language/PureScript/Interactive/Completion.hs−2
@@ -1,5 +1,3 @@
1−{-# LANGUAGE DataKinds #-}
2−
3module Language.PureScript.Interactive.Completion
1module Language.PureScript.Interactive.Completion
4 ( CompletionM
2 ( CompletionM
5 , liftCompletionM
3 , liftCompletionM
src/Language/PureScript/Interactive/Printer.hs−3
@@ -1,6 +1,3 @@
1−{-# LANGUAGE RecordWildCards #-}
2−{-# LANGUAGE DataKinds #-}
3−
4module Language.PureScript.Interactive.Printer where
1module Language.PureScript.Interactive.Printer where
5
2
6import Prelude.Compat
3import Prelude.Compat
src/Language/PureScript/Make.hs−1
@@ -1,6 +1,5 @@
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE TypeFamilies #-}
2{-# LANGUAGE TypeFamilies #-}
3−{-# LANGUAGE OverloadedStrings #-}
4
3
5module Language.PureScript.Make
4module Language.PureScript.Make
6 (
5 (
src/Language/PureScript/Publish.hs−1
@@ -1,5 +1,4 @@
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2−{-# LANGUAGE OverloadedStrings #-}
3
2
4module Language.PureScript.Publish
3module Language.PureScript.Publish
5 ( preparePackage
4 ( preparePackage
src/Language/PureScript/Publish/ErrorsWarnings.hs−2
@@ -1,5 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−
3module Language.PureScript.Publish.ErrorsWarnings
1module Language.PureScript.Publish.ErrorsWarnings
4 ( PackageError(..)
2 ( PackageError(..)
5 , PackageWarning(..)
3 , PackageWarning(..)
src/Language/PureScript/Sugar/TypeClasses/Deriving.hs−3
@@ -1,6 +1,3 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−{-# LANGUAGE PatternGuards #-}
3−
4-- |
1-- |
5-- This module implements the generic deriving elaboration that takes place during desugaring.
2-- This module implements the generic deriving elaboration that takes place during desugaring.
6--
3--
src/Language/PureScript/TypeChecker/Subsumption.hs−1
@@ -1,4 +1,3 @@
1−{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
3{-# LANGUAGE TypeFamilies #-}
2{-# LANGUAGE TypeFamilies #-}
4
3
src/Language/PureScript/TypeChecker/TypeSearch.hs−4
@@ -1,7 +1,3 @@
1−{-# LANGUAGE NoImplicitPrelude #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−{-# LANGUAGE RecordWildCards #-}
4−
5module Language.PureScript.TypeChecker.TypeSearch
1module Language.PureScript.TypeChecker.TypeSearch
6 ( typeSearch
2 ( typeSearch
7 ) where
3 ) where
src/Language/PureScript/TypeChecker/Types.hs−1
@@ -1,4 +1,3 @@
1−{-# LANGUAGE LambdaCase #-}
2{-# LANGUAGE NamedFieldPuns #-}
1{-# LANGUAGE NamedFieldPuns #-}
3
2
4-- |
3-- |