packages feed

purescript 0.8.5.0 → 0.9.1

raw patch · 560 files changed

+7765/−9823 lines, 560 filesdep +ansi-terminaldep +silentlydep ~parsecPVP ok

version bump matches the API change (PVP)

Dependencies added: ansi-terminal, silently

Dependency ranges changed: parsec

API changes (from Hackage documentation)

- Language.PureScript.AST.Declarations: AliasConstructor :: (ProperName ConstructorName) -> FixityAlias
- Language.PureScript.AST.Declarations: AliasType :: (ProperName TypeName) -> FixityAlias
- Language.PureScript.AST.Declarations: AliasValue :: Ident -> FixityAlias
- Language.PureScript.AST.Declarations: OperatorSection :: Expr -> (Either Expr Expr) -> Expr
- Language.PureScript.AST.Declarations: ProperRef :: String -> DeclarationRef
- Language.PureScript.AST.Declarations: data FixityAlias
- Language.PureScript.AST.Declarations: findDuplicateRefs :: [DeclarationRef] -> ([DeclarationRef], [ProperName ConstructorName])
- Language.PureScript.AST.Declarations: foldFixityAlias :: (Ident -> a) -> (ProperName ConstructorName -> a) -> (ProperName TypeName -> a) -> FixityAlias -> a
- Language.PureScript.AST.Declarations: getTypeAlias :: FixityAlias -> Maybe (ProperName TypeName)
- Language.PureScript.AST.Declarations: getValueAlias :: FixityAlias -> Maybe (Either Ident (ProperName ConstructorName))
- Language.PureScript.AST.Declarations: instance Data.Aeson.Types.Class.FromJSON Language.PureScript.AST.Declarations.FixityAlias
- Language.PureScript.AST.Declarations: instance Data.Aeson.Types.Class.ToJSON Language.PureScript.AST.Declarations.FixityAlias
- Language.PureScript.AST.Declarations: instance GHC.Classes.Eq Language.PureScript.AST.Declarations.FixityAlias
- Language.PureScript.AST.Declarations: instance GHC.Classes.Ord Language.PureScript.AST.Declarations.FixityAlias
- Language.PureScript.AST.Declarations: instance GHC.Read.Read Language.PureScript.AST.Declarations.FixityAlias
- Language.PureScript.AST.Declarations: instance GHC.Show.Show Language.PureScript.AST.Declarations.FixityAlias
- Language.PureScript.CodeGen.JS.Optimizer.Common: isFn' :: [(String, String)] -> JS -> Bool
- Language.PureScript.Constants: dataBooleanAlgebra :: String
- Language.PureScript.Constants: dataModuloSemiring :: String
- Language.PureScript.Docs.Types: [declFixity] :: Declaration -> Maybe Fixity
- Language.PureScript.Docs.Types: asAliasFor :: Parse e (Qualified FixityAlias)
- Language.PureScript.Environment: tyObject :: Type
- Language.PureScript.Errors: ClassConflictsWithCtor :: (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: ClassConflictsWithType :: (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: ClassOperator :: (ProperName ClassName) -> Ident -> SimpleErrorMessage
- Language.PureScript.Errors: ConflictingCtorDecls :: (ProperName ConstructorName) -> SimpleErrorMessage
- Language.PureScript.Errors: ConflictingTypeDecls :: (ProperName TypeName) -> SimpleErrorMessage
- Language.PureScript.Errors: CtorConflictsWithClass :: (ProperName ConstructorName) -> SimpleErrorMessage
- Language.PureScript.Errors: DeprecatedClassExport :: (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: DeprecatedClassImport :: ModuleName -> (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: DeprecatedOperatorDecl :: String -> SimpleErrorMessage
- Language.PureScript.Errors: DeprecatedOperatorSection :: Expr -> (Either Expr Expr) -> SimpleErrorMessage
- Language.PureScript.Errors: DeprecatedQualifiedSyntax :: ModuleName -> ModuleName -> SimpleErrorMessage
- Language.PureScript.Errors: DuplicateClassExport :: (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: DuplicateTypeOpExport :: Ident -> SimpleErrorMessage
- Language.PureScript.Errors: DuplicateValueExport :: Ident -> SimpleErrorMessage
- Language.PureScript.Errors: MultipleFixities :: Ident -> SimpleErrorMessage
- Language.PureScript.Errors: NotExhaustivePattern :: [[Binder]] -> Bool -> SimpleErrorMessage
- Language.PureScript.Errors: OrphanFixityDeclaration :: String -> SimpleErrorMessage
- Language.PureScript.Errors: RedundantEmptyHidingImport :: ModuleName -> SimpleErrorMessage
- Language.PureScript.Errors: TypeConflictsWithClass :: (ProperName TypeName) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownDataConstructor :: (Qualified (ProperName ConstructorName)) -> (Maybe (Qualified (ProperName ConstructorName))) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownExportModule :: ModuleName -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownExportType :: (ProperName TypeName) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownExportTypeClass :: (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownExportTypeOp :: Ident -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownExportValue :: Ident -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownImportType :: ModuleName -> (ProperName TypeName) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownImportTypeClass :: ModuleName -> (ProperName ClassName) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownImportTypeOp :: ModuleName -> Ident -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownImportValue :: ModuleName -> Ident -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownModule :: ModuleName -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownType :: (Qualified (ProperName TypeName)) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownTypeClass :: (Qualified (ProperName ClassName)) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownTypeConstructor :: (Qualified (ProperName TypeName)) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownTypeOp :: (Qualified Ident) -> SimpleErrorMessage
- Language.PureScript.Errors: UnknownValue :: (Qualified Ident) -> SimpleErrorMessage
- Language.PureScript.Errors: [umNextSkolem] :: TypeMap -> Int
- Language.PureScript.Errors: [umNextUnknown] :: TypeMap -> Int
- Language.PureScript.Ide.Rebuild: sortExterns :: (PscIde m, MonadError PscIdeError m) => Module -> Map ModuleName ExternsFile -> m [ExternsFile]
- Language.PureScript.Ide.State: getAllDecls :: (PscIde m) => m [ExternDecl]
- Language.PureScript.Ide.State: getAllModules :: (PscIde m) => m [Module]
- Language.PureScript.Ide.State: getExternFile :: (PscIde m) => ModuleName -> m (Maybe ExternsFile)
- Language.PureScript.Ide.State: insertModule' :: TVar PscIdeState -> ExternsFile -> STM ()
- Language.PureScript.Ide.Types: [externsFiles] :: PscIdeState -> Map ModuleName ExternsFile
- Language.PureScript.Ide.Types: [pscStateModules] :: PscIdeState -> Map Text [ExternDecl]
- Language.PureScript.Linter.Exhaustive: checkExhaustiveModule :: MonadWriter MultipleErrors m => Environment -> Module -> m ()
- Language.PureScript.Linter.Imports: instance GHC.Classes.Eq Language.PureScript.Linter.Imports.Name
- Language.PureScript.Linter.Imports: instance GHC.Show.Show Language.PureScript.Linter.Imports.Name
- Language.PureScript.Names: Op :: String -> Ident
- Language.PureScript.Options: [optionsRequirePath] :: Options -> Maybe FilePath
- Language.PureScript.Parser.Declarations: parseModules :: TokenParser [Module]
- Language.PureScript.Parser.JS: parseForeignModulesFromFiles :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [(FilePath, ForeignJS)] -> m (Map ModuleName FilePath)
- Language.PureScript.Parser.JS: type ForeignJS = String
- Language.PureScript.Publish.ErrorsWarnings: LicenseNotFound :: UserError
- Language.PureScript.Sugar.Names: [importedVirtualModules] :: Imports -> Set ModuleName
- Language.PureScript.Sugar.Names.Env: [importedVirtualModules] :: Imports -> Set ModuleName
- Language.PureScript.Sugar.Names.Env: nullImports :: Imports
- Language.PureScript.Sugar.Operators: desugarOperatorSections :: (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
- Language.PureScript.Sugar.Operators: removeSignedLiterals :: Module -> Module
- Language.PureScript.Types: type Constraint = (Qualified (ProperName ClassName), [Type])
+ Language.PureScript.AST.Declarations: Op :: (Qualified (OpName ValueOpName)) -> Expr
+ Language.PureScript.AST.Declarations: TypeFixity :: Fixity -> (Qualified (ProperName TypeName)) -> (OpName TypeOpName) -> TypeFixity
+ Language.PureScript.AST.Declarations: ValueFixity :: Fixity -> (Qualified (Either Ident (ProperName ConstructorName))) -> (OpName ValueOpName) -> ValueFixity
+ Language.PureScript.AST.Declarations: ValueOpRef :: (OpName ValueOpName) -> DeclarationRef
+ Language.PureScript.AST.Declarations: data TypeFixity
+ Language.PureScript.AST.Declarations: data ValueFixity
+ Language.PureScript.AST.Declarations: getFixityDecl :: Declaration -> Maybe (Either ValueFixity TypeFixity)
+ Language.PureScript.AST.Declarations: getTypeClassRef :: DeclarationRef -> Maybe (ProperName ClassName)
+ Language.PureScript.AST.Declarations: getTypeOpRef :: DeclarationRef -> Maybe (OpName TypeOpName)
+ Language.PureScript.AST.Declarations: getTypeRef :: DeclarationRef -> Maybe (ProperName TypeName, Maybe [ProperName ConstructorName])
+ Language.PureScript.AST.Declarations: getValueOpRef :: DeclarationRef -> Maybe (OpName ValueOpName)
+ Language.PureScript.AST.Declarations: getValueRef :: DeclarationRef -> Maybe Ident
+ Language.PureScript.AST.Declarations: instance GHC.Classes.Eq Language.PureScript.AST.Declarations.TypeFixity
+ Language.PureScript.AST.Declarations: instance GHC.Classes.Eq Language.PureScript.AST.Declarations.ValueFixity
+ Language.PureScript.AST.Declarations: instance GHC.Classes.Ord Language.PureScript.AST.Declarations.TypeFixity
+ Language.PureScript.AST.Declarations: instance GHC.Classes.Ord Language.PureScript.AST.Declarations.ValueFixity
+ Language.PureScript.AST.Declarations: instance GHC.Read.Read Language.PureScript.AST.Declarations.TypeFixity
+ Language.PureScript.AST.Declarations: instance GHC.Read.Read Language.PureScript.AST.Declarations.ValueFixity
+ Language.PureScript.AST.Declarations: instance GHC.Show.Show Language.PureScript.AST.Declarations.TypeFixity
+ Language.PureScript.AST.Declarations: instance GHC.Show.Show Language.PureScript.AST.Declarations.ValueFixity
+ Language.PureScript.Constants: dataEuclideanRing :: String
+ Language.PureScript.Constants: dataHeytingAlgebra :: String
+ Language.PureScript.Constants: euclideanRingInt :: String
+ Language.PureScript.Constants: euclideanRingNumber :: String
+ Language.PureScript.Constants: heytingAlgebraBoolean :: String
+ Language.PureScript.Constants: partial :: String
+ Language.PureScript.Docs.Types: asFixityAlias :: Parse PackageError FixityAlias
+ Language.PureScript.Docs.Types: type FixityAlias = Qualified (Either (ProperName TypeName) (Either Ident (ProperName ConstructorName)))
+ Language.PureScript.Environment: tyRecord :: Type
+ Language.PureScript.Errors: DeclConflict :: Name -> Name -> SimpleErrorMessage
+ Language.PureScript.Errors: ExportConflict :: (Qualified Name) -> (Qualified Name) -> SimpleErrorMessage
+ Language.PureScript.Errors: MultipleTypeOpFixities :: (OpName TypeOpName) -> SimpleErrorMessage
+ Language.PureScript.Errors: MultipleValueOpFixities :: (OpName ValueOpName) -> SimpleErrorMessage
+ Language.PureScript.Errors: PPEOptions :: Maybe (ColorIntensity, Color) -> Bool -> Level -> Bool -> PPEOptions
+ Language.PureScript.Errors: UnknownExport :: Name -> SimpleErrorMessage
+ Language.PureScript.Errors: UnknownImport :: ModuleName -> Name -> SimpleErrorMessage
+ Language.PureScript.Errors: UnknownName :: (Qualified Name) -> SimpleErrorMessage
+ Language.PureScript.Errors: [ppeCodeColor] :: PPEOptions -> Maybe (ColorIntensity, Color)
+ Language.PureScript.Errors: [ppeFull] :: PPEOptions -> Bool
+ Language.PureScript.Errors: [ppeLevel] :: PPEOptions -> Level
+ Language.PureScript.Errors: [ppeShowWiki] :: PPEOptions -> Bool
+ Language.PureScript.Errors: [umNextIndex] :: TypeMap -> Int
+ Language.PureScript.Errors: ansiColor :: (ColorIntensity, Color) -> String
+ Language.PureScript.Errors: ansiColorReset :: String
+ Language.PureScript.Errors: colorCode :: Maybe (ColorIntensity, Color) -> String -> String
+ Language.PureScript.Errors: colorCodeBox :: Maybe (ColorIntensity, Color) -> Box -> Box
+ Language.PureScript.Errors: data PPEOptions
+ Language.PureScript.Errors: defaultCodeColor :: (ColorIntensity, Color)
+ Language.PureScript.Errors: defaultPPEOptions :: PPEOptions
+ Language.PureScript.Errors: suggestionSpan :: ErrorMessage -> Maybe SourceSpan
+ Language.PureScript.Errors.JSON: [replaceRange] :: ErrorSuggestion -> Maybe ErrorPosition
+ Language.PureScript.Externs: ExternsTypeFixity :: Associativity -> Precedence -> OpName TypeOpName -> Qualified (ProperName TypeName) -> ExternsTypeFixity
+ Language.PureScript.Externs: [efTypeAlias] :: ExternsTypeFixity -> Qualified (ProperName TypeName)
+ Language.PureScript.Externs: [efTypeAssociativity] :: ExternsTypeFixity -> Associativity
+ Language.PureScript.Externs: [efTypeFixities] :: ExternsFile -> [ExternsTypeFixity]
+ Language.PureScript.Externs: [efTypeOperator] :: ExternsTypeFixity -> OpName TypeOpName
+ Language.PureScript.Externs: [efTypePrecedence] :: ExternsTypeFixity -> Precedence
+ Language.PureScript.Externs: data ExternsTypeFixity
+ Language.PureScript.Externs: instance Data.Aeson.Types.Class.FromJSON Language.PureScript.Externs.ExternsTypeFixity
+ Language.PureScript.Externs: instance Data.Aeson.Types.Class.ToJSON Language.PureScript.Externs.ExternsTypeFixity
+ Language.PureScript.Externs: instance GHC.Read.Read Language.PureScript.Externs.ExternsTypeFixity
+ Language.PureScript.Externs: instance GHC.Show.Show Language.PureScript.Externs.ExternsTypeFixity
+ Language.PureScript.Ide.Command: Reset :: Command
+ Language.PureScript.Ide.Command: [completeCurrentModule] :: Command -> Maybe ModuleName
+ Language.PureScript.Ide.Command: [typeCurrentModule] :: Command -> Maybe ModuleName
+ Language.PureScript.Ide.Externs: TypeOperator :: (OpName TypeOpName) -> Ident -> Precedence -> Associativity -> ExternDecl
+ Language.PureScript.Ide.Externs: ValueOperator :: (OpName ValueOpName) -> Ident -> Precedence -> Associativity -> ExternDecl
+ Language.PureScript.Ide.State: getAllModulesWithReexportsAndCache :: (PscIde m) => Maybe ModuleName -> m [Module]
+ Language.PureScript.Ide.State: getCachedRebuild :: PscIde m => m (Maybe (ModuleName, ExternsFile))
+ Language.PureScript.Ide.State: insertModuleSTM :: TVar PscIdeState -> ExternsFile -> STM ()
+ Language.PureScript.Ide.State: resetPscIdeState :: PscIde m => m ()
+ Language.PureScript.Ide.State: setCachedRebuild :: PscIde m => ExternsFile -> m ()
+ Language.PureScript.Ide.Types: TypeOperator :: (OpName TypeOpName) -> Ident -> Precedence -> Associativity -> ExternDecl
+ Language.PureScript.Ide.Types: ValueOperator :: (OpName ValueOpName) -> Ident -> Precedence -> Associativity -> ExternDecl
+ Language.PureScript.Ide.Types: [pscIdeStateCachedRebuild] :: PscIdeState -> Maybe (ModuleName, ExternsFile)
+ Language.PureScript.Ide.Types: [pscIdeStateExternsFiles] :: PscIdeState -> Map ModuleName ExternsFile
+ Language.PureScript.Ide.Types: [pscIdeStateModules] :: PscIdeState -> Map Text [ExternDecl]
+ Language.PureScript.Ide.Util: runModuleNameT :: ModuleName -> Text
+ Language.PureScript.Ide.Util: runOpNameT :: OpName a -> Text
+ Language.PureScript.Interactive: handleCommand :: (MonadReader PSCiConfig m, MonadState PSCiState m, MonadIO m) => Command -> m ()
+ Language.PureScript.Interactive: make :: [(FilePath, Module)] -> Make ([ExternsFile], Environment)
+ Language.PureScript.Interactive: runMake :: Make a -> IO (Either MultipleErrors a)
+ Language.PureScript.Interactive.Completion: completion :: (MonadState PSCiState m, MonadIO m) => CompletionFunc m
+ Language.PureScript.Interactive.Completion: completion' :: CompletionFunc CompletionM
+ Language.PureScript.Interactive.Completion: instance GHC.Read.Read Language.PureScript.Interactive.Completion.CompletionContext
+ Language.PureScript.Interactive.Completion: instance GHC.Show.Show Language.PureScript.Interactive.Completion.CompletionContext
+ Language.PureScript.Interactive.Completion: liftCompletionM :: (MonadState PSCiState m, MonadIO m) => CompletionM a -> m a
+ Language.PureScript.Interactive.Completion: type CompletionM = ReaderT PSCiState IO
+ Language.PureScript.Interactive.Directive: directiveStrings :: [(Directive, [String])]
+ Language.PureScript.Interactive.Directive: directiveStrings' :: [(String, Directive)]
+ Language.PureScript.Interactive.Directive: directiveStringsFor :: String -> [String]
+ Language.PureScript.Interactive.Directive: directives :: [Directive]
+ Language.PureScript.Interactive.Directive: directivesFor :: String -> [Directive]
+ Language.PureScript.Interactive.Directive: directivesFor' :: String -> [(Directive, String)]
+ Language.PureScript.Interactive.Directive: hasArgument :: Directive -> Bool
+ Language.PureScript.Interactive.Directive: help :: [(Directive, String, String)]
+ Language.PureScript.Interactive.Directive: parseDirective :: String -> Maybe Directive
+ Language.PureScript.Interactive.Directive: stringFor :: Directive -> String
+ Language.PureScript.Interactive.Directive: strings :: [String]
+ Language.PureScript.Interactive.Directive: stringsFor :: Directive -> [String]
+ Language.PureScript.Interactive.IO: expandTilde :: FilePath -> IO FilePath
+ Language.PureScript.Interactive.IO: findNodeProcess :: IO (Maybe String)
+ Language.PureScript.Interactive.IO: getHistoryFilename :: IO FilePath
+ Language.PureScript.Interactive.IO: mkdirp :: FilePath -> IO ()
+ Language.PureScript.Interactive.IO: onFirstFileMatching :: Monad m => (b -> m (Maybe a)) -> [b] -> m (Maybe a)
+ Language.PureScript.Interactive.Message: helpMessage :: String
+ Language.PureScript.Interactive.Message: prologueMessage :: String
+ Language.PureScript.Interactive.Message: quitMessage :: String
+ Language.PureScript.Interactive.Message: supportModuleMessage :: String
+ Language.PureScript.Interactive.Module: createTemporaryModule :: Bool -> PSCiState -> Expr -> Module
+ Language.PureScript.Interactive.Module: createTemporaryModuleForImports :: PSCiState -> Module
+ Language.PureScript.Interactive.Module: createTemporaryModuleForKind :: PSCiState -> Type -> Module
+ Language.PureScript.Interactive.Module: importDecl :: ImportedModule -> Declaration
+ Language.PureScript.Interactive.Module: indexFile :: FilePath
+ Language.PureScript.Interactive.Module: loadAllModules :: [FilePath] -> IO (Either MultipleErrors [(FilePath, Module)])
+ Language.PureScript.Interactive.Module: loadModule :: FilePath -> IO (Either String [Module])
+ Language.PureScript.Interactive.Module: modulesDir :: FilePath
+ Language.PureScript.Interactive.Module: supportModuleIsDefined :: [Module] -> Bool
+ Language.PureScript.Interactive.Module: supportModuleName :: ModuleName
+ Language.PureScript.Interactive.Parser: parseCommand :: String -> Either String Command
+ Language.PureScript.Interactive.Printer: printModuleSignatures :: ModuleName -> Environment -> String
+ Language.PureScript.Interactive.Types: Browse :: Directive
+ Language.PureScript.Interactive.Types: BrowseModule :: ModuleName -> Command
+ Language.PureScript.Interactive.Types: Decls :: [Declaration] -> Command
+ Language.PureScript.Interactive.Types: Expression :: Expr -> Command
+ Language.PureScript.Interactive.Types: Help :: Directive
+ Language.PureScript.Interactive.Types: Import :: ImportedModule -> Command
+ Language.PureScript.Interactive.Types: Kind :: Directive
+ Language.PureScript.Interactive.Types: KindOf :: Type -> Command
+ Language.PureScript.Interactive.Types: PSCiConfig :: [FilePath] -> [String] -> Environment -> PSCiConfig
+ Language.PureScript.Interactive.Types: PSCiState :: [ImportedModule] -> [Declaration] -> [(Module, ExternsFile)] -> PSCiState
+ Language.PureScript.Interactive.Types: QueryImport :: ReplQuery
+ Language.PureScript.Interactive.Types: QueryLoaded :: ReplQuery
+ Language.PureScript.Interactive.Types: Quit :: Directive
+ Language.PureScript.Interactive.Types: QuitPSCi :: Command
+ Language.PureScript.Interactive.Types: Reset :: Directive
+ Language.PureScript.Interactive.Types: ResetState :: Command
+ Language.PureScript.Interactive.Types: Show :: Directive
+ Language.PureScript.Interactive.Types: ShowHelp :: Command
+ Language.PureScript.Interactive.Types: ShowInfo :: ReplQuery -> Command
+ Language.PureScript.Interactive.Types: Type :: Directive
+ Language.PureScript.Interactive.Types: TypeOf :: Expr -> Command
+ Language.PureScript.Interactive.Types: [psciEnvironment] :: PSCiConfig -> Environment
+ Language.PureScript.Interactive.Types: [psciImportedModules] :: PSCiState -> [ImportedModule]
+ Language.PureScript.Interactive.Types: [psciLetBindings] :: PSCiState -> [Declaration]
+ Language.PureScript.Interactive.Types: [psciLoadedExterns] :: PSCiState -> [(Module, ExternsFile)]
+ Language.PureScript.Interactive.Types: [psciLoadedFiles] :: PSCiConfig -> [FilePath]
+ Language.PureScript.Interactive.Types: [psciNodeFlags] :: PSCiConfig -> [String]
+ Language.PureScript.Interactive.Types: allImportsOf :: Module -> PSCiState -> [ImportedModule]
+ Language.PureScript.Interactive.Types: data Command
+ Language.PureScript.Interactive.Types: data Directive
+ Language.PureScript.Interactive.Types: data PSCiConfig
+ Language.PureScript.Interactive.Types: data PSCiState
+ Language.PureScript.Interactive.Types: data ReplQuery
+ Language.PureScript.Interactive.Types: initialPSCiState :: PSCiState
+ Language.PureScript.Interactive.Types: instance GHC.Classes.Eq Language.PureScript.Interactive.Types.Directive
+ Language.PureScript.Interactive.Types: instance GHC.Classes.Eq Language.PureScript.Interactive.Types.ReplQuery
+ Language.PureScript.Interactive.Types: instance GHC.Show.Show Language.PureScript.Interactive.Types.Directive
+ Language.PureScript.Interactive.Types: instance GHC.Show.Show Language.PureScript.Interactive.Types.PSCiConfig
+ Language.PureScript.Interactive.Types: instance GHC.Show.Show Language.PureScript.Interactive.Types.PSCiState
+ Language.PureScript.Interactive.Types: instance GHC.Show.Show Language.PureScript.Interactive.Types.ReplQuery
+ Language.PureScript.Interactive.Types: parseReplQuery :: String -> Maybe ReplQuery
+ Language.PureScript.Interactive.Types: psciImportedModuleNames :: PSCiState -> [ModuleName]
+ Language.PureScript.Interactive.Types: replQueries :: [ReplQuery]
+ Language.PureScript.Interactive.Types: replQueryStrings :: [String]
+ Language.PureScript.Interactive.Types: showReplQuery :: ReplQuery -> String
+ Language.PureScript.Interactive.Types: type ImportedModule = (ModuleName, ImportDeclarationType, Maybe ModuleName)
+ Language.PureScript.Interactive.Types: updateImportedModules :: ([ImportedModule] -> [ImportedModule]) -> PSCiState -> PSCiState
+ Language.PureScript.Interactive.Types: updateLets :: ([Declaration] -> [Declaration]) -> PSCiState -> PSCiState
+ Language.PureScript.Interactive.Types: updateLoadedExterns :: ([(Module, ExternsFile)] -> [(Module, ExternsFile)]) -> PSCiState -> PSCiState
+ Language.PureScript.Kinds: Symbol :: Kind
+ Language.PureScript.Linter.Exhaustive: checkExhaustiveExpr :: forall m. (MonadWriter MultipleErrors m, MonadSupply m) => Environment -> ModuleName -> Expr -> m Expr
+ Language.PureScript.Linter.Imports: ModName :: ModuleName -> Name
+ Language.PureScript.Linter.Imports: ValOpName :: (OpName ValueOpName) -> Name
+ Language.PureScript.Make: inferForeignModules :: forall m. MonadIO m => Map ModuleName (Either RebuildPolicy FilePath) -> m (Map ModuleName FilePath)
+ Language.PureScript.Make: makeIO :: (IOError -> ErrorMessage) -> IO a -> Make a
+ Language.PureScript.Make: readTextFile :: FilePath -> Make String
+ Language.PureScript.Names: DctorName :: (ProperName ConstructorName) -> Name
+ Language.PureScript.Names: IdentName :: Ident -> Name
+ Language.PureScript.Names: ModName :: ModuleName -> Name
+ Language.PureScript.Names: OpName :: String -> OpName
+ Language.PureScript.Names: TyClassName :: (ProperName ClassName) -> Name
+ Language.PureScript.Names: TyName :: (ProperName TypeName) -> Name
+ Language.PureScript.Names: TyOpName :: (OpName TypeOpName) -> Name
+ Language.PureScript.Names: TypeOpName :: OpNameType
+ Language.PureScript.Names: ValOpName :: (OpName ValueOpName) -> Name
+ Language.PureScript.Names: ValueOpName :: OpNameType
+ Language.PureScript.Names: [runOpName] :: OpName -> String
+ Language.PureScript.Names: data Name
+ Language.PureScript.Names: data OpNameType
+ Language.PureScript.Names: disqualifyFor :: Maybe ModuleName -> Qualified a -> Maybe a
+ Language.PureScript.Names: getClassName :: Name -> Maybe (ProperName ClassName)
+ Language.PureScript.Names: getDctorName :: Name -> Maybe (ProperName ConstructorName)
+ Language.PureScript.Names: getIdentName :: Name -> Maybe Ident
+ Language.PureScript.Names: getModName :: Name -> Maybe ModuleName
+ Language.PureScript.Names: getQual :: Qualified a -> Maybe ModuleName
+ Language.PureScript.Names: getTypeName :: Name -> Maybe (ProperName TypeName)
+ Language.PureScript.Names: getTypeOpName :: Name -> Maybe (OpName TypeOpName)
+ Language.PureScript.Names: getValOpName :: Name -> Maybe (OpName ValueOpName)
+ Language.PureScript.Names: instance Data.Aeson.Types.Class.FromJSON (Language.PureScript.Names.OpName a)
+ Language.PureScript.Names: instance Data.Aeson.Types.Class.ToJSON (Language.PureScript.Names.OpName a)
+ Language.PureScript.Names: instance GHC.Classes.Eq (Language.PureScript.Names.OpName a)
+ Language.PureScript.Names: instance GHC.Classes.Eq Language.PureScript.Names.Name
+ Language.PureScript.Names: instance GHC.Classes.Ord (Language.PureScript.Names.OpName a)
+ Language.PureScript.Names: instance GHC.Read.Read (Language.PureScript.Names.OpName a)
+ Language.PureScript.Names: instance GHC.Show.Show (Language.PureScript.Names.OpName a)
+ Language.PureScript.Names: instance GHC.Show.Show Language.PureScript.Names.Name
+ Language.PureScript.Names: newtype OpName (a :: OpNameType)
+ Language.PureScript.Names: showOp :: OpName a -> String
+ Language.PureScript.Parser.Common: parseOperator :: TokenParser (OpName a)
+ Language.PureScript.Parser.Common: toSourcePos :: SourcePos -> SourcePos
+ Language.PureScript.Parser.Common: typeName :: TokenParser (ProperName TypeName)
+ Language.PureScript.Parser.Declarations: parseModuleFromFile :: (k -> FilePath) -> (k, String) -> Either ParseError (k, Module)
+ Language.PureScript.Parser.Declarations: toPositionedError :: ParseError -> ErrorMessage
+ Language.PureScript.Parser.Lexer: [ptEndPos] :: PositionedToken -> SourcePos
+ Language.PureScript.Parser.Lexer: [ptPrevEndPos] :: PositionedToken -> Maybe SourcePos
+ Language.PureScript.Parser.Lexer: tyname :: TokenParser String
+ Language.PureScript.Pretty.Common: endWith :: Box -> Box -> Box
+ Language.PureScript.Publish.ErrorsWarnings: InvalidLicense :: UserError
+ Language.PureScript.Sugar.Names: Prim :: ImportProvenance
+ Language.PureScript.Sugar.Names: [exportedValueOps] :: Exports -> Map (OpName ValueOpName) ModuleName
+ Language.PureScript.Sugar.Names: [importedQualModules] :: Imports -> Set ModuleName
+ Language.PureScript.Sugar.Names: [importedValueOps] :: Imports -> ImportMap (OpName ValueOpName)
+ Language.PureScript.Sugar.Names.Common: warnDuplicateRefs :: MonadWriter MultipleErrors m => SourceSpan -> (Name -> SimpleErrorMessage) -> [DeclarationRef] -> m ()
+ Language.PureScript.Sugar.Names.Env: Internal :: ExportMode
+ Language.PureScript.Sugar.Names.Env: Prim :: ImportProvenance
+ Language.PureScript.Sugar.Names.Env: ReExport :: ExportMode
+ Language.PureScript.Sugar.Names.Env: [exportedValueOps] :: Exports -> Map (OpName ValueOpName) ModuleName
+ Language.PureScript.Sugar.Names.Env: [importedQualModules] :: Imports -> Set ModuleName
+ Language.PureScript.Sugar.Names.Env: [importedValueOps] :: Imports -> ImportMap (OpName ValueOpName)
+ Language.PureScript.Sugar.Names.Env: data ExportMode
+ Language.PureScript.Sugar.Names.Env: exportValueOp :: MonadError MultipleErrors m => Exports -> OpName ValueOpName -> ModuleName -> m Exports
+ Language.PureScript.Sugar.Names.Env: instance GHC.Classes.Eq Language.PureScript.Sugar.Names.Env.ExportMode
+ Language.PureScript.Sugar.Names.Env: instance GHC.Show.Show Language.PureScript.Sugar.Names.Env.ExportMode
+ Language.PureScript.Sugar.Names.Env: primImports :: Imports
+ Language.PureScript.Sugar.Names.Imports: type ImportDef = (Maybe SourceSpan, ImportDeclarationType, Maybe ModuleName)
+ Language.PureScript.Sugar.Operators: checkFixityExports :: forall m. MonadError MultipleErrors m => Module -> m Module
+ Language.PureScript.Sugar.Operators: desugarSignedLiterals :: Module -> Module
+ Language.PureScript.Types: Constraint :: Qualified (ProperName ClassName) -> [Type] -> Maybe ConstraintData -> Constraint
+ Language.PureScript.Types: PartialConstraintData :: [[String]] -> Bool -> ConstraintData
+ Language.PureScript.Types: TypeLevelString :: String -> Type
+ Language.PureScript.Types: [constraintArgs] :: Constraint -> [Type]
+ Language.PureScript.Types: [constraintClass] :: Constraint -> Qualified (ProperName ClassName)
+ Language.PureScript.Types: [constraintData] :: Constraint -> Maybe ConstraintData
+ Language.PureScript.Types: data Constraint
+ Language.PureScript.Types: data ConstraintData
+ Language.PureScript.Types: instance Data.Aeson.Types.Class.FromJSON Language.PureScript.Types.Constraint
+ Language.PureScript.Types: instance Data.Aeson.Types.Class.FromJSON Language.PureScript.Types.ConstraintData
+ Language.PureScript.Types: instance Data.Aeson.Types.Class.ToJSON Language.PureScript.Types.Constraint
+ Language.PureScript.Types: instance Data.Aeson.Types.Class.ToJSON Language.PureScript.Types.ConstraintData
+ Language.PureScript.Types: instance GHC.Classes.Eq Language.PureScript.Types.Constraint
+ Language.PureScript.Types: instance GHC.Classes.Eq Language.PureScript.Types.ConstraintData
+ Language.PureScript.Types: instance GHC.Classes.Ord Language.PureScript.Types.Constraint
+ Language.PureScript.Types: instance GHC.Classes.Ord Language.PureScript.Types.ConstraintData
+ Language.PureScript.Types: instance GHC.Read.Read Language.PureScript.Types.Constraint
+ Language.PureScript.Types: instance GHC.Read.Read Language.PureScript.Types.ConstraintData
+ Language.PureScript.Types: instance GHC.Show.Show Language.PureScript.Types.Constraint
+ Language.PureScript.Types: instance GHC.Show.Show Language.PureScript.Types.ConstraintData
+ Language.PureScript.Types: mapConstraintArgs :: ([Type] -> [Type]) -> Constraint -> Constraint
+ Language.PureScript.Types: overConstraintArgs :: Functor f => ([Type] -> f [Type]) -> Constraint -> f Constraint
- Control.Monad.Supply.Class: class (Monad m) => MonadSupply m
+ Control.Monad.Supply.Class: class Monad m => MonadSupply m
- Control.Monad.Supply.Class: freshName :: (MonadSupply m) => m String
+ Control.Monad.Supply.Class: freshName :: MonadSupply m => m String
- Language.PureScript.AST.Binders: OpBinder :: (Qualified Ident) -> Binder
+ Language.PureScript.AST.Binders: OpBinder :: (Qualified (OpName ValueOpName)) -> Binder
- Language.PureScript.AST.Declarations: FixityDeclaration :: Fixity -> String -> (Maybe (Qualified FixityAlias)) -> Declaration
+ Language.PureScript.AST.Declarations: FixityDeclaration :: (Either ValueFixity TypeFixity) -> Declaration
- Language.PureScript.AST.Declarations: ImportDeclaration :: ModuleName -> ImportDeclarationType -> (Maybe ModuleName) -> Bool -> Declaration
+ Language.PureScript.AST.Declarations: ImportDeclaration :: ModuleName -> ImportDeclarationType -> (Maybe ModuleName) -> Declaration
- Language.PureScript.AST.Declarations: TypeOpRef :: Ident -> DeclarationRef
+ Language.PureScript.AST.Declarations: TypeOpRef :: (OpName TypeOpName) -> DeclarationRef
- Language.PureScript.AST.Traversals: everythingOnValues :: (r -> r -> r) -> (Declaration -> r) -> (Expr -> r) -> (Binder -> r) -> (CaseAlternative -> r) -> (DoNotationElement -> r) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r)
+ Language.PureScript.AST.Traversals: everythingOnValues :: forall r. (r -> r -> r) -> (Declaration -> r) -> (Expr -> r) -> (Binder -> r) -> (CaseAlternative -> r) -> (DoNotationElement -> r) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r)
- Language.PureScript.AST.Traversals: everythingWithContextOnValues :: s -> r -> (r -> r -> r) -> (s -> Declaration -> (s, r)) -> (s -> Expr -> (s, r)) -> (s -> Binder -> (s, r)) -> (s -> CaseAlternative -> (s, r)) -> (s -> DoNotationElement -> (s, r)) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r)
+ Language.PureScript.AST.Traversals: everythingWithContextOnValues :: forall s r. s -> r -> (r -> r -> r) -> (s -> Declaration -> (s, r)) -> (s -> Expr -> (s, r)) -> (s -> Binder -> (s, r)) -> (s -> CaseAlternative -> (s, r)) -> (s -> DoNotationElement -> (s, r)) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r)
- Language.PureScript.AST.Traversals: everythingWithScope :: (Monoid r) => (Set Ident -> Declaration -> r) -> (Set Ident -> Expr -> r) -> (Set Ident -> Binder -> r) -> (Set Ident -> CaseAlternative -> r) -> (Set Ident -> DoNotationElement -> r) -> (Set Ident -> Declaration -> r, Set Ident -> Expr -> r, Set Ident -> Binder -> r, Set Ident -> CaseAlternative -> r, Set Ident -> DoNotationElement -> r)
+ Language.PureScript.AST.Traversals: everythingWithScope :: forall r. (Monoid r) => (Set Ident -> Declaration -> r) -> (Set Ident -> Expr -> r) -> (Set Ident -> Binder -> r) -> (Set Ident -> CaseAlternative -> r) -> (Set Ident -> DoNotationElement -> r) -> (Set Ident -> Declaration -> r, Set Ident -> Expr -> r, Set Ident -> Binder -> r, Set Ident -> CaseAlternative -> r, Set Ident -> DoNotationElement -> r)
- Language.PureScript.AST.Traversals: everywhereOnValuesM :: (Monad m) => (Declaration -> m Declaration) -> (Expr -> m Expr) -> (Binder -> m Binder) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder)
+ Language.PureScript.AST.Traversals: everywhereOnValuesM :: forall m. (Monad m) => (Declaration -> m Declaration) -> (Expr -> m Expr) -> (Binder -> m Binder) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder)
- Language.PureScript.AST.Traversals: everywhereOnValuesTopDownM :: (Monad m) => (Declaration -> m Declaration) -> (Expr -> m Expr) -> (Binder -> m Binder) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder)
+ Language.PureScript.AST.Traversals: everywhereOnValuesTopDownM :: forall m. (Monad m) => (Declaration -> m Declaration) -> (Expr -> m Expr) -> (Binder -> m Binder) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder)
- Language.PureScript.AST.Traversals: everywhereWithContextOnValuesM :: (Monad m) => s -> (s -> Declaration -> m (s, Declaration)) -> (s -> Expr -> m (s, Expr)) -> (s -> Binder -> m (s, Binder)) -> (s -> CaseAlternative -> m (s, CaseAlternative)) -> (s -> DoNotationElement -> m (s, DoNotationElement)) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder, CaseAlternative -> m CaseAlternative, DoNotationElement -> m DoNotationElement)
+ Language.PureScript.AST.Traversals: everywhereWithContextOnValuesM :: forall m s. (Monad m) => s -> (s -> Declaration -> m (s, Declaration)) -> (s -> Expr -> m (s, Expr)) -> (s -> Binder -> m (s, Binder)) -> (s -> CaseAlternative -> m (s, CaseAlternative)) -> (s -> DoNotationElement -> m (s, DoNotationElement)) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder, CaseAlternative -> m CaseAlternative, DoNotationElement -> m DoNotationElement)
- Language.PureScript.Bundle: bundle :: (MonadError ErrorMessage m) => [(ModuleIdentifier, String)] -> [ModuleIdentifier] -> Maybe String -> String -> Maybe FilePath -> m String
+ Language.PureScript.Bundle: bundle :: (MonadError ErrorMessage m) => [(ModuleIdentifier, String)] -> [ModuleIdentifier] -> Maybe String -> String -> m String
- Language.PureScript.CodeGen.JS: moduleToJs :: (Monad m, MonadReader Options m, MonadSupply m, MonadError MultipleErrors m) => Module Ann -> Maybe JS -> m [JS]
+ Language.PureScript.CodeGen.JS: moduleToJs :: forall m. (Monad m, MonadReader Options m, MonadSupply m, MonadError MultipleErrors m) => Module Ann -> Maybe JS -> m [JS]
- Language.PureScript.Docs.Types: AliasDeclaration :: (Qualified FixityAlias) -> Fixity -> DeclarationInfo
+ Language.PureScript.Docs.Types: AliasDeclaration :: Fixity -> FixityAlias -> DeclarationInfo
- Language.PureScript.Docs.Types: Declaration :: String -> Maybe String -> Maybe SourceSpan -> [ChildDeclaration] -> Maybe Fixity -> DeclarationInfo -> Declaration
+ Language.PureScript.Docs.Types: Declaration :: String -> Maybe String -> Maybe SourceSpan -> [ChildDeclaration] -> DeclarationInfo -> Declaration
- Language.PureScript.Errors: DuplicateExportRef :: String -> SimpleErrorMessage
+ Language.PureScript.Errors: DuplicateExportRef :: Name -> SimpleErrorMessage
- Language.PureScript.Errors: DuplicateImportRef :: String -> SimpleErrorMessage
+ Language.PureScript.Errors: DuplicateImportRef :: Name -> SimpleErrorMessage
- Language.PureScript.Errors: HoleInferredType :: String -> Type -> SimpleErrorMessage
+ Language.PureScript.Errors: HoleInferredType :: String -> Type -> [(Ident, Type)] -> SimpleErrorMessage
- Language.PureScript.Errors: InvalidOperatorInBinder :: Ident -> Ident -> SimpleErrorMessage
+ Language.PureScript.Errors: InvalidOperatorInBinder :: (Qualified (OpName ValueOpName)) -> (Qualified Ident) -> SimpleErrorMessage
- Language.PureScript.Errors: NoInstanceFound :: (Qualified (ProperName ClassName)) -> [Type] -> SimpleErrorMessage
+ Language.PureScript.Errors: NoInstanceFound :: Constraint -> SimpleErrorMessage
- Language.PureScript.Errors: ScopeConflict :: String -> [ModuleName] -> SimpleErrorMessage
+ Language.PureScript.Errors: ScopeConflict :: Name -> [ModuleName] -> SimpleErrorMessage
- Language.PureScript.Errors: ScopeShadowing :: String -> (Maybe ModuleName) -> [ModuleName] -> SimpleErrorMessage
+ Language.PureScript.Errors: ScopeShadowing :: Name -> (Maybe ModuleName) -> [ModuleName] -> SimpleErrorMessage
- Language.PureScript.Errors: TypeMap :: Map Int (String, Int, Maybe SourceSpan) -> Int -> Map Int Int -> Int -> TypeMap
+ Language.PureScript.Errors: TypeMap :: Map Int (String, Int, Maybe SourceSpan) -> Map Int Int -> Int -> TypeMap
- Language.PureScript.Errors: prettyPrintMultipleErrors :: Bool -> MultipleErrors -> String
+ Language.PureScript.Errors: prettyPrintMultipleErrors :: PPEOptions -> MultipleErrors -> String
- Language.PureScript.Errors: prettyPrintMultipleErrorsBox :: Bool -> MultipleErrors -> [Box]
+ Language.PureScript.Errors: prettyPrintMultipleErrorsBox :: PPEOptions -> MultipleErrors -> [Box]
- Language.PureScript.Errors: prettyPrintMultipleErrorsWith :: Level -> String -> String -> Bool -> MultipleErrors -> [Box]
+ Language.PureScript.Errors: prettyPrintMultipleErrorsWith :: PPEOptions -> String -> String -> MultipleErrors -> [Box]
- Language.PureScript.Errors: prettyPrintMultipleWarnings :: Bool -> MultipleErrors -> String
+ Language.PureScript.Errors: prettyPrintMultipleWarnings :: PPEOptions -> MultipleErrors -> String
- Language.PureScript.Errors: prettyPrintMultipleWarningsBox :: Bool -> MultipleErrors -> [Box]
+ Language.PureScript.Errors: prettyPrintMultipleWarningsBox :: PPEOptions -> MultipleErrors -> [Box]
- Language.PureScript.Errors: prettyPrintSingleError :: Bool -> Level -> Bool -> ErrorMessage -> Box
+ Language.PureScript.Errors: prettyPrintSingleError :: PPEOptions -> ErrorMessage -> Box
- Language.PureScript.Errors.JSON: ErrorSuggestion :: String -> ErrorSuggestion
+ Language.PureScript.Errors.JSON: ErrorSuggestion :: String -> Maybe ErrorPosition -> ErrorSuggestion
- Language.PureScript.Externs: ExternsFile :: String -> ModuleName -> [DeclarationRef] -> [ExternsImport] -> [ExternsFixity] -> [ExternsDeclaration] -> ExternsFile
+ Language.PureScript.Externs: ExternsFile :: String -> ModuleName -> [DeclarationRef] -> [ExternsImport] -> [ExternsFixity] -> [ExternsTypeFixity] -> [ExternsDeclaration] -> ExternsFile
- Language.PureScript.Externs: ExternsFixity :: Associativity -> Precedence -> String -> Maybe (Qualified FixityAlias) -> ExternsFixity
+ Language.PureScript.Externs: ExternsFixity :: Associativity -> Precedence -> OpName ValueOpName -> Qualified (Either Ident (ProperName ConstructorName)) -> ExternsFixity
- Language.PureScript.Externs: [efAlias] :: ExternsFixity -> Maybe (Qualified FixityAlias)
+ Language.PureScript.Externs: [efAlias] :: ExternsFixity -> Qualified (Either Ident (ProperName ConstructorName))
- Language.PureScript.Externs: [efOperator] :: ExternsFixity -> String
+ Language.PureScript.Externs: [efOperator] :: ExternsFixity -> OpName ValueOpName
- Language.PureScript.Ide.Command: Complete :: [Filter] -> Matcher -> Command
+ Language.PureScript.Ide.Command: Complete :: [Filter] -> Matcher -> Maybe ModuleName -> Command
- Language.PureScript.Ide.Command: Type :: DeclIdent -> [Filter] -> Command
+ Language.PureScript.Ide.Command: Type :: DeclIdent -> [Filter] -> Maybe ModuleName -> Command
- Language.PureScript.Ide.State: getAllModulesWithReexports :: (PscIde m, MonadLogger m) => m [Module]
+ Language.PureScript.Ide.State: getAllModulesWithReexports :: (PscIde m) => m [Module]
- Language.PureScript.Ide.State: getModuleWithReexports :: (PscIde m, MonadLogger m) => ModuleIdent -> m (Maybe Module)
+ Language.PureScript.Ide.State: getModuleWithReexports :: PscIde m => ModuleIdent -> m (Maybe Module)
- Language.PureScript.Ide.State: getPscIdeState :: (PscIde m) => m (Map ModuleIdent [ExternDecl])
+ Language.PureScript.Ide.State: getPscIdeState :: PscIde m => m PscIdeState
- Language.PureScript.Ide.Types: PscIdeState :: Map Text [ExternDecl] -> Map ModuleName ExternsFile -> PscIdeState
+ Language.PureScript.Ide.Types: PscIdeState :: Map Text [ExternDecl] -> Map ModuleName ExternsFile -> Maybe (ModuleName, ExternsFile) -> PscIdeState
- Language.PureScript.Ide.Watcher: reloadFile :: TVar PscIdeState -> FilePath -> IO ()
+ Language.PureScript.Ide.Watcher: reloadFile :: TVar PscIdeState -> Event -> IO ()
- Language.PureScript.Linter: lint :: (MonadWriter MultipleErrors m) => Module -> m ()
+ Language.PureScript.Linter: lint :: forall m. (MonadWriter MultipleErrors m) => Module -> m ()
- Language.PureScript.Linter.Imports: DctorName :: (Qualified (ProperName ConstructorName)) -> Name
+ Language.PureScript.Linter.Imports: DctorName :: (ProperName ConstructorName) -> Name
- Language.PureScript.Linter.Imports: IdentName :: (Qualified Ident) -> Name
+ Language.PureScript.Linter.Imports: IdentName :: Ident -> Name
- Language.PureScript.Linter.Imports: TyClassName :: (Qualified (ProperName ClassName)) -> Name
+ Language.PureScript.Linter.Imports: TyClassName :: (ProperName ClassName) -> Name
- Language.PureScript.Linter.Imports: TyName :: (Qualified (ProperName TypeName)) -> Name
+ Language.PureScript.Linter.Imports: TyName :: (ProperName TypeName) -> Name
- Language.PureScript.Linter.Imports: TyOpName :: (Qualified Ident) -> Name
+ Language.PureScript.Linter.Imports: TyOpName :: (OpName TypeOpName) -> Name
- Language.PureScript.Linter.Imports: lintImports :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Module -> Env -> UsedImports -> m ()
+ Language.PureScript.Linter.Imports: lintImports :: forall m. MonadWriter MultipleErrors m => Module -> Env -> UsedImports -> m ()
- Language.PureScript.Linter.Imports: type UsedImports = Map ModuleName [Name]
+ Language.PureScript.Linter.Imports: type UsedImports = Map ModuleName [Qualified Name]
- Language.PureScript.Make: make :: (Monad m, MonadBaseControl IO m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [Module] -> m Environment
+ Language.PureScript.Make: make :: forall m. (Monad m, MonadBaseControl IO m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [Module] -> m [ExternsFile]
- Language.PureScript.Make: rebuildModule :: (Monad m, MonadBaseControl IO m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [ExternsFile] -> Module -> m ExternsFile
+ Language.PureScript.Make: rebuildModule :: forall m. (Monad m, MonadBaseControl IO m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [ExternsFile] -> Module -> m ExternsFile
- Language.PureScript.Names: freshIdent :: (MonadSupply m) => String -> m Ident
+ Language.PureScript.Names: freshIdent :: MonadSupply m => String -> m Ident
- Language.PureScript.Names: freshIdent' :: (MonadSupply m) => m Ident
+ Language.PureScript.Names: freshIdent' :: MonadSupply m => m Ident
- Language.PureScript.Options: Options :: Bool -> Bool -> Maybe String -> Bool -> Bool -> Bool -> Maybe FilePath -> Bool -> Options
+ Language.PureScript.Options: Options :: Bool -> Bool -> Maybe String -> Bool -> Bool -> Bool -> Bool -> Options
- Language.PureScript.Parser.Declarations: parseImportDeclaration' :: TokenParser (ModuleName, ImportDeclarationType, Maybe ModuleName, Bool)
+ Language.PureScript.Parser.Declarations: parseImportDeclaration' :: TokenParser (ModuleName, ImportDeclarationType, Maybe ModuleName)
- Language.PureScript.Parser.Declarations: parseModulesFromFiles :: (MonadError MultipleErrors m) => (k -> FilePath) -> [(k, String)] -> m [(k, Module)]
+ Language.PureScript.Parser.Declarations: parseModulesFromFiles :: forall m k. MonadError MultipleErrors m => (k -> FilePath) -> [(k, String)] -> m [(k, Module)]
- Language.PureScript.Parser.Lexer: PositionedToken :: SourcePos -> Token -> [Comment] -> PositionedToken
+ Language.PureScript.Parser.Lexer: PositionedToken :: SourcePos -> SourcePos -> Maybe SourcePos -> Token -> [Comment] -> PositionedToken
- Language.PureScript.Sugar.BindingGroups: createBindingGroups :: (MonadError MultipleErrors m) => ModuleName -> [Declaration] -> m [Declaration]
+ Language.PureScript.Sugar.BindingGroups: createBindingGroups :: forall m. (MonadError MultipleErrors m) => ModuleName -> [Declaration] -> m [Declaration]
- Language.PureScript.Sugar.BindingGroups: createBindingGroupsModule :: (MonadError MultipleErrors m) => [Module] -> m [Module]
+ Language.PureScript.Sugar.BindingGroups: createBindingGroupsModule :: (MonadError MultipleErrors m) => Module -> m Module
- Language.PureScript.Sugar.CaseDeclarations: desugarCases :: (MonadSupply m, MonadError MultipleErrors m) => [Declaration] -> m [Declaration]
+ Language.PureScript.Sugar.CaseDeclarations: desugarCases :: forall m. (MonadSupply m, MonadError MultipleErrors m) => [Declaration] -> m [Declaration]
- Language.PureScript.Sugar.CaseDeclarations: desugarCasesModule :: (MonadSupply m, MonadError MultipleErrors m) => [Module] -> m [Module]
+ Language.PureScript.Sugar.CaseDeclarations: desugarCasesModule :: (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
- Language.PureScript.Sugar.DoNotation: desugarDoModule :: (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
+ Language.PureScript.Sugar.DoNotation: desugarDoModule :: forall m. (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
- Language.PureScript.Sugar.Names: Exports :: [((ProperName TypeName, [ProperName ConstructorName]), ModuleName)] -> [(Ident, ModuleName)] -> [(ProperName ClassName, ModuleName)] -> [(Ident, ModuleName)] -> Exports
+ Language.PureScript.Sugar.Names: Exports :: Map (ProperName TypeName) ([ProperName ConstructorName], ModuleName) -> Map (OpName TypeOpName) ModuleName -> Map (ProperName ClassName) ModuleName -> Map Ident ModuleName -> Map (OpName ValueOpName) ModuleName -> Exports
- Language.PureScript.Sugar.Names: Imports :: Map (Qualified (ProperName TypeName)) [ImportRecord (ProperName TypeName)] -> Map (Qualified Ident) [ImportRecord Ident] -> Map (Qualified (ProperName ConstructorName)) [ImportRecord (ProperName ConstructorName)] -> Map (Qualified (ProperName ClassName)) [ImportRecord (ProperName ClassName)] -> Map (Qualified Ident) [ImportRecord Ident] -> Set ModuleName -> Set ModuleName -> Imports
+ Language.PureScript.Sugar.Names: Imports :: ImportMap (ProperName TypeName) -> ImportMap (OpName TypeOpName) -> ImportMap (ProperName ConstructorName) -> ImportMap (ProperName ClassName) -> ImportMap Ident -> ImportMap (OpName ValueOpName) -> Set ModuleName -> Set ModuleName -> Imports
- Language.PureScript.Sugar.Names: [exportedTypeClasses] :: Exports -> [(ProperName ClassName, ModuleName)]
+ Language.PureScript.Sugar.Names: [exportedTypeClasses] :: Exports -> Map (ProperName ClassName) ModuleName
- Language.PureScript.Sugar.Names: [exportedTypeOps] :: Exports -> [(Ident, ModuleName)]
+ Language.PureScript.Sugar.Names: [exportedTypeOps] :: Exports -> Map (OpName TypeOpName) ModuleName
- Language.PureScript.Sugar.Names: [exportedTypes] :: Exports -> [((ProperName TypeName, [ProperName ConstructorName]), ModuleName)]
+ Language.PureScript.Sugar.Names: [exportedTypes] :: Exports -> Map (ProperName TypeName) ([ProperName ConstructorName], ModuleName)
- Language.PureScript.Sugar.Names: [exportedValues] :: Exports -> [(Ident, ModuleName)]
+ Language.PureScript.Sugar.Names: [exportedValues] :: Exports -> Map Ident ModuleName
- Language.PureScript.Sugar.Names: [importedDataConstructors] :: Imports -> Map (Qualified (ProperName ConstructorName)) [ImportRecord (ProperName ConstructorName)]
+ Language.PureScript.Sugar.Names: [importedDataConstructors] :: Imports -> ImportMap (ProperName ConstructorName)
- Language.PureScript.Sugar.Names: [importedTypeClasses] :: Imports -> Map (Qualified (ProperName ClassName)) [ImportRecord (ProperName ClassName)]
+ Language.PureScript.Sugar.Names: [importedTypeClasses] :: Imports -> ImportMap (ProperName ClassName)
- Language.PureScript.Sugar.Names: [importedTypeOps] :: Imports -> Map (Qualified Ident) [ImportRecord Ident]
+ Language.PureScript.Sugar.Names: [importedTypeOps] :: Imports -> ImportMap (OpName TypeOpName)
- Language.PureScript.Sugar.Names: [importedTypes] :: Imports -> Map (Qualified (ProperName TypeName)) [ImportRecord (ProperName TypeName)]
+ Language.PureScript.Sugar.Names: [importedTypes] :: Imports -> ImportMap (ProperName TypeName)
- Language.PureScript.Sugar.Names: [importedValues] :: Imports -> Map (Qualified Ident) [ImportRecord Ident]
+ Language.PureScript.Sugar.Names: [importedValues] :: Imports -> ImportMap Ident
- Language.PureScript.Sugar.Names: desugarImports :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [ExternsFile] -> [Module] -> m [Module]
+ Language.PureScript.Sugar.Names: desugarImports :: forall m. (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [ExternsFile] -> [Module] -> m [Module]
- Language.PureScript.Sugar.Names: desugarImportsWithEnv :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [ExternsFile] -> [Module] -> m (Env, [Module])
+ Language.PureScript.Sugar.Names: desugarImportsWithEnv :: forall m. (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [ExternsFile] -> [Module] -> m (Env, [Module])
- Language.PureScript.Sugar.Names.Env: Exports :: [((ProperName TypeName, [ProperName ConstructorName]), ModuleName)] -> [(Ident, ModuleName)] -> [(ProperName ClassName, ModuleName)] -> [(Ident, ModuleName)] -> Exports
+ Language.PureScript.Sugar.Names.Env: Exports :: Map (ProperName TypeName) ([ProperName ConstructorName], ModuleName) -> Map (OpName TypeOpName) ModuleName -> Map (ProperName ClassName) ModuleName -> Map Ident ModuleName -> Map (OpName ValueOpName) ModuleName -> Exports
- Language.PureScript.Sugar.Names.Env: Imports :: Map (Qualified (ProperName TypeName)) [ImportRecord (ProperName TypeName)] -> Map (Qualified Ident) [ImportRecord Ident] -> Map (Qualified (ProperName ConstructorName)) [ImportRecord (ProperName ConstructorName)] -> Map (Qualified (ProperName ClassName)) [ImportRecord (ProperName ClassName)] -> Map (Qualified Ident) [ImportRecord Ident] -> Set ModuleName -> Set ModuleName -> Imports
+ Language.PureScript.Sugar.Names.Env: Imports :: ImportMap (ProperName TypeName) -> ImportMap (OpName TypeOpName) -> ImportMap (ProperName ConstructorName) -> ImportMap (ProperName ClassName) -> ImportMap Ident -> ImportMap (OpName ValueOpName) -> Set ModuleName -> Set ModuleName -> Imports
- Language.PureScript.Sugar.Names.Env: [exportedTypeClasses] :: Exports -> [(ProperName ClassName, ModuleName)]
+ Language.PureScript.Sugar.Names.Env: [exportedTypeClasses] :: Exports -> Map (ProperName ClassName) ModuleName
- Language.PureScript.Sugar.Names.Env: [exportedTypeOps] :: Exports -> [(Ident, ModuleName)]
+ Language.PureScript.Sugar.Names.Env: [exportedTypeOps] :: Exports -> Map (OpName TypeOpName) ModuleName
- Language.PureScript.Sugar.Names.Env: [exportedTypes] :: Exports -> [((ProperName TypeName, [ProperName ConstructorName]), ModuleName)]
+ Language.PureScript.Sugar.Names.Env: [exportedTypes] :: Exports -> Map (ProperName TypeName) ([ProperName ConstructorName], ModuleName)
- Language.PureScript.Sugar.Names.Env: [exportedValues] :: Exports -> [(Ident, ModuleName)]
+ Language.PureScript.Sugar.Names.Env: [exportedValues] :: Exports -> Map Ident ModuleName
- Language.PureScript.Sugar.Names.Env: [importedDataConstructors] :: Imports -> Map (Qualified (ProperName ConstructorName)) [ImportRecord (ProperName ConstructorName)]
+ Language.PureScript.Sugar.Names.Env: [importedDataConstructors] :: Imports -> ImportMap (ProperName ConstructorName)
- Language.PureScript.Sugar.Names.Env: [importedTypeClasses] :: Imports -> Map (Qualified (ProperName ClassName)) [ImportRecord (ProperName ClassName)]
+ Language.PureScript.Sugar.Names.Env: [importedTypeClasses] :: Imports -> ImportMap (ProperName ClassName)
- Language.PureScript.Sugar.Names.Env: [importedTypeOps] :: Imports -> Map (Qualified Ident) [ImportRecord Ident]
+ Language.PureScript.Sugar.Names.Env: [importedTypeOps] :: Imports -> ImportMap (OpName TypeOpName)
- Language.PureScript.Sugar.Names.Env: [importedTypes] :: Imports -> Map (Qualified (ProperName TypeName)) [ImportRecord (ProperName TypeName)]
+ Language.PureScript.Sugar.Names.Env: [importedTypes] :: Imports -> ImportMap (ProperName TypeName)
- Language.PureScript.Sugar.Names.Env: [importedValues] :: Imports -> Map (Qualified Ident) [ImportRecord Ident]
+ Language.PureScript.Sugar.Names.Env: [importedValues] :: Imports -> ImportMap Ident
- Language.PureScript.Sugar.Names.Env: checkImportConflicts :: (Show a, MonadError MultipleErrors m, MonadWriter MultipleErrors m, Ord a) => ModuleName -> (a -> String) -> [ImportRecord a] -> m (ModuleName, ModuleName)
+ Language.PureScript.Sugar.Names.Env: checkImportConflicts :: forall m a. (Show a, MonadError MultipleErrors m, MonadWriter MultipleErrors m, Ord a) => ModuleName -> (a -> Name) -> [ImportRecord a] -> m (ModuleName, ModuleName)
- Language.PureScript.Sugar.Names.Env: exportType :: (MonadError MultipleErrors m) => Exports -> ProperName TypeName -> [ProperName ConstructorName] -> ModuleName -> m Exports
+ Language.PureScript.Sugar.Names.Env: exportType :: MonadError MultipleErrors m => ExportMode -> Exports -> ProperName TypeName -> [ProperName ConstructorName] -> ModuleName -> m Exports
- Language.PureScript.Sugar.Names.Env: exportTypeClass :: (MonadError MultipleErrors m) => Exports -> ProperName ClassName -> ModuleName -> m Exports
+ Language.PureScript.Sugar.Names.Env: exportTypeClass :: MonadError MultipleErrors m => ExportMode -> Exports -> ProperName ClassName -> ModuleName -> m Exports
- Language.PureScript.Sugar.Names.Env: exportTypeOp :: (MonadError MultipleErrors m) => Exports -> Ident -> ModuleName -> m Exports
+ Language.PureScript.Sugar.Names.Env: exportTypeOp :: MonadError MultipleErrors m => Exports -> OpName TypeOpName -> ModuleName -> m Exports
- Language.PureScript.Sugar.Names.Env: exportValue :: (MonadError MultipleErrors m) => Exports -> Ident -> ModuleName -> m Exports
+ Language.PureScript.Sugar.Names.Env: exportValue :: MonadError MultipleErrors m => Exports -> Ident -> ModuleName -> m Exports
- Language.PureScript.Sugar.Names.Env: getExports :: (MonadError MultipleErrors m) => Env -> ModuleName -> m Exports
+ Language.PureScript.Sugar.Names.Env: getExports :: MonadError MultipleErrors m => Env -> ModuleName -> m Exports
- Language.PureScript.Sugar.Names.Exports: findExportable :: (MonadError MultipleErrors m) => Module -> m Exports
+ Language.PureScript.Sugar.Names.Exports: findExportable :: forall m. (MonadError MultipleErrors m) => Module -> m Exports
- Language.PureScript.Sugar.Names.Exports: resolveExports :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Env -> ModuleName -> Imports -> Exports -> [DeclarationRef] -> m Exports
+ Language.PureScript.Sugar.Names.Exports: resolveExports :: forall m. (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Env -> SourceSpan -> ModuleName -> Imports -> Exports -> [DeclarationRef] -> m Exports
- Language.PureScript.Sugar.Names.Imports: findImports :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [Declaration] -> m (Map ModuleName [(Maybe SourceSpan, ImportDeclarationType, Maybe ModuleName)])
+ Language.PureScript.Sugar.Names.Imports: findImports :: [Declaration] -> Map ModuleName [ImportDef]
- Language.PureScript.Sugar.Names.Imports: resolveImports :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Env -> Module -> m (Module, Imports)
+ Language.PureScript.Sugar.Names.Imports: resolveImports :: forall m. MonadError MultipleErrors m => Env -> Module -> m (Module, Imports)
- Language.PureScript.Sugar.Names.Imports: resolveModuleImport :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Env -> Imports -> (ModuleName, [(Maybe SourceSpan, Maybe ImportDeclarationType, Maybe ModuleName)]) -> m Imports
+ Language.PureScript.Sugar.Names.Imports: resolveModuleImport :: forall m. MonadError MultipleErrors m => Env -> Imports -> (ModuleName, [(Maybe SourceSpan, Maybe ImportDeclarationType, Maybe ModuleName)]) -> m Imports
- Language.PureScript.Sugar.ObjectWildcards: desugarObjectConstructors :: (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
+ Language.PureScript.Sugar.ObjectWildcards: desugarObjectConstructors :: forall m. (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
- Language.PureScript.Sugar.Operators: rebracket :: MonadError MultipleErrors m => [ExternsFile] -> [Module] -> m [Module]
+ Language.PureScript.Sugar.Operators: rebracket :: forall m. MonadError MultipleErrors m => [ExternsFile] -> [Module] -> m [Module]
- Language.PureScript.Sugar.Operators.Binders: matchBinderOperators :: [[(Qualified Ident, Associativity)]] -> Binder -> Binder
+ Language.PureScript.Sugar.Operators.Binders: matchBinderOperators :: [[(Qualified (OpName ValueOpName), Associativity)]] -> Binder -> Binder
- Language.PureScript.Sugar.Operators.Common: matchOp :: (a -> (Maybe (Qualified Ident))) -> Qualified Ident -> Parsec (Chain a) () ()
+ Language.PureScript.Sugar.Operators.Common: matchOp :: (a -> (Maybe (Qualified (OpName nameType)))) -> Qualified (OpName nameType) -> Parsec (Chain a) () ()
- Language.PureScript.Sugar.Operators.Common: matchOperators :: Show a => (a -> Bool) -> (a -> Maybe (a, a, a)) -> (a -> Maybe (Qualified Ident)) -> (Qualified Ident -> a -> a -> a) -> ([[Operator (Chain a) () Identity a]] -> OperatorTable (Chain a) () Identity a) -> [[(Qualified Ident, Associativity)]] -> a -> a
+ Language.PureScript.Sugar.Operators.Common: matchOperators :: forall a nameType. Show a => (a -> Bool) -> (a -> Maybe (a, a, a)) -> (a -> Maybe (Qualified (OpName nameType))) -> (Qualified (OpName nameType) -> a -> a -> a) -> ([[Operator (Chain a) () Identity a]] -> OperatorTable (Chain a) () Identity a) -> [[(Qualified (OpName nameType), Associativity)]] -> a -> a
- Language.PureScript.Sugar.Operators.Common: opTable :: [[(Qualified Ident, Associativity)]] -> (a -> Maybe (Qualified Ident)) -> (Qualified Ident -> a -> a -> a) -> [[Operator (Chain a) () Identity a]]
+ Language.PureScript.Sugar.Operators.Common: opTable :: [[(Qualified (OpName nameType), Associativity)]] -> (a -> Maybe (Qualified (OpName nameType))) -> (Qualified (OpName nameType) -> a -> a -> a) -> [[Operator (Chain a) () Identity a]]
- Language.PureScript.Sugar.Operators.Common: parseOp :: (a -> (Maybe (Qualified Ident))) -> Parsec (Chain a) () (Qualified Ident)
+ Language.PureScript.Sugar.Operators.Common: parseOp :: (a -> (Maybe (Qualified (OpName nameType)))) -> Parsec (Chain a) () (Qualified (OpName nameType))
- Language.PureScript.Sugar.Operators.Expr: matchExprOperators :: [[(Qualified Ident, Associativity)]] -> Expr -> Expr
+ Language.PureScript.Sugar.Operators.Expr: matchExprOperators :: [[(Qualified (OpName ValueOpName), Associativity)]] -> Expr -> Expr
- Language.PureScript.Sugar.Operators.Types: matchTypeOperators :: [[(Qualified Ident, Associativity)]] -> Type -> Type
+ Language.PureScript.Sugar.Operators.Types: matchTypeOperators :: [[(Qualified (OpName TypeOpName), Associativity)]] -> Type -> Type
- Language.PureScript.Sugar.TypeDeclarations: desugarTypeDeclarationsModule :: (MonadError MultipleErrors m) => [Module] -> m [Module]
+ Language.PureScript.Sugar.TypeDeclarations: desugarTypeDeclarationsModule :: forall m. MonadError MultipleErrors m => Module -> m Module
- Language.PureScript.TypeChecker: typeCheckModule :: (MonadSupply m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Module -> m Module
+ Language.PureScript.TypeChecker: typeCheckModule :: forall m. (MonadSupply m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Module -> m Module
- Language.PureScript.TypeChecker.Rows: checkDuplicateLabels :: (MonadError MultipleErrors m, MonadState CheckState m) => Expr -> m ()
+ Language.PureScript.TypeChecker.Rows: checkDuplicateLabels :: forall m. (MonadError MultipleErrors m, MonadState CheckState m) => Expr -> m ()
- Language.PureScript.TypeChecker.Unify: unifyRows :: (MonadError MultipleErrors m, MonadState CheckState m) => Type -> Type -> m ()
+ Language.PureScript.TypeChecker.Unify: unifyRows :: forall m. (MonadError MultipleErrors m, MonadState CheckState m) => Type -> Type -> m ()
- Language.PureScript.Types: TypeOp :: (Qualified Ident) -> Type
+ Language.PureScript.Types: TypeOp :: (Qualified (OpName TypeOpName)) -> Type
- Language.PureScript.Types: TypeWildcard :: Type
+ Language.PureScript.Types: TypeWildcard :: SourceSpan -> Type

This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.

Files

CONTRIBUTORS.md view
@@ -31,6 +31,7 @@ - [@jacereda](https://github.com/jacereda) (Jorge Acereda) My existing contributions and all future contributions until further notice are Copyright Jorge Acereda, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT). - [@japesinator](https://github.com/japesinator) (JP Smith) My existing contributions and all future contributions until further notice are Copyright JP Smith, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT). - [@joneshf](https://github.com/joneshf) (Hardy Jones) - My existing contributions and all future contributions until further notice are Copyright Hardy Jones, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license.+- [@kika](https://github.com/kika) (Kirill Pertsev) - My existing contributions and all future contributions until further notice are Copyright Kirill Pertsev, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license. - [@kRITZCREEK](https://github.com/kRITZCREEK) (Christoph Hegemann) - My existing contributions and all future contributions until further notice are Copyright Christoph Hegemann, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license. - [@L8D](https://github.com/L8D) (Tenor Biel) My existing contributions and all future contributions until further notice are Copyright Tenor Biel, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT). - [@leighman](http://github.com/leighman) (Jack Leigh) My existing contributions and all future contributions until further notice are Copyright Jack Leigh, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).@@ -70,6 +71,7 @@ - [@zudov](https://github.com/zudov) (Konstantin Zudov) My existing contributions and all future contributions until further notice are Copyright Konstantin Zudov, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT). - [@LiamGoodacre](https://github.com/LiamGoodacre) (Liam Goodacre) My existing contributions and all future contributions until further notice are Copyright Liam Goodacre, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT). - [@bsermons](https://github.com/bsermons) (Brian Sermons) My existing contributions and all future contributions until further notice are Copyright Brian Sermons, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).+- [@bmjames](https://github.com/bmjames) (Ben James) My existing contributions and all future contributions until further notice are Copyright Ben James, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).  ### Companies 
examples/docs/src/Clash.purs view
@@ -2,31 +2,3 @@  import Clash1 as Clash1 import Clash2 as Clash2--module Clash1 (module Clash1a) where--import Clash1a--module Clash1a where--value :: Int-value = 0--type Type = Int--class TypeClass a where-  typeClassMember :: a--module Clash2 (module Clash2a) where--import Clash2a--module Clash2a where--value :: String-value = "hello"--type Type = String--class TypeClass a b where-  typeClassMember :: a -> b
+ examples/docs/src/Clash1.purs view
@@ -0,0 +1,3 @@+module Clash1 (module Clash1a) where++import Clash1a
+ examples/docs/src/Clash1a.purs view
@@ -0,0 +1,9 @@+module Clash1a where++value :: Int+value = 0++type Type = Int++class TypeClass a where+  typeClassMember :: a
+ examples/docs/src/Clash2.purs view
@@ -0,0 +1,3 @@+module Clash2 (module Clash2a) where++import Clash2a
+ examples/docs/src/Clash2a.purs view
@@ -0,0 +1,9 @@+module Clash2a where++value :: String+value = "hello"++type Type = String++class TypeClass a b where+  typeClassMember :: a -> b
examples/docs/src/ImportedTwice.purs view
@@ -4,24 +4,10 @@ -- re-exports it from Control.Monad.Trans).  module ImportedTwice-  ( module A-  , module B+  ( module ImportedTwiceA+  , module ImportedTwiceB   )   where -import A-import B--module A-  ( module B )-  where--import B--bar :: Int-bar = 1--module B where--foo :: Int-foo = 0+import ImportedTwiceA+import ImportedTwiceB
+ examples/docs/src/ImportedTwiceA.purs view
@@ -0,0 +1,8 @@+module ImportedTwiceA+  ( module ImportedTwiceB )+  where++import ImportedTwiceB++bar :: Int+bar = 1
+ examples/docs/src/ImportedTwiceB.purs view
@@ -0,0 +1,4 @@+module ImportedTwiceB where++foo :: Int+foo = 0
examples/docs/src/MultiVirtual.purs view
@@ -4,24 +4,3 @@  import MultiVirtual1 as X import MultiVirtual2 as X---module MultiVirtual1 where--foo :: Int-foo = 1--module MultiVirtual2 -  ( module MultiVirtual2-  , module MultiVirtual3-  ) where--import MultiVirtual3--bar :: Int-bar = 2--module MultiVirtual3 where--baz :: Int-baz = 3
+ examples/docs/src/MultiVirtual1.purs view
@@ -0,0 +1,4 @@+module MultiVirtual1 where++foo :: Int+foo = 1
+ examples/docs/src/MultiVirtual2.purs view
@@ -0,0 +1,9 @@+module MultiVirtual2+  ( module MultiVirtual2+  , module MultiVirtual3+  ) where++import MultiVirtual3++bar :: Int+bar = 2
+ examples/docs/src/MultiVirtual3.purs view
@@ -0,0 +1,4 @@+module MultiVirtual3 where++baz :: Int+baz = 3
examples/docs/src/NewOperators.purs view
@@ -3,10 +3,3 @@   where  import NewOperators2--module NewOperators2 where--infixl 8 _compose as >>>--_compose :: forall a b c. (b -> c) -> (a -> b) -> (a -> c)-_compose f g x = f (g x)
+ examples/docs/src/NewOperators2.purs view
@@ -0,0 +1,6 @@+module NewOperators2 where++infixl 8 _compose as >>>++_compose :: forall a b c. (b -> c) -> (a -> b) -> (a -> c)+_compose f g x = f (g x)
− examples/docs/src/OldOperators.purs
@@ -1,10 +0,0 @@---- Remove this after 0.9.-module OldOperators (module OldOperators2) where--import OldOperators2--module OldOperators2 where--(>>) :: forall a. a -> a -> a-(>>) a b = b
examples/docs/src/TypeClassWithoutMembers.purs view
@@ -1,11 +1,5 @@ module TypeClassWithoutMembers-  ( module Intermediate )-  where--import Intermediate--module Intermediate-  ( module SomeTypeClass )+  ( module TypeClassWithoutMembersIntermediate )   where -import SomeTypeClass (SomeClass)+import TypeClassWithoutMembersIntermediate
+ examples/docs/src/TypeClassWithoutMembersIntermediate.purs view
@@ -0,0 +1,5 @@+module TypeClassWithoutMembersIntermediate+  ( module SomeTypeClass )+  where++import SomeTypeClass (class SomeClass)
examples/failing/1733.purs view
@@ -1,13 +1,6 @@--- @shouldFailWith UnknownValue-+-- @shouldFailWith UnknownName module Main where  import Thingy as Thing  main = Thing.doesntExist "hi"--module Thingy where--foo :: Int-foo = 1-
+ examples/failing/1733/Thingy.purs view
@@ -0,0 +1,4 @@+module Thingy where++foo :: Int+foo = 1
examples/failing/1825.purs view
@@ -1,9 +1,9 @@--- @shouldFailWith UnknownValue+-- @shouldFailWith UnknownName  module Main where  data W = X | Y | Z -bad X a = a -bad Y _ = a -bad Z a = a +bad X a = a+bad Y _ = a+bad Z a = a
+ examples/failing/1881.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith ErrorParsingModule+module Main where++foo =+bar :: Int+bar = 3
+ examples/failing/2128-class.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ErrorParsingModule+module Main where++class Foo a where+  foo :: a -> !!!
+ examples/failing/2128-instance.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith ErrorParsingModule+module Main where++class Foo a where+  foo :: a++instance fooInt :: Foo Int where+  foo = !!!
+ examples/failing/ArgLengthMismatch.purs view
@@ -0,0 +1,7 @@+-- @shouldFailWith ArgListLengthsDiffer
+module ArgLengthMismatch where
+
+import Prelude
+
+f x y = true
+f = false
examples/failing/Arrays.purs view
@@ -1,8 +1,6 @@ -- @shouldFailWith TypesDoNotUnify module Main where -import Prelude--foreign import (!!) :: forall a. Array a -> Int -> a+foreign import ix :: forall a. Array a -> Int -> a -test = \arr -> arr !! (0 !! 0)+test = \arr -> arr `ix` (0 `ix` 0)
examples/failing/ConflictingExports.purs view
@@ -1,14 +1,4 @@ -- @shouldFailWith ScopeConflict-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2- -- Fails here because re-exporting forces any scope conflicts to be resolved module Main (module A, module B) where 
+ examples/failing/ConflictingExports/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/failing/ConflictingExports/B.purs view
@@ -0,0 +1,4 @@+module B where++thing :: Int+thing = 2
examples/failing/ConflictingImports.purs view
@@ -1,19 +1,9 @@ -- @shouldFailWith ScopeConflict-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2- module Main where -  import A-  import B+import A+import B -  -- Error due to referencing `thing` which is in scope as A.thing and B.thing-  what :: Int-  what = thing+-- Error due to referencing `thing` which is in scope as A.thing and B.thing+what :: Int+what = thing
+ examples/failing/ConflictingImports/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/failing/ConflictingImports/B.purs view
@@ -0,0 +1,4 @@+module B where++thing :: Int+thing = 2
examples/failing/ConflictingImports2.purs view
@@ -1,20 +1,10 @@ -- @shouldFailWith ScopeConflict-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2- module Main where -  import A (thing)-  import B (thing)+import A (thing)+import B (thing) -  -- Error due to referencing `thing` which is explicitly in scope as A.thing-  -- and B.thing-  what :: Int-  what = thing+-- Error due to referencing `thing` which is explicitly in scope as A.thing+-- and B.thing+what :: Int+what = thing
+ examples/failing/ConflictingImports2/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/failing/ConflictingImports2/B.purs view
@@ -0,0 +1,4 @@+module B where++thing :: Int+thing = 2
examples/failing/ConflictingQualifiedImports.purs view
@@ -1,17 +1,7 @@ -- @shouldFailWith ScopeConflict-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2- module Main where -  import A as X-  import B as X+import A as X+import B as X -  foo = X.thing+foo = X.thing
+ examples/failing/ConflictingQualifiedImports/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/failing/ConflictingQualifiedImports/B.purs view
@@ -0,0 +1,4 @@+module B where++thing :: Int+thing = 2
examples/failing/ConflictingQualifiedImports2.purs view
@@ -1,15 +1,5 @@ -- @shouldFailWith ScopeConflict-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2- module Main (module X) where -  import A as X-  import B as X+import A as X+import B as X
+ examples/failing/ConflictingQualifiedImports2/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/failing/ConflictingQualifiedImports2/B.purs view
@@ -0,0 +1,4 @@+module B where++thing :: Int+thing = 2
+ examples/failing/DeclConflictClassCtor.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith DeclConflict+module Main where++data T = Fail++class Fail
+ examples/failing/DeclConflictClassSynonym.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith DeclConflict+module Main where++import Prelude++type Fail = Unit++class Fail
+ examples/failing/DeclConflictClassType.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith DeclConflict+module Main where++class Fail++data Fail
+ examples/failing/DeclConflictCtorClass.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith DeclConflict+module Main where++class Fail++data T = Fail
+ examples/failing/DeclConflictCtorCtor.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith DeclConflict+module Main where++data T1 = Fail++data T2 = Fail
+ examples/failing/DeclConflictSynonymClass.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith DeclConflict+module Main where++import Prelude++class Fail++type Fail = Unit
+ examples/failing/DeclConflictSynonymType.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith DeclConflict+module Main where++import Prelude++data Fail++type Fail = Unit
+ examples/failing/DeclConflictTypeClass.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith DeclConflict+module Main where++class Fail++data Fail
+ examples/failing/DeclConflictTypeSynonym.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith DeclConflict+module Main where++import Prelude++type Fail = Unit++data Fail
+ examples/failing/DeclConflictTypeType.purs view
@@ -0,0 +1,6 @@+-- @shouldFailWith DeclConflict+module Main where++data Fail++data Fail
examples/failing/Do.purs view
@@ -8,5 +8,5 @@  test2 y = do x <- y -test3 = do return 1-           return 2+test3 = do pure 1+           pure 2
+ examples/failing/ExportConflictClass.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ExportConflict+module C (module A, module B) where++import A as A+import B as B
+ examples/failing/ExportConflictClass/A.purs view
@@ -0,0 +1,3 @@+module A where++class X
+ examples/failing/ExportConflictClass/B.purs view
@@ -0,0 +1,3 @@+module B where++class X
+ examples/failing/ExportConflictCtor.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ExportConflict+module C (module A, module B) where++import A as A+import B as B
+ examples/failing/ExportConflictCtor/A.purs view
@@ -0,0 +1,3 @@+module A where++data T1 = X
+ examples/failing/ExportConflictCtor/B.purs view
@@ -0,0 +1,3 @@+module B where++data T2 = X
+ examples/failing/ExportConflictType.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ExportConflict+module C (module A, module B) where++import A as A+import B as B
+ examples/failing/ExportConflictType/A.purs view
@@ -0,0 +1,3 @@+module A where++data T
+ examples/failing/ExportConflictType/B.purs view
@@ -0,0 +1,3 @@+module B where++data T
+ examples/failing/ExportConflictTypeOp.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ExportConflict+module C (module A, module B) where++import A as A+import B as B
+ examples/failing/ExportConflictTypeOp/A.purs view
@@ -0,0 +1,5 @@+module A where++type T1 a b = a -> b++infixr 4 type T1 as ??
+ examples/failing/ExportConflictTypeOp/B.purs view
@@ -0,0 +1,5 @@+module B where++type T2 a b = a -> b++infixr 4 type T2 as ??
+ examples/failing/ExportConflictValue.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ExportConflict+module C (module A, module B) where++import A as A+import B as B
+ examples/failing/ExportConflictValue/A.purs view
@@ -0,0 +1,4 @@+module A where++x :: Boolean+x = true
+ examples/failing/ExportConflictValue/B.purs view
@@ -0,0 +1,4 @@+module B where++x :: Boolean+x = false
+ examples/failing/ExportConflictValueOp.purs view
@@ -0,0 +1,5 @@+-- @shouldFailWith ExportConflict+module C (module A, module B) where++import A as A+import B as B
+ examples/failing/ExportConflictValueOp/A.purs view
@@ -0,0 +1,6 @@+module A where++f1 :: forall a b. a -> b -> a+f1 x _ = x++infix 0 f1 as !!
+ examples/failing/ExportConflictValueOp/B.purs view
@@ -0,0 +1,6 @@+module B where++f2 :: forall a b. a -> b -> a+f2 x _ = x++infix 0 f2 as !!
+ examples/failing/ExportExplicit.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith UnknownExport
+-- should fail as z does not exist in the module
+module M1 (x, y, z) where
+
+import Prelude
+
+x = 1
+y = 2
+ examples/failing/ExportExplicit1.purs view
@@ -0,0 +1,12 @@+-- @shouldFailWith UnknownName
+module Main where
+
+import M1
+import Control.Monad.Eff.Console (log)
+
+testX = X
+
+-- should fail as Y constructor is not exported from M1
+testY = Y
+
+main = log "Done"
+ examples/failing/ExportExplicit1/M1.purs view
@@ -0,0 +1,3 @@+module M1 (X(X)) where
+
+data X = X | Y
+ examples/failing/ExportExplicit2.purs view
@@ -0,0 +1,8 @@+-- @shouldFailWith UnknownExportDataConstructor
+-- should fail as Y is not a data constructor for X
+module M1 (X(Y)) where
+
+import Prelude
+
+data X = X
+data Y = Y
+ examples/failing/ExportExplicit3.purs view
@@ -0,0 +1,10 @@+-- @shouldFailWith UnknownName
+module Main where
+
+import M1 as M
+import Control.Monad.Eff.Console (log)
+
+-- should fail as Z is not exported from M1
+testZ = M.Z
+
+main = log "Done"
+ examples/failing/ExportExplicit3/M1.purs view
@@ -0,0 +1,4 @@+module M1 (X(..)) where
+
+data X = X | Y
+data Z = Z
+ examples/failing/ImportExplicit.purs view
@@ -0,0 +1,4 @@+-- @shouldFailWith UnknownImport
+module Main where
+
+import M1 (X(..))
+ examples/failing/ImportExplicit/M1.purs view
@@ -0,0 +1,3 @@+module M1 where
+
+foo = "foo"
+ examples/failing/ImportExplicit2.purs view
@@ -0,0 +1,4 @@+-- @shouldFailWith UnknownImportDataConstructor
+module Main where
+
+import M1 (X(Z, Q))
+ examples/failing/ImportExplicit2/M1.purs view
@@ -0,0 +1,3 @@+module M1 where
+
+data X = Y
examples/failing/ImportHidingModule.purs view
@@ -1,10 +1,4 @@--- @shouldFailWith ImportHidingModule-module A where-  x = 1--module B (module B, module A) where-  import A-  y = 1--module C where-  import B hiding (module A)+-- @shouldFailWith ImportHidingModule
+module Main where
+
+import B hiding (module A)
+ examples/failing/ImportHidingModule/A.purs view
@@ -0,0 +1,2 @@+module A where
+x = 1
+ examples/failing/ImportHidingModule/B.purs view
@@ -0,0 +1,3 @@+module B (module B, module A) where
+import A
+y = 1
+ examples/failing/ImportModule.purs view
@@ -0,0 +1,4 @@+-- @shouldFailWith UnknownName
+module Main where
+
+import M1
+ examples/failing/ImportModule/M2.purs view
@@ -0,0 +1,3 @@+module M2 where
+
+data X = X
examples/failing/InstanceExport.purs view
@@ -1,19 +1,7 @@--- @shouldFailWith TransitiveExportError-module InstanceExport (S(..), f) where--import Prelude--newtype S = S String--class F a where-  f :: a -> String--instance fs :: F S where-  f (S s) = s--module Test where--import InstanceExport-import Prelude--test = f $ S "Test"+-- @shouldFailWith TransitiveExportError
+module Test where
+
+import InstanceExport
+import Prelude
+
+test = f $ S "Test"
+ examples/failing/InstanceExport/InstanceExport.purs view
@@ -0,0 +1,11 @@+module InstanceExport (S(..), f) where
+
+import Prelude
+
+newtype S = S String
+
+class F a where
+  f :: a -> String
+
+instance fs :: F S where
+  f (S s) = s
examples/failing/MissingClassMemberExport.purs view
@@ -1,5 +1,5 @@ -- @shouldFailWith TransitiveExportError-module Test (Foo) where+module Test (class Foo) where  import Prelude 
examples/failing/MultipleErrors2.purs view
@@ -1,5 +1,5 @@--- @shouldFailWith UnknownValue--- @shouldFailWith UnknownValue+-- @shouldFailWith UnknownName+-- @shouldFailWith UnknownName module MultipleErrors2 where  import Prelude
+ examples/failing/MultipleTypeOpFixities.purs view
@@ -0,0 +1,9 @@+-- @shouldFailWith MultipleTypeOpFixities
+module MultipleTypeOpFixities where
+
+import Prelude
+
+type Op x y = Op x y
+
+infix 2 type Op as !?
+infix 2 type Op as !?
+ examples/failing/MultipleValueOpFixities.purs view
@@ -0,0 +1,9 @@+-- @shouldFailWith MultipleValueOpFixities
+module MultipleValueOpFixities where
+
+import Prelude
+
+add x y = x + y
+
+infix 2 add as !?
+infix 2 add as !?
examples/failing/OrphanInstance.purs view
@@ -1,12 +1,7 @@--- @shouldFailWith OrphanInstance-module Class where--  class C a where-    op :: a -> a--module Test where--  import Class--  instance cBoolean :: C Boolean where-    op a = a+-- @shouldFailWith OrphanInstance
+module Test where
+
+import Class
+
+instance cBoolean :: C Boolean where
+  op a = a
+ examples/failing/OrphanInstance/Class.purs view
@@ -0,0 +1,4 @@+module Class where
+
+class C a where
+  op :: a -> a
+ examples/failing/OrphanTypeDecl.purs view
@@ -0,0 +1,4 @@+-- @shouldFailWith OrphanTypeDeclaration
+module OrphanTypeDecl where
+
+fn :: Number -> Boolean
− examples/failing/OverlappingReExport.purs
@@ -1,10 +0,0 @@--- @shouldFailWith DuplicateValueExport-module A where-  x = true--module B where-  x = false--module C (module A, module M2) where-  import A-  import qualified B as M2
+ examples/failing/ProgrammableTypeErrors.purs view
@@ -0,0 +1,16 @@+-- @shouldFailWith NoInstanceFound++module Main where++import Prelude+import Control.Monad.Eff (Eff)+import Control.Monad.Eff.Console (log)++class MyShow a where+  myShow :: a -> String++instance cannotShowFunctions :: Fail "Cannot show functions" => MyShow (a -> b) where+  myShow _ = "unreachable"++main :: Eff _ _+main = log (myShow (_ + 1))
+ examples/failing/RequiredHiddenType.purs view
@@ -0,0 +1,9 @@+-- @shouldFailWith TransitiveExportError
+-- exporting `a` should fail as `A` is hidden
+module Foo (B(..), a, b) where
+
+data A = A
+data B = B
+
+a = A
+b = B
examples/failing/RowConstructors1.purs view
@@ -1,9 +1,9 @@ -- @shouldFailWith KindsDoNotUnify module Main where -import Prelude+import Control.Monad.Eff.Console (log)  data Foo = Bar type Baz = { | Foo } -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/failing/RowConstructors2.purs view
@@ -1,9 +1,9 @@ -- @shouldFailWith KindsDoNotUnify module Main where -import Prelude+import Control.Monad.Eff.Console (log)  type Foo r = (x :: Number | r) type Bar = { | Foo } -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/failing/RowConstructors3.purs view
@@ -1,9 +1,9 @@ -- @shouldFailWith KindsDoNotUnify module Main where -import Prelude+import Control.Monad.Eff.Console (log)  type Foo = { x :: Number } type Bar = { | Foo } -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/failing/SkolemEscape2.purs view
@@ -7,4 +7,4 @@  test _ = do   r <- runST (newSTRef 0)-  return 0+  pure 0
examples/failing/SuggestComposition.purs view
@@ -4,4 +4,4 @@  import Prelude -f = g . g where g = (+1)+f = g . g where g = (_ + 1)
examples/failing/Superclasses5.purs view
@@ -3,6 +3,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (logShow)  class Su a where   su :: a -> a@@ -22,4 +23,4 @@ test :: forall a. (Cl a) => a -> Array a test x = su [cl x x] -main = Control.Monad.Eff.Console.print $ test 10.0+main = logShow $ test 10.0
examples/failing/TypeError.purs view
@@ -3,4 +3,4 @@  import Prelude -test = 1 ++ "A"+test = 1 <> "A"
examples/failing/TypedBinders.purs view
@@ -1,10 +1,10 @@--- @shouldFailWith ErrorParsingModule +-- @shouldFailWith ErrorParsingModule module Main where -import Prelude+import Control.Monad.Eff.Console (log)  test = (\f :: Int -> Int -> f 10) id  main = do   let t1 = test-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/failing/TypedBinders2.purs view
@@ -2,8 +2,8 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  main = do-  s :: String <- Control.Monad.Eff.Console.log "Foo"-  Control.Monad.Eff.Console.log "Done"-+  s :: String <- log "Foo"+  log "Done"
examples/failing/TypedBinders3.purs view
@@ -2,6 +2,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test = case 1 of   (0 :: String) -> true@@ -9,4 +10,4 @@  main = do   let t = test-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/failing/UnderscoreModuleName.purs view
@@ -1,6 +1,6 @@ -- @shouldFailWith ErrorParsingModule module Bad_Module where -import Prelude+import Control.Monad.Eff.Console (log) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/failing/UnknownType.purs view
@@ -1,4 +1,4 @@--- @shouldFailWith UnknownType+-- @shouldFailWith UnknownName module Main where  import Prelude
examples/passing/1185.purs view
@@ -1,5 +1,7 @@ module Main where +import Control.Monad.Eff.Console (log)+ data Person = Person String Boolean  getName :: Person -> String@@ -10,4 +12,4 @@ name :: String name = getName (Person "John Smith" true) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/1335.purs view
@@ -1,12 +1,14 @@-module Main where--import Prelude-import Control.Monad.Eff.Console (log)--x :: forall a. a -> String-x a = y "Done"-  where-  y :: forall a. (Show a) => a -> String-  y a = show (a :: a)--main = log (x 0)+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+x :: forall a. a -> String
+x a = y "Test"
+  where
+  y :: forall a. (Show a) => a -> String
+  y a = show (a :: a)
+
+main = do
+  log (x 0)
+  log "Done"
examples/passing/1570.purs view
@@ -1,6 +1,8 @@ module Main where +import Control.Monad.Eff.Console (log)+ test :: forall a. a -> a test = \(x :: a) -> x -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/1664.purs view
@@ -11,6 +11,6 @@ test :: forall e a. IdentityEff e a -> IdentityEff e Unit test (IdentityEff action) = IdentityEff $ do   (Identity x :: Identity _) <- action-  return $ Identity unit+  pure $ Identity unit  main = log "Done"
examples/passing/1697.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  _2 :: forall a. a -> a _2 a = a@@ -21,4 +22,4 @@   let tmp = _2 1   pure unit -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/1881.purs view
@@ -0,0 +1,19 @@+module Main where++import Control.Monad.Eff.Console (log)++foo =+ 1++bar+ = 2++baz+ =+ 3++qux+  =+ 3++main = log "Done"
examples/passing/1991.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  singleton :: forall a. a -> Array a singleton x = [x]@@ -10,11 +11,12 @@  foldMap :: forall a m. (Semigroup m) => (a -> m) -> Array a -> m foldMap f [a, b, c, d, e] = f a <> f b <> f c <> f d <> f e+foldMap f xs = foldMap f xs -- spin, not used  regression :: Array Int regression =   let as = [1,2,3,4,5]       as' = foldMap (\x -> if 1 < x && x < 4 then singleton x else empty) as   in as'-                  -main = Control.Monad.Eff.Console.log "Done"++main = log "Done"
examples/passing/2018.purs view
@@ -1,15 +1,3 @@-module B where--  data Foo = X | Y--module A where--  import B as Main--  -- Prior to the 2018 fix this would be detected as a cycle between A and Main.-  foo ∷ Main.Foo → Main.Foo-  foo x = x- module Main where  import Prelude@@ -22,4 +10,3 @@ main = do   let tmp = foo X   log "Done"-
+ examples/passing/2018/A.purs view
@@ -0,0 +1,7 @@+module A where++import B as Main++-- Prior to the 2018 fix this would be detected as a cycle between A and Main.+foo ∷ Main.Foo → Main.Foo+foo x = x
+ examples/passing/2018/B.purs view
@@ -0,0 +1,3 @@+module B where++data Foo = X | Y
+ examples/passing/2049.purs view
@@ -0,0 +1,14 @@+module Main where++import Prelude+import Control.Monad.Eff.Console (log)++data List a = Cons a (List a) | Nil++infixr 6 Cons as :++f :: List { x :: Int, y :: Int } -> Int+f ( r@{ x } : _) = x + r.y+f _ = 0++main = log "Done"
+ examples/passing/2138.purs view
@@ -0,0 +1,7 @@+module Main where++import Control.Monad.Eff.Console (log)++import Lib (A(B,C))++main = log "Done"
+ examples/passing/2138/Lib.purs view
@@ -0,0 +1,3 @@+module Lib (A(..), A) where++data A = B | C
+ examples/passing/2172.js view
@@ -0,0 +1,5 @@+exports['a\''] = 0;+exports["\x62\x27"] = 1;+// NOTE: I wanted to use "\c'" here, but langauge-javascript doesn't support it...+exports["c'"] = 2;+exports["\u0064\u0027"] = 3;
+ examples/passing/2172.purs view
@@ -0,0 +1,10 @@+module Main where++import Control.Monad.Eff.Console (log)++foreign import a' :: Number+foreign import b' :: Number+foreign import c' :: Number+foreign import d' :: Number++main = log "Done"
examples/passing/652.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class Foo a b @@ -14,4 +15,4 @@  instance baz :: (Eq a) => Baz (a -> b) a b -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/810.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Maybe a = Nothing | Just a @@ -10,4 +11,4 @@     o = case m of Nothing -> { x : Nothing }                   Just a  -> { x : Just a } -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Applicative.purs view
@@ -1,6 +1,6 @@ module Main where -import Prelude ()+import Control.Monad.Eff.Console (log)  class Applicative f where   pure :: forall a. a -> f a@@ -13,4 +13,4 @@   apply (Just f) (Just a) = Just (f a)   apply _ _ = Nothing -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/ArrayType.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class Pointed p where   point :: forall a. a -> p a@@ -8,4 +9,4 @@ instance pointedArray :: Pointed Array where   point a = [a] -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Auto.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Auto s i o = Auto { state :: s, step :: s -> i -> o } @@ -12,4 +13,4 @@ run :: forall i o. SomeAuto i o -> i -> o run = \s i -> s (\a -> case a of Auto a -> a.step a.state i) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/AutoPrelude.purs view
@@ -1,9 +1,11 @@-module Main where--import Prelude-import Control.Monad.Eff.Console--f x = x * 10.0-g y = y - 10.0--main = log $ show $ (f <<< g) 100.0+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+f x = x * 10.0
+g y = y - 10.0
+
+main = do
+  log $ show $ (f <<< g) 100.0
+  log "Done"
examples/passing/AutoPrelude2.purs view
@@ -1,7 +1,7 @@ module Main where  import Prelude-import qualified Prelude as P+import Prelude as P import Control.Monad.Eff.Console  f :: forall a. a -> a
examples/passing/BindersInFunctions.purs view
@@ -1,11 +1,16 @@ module Main where  import Prelude-import Test.Assert+import Partial.Unsafe (unsafePartial)+import Test.Assert (assert')+import Control.Monad.Eff (Eff)+import Control.Monad.Eff.Console (log) +snd :: forall a. Partial => Array a -> a snd = \[_, y] -> y +main :: Eff _ _ main = do-  let ts = snd [1.0, 2.0]+  let ts = unsafePartial (snd [1.0, 2.0])   assert' "Incorrect result from 'snd'." (ts == 2.0)-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/BindingGroups.purs view
@@ -1,10 +1,11 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  foo = bar   where bar r = r + 1.0  r = foo 2.0 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/BlockString.purs view
@@ -1,8 +1,9 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  foo :: String foo = """foo""" -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/CaseInDo.purs view
@@ -1,19 +1,21 @@ module Main where  import Prelude+import Partial.Unsafe (unsafeCrashWith) import Control.Monad.Eff.Console import Control.Monad.Eff  doIt :: forall eff. Eff eff Boolean-doIt = return true+doIt = pure true  set = do   log "Testing..."   case 0 of     0 -> doIt-    _ -> return false+    _ -> pure false  main = do   b <- set   case b of     true -> log "Done"+    false -> unsafeCrashWith "Failed"
examples/passing/CaseMultipleExpressions.purs view
@@ -1,19 +1,21 @@ module Main where  import Prelude+import Partial.Unsafe (unsafeCrashWith) import Control.Monad.Eff.Console import Control.Monad.Eff  doIt :: forall eff. Eff eff Boolean-doIt = return true+doIt = pure true  set = do   log "Testing..."   case 42, 10 of     42, 10 -> doIt-    _ , _  -> return false+    _ , _  -> pure false  main = do   b <- set   case b of     true -> log "Done"+    false -> unsafeCrashWith "Failed"
examples/passing/CaseStatement.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data A = A | B | C @@ -18,4 +19,4 @@ h f a N = a h f (J a) (J b) = J (f a b) -main = Control.Monad.Eff.Console.log $ f "Done" "Failed" A+main = log $ f "Done" "Failed" A
examples/passing/CheckFunction.purs view
@@ -1,7 +1,8 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test = ((\x -> x+1.0) >>> (\x -> x*2.0)) 4.0 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/CheckSynonymBug.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  length :: forall a. Array a -> Int length _ = 0@@ -9,4 +10,4 @@  foo _ = length ([] :: Foo Number) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/CheckTypeClass.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Bar a = Bar data Baz@@ -14,5 +15,4 @@ mkBar :: forall a. a -> Bar a mkBar _ = Bar -main = Control.Monad.Eff.Console.log "Done"-+main = log "Done"
examples/passing/Church.purs view
@@ -1,6 +1,6 @@ module Main where -import Prelude ()+import Control.Monad.Eff.Console (log)  type List a = forall r. r -> (a -> r -> r) -> r @@ -15,4 +15,4 @@  test = append (cons 1 empty) (cons 2 empty) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/ClassRefSyntax.purs view
@@ -1,13 +1,9 @@-module Lib (class X, go) where--  class X a where-    go :: a -> a- module Main where -  import Lib (class X, go)+import Lib (class X, go)+import Control.Monad.Eff.Console (log) -  go' :: forall a. (X a) => a -> a-  go' = go+go' :: forall a. (X a) => a -> a+go' = go -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/ClassRefSyntax/Lib.purs view
@@ -0,0 +1,4 @@+module Lib (class X, go) where++class X a where+  go :: a -> a
examples/passing/Collatz.purs view
@@ -3,6 +3,7 @@ import Prelude import Control.Monad.Eff import Control.Monad.ST+import Control.Monad.Eff.Console (log, logShow)  collatz :: Int -> Int collatz n = runPure (runST (do@@ -12,7 +13,9 @@     modifySTRef count $ (+) 1     m <- readSTRef r     writeSTRef r $ if m `mod` 2 == 0 then m / 2 else 3 * m + 1-    return $ m == 1+    pure $ m == 1   readSTRef count)) -main = Control.Monad.Eff.Console.print $ collatz 1000+main = do+  logShow $ collatz 1000+  log "Done"
examples/passing/Comparisons.purs view
@@ -1,15 +1,15 @@-module Main where--import Prelude-import Control.Monad.Eff-import Control.Monad.Eff.Console-import Test.Assert--main = do-  assert (1.0 < 2.0)-  assert (2.0 == 2.0)-  assert (3.0 > 1.0)-  assert ("a" < "b")-  assert ("a" == "a")-  assert ("z" > "a")-  log "Done!"+module Main where
+
+import Prelude
+import Control.Monad.Eff
+import Control.Monad.Eff.Console
+import Test.Assert
+
+main = do
+  assert (1.0 < 2.0)
+  assert (2.0 == 2.0)
+  assert (3.0 > 1.0)
+  assert ("a" < "b")
+  assert ("a" == "a")
+  assert ("z" > "a")
+  log "Done"
examples/passing/Conditional.purs view
@@ -1,9 +1,9 @@ module Main where -import Prelude ()+import Control.Monad.Eff.Console (log)  fns = \f -> if f true then f else \x -> x  not = \x -> if x then false else true -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Console.purs view
@@ -5,9 +5,11 @@ import Control.Monad.Eff.Console  replicateM_ :: forall m a. (Monad m) => Number -> m a -> m {}-replicateM_ 0.0 _ = return {}+replicateM_ 0.0 _ = pure {} replicateM_ n act = do   act   replicateM_ (n - 1.0) act -main = replicateM_ 10.0 (log "Hello World!")+main = do+  replicateM_ 10.0 (log "Hello World!")+  log "Done"
examples/passing/ConstraintInference.purs view
@@ -1,7 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log) -shout = Control.Monad.Eff.Console.log <<< (<> "!") <<< show+shout = log <<< (_ <> "!") <<< show -main = shout "Done"+main = do+  shout "Test"+  log "Done"
examples/passing/ContextSimplification.purs view
@@ -3,11 +3,13 @@ import Prelude import Control.Monad.Eff.Console -shout = log <<< (<> "!") <<< show+shout = log <<< (_ <> "!") <<< show  -- Here, we should simplify the context so that only one Show -- constraint is added. usesShowTwice true = shout-usesShowTwice false = print+usesShowTwice false = logShow -main = usesShowTwice true "Done"+main = do+  usesShowTwice true "Test"+  log "Done"
examples/passing/DataAndType.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data A = A B  type B = A -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/DctorOperatorAlias.purs view
@@ -1,17 +1,11 @@-module Data.List where--  data List a = Cons a (List a) | Nil--  infixr 6 Cons as :- module Main where    import Prelude (Unit, bind, (==))   import Control.Monad.Eff (Eff)   import Control.Monad.Eff.Console (CONSOLE, log)   import Test.Assert (ASSERT, assert')-  import Data.List (List(..), (:))-  import Data.List as L+  import List (List(..), (:))+  import List as L    -- unqualified   infixl 6 Cons as !
+ examples/passing/DctorOperatorAlias/List.purs view
@@ -0,0 +1,5 @@+module List where++data List a = Cons a (List a) | Nil++infixr 6 Cons as :
examples/passing/DeepArrayBinder.purs view
@@ -2,6 +2,7 @@  import Prelude import Control.Monad.Eff+import Control.Monad.Eff.Console (log) import Test.Assert  data List a = Cons a (List a) | Nil@@ -13,4 +14,4 @@ main = do   let result = match2 (Cons 1.0 (Cons 2.0 (Cons 3.0 (Cons 4.0 (Cons 5.0 (Cons 6.0 (Cons 7.0 (Cons 8.0 (Cons 9.0 Nil)))))))))   assert' "Incorrect result!" (result == 100.0)-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/DeepCase.purs view
@@ -1,9 +1,7 @@ module Main where  import Prelude-import Control.Monad.Eff.Console-import Control.Monad.Eff-import Control.Monad.ST+import Control.Monad.Eff.Console (log, logShow)  f x y =   let@@ -12,4 +10,6 @@           x -> 1.0 + x * x   in g + x + y -main = print $ f 1.0 10.0+main = do+  logShow $ f 1.0 10.0+  log "Done"
examples/passing/Deriving.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log) import Test.Assert  data V@@ -27,5 +28,7 @@   assert $ X 0 < X 1   assert $ X 0 < Y "Foo"   assert $ Y "Bar" < Y "Baz"-  assert $ z == z where-    z = Z { left: X 0, right: Y "Foo" }+  assert $ z == z+  log "Done"+  where+  z = Z { left: X 0, right: Y "Foo" }
examples/passing/Do.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Maybe a = Nothing | Just a @@ -19,7 +20,7 @@   bind Nothing _ = Nothing   bind (Just a) f = f a -instance monadMaybe :: Prelude.Monad Maybe+instance monadMaybe :: Monad Maybe  test1 = \_ -> do   Just "abc"@@ -64,4 +65,4 @@     g x = f x / 2.0   Just (f 10.0) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Dollar.purs view
@@ -1,11 +1,11 @@ module Main where -import Prelude ()+import Control.Monad.Eff.Console (log) -($) :: forall a b. (a -> b) -> a -> b-($) f x = f x+applyFn :: forall a b. (a -> b) -> a -> b+applyFn f x = f x -infixr 1000 $+infixr 1000 applyFn as $  id x = x @@ -13,4 +13,4 @@  test2 x = id id $ id x -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Eff.purs view
@@ -3,7 +3,7 @@ import Prelude import Control.Monad.Eff import Control.Monad.ST-import Control.Monad.Eff.Console+import Control.Monad.Eff.Console (log, logShow)  test1 = do   log "Line 1"@@ -21,5 +21,6 @@  main = do   test1-  Control.Monad.Eff.Console.print test2-  Control.Monad.Eff.Console.print test3+  logShow test2+  logShow test3+  log "Done"
examples/passing/EmptyDataDecls.purs view
@@ -2,6 +2,7 @@  import Prelude import Test.Assert+import Control.Monad.Eff.Console (log)  data Z data S n@@ -15,5 +16,5 @@ cons' x (ArrayBox xs) = ArrayBox $ append [x] xs  main = case cons' 1 $ cons' 2 $ cons' 3 nil of-         ArrayBox [1, 2, 3] -> Control.Monad.Eff.Console.log "Done"+         ArrayBox [1, 2, 3] -> log "Done"          _ -> assert' "Failed" false
examples/passing/EmptyRow.purs view
@@ -1,10 +1,11 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Foo r = Foo { | r }  test :: Foo () test = Foo {} -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/EmptyTypeClass.purs view
@@ -1,12 +1,11 @@ module Main where  import Prelude--class PartialP+import Control.Monad.Eff+import Control.Monad.Eff.Console -head :: forall a. (PartialP) => Array a -> a+head :: forall a. Partial => Array a -> a head [x] = x -instance allowPartials :: PartialP--main = Control.Monad.Eff.Console.log $ head ["Done"]+main :: Eff _ _+main = log "Done"
examples/passing/EqOrd.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)  data Pair a b = Pair a b @@ -12,4 +13,6 @@ instance eqPair :: (Eq a, Eq b) => Eq (Pair a b) where   eq (Pair a1 b1) (Pair a2 b2) = a1 == a2 && b1 == b2 -main = Control.Monad.Eff.Console.print $ Pair 1.0 2.0 == Pair 1.0 2.0+main = do+  logShow $ Pair 1.0 2.0 == Pair 1.0 2.0+  log "Done"
examples/passing/ExplicitImportReExport.purs view
@@ -1,16 +1,11 @@--- from #1244-module Foo where--  foo :: Int-  foo = 3--module Bar (module Foo) where--  import Foo--module Baz where--  import Bar (foo)--  baz :: Int-  baz = foo+-- from #1244
+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+import Bar (foo)
+
+baz :: Int
+baz = foo
+
+main = log "Done"
+ examples/passing/ExplicitImportReExport/Bar.purs view
@@ -0,0 +1,3 @@+module Bar (module Foo) where
+
+import Foo
+ examples/passing/ExplicitImportReExport/Foo.purs view
@@ -0,0 +1,4 @@+module Foo where
+
+foo :: Int
+foo = 3
examples/passing/ExplicitOperatorSections.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  subtractOne :: Int -> Int subtractOne = (_ - 1)@@ -11,4 +12,4 @@ named :: Int -> Int named = (_ `sub` 1) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/ExportExplicit.purs view
@@ -0,0 +1,10 @@+module Main where
+
+import M1
+import Control.Monad.Eff.Console (log)
+
+testX = X
+testZ = Z
+testFoo = foo
+
+main = log "Done"
+ examples/passing/ExportExplicit/M1.purs view
@@ -0,0 +1,10 @@+module M1 (X(X), Z(..), foo) where
+
+data X = X | Y
+data Z = Z
+
+foo :: Int
+foo = 0
+
+bar :: Int
+bar = 1
+ examples/passing/ExportExplicit2.purs view
@@ -0,0 +1,8 @@+module Main where
+
+import M1
+import Control.Monad.Eff.Console (log)
+
+testBar = bar
+
+main = log "Done"
+ examples/passing/ExportExplicit2/M1.purs view
@@ -0,0 +1,7 @@+module M1 (bar) where
+
+foo :: Int
+foo = 0
+
+bar :: Int
+bar = foo
+ examples/passing/ExportedInstanceDeclarations.purs view
@@ -0,0 +1,45 @@+-- Tests that instances for non-exported classes / types do not appear in the+-- result of `exportedDeclarations`.+module Main+  ( Const(..)+  , class Foo+  , foo+  , main+  ) where++import Prelude+import Control.Monad.Eff.Console (log)++data Const a b = Const a++class Foo a where+  foo :: a++data NonexportedType = NonexportedType++class NonexportedClass a where+  notExported :: a++-- There are three places that a nonexported type or type class can occur,+-- leading an instance to count as non-exported:+--  * Constraints+--  * The type class itself+--  * The instance types++-- Case 1: constraints+instance nonExportedFoo :: (NonexportedClass a) => Foo a where+  foo = notExported++-- Another instance of case 1:+instance nonExportedFoo2 :: (Foo NonexportedType) => Foo (a -> a) where+  foo = id++-- Case 2: type class+instance nonExportedNonexportedType :: NonexportedClass (Const Int a) where+  notExported = Const 0++-- Case 3: instance types+instance constFoo :: Foo (Const NonexportedType b) where+  foo = Const NonexportedType++main = log "Done"
examples/passing/ExtendedInfixOperators.purs view
@@ -1,9 +1,11 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)+import Data.Function (on)  comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering-comparing f = compare `Data.Function.on` f+comparing f = compare `on` f  null [] = true null _ = false@@ -11,4 +13,5 @@ test = [1.0, 2.0, 3.0] `comparing null` [4.0, 5.0, 6.0]  main = do-  Control.Monad.Eff.Console.print test+  logShow test+  log "Done"
examples/passing/Fib.purs view
@@ -1,15 +1,18 @@ module Main where  import Prelude-import Control.Monad.Eff-import Control.Monad.ST+import Control.Monad.Eff (whileE)+import Control.Monad.Eff.Console (log, logShow)+import Control.Monad.ST (runST, newSTRef, readSTRef, writeSTRef) -main = runST (do-  n1 <- newSTRef 1.0-  n2 <- newSTRef 1.0-  whileE ((>) 1000.0 <$> readSTRef n1) $ do-    n1' <- readSTRef n1-    n2' <- readSTRef n2-    writeSTRef n2 $ n1' + n2'-    writeSTRef n1 n2'-    Control.Monad.Eff.Console.print n2')+main = do+  runST do+    n1 <- newSTRef 1.0+    n2 <- newSTRef 1.0+    whileE ((>) 1000.0 <$> readSTRef n1) $ do+      n1' <- readSTRef n1+      n2' <- readSTRef n2+      writeSTRef n2 $ n1' + n2'+      writeSTRef n1 n2'+      logShow n2'+  log "Done"
examples/passing/FieldConsPuns.purs view
@@ -1,10 +1,13 @@-module Main where--import Prelude-import Control.Monad.Eff.Console--greet { greeting, name } = log $ greeting <> ", " <> name <> "."--main = greet { greeting, name} where-  greeting = "Hello"-  name = "World"+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log, logShow)
+
+greet { greeting, name } = log $ greeting <> ", " <> name <> "."
+
+main = do
+  greet { greeting, name }
+  log "Done"
+  where
+  greeting = "Hello"
+  name = "World"
examples/passing/FieldPuns.purs view
@@ -1,8 +1,10 @@-module Main where--import Prelude-import Control.Monad.Eff.Console--greet { greeting, name } = log $ greeting <> ", " <> name <> "."--main = greet { greeting: "Hello", name: "World" } +module Main where
+
+import Prelude
+import Control.Monad.Eff.Console
+
+greet { greeting, name } = log $ greeting <> ", " <> name <> "."
+
+main = do
+  greet { greeting: "Hello", name: "World" }
+  log "Done"
examples/passing/FinalTagless.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude hiding (add)+import Control.Monad.Eff.Console (log, logShow)  class E e where   num :: Number -> e Number@@ -19,4 +20,6 @@ three :: Expr Number three = add (num 1.0) (num 2.0) -main = Control.Monad.Eff.Console.print $ runId three+main = do+  logShow $ runId three+  log "Done"
examples/passing/FunctionScope.purs view
@@ -2,6 +2,7 @@  import Prelude import Test.Assert+import Control.Monad.Eff.Console (log)  mkValue :: Number -> Number mkValue id = id@@ -9,4 +10,4 @@ main = do   let value = mkValue 1.0   assert $ value == 1.0-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/Functions.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test1 = \_ -> 0.0 @@ -8,8 +9,4 @@  test3 = \a -> a -test4 = \(%%) -> 1.0 %% 2.0--test5 = \(+++) (***) -> 1.0 +++ 2.0 *** 3.0--main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Functions2.purs view
@@ -2,6 +2,7 @@  import Prelude import Test.Assert+import Control.Monad.Eff.Console (log)  test :: forall a b. a -> b -> a test = \const _ -> const@@ -9,4 +10,4 @@ main = do   let value = test "Done" {}   assert' "Not done" $ value == "Done"-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/Generalization1.purs view
@@ -1,10 +1,11 @@ module Main where  import Prelude-import Control.Monad.Eff.Console (print)+import Control.Monad.Eff.Console (logShow, log)  main = do-  print (sum 1.0 2.0)-  print (sum 1 2)+  logShow (sum 1.0 2.0)+  logShow (sum 1 2)+  log "Done"  sum x y = x + y
examples/passing/Guards.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  collatz = \x -> case x of   y | y `mod` 2.0 == 0.0 -> y / 2.0@@ -26,4 +27,4 @@                     | otherwise   = y - x -main = Control.Monad.Eff.Console.log $ min "Done" "ZZZZ"+main = log $ min "Done" "ZZZZ"
examples/passing/IfThenElseMaybe.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Maybe a = Nothing | Just a @@ -8,4 +9,4 @@  test2 = if true then Nothing else Just 10 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/ImplicitEmptyImport.purs view
@@ -1,8 +1,9 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  main = do-  Control.Monad.Eff.Console.log "Hello"-  Control.Monad.Eff.Console.log "Goodbye"-  Control.Monad.Eff.Console.log "Done"+  log "Hello"+  log "Goodbye"+  log "Done"
+ examples/passing/Import.purs view
@@ -0,0 +1,6 @@+module Main where
+
+import M2
+import Control.Monad.Eff.Console (log)
+
+main = log "Done"
+ examples/passing/Import/M1.purs view
@@ -0,0 +1,8 @@+module M1 where
+
+import Prelude ()
+
+id :: forall a. a -> a
+id = \x -> x
+
+foo = id
+ examples/passing/Import/M2.purs view
@@ -0,0 +1,6 @@+module M2 where
+
+import Prelude ()
+import M1
+
+main = \_ -> foo 42
+ examples/passing/ImportExplicit.purs view
@@ -0,0 +1,10 @@+module Main where
+
+import M1 (X(..))
+import Control.Monad.Eff.Console (log)
+
+testX :: X
+testX = X
+testY = Y
+
+main = log "Done"
+ examples/passing/ImportExplicit/M1.purs view
@@ -0,0 +1,4 @@+module M1 where
+
+data X = X | Y
+data Z = Z
examples/passing/ImportHiding.purs view
@@ -3,7 +3,7 @@ import Control.Monad.Eff.Console import Prelude hiding (   show, -- a value-  Show, -- a type class+  class Show, -- a type class   Unit(..)  -- a constructor   ) @@ -15,4 +15,5 @@ data Unit = X | Y  main = do-  print show+  logShow show+  log "Done"
+ examples/passing/ImportQualified.purs view
@@ -0,0 +1,8 @@+module Main where
+
+import Prelude
+import Control.Monad.Eff
+import M1
+import Control.Monad.Eff.Console as C
+
+main = C.log (log "Done")
+ examples/passing/ImportQualified/M1.purs view
@@ -0,0 +1,3 @@+module M1 where
+
+log x = x
examples/passing/InferRecFunWithConstrainedArgument.purs view
@@ -1,8 +1,11 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow) -test 100.0 = 100.0-test n = test(1.0 + n)+test 100 = 100+test n = test(1 + n) -main = Control.Monad.Eff.Console.print $ test 0.0+main = do+  logShow (test 0)+  log "Done"
examples/passing/InstanceBeforeClass.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  instance fooNumber :: Foo Number where   foo = 0.0@@ -8,4 +9,4 @@ class Foo a where   foo :: a -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/IntAndChar.purs view
@@ -2,6 +2,7 @@  import Prelude import Control.Monad.Eff+import Control.Monad.Eff.Console (log) import Test.Assert  f 1 = 1@@ -15,4 +16,4 @@   assert $ f 0 == 0   assert $ g 'a' == 'a'   assert $ g 'b' == 'b'-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/JSReserved.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  yield = 0 member = 1@@ -9,4 +10,4 @@  this catch = catch -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/KindedType.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type Star2Star f = f :: * -> * @@ -30,4 +31,4 @@ instance clazzString :: Clazz String where   def = "test" -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/LargeSumType.purs view
@@ -1,5 +1,7 @@ module Main where-    ++import Control.Monad.Eff.Console (log)+ data Large = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z  explode A A = "A"@@ -30,4 +32,4 @@ explode Z Z = "Z" explode _ _ = "" -main = Control.Monad.Eff.Console.log "Done" +main = log "Done"
examples/passing/Let.purs view
@@ -1,7 +1,9 @@ module Main where  import Prelude+import Partial.Unsafe (unsafePartial) import Control.Monad.Eff+import Control.Monad.Eff.Console (log, logShow) import Control.Monad.ST  test1 x = let@@ -17,8 +19,9 @@ test3 = let f x y z = x + y + z in         f 1.0 2.0 3.0 -test4 = let f x [y, z] = x y z in-        f (+) [1.0, 2.0]+test4 = let+          f x [y, z] = x y z+        in f (+) [1.0, 2.0]  test5 = let           f x | x > 0.0 = g (x / 2.0) + 1.0@@ -43,11 +46,13 @@     g x = f x / 2.0   in f 10.0 +main :: Eff _ _ main = do-  Control.Monad.Eff.Console.print (test1 1.0)-  Control.Monad.Eff.Console.print (test2 1.0 2.0)-  Control.Monad.Eff.Console.print test3-  Control.Monad.Eff.Console.print test4-  Control.Monad.Eff.Console.print test5-  Control.Monad.Eff.Console.print test7-  Control.Monad.Eff.Console.print (test8 100.0)+  logShow (test1 1.0)+  logShow (test2 1.0 2.0)+  logShow test3+  unsafePartial (logShow test4)+  logShow test5+  logShow test7+  logShow (test8 100.0)+  log "Done"
examples/passing/Let2.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)  test =   let f :: Number -> Boolean@@ -14,4 +15,6 @@       x = f 1.0   in not x -main = Control.Monad.Eff.Console.print test+main = do+  logShow test+  log "Done"
examples/passing/LetInInstance.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class Foo a where   foo :: a -> String@@ -11,4 +12,4 @@     go :: String -> String     go s = s -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/LiberalTypeSynonyms.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type Reader = (->) String @@ -9,13 +10,13 @@  type AndFoo r = (foo :: String | r) -getFoo :: forall r. Prim.Object (AndFoo r) -> String+getFoo :: forall r. Prim.Record (AndFoo r) -> String getFoo o = o.foo  type F r = { | r } -> { | r }  f :: (forall r. F r) -> String f g = case g { x: "Hello" } of-        { x = x } -> x+        { x: x } -> x -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/MPTCs.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class NullaryTypeClass where   greeting :: String@@ -14,7 +15,7 @@ instance coerceRefl :: Coerce a a where   coerce a = a -instance coerceShow :: (Prelude.Show a) => Coerce a String where+instance coerceShow :: Show a => Coerce a String where   coerce = show -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Match.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Foo a = Foo  foo = \f -> case f of Foo -> "foo" -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/Module.purs view
@@ -0,0 +1,7 @@+module Main where++import M1+import M2+import Control.Monad.Eff.Console (log)++main = log "Done"
+ examples/passing/Module/M1.purs view
@@ -0,0 +1,14 @@+module M1 where++import Prelude++data Foo = Foo String++foo :: Foo -> String+foo = \f -> case f of Foo s -> s <> "foo"++bar :: Foo -> String+bar = foo++incr :: Int -> Int+incr x = x + 1
+ examples/passing/Module/M2.purs view
@@ -0,0 +1,10 @@+module M2 where++import Prelude+import M1 as M1++baz :: M1.Foo -> String+baz = M1.foo++match :: M1.Foo -> String+match = \f -> case f of M1.Foo s -> s <> "foo"
+ examples/passing/ModuleDeps.purs view
@@ -0,0 +1,6 @@+module Main where
+
+import M1
+import Control.Monad.Eff.Console (log)
+
+main = log "Done"
+ examples/passing/ModuleDeps/M1.purs view
@@ -0,0 +1,5 @@+module M1 where
+
+import M2 as M2
+
+foo = M2.bar
+ examples/passing/ModuleDeps/M2.purs view
@@ -0,0 +1,5 @@+module M2 where
+
+import M3 as M3
+
+bar = M3.baz
+ examples/passing/ModuleDeps/M3.purs view
@@ -0,0 +1,3 @@+module M3 where
+
+baz = 1
examples/passing/ModuleExport.purs view
@@ -1,9 +1,8 @@-module A (module Prelude) where-  import Prelude- module Main where-  import Control.Monad.Eff.Console-  import A -  main = do-    print (show 1.0)+import Control.Monad.Eff.Console (log, logShow)+import A++main = do+  logShow (show 1.0)+  log "Done"
+ examples/passing/ModuleExport/A.purs view
@@ -0,0 +1,3 @@+module A (module Prelude) where++import Prelude
examples/passing/ModuleExportDupes.purs view
@@ -1,14 +1,5 @@-module A (module Prelude) where-  import Prelude--module B (module Prelude) where-  import Prelude--module C (module Prelude, module A) where-  import Prelude-  import A- module Main where+   import Control.Monad.Eff.Console   import A   import B@@ -16,4 +7,5 @@   import Prelude    main = do-    print (show 1.0)+    logShow (show 1.0)+    log "Done"
+ examples/passing/ModuleExportDupes/A.purs view
@@ -0,0 +1,3 @@+module A (module Prelude) where++import Prelude
+ examples/passing/ModuleExportDupes/B.purs view
@@ -0,0 +1,3 @@+module B (module Prelude) where++import Prelude
+ examples/passing/ModuleExportDupes/C.purs view
@@ -0,0 +1,4 @@+module C (module Prelude, module A) where++import Prelude+import A
examples/passing/ModuleExportExcluded.purs view
@@ -1,14 +1,11 @@-module A (module Prelude, foo) where-  import Prelude--  foo :: Number -> Number-  foo _ = 0.0- module Main where-  import Control.Monad.Eff.Console-  import A (foo) -  otherwise = false+import Prelude+import Control.Monad.Eff.Console (log, logShow)+import A (foo) -  main = do-    print "1.0"+otherwise = false++main = do+  logShow "1.0"+  log "Done"
+ examples/passing/ModuleExportExcluded/A.purs view
@@ -0,0 +1,6 @@+module A (module Prelude, foo) where++import Prelude++foo :: Number -> Number+foo _ = 0.0
examples/passing/ModuleExportQualified.purs view
@@ -1,9 +1,9 @@-module A (module Prelude) where-  import Prelude- module Main where-  import Control.Monad.Eff.Console-  import qualified A as B -  main = do-    print (B.show 1.0)+import Prelude+import Control.Monad.Eff.Console (log, logShow)+import A as B++main = do+  logShow (B.show 1.0)+  log "Done"
+ examples/passing/ModuleExportQualified/A.purs view
@@ -0,0 +1,3 @@+module A (module Prelude) where++import Prelude
examples/passing/ModuleExportSelf.purs view
@@ -1,14 +1,11 @@-module A (module A, module Prelude) where-  import Prelude--  type Foo = Boolean- module Main where-  import Control.Monad.Eff.Console-  import A -  bar :: Foo-  bar = true+import Control.Monad.Eff.Console+import A -  main = do-    print (show bar)+bar :: Foo+bar = true++main = do+  logShow (show bar)+  log "Done"
+ examples/passing/ModuleExportSelf/A.purs view
@@ -0,0 +1,5 @@+module A (module A, module Prelude) where
+
+import Prelude
+
+type Foo = Boolean
examples/passing/Monad.purs view
@@ -1,6 +1,6 @@ module Main where -import Prelude ()+import Control.Monad.Eff.Console (log)  type Monad m = { return :: forall a. a -> m a 	 , bind :: forall a b. m a -> (a -> m b) -> m b }@@ -29,4 +29,4 @@  test2 = test maybe -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/MonadState.purs view
@@ -58,4 +58,6 @@     same :: forall a. (a -> a) -> (a -> a)     same = id -main = print $ runState 0 (modify (+ 1))+main = do+  logShow $ runState 0 (modify (_ + 1))+  log "Done"
examples/passing/MultiArgFunctions.purs view
@@ -1,7 +1,7 @@ module Main where  import Prelude-import Data.Function+import Data.Function.Uncurried import Control.Monad.Eff import Control.Monad.Eff.Console @@ -23,5 +23,5 @@   runFn8 (mkFn8 $ \a b c d e f g h -> log $ show [a, b, c, d, e, f, g, h]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0   runFn9 (mkFn9 $ \a b c d e f g h i -> log $ show [a, b, c, d, e, f, g, h, i]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0   runFn10 (mkFn10 $ \a b c d e f g h i j-> log $ show [a, b, c, d, e, f, g, h, i, j]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0-  print $ runFn2 g 0.0 0.0-  log "Done!"+  logShow $ runFn2 g 0.0 0.0+  log "Done"
examples/passing/MutRec.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  f 0.0 = 0.0 f x = g x + 0.0@@ -16,4 +17,4 @@  oddToNumber (Odd n) = evenToNumber n + 0.0 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/MutRec2.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data A = A B @@ -16,4 +17,4 @@ showN :: A -> S showN a = f a -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/MutRec3.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data A = A B @@ -16,4 +17,4 @@ showN :: A -> S showN a = f a -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/NamedPatterns.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  foo = \x -> case x of-  y@{ foo = "Foo" } -> y+  y@{ foo: "Foo" } -> y   y -> y -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/NegativeBinder.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test :: Number -> Boolean test -1.0 = false test _  = true -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/NegativeIntInRange.purs view
@@ -1,8 +1,9 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  n :: Int n = -2147483648 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Nested.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Extend r a = Extend { prev :: r a, next :: a }  data Matrix r a = Square (r (r a)) | Bigger (Matrix (Extend r) a) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/NestedTypeSynonyms.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type X = String type Y = X -> X@@ -8,4 +9,4 @@ fn :: Y fn a = a -main = Control.Monad.Eff.Console.print (fn "Done")+main = log (fn "Done")
examples/passing/NestedWhere.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  f x = g x   where@@ -9,4 +10,4 @@     go x = go1 (x - 1.0)     go1 x = go x -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Newtype.purs view
@@ -7,17 +7,17 @@ newtype Thing = Thing String  instance showThing :: Show Thing where-  show (Thing x) = "Thing " ++ show x+  show (Thing x) = "Thing " <> show x  newtype Box a = Box a  instance showBox :: (Show a) => Show (Box a) where-  show (Box x) = "Box " ++ show x+  show (Box x) = "Box " <> show x  apply f x = f x  main = do-  print $ Thing "hello"-  print $ Box 42.0-  print $ apply Box 9000.0+  logShow $ Thing "hello"+  logShow $ Box 42.0+  logShow $ apply Box 9000.0   log "Done"
examples/passing/NewtypeWithRecordUpdate.purs view
@@ -5,9 +5,9 @@ import Prelude import Control.Monad.Eff.Console -newtype NewType a = NewType (Object a)+newtype NewType a = NewType (Record a) -rec1 :: Object (a :: Number, b :: Number, c:: Number)+rec1 :: Record (a :: Number, b :: Number, c:: Number) rec1 = { a: 0.0, b: 0.0, c: 0.0 }  rec2 :: NewType (a :: Number, b :: Number, c :: Number)
examples/passing/NonConflictingExports.purs view
@@ -1,14 +1,10 @@-module A where--  thing :: Int-  thing = 1- -- No failure here as the export `thing` only refers to Main.thing module Main (thing, main) where -  import A+import A+import Control.Monad.Eff.Console (log) -  thing :: Int-  thing = 2+thing :: Int+thing = 2 -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/NonConflictingExports/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/passing/NumberLiterals.purs view
@@ -0,0 +1,39 @@+module Main where++-- See issue #2115.++import Prelude+import Test.Assert (assert')+import Control.Monad.Eff.Console (log)++main = do+  test "0.17" 0.17+  test "0.25996181067141905" 0.25996181067141905+  test "0.3572019862807257" 0.3572019862807257+  test "0.46817723004874223" 0.46817723004874223+  test "0.9640035681058178" 0.9640035681058178+  test "4.23808622486133" 4.23808622486133+  test "4.540362294799751" 4.540362294799751+  test "5.212384849884261" 5.212384849884261+  test "13.958257048123212" 13.958257048123212+  test "32.96176575630599" 32.96176575630599+  test "38.47735512322269" 38.47735512322269++  test "10000000000" 1e10+  test "10000000000" 1.0e10+  test "0.00001" 1e-5+  test "0.00001" 1.0e-5+  test "1.5339794352098402e-118" 1.5339794352098402e-118+  test "2.108934760892056e-59" 2.108934760892056e-59+  test "2.250634744599241e-19" 2.250634744599241e-19+  test "5.960464477539063e-8" 5.960464477539063e-8+  test "5e-324" 5e-324+  test "5e-324" 5.0e-324++  log "Done"++test str num =+  if (show num == str)+    then pure unit+    else flip assert' false $+      "Expected " <> show str <> ", got " <> show (show num) <> "."
examples/passing/ObjectGetter.purs view
@@ -1,13 +1,14 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)  getX = _.x  point = { x: 1.0, y: 0.0 }  main = do-  Control.Monad.Eff.Console.print $ getX point-  Control.Monad.Eff.Console.log $ _." 123 string Prop Name " { " 123 string Prop Name ": "OK" }-  Control.Monad.Eff.Console.log $ (_.x >>> _.y) { x: { y: "Nested" } }-  Control.Monad.Eff.Console.log $ _.value { value: "Done!" }+  logShow $ getX point+  log $ _." 123 string Prop Name " { " 123 string Prop Name ": "OK" }+  log $ (_.x >>> _.y) { x: { y: "Nested" } }+  log $ _.value { value: "Done" }
examples/passing/ObjectSynonym.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type Inner = Number @@ -12,4 +13,4 @@ outer :: Outer outer = { inner: inner } -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/ObjectUpdate.purs view
@@ -1,20 +1,23 @@-module Main where--import Prelude--update1 = \o -> o { foo = "Foo" }--update2 :: forall r. { foo :: String | r } -> { foo :: String | r }-update2 = \o -> o { foo = "Foo" }--replace = \o -> case o of-  { foo = "Foo" } -> o { foo = "Bar" }-  { foo = "Bar" } -> o { bar = "Baz" }-  o -> o--polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }-polyUpdate = \o -> o { foo = "Foo" }--inferPolyUpdate = \o -> o { foo = "Foo" }--main = Control.Monad.Eff.Console.log ((update1 {foo: ""}).foo)+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+update1 = \o -> o { foo = "Foo" }
+
+update2 :: forall r. { foo :: String | r } -> { foo :: String | r }
+update2 = \o -> o { foo = "Foo" }
+
+replace = \o -> case o of
+  { foo: "Foo" } -> o { foo = "Bar" }
+  { foo: "Bar" } -> o { bar = "Baz" }
+  o -> o
+
+polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
+polyUpdate = \o -> o { foo = "Foo" }
+
+inferPolyUpdate = \o -> o { foo = "Foo" }
+
+main = do
+  log ((update1 {foo: ""}).foo)
+  log "Done"
examples/passing/ObjectUpdate2.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type X r = { | r } @@ -14,4 +15,4 @@   { baz = "blah"   } -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/ObjectUpdater.purs view
@@ -6,7 +6,7 @@ import Test.Assert  getValue :: forall e. Eff (| e) Boolean-getValue = return true+getValue = pure true  main = do   let record = { value: false }@@ -22,3 +22,5 @@    let record2 = (_ { x = _ }) { x: 0.0 } 10.0   assert $ record2.x == 10.0++  log "Done"
examples/passing/ObjectWildcards.purs view
@@ -8,13 +8,13 @@ mkRecord = { foo: _, bar: _, baz: "baz" }  getValue :: forall e. Eff (| e) Boolean-getValue = return true+getValue = pure true  main = do   obj <- { value: _ } <$> getValue-  print obj.value+  logShow obj.value   let x = 1.0-  point <- { x: _, y: x } <$> return 2.0+  point <- { x: _, y: x } <$> pure 2.0   assert $ point.x == 2.0   assert $ point.y == 1.0-  log (mkRecord 1.0 "Done!").bar+  log (mkRecord 1.0 "Done").bar
examples/passing/Objects.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude hiding (append)+import Control.Monad.Eff.Console (log)  test = \x -> x.foo + x.bar + 1.0 @@ -25,11 +26,11 @@   weirdObj = { "!@#": 1.0 }  test5 = case { "***": 1.0 } of-  { "***" = n } -> n+  { "***": n } -> n  test6 = case { "***": 1.0 } of              { "***": n } -> n  test7 {a:    snoog , b     : blah } = blah -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/OneConstructor.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data One a = One a  one' (One a) = a -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/OperatorAliasElsewhere.purs view
@@ -1,8 +1,3 @@-module Def where--what :: forall a b. a -> b -> a-what a _ = a- module Main where  import Prelude
+ examples/passing/OperatorAliasElsewhere/Def.purs view
@@ -0,0 +1,4 @@+module Def where
+
+what :: forall a b. a -> b -> a
+what a _ = a
examples/passing/OperatorAssociativity.purs view
@@ -1,25 +1,25 @@-module Main where--import Prelude-import Control.Monad.Eff-import Control.Monad.Eff.Console-import Test.Assert--bug :: Number -> Number -> Number-bug a b = 0.0 - (a - b)--main = do-  assert (bug 0.0 2.0 == 2.0)-  assert (0.0 - (0.0 - 2.0) == 2.0)-  assert (0.0 - (0.0 + 2.0) == -2.0)-  assert (6.0 / (3.0 * 2.0) == 1.0)-  assert ((6.0 / 3.0) * 2.0 == 4.0)-  assert (not (1.0 < 0.0) == true)-  assert (not ((negate 1.0) < 0.0) == false)-  assert (negate (1.0 + 10.0) == -11.0)-  assert (2.0 * 3.0 / 4.0 == 1.5)-  assert (1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0)-  assert (1.0 + 10.0 - 5.0 == 6.0)-  assert (1.0 + 10.0 * 5.0 == 51.0)-  assert (10.0 * 5.0 - 1.0 == 49.0)-  log "Success!"+module Main where
+
+import Prelude
+import Control.Monad.Eff
+import Control.Monad.Eff.Console
+import Test.Assert
+
+bug :: Number -> Number -> Number
+bug a b = 0.0 - (a - b)
+
+main = do
+  assert (bug 0.0 2.0 == 2.0)
+  assert (0.0 - (0.0 - 2.0) == 2.0)
+  assert (0.0 - (0.0 + 2.0) == -2.0)
+  assert (6.0 / (3.0 * 2.0) == 1.0)
+  assert ((6.0 / 3.0) * 2.0 == 4.0)
+  assert (not (1.0 < 0.0) == true)
+  assert (not ((negate 1.0) < 0.0) == false)
+  assert (negate (1.0 + 10.0) == -11.0)
+  assert (2.0 * 3.0 / 4.0 == 1.5)
+  assert (1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0)
+  assert (1.0 + 10.0 - 5.0 == 6.0)
+  assert (1.0 + 10.0 * 5.0 == 51.0)
+  assert (10.0 * 5.0 - 1.0 == 49.0)
+  log "Done"
examples/passing/OperatorInlining.purs view
@@ -1,47 +1,48 @@ module Main where  import Prelude-import Control.Monad.Eff.Console+import Control.Monad.Eff.Console (logShow, log)  main = do    -- semiringNumber-  print (1.0 + 2.0)-  print (1.0 * 2.0)+  logShow (1.0 + 2.0)+  logShow (1.0 * 2.0)    -- ringNumber-  print (1.0 - 2.0)-  print (negate 1.0)+  logShow (1.0 - 2.0)+  logShow (negate 1.0)    -- moduleSemiringNumber-  print (1.0 / 2.0)+  logShow (1.0 / 2.0)    -- ordNumber-  print (1.0 > 2.0)-  print (1.0 < 2.0)-  print (1.0 <= 2.0)-  print (1.0 >= 2.0)-  print (1.0 == 2.0)+  logShow (1.0 > 2.0)+  logShow (1.0 < 2.0)+  logShow (1.0 <= 2.0)+  logShow (1.0 >= 2.0)+  logShow (1.0 == 2.0)    -- eqNumber-  print (1.0 == 2.0)-  print (1.0 /= 2.0)+  logShow (1.0 == 2.0)+  logShow (1.0 /= 2.0)    -- eqString-  print ("foo" == "bar")-  print ("foo" /= "bar")+  logShow ("foo" == "bar")+  logShow ("foo" /= "bar")    -- eqBoolean-  print (true == false)-  print (true /= false)+  logShow (true == false)+  logShow (true /= false)    -- semigroupString-  print ("foo" ++ "bar")-  print ("foo" <> "bar")+  logShow ("foo" <> "bar")    -- latticeBoolean-  print (top && true)-  print (bottom || false)+  logShow (top && true)+  logShow (bottom || false)    -- complementedLatticeBoolean-  print (not true)+  logShow (not true)++  log "Done"
examples/passing/OperatorSections.purs view
@@ -1,17 +1,18 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log) import Test.Assert  main = do-  assert $ (/ 2.0) 4.0 == 2.0-  assert $ (2.0 /) 4.0 == 0.5-  assert $ (`const` 1.0) 2.0 == 2.0-  assert $ (1.0 `const`) 2.0 == 1.0+  assert $ (_ / 2.0) 4.0 == 2.0+  assert $ (2.0 / _) 4.0 == 0.5+  assert $ (_ `const` 1.0) 2.0 == 2.0+  assert $ (1.0 `const` _) 2.0 == 1.0   let foo = { x: 2.0 }-  assert $ (/ foo.x) 4.0 == 2.0-  assert $ (foo.x /) 4.0 == 0.5-  let (//) x y = x.x / y.x-  assert $ (// foo { x = 4.0 }) { x: 4.0 } == 1.0-  assert $ (foo { x = 4.0 } //) { x: 4.0 } == 1.0-  Control.Monad.Eff.Console.log "Done!"+  assert $ (_ / foo.x) 4.0 == 2.0+  assert $ (foo.x / _) 4.0 == 0.5+  let div x y = x.x / y.x+  assert $ (_ `div` foo { x = 4.0 }) { x: 4.0 } == 1.0+  assert $ (foo { x = 4.0 } `div` _) { x: 4.0 } == 1.0+  log "Done"
examples/passing/Operators.purs view
@@ -1,16 +1,17 @@ module Main where  import Prelude+import Other (foo)+import Other as Other import Control.Monad.Eff import Control.Monad.Eff.Console -(?!) :: forall a. a -> a -> a-(?!) x _ = x+op1 :: forall a. a -> a -> a+op1 x _ = x -bar :: String -> String -> String-bar = \s1 s2 -> s1 ++ s2+infix 4 op1 as ?! -test1 :: forall n. (Num n) => n -> n -> (n -> n -> n) -> n+test1 :: forall n. (Semiring n) => n -> n -> (n -> n -> n) -> n test1 x y z = x * y + z x y  test2 = (\x -> x.foo false) { foo : \_ -> 1.0 }@@ -21,40 +22,39 @@  test4 = 1 `k` 2 -infixl 5 %%+op2 :: Number -> Number -> Number+op2 x y = x * y + y -(%%) :: Number -> Number -> Number-(%%) x y = x * y + y+infixl 5 op2 as %%  test5 = 1.0 %% 2.0 %% 3.0  test6 = ((\x -> x) `k` 2.0) 3.0 -(<+>) :: String -> String -> String-(<+>) = \s1 s2 -> s1 ++ s2+op3 :: String -> String -> String+op3 = \s1 s2 -> s1 <> s2 +infix 4 op3 as <+>+ test7 = "Hello" <+> "World!" -(@@) :: forall a b. (a -> b) -> a -> b-(@@) = \f x -> f x+op4 :: forall a b. (a -> b) -> a -> b+op4 = \f x -> f x -foo :: String -> String-foo = \s -> s+infix 4 op4 as @@  test8 = foo @@ "Hello World" -test9 = Main.foo @@ "Hello World"--test10 = "Hello" `Main.bar` "World"+test9 = Other.foo @@ "Hello World" -(...) :: forall a. Array a -> Array a -> Array a-(...) = \as -> \bs -> as+test10 = "Hello" `Other.baz` "World" -test11 = [1.0, 2.0, 0.0] ... [4.0, 5.0, 6.0]+op5 :: forall a. Array a -> Array a -> Array a+op5 = \as -> \bs -> as -test12 (<%>) a b = a <%> b+infix 4 op5 as ... -test13 = \(<%>) a b -> a <%> b+test11 = [1.0, 2.0, 0.0] ... [4.0, 5.0, 6.0]  test14 :: Number -> Number -> Boolean test14 a b = a < b@@ -71,11 +71,6 @@ test19 :: Number test19 = negate $ negate (-1.0) -test20 :: Number-test20 = 1.0 @ 2.0-  where-  (@) x y = x + y * y- main = do   let t1 = test1 1.0 2.0 (\x y -> x + y)   let t2 = test2@@ -88,12 +83,9 @@   let t9 = test9   let t10 = test10   let t11 = test11-  let t12 = test12 k 1.0 2.0-  let t13 = test13 k 1.0 2.0   let t14 = test14 1.0 2.0   let t15 = test15 1.0 2.0   let t17 = test17   let t18 = test18   let t19 = test19-  let t20 = test20   log "Done"
+ examples/passing/Operators/Other.purs view
@@ -0,0 +1,7 @@+module Other where++foo :: String -> String+foo s = s++baz :: String -> String -> String+baz s _ = s
examples/passing/OptimizerBug.purs view
@@ -1,9 +1,10 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  x a = 1.0 + y a  y a = x a -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/OptionalQualified.purs view
@@ -1,7 +1,6 @@ module Main where --- qualified import with the "qualified" keyword-import qualified Prelude as P+import Prelude as P  -- qualified import without the "qualified" keyword import Control.Monad.Eff.Console as Console@@ -9,5 +8,5 @@ bind = P.bind  main = do-  message <- P.return "success!"+  message <- P.pure "Done"   Console.log message
examples/passing/OverlappingInstances.purs view
@@ -1,13 +1,17 @@-module Main where--import Prelude--data A = A--instance showA1 :: Show A where-  show A = "Instance 1"--instance showA2 :: Show A where-  show A = "Instance 2"--main = Test.Assert.assert $ show A == "Instance 1"+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+import Test.Assert (assert)
+
+data A = A
+
+instance showA1 :: Show A where
+  show A = "Instance 1"
+
+instance showA2 :: Show A where
+  show A = "Instance 2"
+
+main = do
+  assert $ show A == "Instance 1"
+  log "Done"
examples/passing/OverlappingInstances2.purs view
@@ -1,23 +1,27 @@-module Main where--import Prelude--data A = A | B--instance eqA1 :: Eq A where-  eq A A = true-  eq B B = true-  eq _ _ = false--instance eqA2 :: Eq A where-  eq _ _ = true--instance ordA :: Ord A where-  compare A B = LT-  compare B A = GT-  compare _ _ = EQ--test :: forall a. (Ord a) => a -> a -> String-test x y = show $ x == y--main = Test.Assert.assert $ test A B == "false"+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+import Test.Assert (assert)
+
+data A = A | B
+
+instance eqA1 :: Eq A where
+  eq A A = true
+  eq B B = true
+  eq _ _ = false
+
+instance eqA2 :: Eq A where
+  eq _ _ = true
+
+instance ordA :: Ord A where
+  compare A B = LT
+  compare B A = GT
+  compare _ _ = EQ
+
+test :: forall a. (Ord a) => a -> a -> String
+test x y = show $ x == y
+
+main = do
+  assert $ test A B == "false"
+  log "Done"
examples/passing/OverlappingInstances3.purs view
@@ -1,16 +1,20 @@-module Main where--import Prelude--class Foo a--instance foo1 :: Foo Number--instance foo2 :: Foo Number--test :: forall a. (Foo a) => a -> a-test a = a--test1 = test 0.0--main = Test.Assert.assert (test1 == 0.0)+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+import Test.Assert (assert)
+
+class Foo a
+
+instance foo1 :: Foo Number
+
+instance foo2 :: Foo Number
+
+test :: forall a. (Foo a) => a -> a
+test a = a
+
+test1 = test 0.0
+
+main = do
+  assert (test1 == 0.0)
+  log "Done"
+ examples/passing/ParensInTypedBinder.purs view
@@ -0,0 +1,20 @@+module Main where++import Prelude+import Control.Monad.Eff (Eff)+import Control.Monad.Eff.Console (CONSOLE, log)++foo :: Array Int+foo = do+  xss :: Array (Array Int) <- [[[1,2,3], [4, 5]], [[6]]]+  xs :: Array Int <- xss+  xs++main :: +    forall eff.+      Eff+        ( console :: CONSOLE+        | eff+        )+        Unit+main = log "Done"
examples/passing/PartialFunction.purs view
@@ -1,9 +1,11 @@ module Main where  import Prelude-import Test.Assert+import Control.Monad.Eff+import Control.Monad.Eff.Console +fn :: Partial => Number -> Number fn 0.0 = 0.0 fn 1.0 = 2.0 -main = assertThrows $ \_ -> fn 2.0+main = log "Done"
examples/passing/Patterns.purs view
@@ -1,14 +1,15 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test = \x -> case x of-  { str = "Foo", bool = true } -> true-  { str = "Bar", bool = b } -> b+  { str: "Foo", bool: true } -> true+  { str: "Bar", bool: b } -> b   _ -> false  f = \o -> case o of-  { foo = "Foo" } -> o.bar+  { foo: "Foo" } -> o.bar   _ -> 0  h = \o -> case o of@@ -19,4 +20,4 @@ isDesc [x, y] | x > y = true isDesc _ = false -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/PendingConflictingImports.purs view
@@ -1,17 +1,8 @@-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2- module Main where -  -- No error as we never force `thing` to be resolved in `Main`-  import A-  import B+-- No error as we never force `thing` to be resolved in `Main`+import A+import B+import Control.Monad.Eff.Console (log) -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/PendingConflictingImports/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/passing/PendingConflictingImports/B.purs view
@@ -0,0 +1,4 @@+module B where++thing :: Int+thing = 2
examples/passing/PendingConflictingImports2.purs view
@@ -1,14 +1,10 @@-module A where--  thing :: Int-  thing = 1- module Main where -  import A+import A+import Control.Monad.Eff.Console (log) -  -- No error as we never force `thing` to be resolved in `Main`-  thing :: Int-  thing = 2+-- No error as we never force `thing` to be resolved in `Main`+thing :: Int+thing = 2 -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/PendingConflictingImports2/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
examples/passing/Person.purs view
@@ -1,11 +1,12 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Person = Person { name :: String, age :: Number }  showPerson :: Person -> String showPerson = \p -> case p of-  Person o -> o.name ++ ", aged " ++ show o.age+  Person o -> o.name <> ", aged " <> show o.age -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/PrimedTypeName.purs view
@@ -0,0 +1,20 @@+module Main (T, T', T'', T''', main) where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+data T a = T
+type T' = T Unit
+
+data T'' = TP
+
+foreign import data T''' ∷ *
+
+instance eqT ∷ Eq T'' where
+  eq _ _ = true
+
+type A' a b = b → a
+
+infixr 4 type A' as ↫
+
+main = log "Done"
+ examples/passing/QualifiedNames.purs view
@@ -0,0 +1,11 @@+module Main where
+
+import Prelude
+import Either as Either
+import Control.Monad.Eff.Console (log)
+
+either :: forall a b c. (a -> c) -> (b -> c) -> Either.Either a b -> c
+either f _ (Either.Left x) = f x
+either _ g (Either.Right y) = g y
+
+main = log (either id id (Either.Left "Done"))
+ examples/passing/QualifiedNames/Either.purs view
@@ -0,0 +1,5 @@+module Either where
+
+import Prelude
+
+data Either a b = Left a | Right b
examples/passing/QualifiedQualifiedImports.purs view
@@ -1,6 +1,6 @@ module Main where  -- qualified import with qualified imported names-import qualified Control.Monad.Eff.Console (log) as Console+import Control.Monad.Eff.Console (log) as Console -main = Console.log "Success!"+main = Console.log "Done"
examples/passing/Rank2Data.purs view
@@ -1,29 +1,30 @@-module Main where--import Prelude hiding (add)--data Id = Id forall a. a -> a--runId = \id a -> case id of-  Id f -> f a--data Nat = Nat forall r. r -> (r -> r) -> r--runNat = \nat -> case nat of-  Nat f -> f 0.0 (\n -> n + 1.0)--zero' = Nat (\zero' _ -> zero')--succ = \n -> case n of-  Nat f -> Nat (\zero' succ -> succ (f zero' succ))--add = \n m -> case n of-  Nat f -> case m of-    Nat g -> Nat (\zero' succ -> g (f zero' succ) succ)--one' = succ zero'-two = succ zero'-four = add two two-fourNumber = runNat four--main = Control.Monad.Eff.Console.log "Done'"+module Main where
+
+import Prelude hiding (add)
+import Control.Monad.Eff.Console (log)
+
+data Id = Id forall a. a -> a
+
+runId = \id a -> case id of
+  Id f -> f a
+
+data Nat = Nat forall r. r -> (r -> r) -> r
+
+runNat = \nat -> case nat of
+  Nat f -> f 0.0 (\n -> n + 1.0)
+
+zero' = Nat (\zero' _ -> zero')
+
+succ = \n -> case n of
+  Nat f -> Nat (\zero' succ -> succ (f zero' succ))
+
+add = \n m -> case n of
+  Nat f -> case m of
+    Nat g -> Nat (\zero' succ -> g (f zero' succ) succ)
+
+one' = succ zero'
+two = succ zero'
+four = add two two
+fourNumber = runNat four
+
+main = log "Done"
examples/passing/Rank2Object.purs view
@@ -6,6 +6,6 @@ data Foo = Foo { id :: forall a. a -> a }  foo :: Foo -> Number-foo (Foo { id = f }) = f 0.0+foo (Foo { id: f }) = f 0.0  main = log "Done"
examples/passing/Rank2TypeSynonym.purs view
@@ -1,7 +1,7 @@ module Main where  import Prelude-import Control.Monad.Eff+import Control.Monad.Eff.Console (log, logShow)  type Foo a = forall f. (Monad f) => f a @@ -13,4 +13,5 @@  main = do   x <- bar-  Control.Monad.Eff.Console.print x+  logShow x+  log "Done"
examples/passing/Rank2Types.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test1 :: (forall a. (a -> a)) -> Number test1 = \f -> f 0.0@@ -8,4 +9,4 @@ forever :: forall m a b. (forall a b. m a -> (a -> m b) -> m b) -> m a -> m b forever = \bind action -> bind action $ \_ -> forever bind action -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/ReExportQualified.purs view
@@ -1,16 +1,7 @@-module A where-  x = "Do"--module B where-  y = "ne"--module C (module A, module M2) where-  import A-  import qualified B as M2- module Main where -  import Prelude-  import C+import Prelude+import C+import Control.Monad.Eff.Console (log) -  main = Control.Monad.Eff.Console.log (x ++ y)+main = log (x <> y)
+ examples/passing/ReExportQualified/A.purs view
@@ -0,0 +1,3 @@+module A where++x = "Do"
+ examples/passing/ReExportQualified/B.purs view
@@ -0,0 +1,3 @@+module B where++y = "ne"
+ examples/passing/ReExportQualified/C.purs view
@@ -0,0 +1,4 @@+module C (module A, module M2) where++import A+import B as M2
examples/passing/RebindableSyntax.purs view
@@ -1,39 +1,43 @@-module Main where--import Prelude--example1 :: String-example1 = do-  "Do"-  " notation"-  " for"-  " Semigroup"-  where-  bind x f = x <> f unit--(*>) :: forall f a b. (Apply f) => f a -> f b -> f b-(*>) fa fb = const id <$> fa <*> fb--newtype Const a b = Const a--runConst :: forall a b. Const a b -> a-runConst (Const a) = a--instance functorConst :: Functor (Const a) where-  map _ (Const a) = Const a--instance applyConst :: (Semigroup a) => Apply (Const a) where-  apply (Const a1) (Const a2) = Const (a1 <> a2)--example2 :: Const String Unit-example2 = do-  Const "Do"-  Const " notation"-  Const " for"-  Const " Apply"-  where-  bind x f = x *> f unit--main = do-  Control.Monad.Eff.Console.log example1-  Control.Monad.Eff.Console.log $ runConst example2+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+example1 :: String
+example1 = do
+  "Do"
+  " notation"
+  " for"
+  " Semigroup"
+  where
+  bind x f = x <> f unit
+
+applySecond :: forall f a b. (Apply f) => f a -> f b -> f b
+applySecond fa fb = const id <$> fa <*> fb
+
+infixl 4 applySecond as *>
+
+newtype Const a b = Const a
+
+runConst :: forall a b. Const a b -> a
+runConst (Const a) = a
+
+instance functorConst :: Functor (Const a) where
+  map _ (Const a) = Const a
+
+instance applyConst :: (Semigroup a) => Apply (Const a) where
+  apply (Const a1) (Const a2) = Const (a1 <> a2)
+
+example2 :: Const String Unit
+example2 = do
+  Const "Do"
+  Const " notation"
+  Const " for"
+  Const " Apply"
+  where
+  bind x f = x *> f unit
+
+main = do
+  log example1
+  log $ runConst example2
+  log "Done"
examples/passing/Recursion.purs view
@@ -1,10 +1,11 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  fib = \n -> case n of   0.0 -> 1.0   1.0 -> 1.0   n -> fib (n - 1.0) + fib (n - 2.0) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/RedefinedFixity.purs view
@@ -0,0 +1,6 @@+module Main where
+
+import M3
+import Control.Monad.Eff.Console (log)
+
+main = log "Done"
+ examples/passing/RedefinedFixity/M1.purs view
@@ -0,0 +1,6 @@+module M1 where
+
+applyFn :: forall a b. (forall c d. c -> d) -> a -> b
+applyFn f a = f a
+
+infixr 1000 applyFn as $
+ examples/passing/RedefinedFixity/M2.purs view
@@ -0,0 +1,5 @@+module M2 where
+
+import Prelude ()
+
+import M1
+ examples/passing/RedefinedFixity/M3.purs view
@@ -0,0 +1,6 @@+module M3 where
+
+import Prelude ()
+
+import M1
+import M2
examples/passing/ReservedWords.purs view
@@ -2,6 +2,8 @@ module Main where  import Prelude+import Control.Monad.Eff+import Control.Monad.Eff.Console (log)  o :: { type :: String } o = { type: "o" }@@ -10,6 +12,8 @@ p = o { type = "p" }  f :: forall r. { type :: String | r } -> String-f { type = "p" } = "Done"+f { type: "p" } = "Done"+f _ = "Fail" -main = Control.Monad.Eff.Console.log $ f { type: p.type, foo: "bar" }+main :: Eff _ _+main = log $ f { type: p.type, foo: "bar" }
examples/passing/ResolvableScopeConflict.purs view
@@ -1,25 +1,13 @@-module A where--  thing :: Int-  thing = 1--module B where--  thing :: Int-  thing = 2--  zing :: Int-  zing = 3- module Main where -  import A (thing)-  import B+import A (thing)+import B+import Control.Monad.Eff.Console (log) -  -- Not an error as although we have `thing` in scope from both A and B, it is-  -- imported explicitly from A, giving it a resolvable solution.-  what :: Boolean -> Int-  what true = thing-  what false = zing+-- Not an error as although we have `thing` in scope from both A and B, it is+-- imported explicitly from A, giving it a resolvable solution.+what :: Boolean -> Int+what true = thing+what false = zing -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/ResolvableScopeConflict/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
+ examples/passing/ResolvableScopeConflict/B.purs view
@@ -0,0 +1,7 @@+module B where++thing :: Int+thing = 2++zing :: Int+zing = 3
examples/passing/ResolvableScopeConflict2.purs view
@@ -1,22 +1,15 @@-module A where--  thing :: Int-  thing = 2--  zing :: Int-  zing = 3- module Main where -  import A+import A+import Control.Monad.Eff.Console (log) -  thing :: Int-  thing = 1+thing :: Int+thing = 1 -  -- Not an error as although we have `thing` in scope from both Main and A,-  -- as the local declaration takes precedence over the implicit import-  what :: Boolean -> Int-  what true = thing-  what false = zing+-- Not an error as although we have `thing` in scope from both Main and A,+-- as the local declaration takes precedence over the implicit import+what :: Boolean -> Int+what true = thing+what false = zing -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/ResolvableScopeConflict2/A.purs view
@@ -0,0 +1,7 @@+module A where++thing :: Int+thing = 2++zing :: Int+zing = 3
examples/passing/ResolvableScopeConflict3.purs view
@@ -1,15 +1,9 @@-module A where--  thing :: Int-  thing = 1- module Main (thing, main, module A) where -  import A--  thing :: Int-  thing = 2--  main = Control.Monad.Eff.Console.log "Done"+import A+import Control.Monad.Eff.Console (log) +thing :: Int+thing = 2 +main = log "Done"
+ examples/passing/ResolvableScopeConflict3/A.purs view
@@ -0,0 +1,4 @@+module A where++thing :: Int+thing = 1
examples/passing/RowConstructors.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type Foo = (x :: Number | (y :: Number | (z :: Number))) type Bar = (x :: Number, y :: Number, z :: Number)@@ -12,7 +13,7 @@ bar :: { | Bar } bar = { x: 0.0, y: 0.0, z: 0.0 } -id' :: Object Foo -> Object Bar+id' :: Record Foo -> Record Bar id' = id  foo' :: { | Foo }@@ -39,4 +40,4 @@ wildcard' :: { | Quux _ } -> Number wildcard' { q: q } = q -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/RowPolyInstanceContext.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class T s m where   state :: (s -> s) -> m Unit@@ -11,12 +12,12 @@   state f = S $ \s -> { new: f s, ret: unit }  test1 :: forall r . S { foo :: String | r } Unit-test1 = state $ \o -> o { foo = o.foo ++ "!" }+test1 = state $ \o -> o { foo = o.foo <> "!" }  test2 :: forall m r . (T { foo :: String | r } m) => m Unit-test2 = state $ \o -> o { foo = o.foo ++ "!" }+test2 = state $ \o -> o { foo = o.foo <> "!" }  main = do   let t1 = test1   let t2 = test2-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/RuntimeScopeIssue.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)  class A a where   a :: a -> Boolean@@ -16,4 +17,6 @@   b 0.0 = false   b n = a (n - 1.0) -main = Control.Monad.Eff.Console.print $ a 10.0+main = do+  logShow $ a 10.0+  log "Done"
examples/passing/ScopedTypeVariables.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test1 :: forall a. (a -> a) -> a -> a test1 f x = g (g x)@@ -33,4 +34,4 @@       j x = x  -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Sequence.purs view
@@ -2,6 +2,7 @@  import Prelude import Control.Monad.Eff+import Control.Monad.Eff.Console (log)  data List a = Cons a (List a) | Nil @@ -12,4 +13,4 @@   sequence Nil = pure Nil   sequence (Cons x xs) = Cons <$> x <*> sequence xs -main = sequence $ Cons (Control.Monad.Eff.Console.log "Done") Nil+main = sequence $ Cons (log "Done") Nil
examples/passing/SequenceDesugared.purs view
@@ -2,6 +2,7 @@  import Prelude import Control.Monad.Eff+import Control.Monad.Eff.Console (log)  data List a = Cons a (List a) | Nil @@ -31,7 +32,7 @@   Cons x xs -> Cons <$> x <*> sequence sequenceList''' xs) :: forall m a. (Monad m) => List (m a) -> m (List a))  main = do-  sequence sequenceList $ Cons (Control.Monad.Eff.Console.log "Done") Nil-  sequence sequenceList' $ Cons (Control.Monad.Eff.Console.log "Done") Nil-  sequence sequenceList'' $ Cons (Control.Monad.Eff.Console.log "Done") Nil-  sequence sequenceList''' $ Cons (Control.Monad.Eff.Console.log "Done") Nil+  sequence sequenceList $ Cons (log "Done") Nil+  sequence sequenceList' $ Cons (log "Done") Nil+  sequence sequenceList'' $ Cons (log "Done") Nil+  sequence sequenceList''' $ Cons (log "Done") Nil
examples/passing/ShadowedModuleName.purs view
@@ -1,15 +1,8 @@-module Test where--  data Z = Z String--  runZ :: Z -> String-  runZ (Z s) = s- module Main where -  import Test-  import Control.Monad.Eff.Console+import Test+import Control.Monad.Eff.Console -  data Test = Test+data Test = Test -  main = log (runZ (Z "done"))+main = log (runZ (Z "Done"))
+ examples/passing/ShadowedModuleName/Test.purs view
@@ -0,0 +1,6 @@+module Test where++data Z = Z String++runZ :: Z -> String+runZ (Z s) = s
+ examples/passing/ShadowedName.purs view
@@ -0,0 +1,11 @@+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console
+import Control.Monad.Eff.Console (log)
+
+done :: String
+done = let str = "Not yet done" in
+        let str = "Done" in str
+
+main = log done
examples/passing/ShadowedTCO.purs view
@@ -1,18 +1,21 @@-module Main where--import Prelude hiding (add)--runNat f = f 0.0 (\n -> n + 1.0)--zero' z _ = z--succ f zero' succ = succ (f zero' succ)--add f g zero' succ = g (f zero' succ) succ--one' = succ zero'-two = succ one'-four = add two two-fourNumber = runNat four--main = Control.Monad.Eff.Console.log $ show fourNumber+module Main where
+
+import Prelude hiding (add)
+import Control.Monad.Eff.Console (log)
+
+runNat f = f 0.0 (\n -> n + 1.0)
+
+zero' z _ = z
+
+succ f zero' succ = succ (f zero' succ)
+
+add f g zero' succ = g (f zero' succ) succ
+
+one' = succ zero'
+two = succ one'
+four = add two two
+fourNumber = runNat four
+
+main = do
+  log $ show fourNumber
+  log "Done"
examples/passing/ShadowedTCOLet.purs view
@@ -1,9 +1,15 @@-module Main where--import Prelude--f x y z =-  let f 1.0 2.0 3.0 = 1.0-  in f x z y--main = Control.Monad.Eff.Console.log $ show $ f 1.0 3.0 2.0+module Main where
+
+import Prelude
+import Partial.Unsafe (unsafePartial)
+import Control.Monad.Eff
+import Control.Monad.Eff.Console (log)
+
+f x y z =
+  let f 1.0 2.0 3.0 = 1.0
+  in f x z y
+
+main :: Eff _ _
+main = do
+  log $ show $ unsafePartial f 1.0 3.0 2.0
+  log "Done"
examples/passing/SignedNumericLiterals.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  p = 0.5 q = 1.0@@ -14,4 +15,4 @@  test1 = 2.0 - 1.0 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/StringEscapes.purs view
@@ -1,15 +1,17 @@-module Main where--import Prelude ((==), bind)-import Test.Assert (assert)--singleCharacter = "\0\b\t\n\v\f\r\"\\" == "\x0\x8\x9\xA\xB\xC\xD\x22\x5C"-hex = "\x1D306\x2603\x3C6\xE0\x0" == "𝌆☃φà\0"-decimal  = "\119558\9731\966\224\0" == "𝌆☃φà\0"-surrogatePair = "\xD834\xDF06" == "\x1D306"--main = do-  assert singleCharacter-  assert hex-  assert decimal-  assert surrogatePair+module Main where
+
+import Prelude ((==), bind)
+import Test.Assert (assert)
+import Control.Monad.Eff.Console (log)
+
+singleCharacter = "\0\b\t\n\v\f\r\"\\" == "\x0\x8\x9\xA\xB\xC\xD\x22\x5C"
+hex = "\x1D306\x2603\x3C6\xE0\x0" == "𝌆☃φà\0"
+decimal  = "\119558\9731\966\224\0" == "𝌆☃φà\0"
+surrogatePair = "\xD834\xDF06" == "\x1D306"
+
+main = do
+  assert singleCharacter
+  assert hex
+  assert decimal
+  assert surrogatePair
+  log "Done"
examples/passing/Superclasses1.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)  class Su a where   su :: a -> a@@ -17,4 +18,6 @@ test :: forall a. (Cl a) => a -> a test a = su (cl a a) -main = Control.Monad.Eff.Console.print $ test 10.0+main = do+  logShow $ test 10.0+  log "Done"
examples/passing/Superclasses3.purs view
@@ -28,7 +28,7 @@   apply = ap  instance applicativeMTrace :: Applicative MTrace where-  pure = MTrace <<< return+  pure = MTrace <<< pure  instance bindMTrace :: Bind MTrace where   bind m f = MTrace (runMTrace m >>= (runMTrace <<< f))
examples/passing/TCO.purs view
@@ -1,20 +1,20 @@ module Main where  import Prelude-import Control.Monad.Eff.Console (print)+import Control.Monad.Eff.Console (log, logShow)  main = do   let f x = x + 1   let v = 0-  print (applyN 0 f v)-  print (applyN 1 f v)-  print (applyN 2 f v)-  print (applyN 3 f v)-  print (applyN 4 f v)+  logShow (applyN 0 f v)+  logShow (applyN 1 f v)+  logShow (applyN 2 f v)+  logShow (applyN 3 f v)+  logShow (applyN 4 f v)+  log "Done"  applyN :: forall a. Int -> (a -> a) -> a -> a applyN = go id   where   go f n _ | n <= 0 = f   go f n g = go (f >>> g) (n - 1) g-
examples/passing/TCOCase.purs view
@@ -1,10 +1,11 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Data = One | More Data -main = Control.Monad.Eff.Console.log (from (to 10000.0 One))+main = log (from (to 10000.0 One))   where   to 0.0 a = a   to n a = to (n - 1.0) (More a)
examples/passing/TailCall.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log, logShow)  data L a = C a (L a) | N @@ -14,4 +15,6 @@ notATailCall = \x ->   (\notATailCall -> notATailCall x) (\x -> x) -main = Control.Monad.Eff.Console.print (test 0.0 (1.0 `C` (2.0 `C` (3.0 `C` N))))+main = do+  logShow (test 0.0 (1.0 `C` (2.0 `C` (3.0 `C` N))))+  log "Done"
examples/passing/Tick.purs view
@@ -1,7 +1,8 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test' x = x -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TopLevelCase.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  gcd :: Number -> Number -> Number gcd 0.0 x = x@@ -15,4 +16,4 @@  parseTest A 0.0 = 0.0 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/TransitiveImport.purs view
@@ -0,0 +1,9 @@+module Main where++  import Prelude+  import Middle+  import Control.Monad.Eff.Console++  main = do+    logShow (middle unit)+    log "Done"
+ examples/passing/TransitiveImport/Middle.purs view
@@ -0,0 +1,5 @@+module Middle where++import Test (test)++middle = test
+ examples/passing/TransitiveImport/Test.purs view
@@ -0,0 +1,9 @@+module Test where++import Prelude++class TestCls a where+  test :: a -> a++instance unitTestCls :: TestCls Unit where+  test _ = unit
examples/passing/TypeClassMemberOrderChange.purs view
@@ -1,13 +1,16 @@-module Main where--import Prelude--class Test a where-  fn :: a -> a -> a-  val :: a--instance testBoolean :: Test Boolean where-  val = true-  fn x y = y--main = Control.Monad.Eff.Console.log (show (fn true val))+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+class Test a where
+  fn :: a -> a -> a
+  val :: a
+
+instance testBoolean :: Test Boolean where
+  val = true
+  fn x y = y
+
+main = do
+  log (show (fn true val))
+  log "Done"
examples/passing/TypeClasses.purs view
@@ -1,23 +1,24 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  test1 = \_ -> show "testing" -f :: forall a. (Prelude.Show a) => a -> String+f :: forall a. (Show a) => a -> String f x = show x  test2 = \_ -> f "testing" -test7 :: forall a. (Prelude.Show a) => a -> String+test7 :: forall a. (Show a) => a -> String test7 = show  test8 = \_ -> show $ "testing"  data Data a = Data a -instance showData :: (Prelude.Show a) => Prelude.Show (Data a) where-  show (Data a) = "Data (" ++ show a ++ ")"+instance showData :: (Show a) => Show (Data a) where+  show (Data a) = "Data (" <> show a <> ")"  test3 = \_ -> show (Data "testing") @@ -53,9 +54,9 @@ instance monadMaybe :: Monad Maybe  test4 :: forall a m. (Monad m) => a -> m Number-test4 = \_ -> return 1.0+test4 = \_ -> pure 1.0 -test5 = \_ -> Just 1.0 >>= \n -> return (n + 1.0)+test5 = \_ -> Just 1.0 >>= \n -> pure (n + 1.0)  ask r = r @@ -63,7 +64,8 @@  test9 _ = runReader 0.0 $ do   n <- ask-  return $ n + 1.0--main = Control.Monad.Eff.Console.log (test7 "Done")+  pure $ n + 1.0 +main = do+  log (test7 "Hello")+  log "Done"
examples/passing/TypeClassesInOrder.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class Foo a where   foo :: a -> String@@ -8,4 +9,4 @@ instance fooString :: Foo String where   foo s = s -main = Control.Monad.Eff.Console.log $ foo "Done"+main = log $ foo "Done"
examples/passing/TypeClassesWithOverlappingTypeVariables.purs view
@@ -1,11 +1,12 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Either a b = Left a | Right b -instance functorEither :: Prelude.Functor (Either a) where+instance functorEither :: Functor (Either a) where   map _ (Left x) = Left x   map f (Right y) = Right (f y) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TypeDecl.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  k :: String -> Number -> String k x y = x@@ -9,4 +10,4 @@ iterate 0.0 f a = a iterate n f a = iterate (n - 1.0) f (f a) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TypeOperators.purs view
@@ -1,34 +1,20 @@-module A-  ( Tuple(..)-  , type (/\)-  , (/\)-  , Natural-  , type (~>)-  ) where--  data Tuple a b = Tuple a b--  infixl 6 Tuple as /\-  infixl 6 type Tuple as /\--  type Natural f g = ∀ a. f a → g a--  infixr 0 type Natural as ~>+module Main where -  tup ∷ ∀ a b. a → b → b /\ a-  tup a b = b /\ a+import A (type (~>), type (/\), (/\))+import Control.Monad.Eff.Console (log) -  tupX ∷ ∀ a b c. a /\ b /\ c → c-  tupX (a /\ b /\ c) = c+natty ∷ ∀ f. f ~> f+natty x = x -module Main where+data Compose f g a = Compose (f (g a)) -  import A (type (~>), type (/\), (/\))+testPrecedence1 ∷ ∀ f g. Compose f g ~> Compose f g+testPrecedence1 x = x -  natty ∷ ∀ f. f ~> f-  natty x = x+testPrecedence2 ∷ ∀ f g. f ~> g → f ~> g+testPrecedence2 nat fx = nat fx -  swap ∷ ∀ a b. a /\ b → b /\ a-  swap (a /\ b) = b /\ a+swap ∷ ∀ a b. a /\ b → b /\ a+swap (a /\ b) = b /\ a -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/TypeOperators/A.purs view
@@ -0,0 +1,22 @@+module A+( Tuple(..)+, type (/\)+, (/\)+, Natural+, type (~>)+) where++data Tuple a b = Tuple a b++infixl 6 Tuple as /\+infixl 6 type Tuple as /\++type Natural f g = ∀ a. f a → g a++infixr 0 type Natural as ~>++tup ∷ ∀ a b. a → b → b /\ a+tup a b = b /\ a++tupX ∷ ∀ a b c. a /\ b /\ c → c+tupX (a /\ b /\ c) = c
examples/passing/TypeSynonymInData.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type A a = Array a @@ -8,4 +9,4 @@  foo (Foo []) = Bar -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TypeSynonyms.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  type Lens a b =   { get :: a -> b@@ -24,4 +25,4 @@ test1 :: forall a b c. Lens (Pair (Pair a b) c) a test1 = composeLenses fst fst -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TypeWildcards.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  testTopLevel :: _ -> _ testTopLevel n = n + 1.0@@ -12,4 +13,4 @@   go a1 a2 | a1 == a2 = a1   go a1 _ = go (f a1) a1 -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TypeWildcardsRecordExtension.purs view
@@ -1,8 +1,9 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  foo :: forall a. {b :: Number | a} -> {b :: Number | _} foo f = f -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/TypeWithoutParens.purs view
@@ -1,16 +1,12 @@-module Lib (X, Y) where--  data X = X-  type Y = X- module Main where -  import Lib (X, Y)+import Lib (X, Y)+import Control.Monad.Eff.Console (log) -  idX :: X -> X-  idX x = x+idX :: X -> X+idX x = x -  idY :: Y -> Y-  idY y = y+idY :: Y -> Y+idY y = y -  main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/passing/TypeWithoutParens/Lib.purs view
@@ -0,0 +1,4 @@+module Lib (X, Y) where++data X = X+type Y = X
examples/passing/TypedBinders.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Tuple a b = Tuple a b @@ -31,27 +32,27 @@   get = State (\s -> Tuple s s)   put s = State (\_ -> Tuple s {}) -modify :: forall m s. (Prelude.Monad m, MonadState s m) => (s -> s) -> m {}+modify :: forall m s. (Monad m, MonadState s m) => (s -> s) -> m {} modify f = do   s <- get   put (f s)  test :: Tuple String String test = runState "" $ do-  modify $ (++) "World!"-  modify $ (++) "Hello, "+  modify $ (<>) "World!"+  modify $ (<>) "Hello, "   str :: String <- get-  return str+  pure str  test2 :: (Int -> Int) -> Int test2 = (\(f :: Int -> Int) -> f 10) -test3 :: Int -> Boolean +test3 :: Int -> Boolean test3 n = case n of   (0 :: Int) -> true   _ -> false -test4 :: Tuple Int Int -> Tuple Int Int +test4 :: Tuple Int Int -> Tuple Int Int test4 = (\(Tuple a b :: Tuple Int Int) -> Tuple b a)  type Int1 = Int@@ -64,4 +65,4 @@       t2 = test2 id       t3 = test3 1       t4 = test4 (Tuple 1 0)-  Control.Monad.Eff.Console.log "Done"+  log "Done"
examples/passing/TypedWhere.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data E a b = L a | R b @@ -14,4 +15,4 @@   go ls (C (L a) rest) = go (C a ls) rest   go ls (C _ rest) = go ls rest -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/UTF8Sourcefile.purs view
@@ -1,10 +1,8 @@-module Main where--import Control.Monad.Eff.Console- --- '→' is multibyte sequence \u2192.-utf8multibyte = "Hello λ→ world!!"--main = do-  log "done"-+module Main where
+
+import Control.Monad.Eff.Console
+
+-- '→' is multibyte sequence \u2192.
+utf8multibyte = "Hello λ→ world!!"
+
+main = log "Done"
examples/passing/UnderscoreIdent.purs view
@@ -1,11 +1,13 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  data Data_type = Con_Structor | Con_2 String  type Type_name = Data_type  done (Con_2 s) = s+done _ = "Failed" -main = Control.Monad.Eff.Console.log (done (Con_2 "Done"))+main = log (done (Con_2 "Done"))
examples/passing/UnicodeIdentifier.purs view
@@ -1,5 +1,7 @@ module Main where +import Control.Monad.Eff.Console (log)+ f asgård = asgård -main = Control.Monad.Eff.Console.log (f "Done")+main = log (f "Done")
examples/passing/UnicodeOperators.purs view
@@ -1,5 +1,7 @@ module Main where +import Control.Monad.Eff.Console (log)+ compose :: forall a b c. (b -> c) -> (a -> b) -> a -> c compose f g a = f (g a) @@ -17,4 +19,4 @@  test2 = 1 ∈ emptySet -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/UnicodeType.purs view
@@ -1,23 +1,22 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log) -class (Monad m) ⇐ Monad1 m where+class Monad m ⇐ Monad1 m where   f1 :: Int -class (Monad m) <= Monad2 m where+class Monad m <= Monad2 m where   f2 :: Int  f ∷ ∀ m. Monad m ⇒ Int → m Int f n = do-  n' ← return n-  return n'+  n' ← pure n+  pure n'  f' :: forall m. Monad m => Int -> m Int f' n = do-  n' <- return n-  return n'--(←→) a b = a ←→ b+  n' <- pure n+  pure n' -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/Unit.purs view
@@ -1,6 +1,8 @@ module Main where  import Prelude-import Control.Monad.Eff.Console+import Control.Monad.Eff.Console (logShow, log) -main = print (const unit $ "Hello world")+main = do+  logShow (const unit $ "Hello world")+  log "Done"
examples/passing/UnknownInTypeClassLookup.purs view
@@ -1,6 +1,7 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  class EQ a b @@ -11,4 +12,4 @@  runTest a = test a a -main = Control.Monad.Eff.Console.log $ runTest 0.0+main = log $ runTest 0.0
examples/passing/UntupledConstraints.purs view
@@ -1,7 +1,7 @@ module Main where  import Prelude-import Control.Monad.Eff.Console+import Control.Monad.Eff.Console (log)  class Show a <= Nonsense a where   method :: a -> a
examples/passing/Where.purs view
@@ -1,8 +1,9 @@ module Main where  import Prelude+import Partial.Unsafe (unsafePartial) import Control.Monad.Eff-import Control.Monad.ST+import Control.Monad.Eff.Console (logShow, log)  test1 x = y   where@@ -14,15 +15,12 @@   x' = x + 1.0   y' = y + 1.0 - test3 = f 1.0 2.0 3.0   where f x y z = x + y + z - test4 = f (+) [1.0, 2.0]   where f x [y, z] = x y z - test5 = g 10.0   where   f x | x > 0.0 = g (x / 2.0) + 1.0@@ -39,11 +37,13 @@   go y | (x - 0.1 < y * y) && (y * y < x + 0.1) = y   go y = go $ (y + x / y) / 2.0 +main :: Eff _ _ main = do-  Control.Monad.Eff.Console.print (test1 1.0)-  Control.Monad.Eff.Console.print (test2 1.0 2.0)-  Control.Monad.Eff.Console.print test3-  Control.Monad.Eff.Console.print test4-  Control.Monad.Eff.Console.print test5-  Control.Monad.Eff.Console.print test6-  Control.Monad.Eff.Console.print (test7 100.0)+  logShow (test1 1.0)+  logShow (test2 1.0 2.0)+  logShow test3+  unsafePartial (logShow test4)+  logShow test5+  logShow test6+  logShow (test7 100.0)+  log "Done"
+ examples/passing/WildcardType.purs view
@@ -0,0 +1,12 @@+module Main where
+
+import Prelude
+import Control.Monad.Eff.Console (log)
+
+f1 :: (_ -> _) -> _
+f1 g = g 1
+
+f2 :: _ -> _
+f2 _ = "Done"
+
+main = log $ f1 f2
examples/passing/iota.purs view
@@ -1,9 +1,11 @@ module Main where +import Control.Monad.Eff.Console (log)+ s = \x -> \y -> \z -> x z (y z)  k = \x -> \y -> x  iota = \x -> x s k -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
examples/passing/s.purs view
@@ -1,7 +1,8 @@ module Main where  import Prelude+import Control.Monad.Eff.Console (log)  s = \x y z -> x z (y z) -main = Control.Monad.Eff.Console.log "Done"+main = log "Done"
+ examples/warning/DuplicateExportRef.purs view
@@ -0,0 +1,30 @@+-- @shouldWarnWith DuplicateExportRef+-- @shouldWarnWith DuplicateExportRef+-- @shouldWarnWith DuplicateExportRef+-- @shouldWarnWith DuplicateExportRef+-- @shouldWarnWith DuplicateExportRef+-- @shouldWarnWith DuplicateExportRef+-- @shouldWarnWith DuplicateExportRef+module Main+  ( X(X, X), X+  , fn, fn+  , (!), (!)+  , class Y, class Y+  , Natural, type (~>), type (~>)+  , module Prelude, module Prelude+  ) where++import Prelude (Unit)++data X = X++fn :: X -> X -> X+fn _ _ = X++infix 2 fn as !++class Y a++type Natural f g = forall a. f a -> g a++infixl 1 type Natural as ~>
+ examples/warning/DuplicateImport.purs view
@@ -0,0 +1,10 @@+-- @shouldWarnWith DuplicateImport+module Main where++import Prelude (Unit, unit, pure)+import Prelude (Unit, unit, pure)++import Control.Monad.Eff (Eff)++main :: Eff () Unit+main = pure unit
+ examples/warning/DuplicateImportRef.purs view
@@ -0,0 +1,18 @@+-- @shouldWarnWith DuplicateImportRef+-- @shouldWarnWith DuplicateImportRef+-- @shouldWarnWith DuplicateImportRef+-- @shouldWarnWith DuplicateImportRef+module Main where++import Prelude+  ( Unit, Unit+  , unit, unit+  , class Functor, class Functor+  , (<>), (<>)+  )++u :: Unit+u = unit <> unit++fid :: forall f a. Functor f => f a -> f a+fid fa = fa
+ examples/warning/DuplicateSelectiveImport.purs view
@@ -0,0 +1,10 @@+-- @shouldWarnWith DuplicateSelectiveImport+module Main where++import Prelude (Unit, unit)+import Prelude (pure)++import Control.Monad.Eff (Eff)++main :: Eff () Unit+main = pure unit
+ examples/warning/HidingImport.purs view
@@ -0,0 +1,9 @@+-- @shouldWarnWith HidingImport+-- @shouldWarnWith HidingImport+module Main where++import Prelude hiding (one)+import Control.Monad.Eff hiding (runPure)++main :: Eff () Unit+main = pure unit
+ examples/warning/ImplicitImport.purs view
@@ -0,0 +1,9 @@+-- @shouldWarnWith ImplicitImport+-- @shouldWarnWith ImplicitImport+module Main where++import Prelude+import Control.Monad.Eff++main :: Eff () Unit+main = pure unit
+ examples/warning/ImplicitQualifiedImport.purs view
@@ -0,0 +1,11 @@+-- @shouldWarnWith ImplicitQualifiedImport+-- @shouldWarnWith ImplicitQualifiedImport+module Main where++import Data.Unit++import Control.Monad.Eff as E+import Control.Monad.Eff.Console as E++main :: E.Eff (console :: E.CONSOLE) Unit+main = E.log "test"
+ examples/warning/MissingTypeDeclaration.purs view
@@ -0,0 +1,4 @@+-- @shouldWarnWith MissingTypeDeclaration+module Main where++x = 0
+ examples/warning/OverlappingInstances.purs view
@@ -0,0 +1,17 @@+-- @shouldWarnWith OverlappingInstances+module Main where++class Test a where+  test :: a -> a++instance testRefl :: Test a where+  test x = x++instance testInt :: Test Int where+  test _ = 0++-- The OverlappingInstances instances warning only arises when there are two+-- choices for a dictionary, not when the instances are defined. So without+-- `value` this module would not raise a warning.+value :: Int+value = test 1
+ examples/warning/OverlappingPattern.purs view
@@ -0,0 +1,15 @@+-- @shouldWarnWith OverlappingPattern+-- @shouldWarnWith OverlappingPattern+module Main where++data X = A | B++pat1 :: X -> Boolean+pat1 A = true+pat1 A = true+pat1 B = false++pat2 :: X -> Boolean+pat2 A = true+pat2 _ = false+pat2 B = false
+ examples/warning/ScopeShadowing.purs view
@@ -0,0 +1,13 @@+-- @shouldWarnWith ScopeShadowing+module Main where++import Prelude++-- No warning at the definition, only when the name is later resolved+data Unit = Unit++-- This is only a warning as the `Prelude` import is implicit. If `Unit` was+-- named explicitly in an import list, then this refernce to `Unit`+-- would be a `ScopeConflict` error instead.+test :: Unit+test = const Unit unit
+ examples/warning/ShadowedTypeVar.purs view
@@ -0,0 +1,5 @@+-- @shouldWarnWith ShadowedTypeVar+module Main where++f :: forall a. (forall a. a -> a) -> a -> a+f g x = g x
+ examples/warning/UnnecessaryFFIModule.js view
@@ -0,0 +1,1 @@+exports.out = null;
+ examples/warning/UnnecessaryFFIModule.purs view
@@ -0,0 +1,5 @@+-- @shouldWarnWith UnnecessaryFFIModule+module Main where++t :: Boolean+t = true
+ examples/warning/UnusedDctorExplicitImport.purs view
@@ -0,0 +1,8 @@+-- @shouldWarnWith UnusedDctorExplicitImport+module Main where++import Data.Ordering (Ordering(EQ, LT))++f :: Ordering -> Ordering+f EQ = EQ+f x = x
+ examples/warning/UnusedDctorImportAll.purs view
@@ -0,0 +1,7 @@+-- @shouldWarnWith UnusedDctorImport+module Main where++import Data.Ordering (Ordering(..))++f :: Ordering -> Ordering+f x = x
+ examples/warning/UnusedDctorImportExplicit.purs view
@@ -0,0 +1,7 @@+-- @shouldWarnWith UnusedDctorImport+module Main where++import Data.Ordering (Ordering(EQ))++f :: Ordering -> Ordering+f x = x
+ examples/warning/UnusedExplicitImport.purs view
@@ -0,0 +1,8 @@+-- @shouldWarnWith UnusedExplicitImport+module Main where++import Prelude (Unit, unit, pure, bind)+import Control.Monad.Eff (Eff)++main :: Eff () Unit+main = pure unit
+ examples/warning/UnusedFFIImplementations.js view
@@ -0,0 +1,2 @@+exports.yes = true;+exports.no = false;
+ examples/warning/UnusedFFIImplementations.purs view
@@ -0,0 +1,4 @@+-- @shouldWarnWith UnusedFFIImplementations+module Main where++foreign import yes :: Boolean
+ examples/warning/UnusedImport.purs view
@@ -0,0 +1,14 @@+-- @shouldWarnWith UnusedImport+-- @shouldWarnWith UnusedImport+-- @shouldWarnWith UnusedImport+module Main where++import Data.Unit (Unit, unit)++-- All of the below are unused+import Control.Monad.Eff+import Control.Monad.Eff.Console as Console+import Test.Assert ()++main :: Unit+main = unit
+ examples/warning/UnusedTypeVar.purs view
@@ -0,0 +1,5 @@+-- @shouldWarnWith UnusedTypeVar+module Main where++f :: forall a b. a -> a+f x = x
+ examples/warning/WildcardInferredType.purs view
@@ -0,0 +1,23 @@+-- @shouldWarnWith WildcardInferredType+-- @shouldWarnWith WildcardInferredType+-- @shouldWarnWith WildcardInferredType+-- @shouldWarnWith WildcardInferredType+module Main where++x :: Int+x = 0 :: _++y :: _+y = 0++z :: Int+z =+  let n :: _+      n = 0+  in n++w :: Int+w = n+  where+  n :: _+  n = 0
hierarchy/Main.hs view
@@ -65,7 +65,7 @@   input <- glob inputGlob   modules <- readInput input   case modules of-    Left errs -> hPutStr stderr (P.prettyPrintMultipleErrors False errs) >> exitFailure+    Left errs -> hPutStr stderr (P.prettyPrintMultipleErrors P.defaultPPEOptions errs) >> exitFailure     Right ms -> do       for_ ms $ \(P.Module _ _ moduleName decls _) ->         let name = runModuleName moduleName@@ -84,7 +84,7 @@  superClasses :: P.Declaration -> [SuperMap] superClasses (P.TypeClassDeclaration sub _ supers@(_:_) _) =-  fmap (\(P.Qualified _ super, _) -> SuperMap (Right (super, sub))) supers+  fmap (\(P.Constraint (P.Qualified _ super) _ _) -> SuperMap (Right (super, sub))) supers superClasses (P.TypeClassDeclaration sub _ _ _) = [SuperMap (Left sub)] superClasses (P.PositionedDeclaration _ _ decl) = superClasses decl superClasses _ = []@@ -113,4 +113,3 @@   infoModList = fullDesc <> headerInfo <> footerInfo   headerInfo  = header   "hierarchy - Creates a GraphViz directed graph of PureScript TypeClasses"   footerInfo  = footer $ "hierarchy " ++ showVersion Paths.version-
psc-bundle/Main.hs view
@@ -6,7 +6,6 @@ -- | Bundles compiled PureScript modules for the browser. module Main (main) where -import Data.Maybe import Data.Traversable (for) import Data.Version (showVersion) @@ -36,7 +35,6 @@   , optionsEntryPoints :: [String]   , optionsMainModule  :: Maybe String   , optionsNamespace   :: String-  , optionsRequirePath :: Maybe FilePath   } deriving Show  -- | Given a filename, assuming it is in the correct place on disk, infer a ModuleIdentifier.@@ -63,7 +61,7 @@    let entryIds = map (`ModuleIdentifier` Regular) optionsEntryPoints -  bundle input entryIds optionsMainModule optionsNamespace optionsRequirePath+  bundle input entryIds optionsMainModule optionsNamespace  -- | Command line options parser. options :: Parser Options@@ -72,7 +70,6 @@                   <*> many entryPoint                   <*> optional mainModule                   <*> namespace-                  <*> optional requirePath   where   inputFile :: Parser FilePath   inputFile = strArgument $@@ -104,19 +101,12 @@     <> showDefault     <> help "Specify the namespace that PureScript modules will be exported to when running in the browser." -  requirePath :: Parser FilePath-  requirePath = strOption $-       short 'r'-    <> long "require-path"-    <> help "The path prefix used in require() calls in the generated JavaScript [deprecated]"- -- | Make it go. main :: IO () main = do   hSetEncoding stdout utf8   hSetEncoding stderr utf8   opts <- execParser (info (version <*> helper <*> options) infoModList)-  when (isJust (optionsRequirePath opts)) $ hPutStrLn stderr "The require-path option is deprecated and will be removed in PureScript 0.9."   output <- runExceptT (app opts)   case output of     Left err -> do
psc-docs/Main.hs view
@@ -95,7 +95,7 @@       Right x ->         return x       Left err -> do-        hPutStrLn stderr $ P.prettyPrintMultipleErrors False err+        hPutStrLn stderr $ P.prettyPrintMultipleErrors P.defaultPPEOptions err         exitFailure    takeByName = takeModulesByName D.modName
psc-ide-client/Main.hs view
@@ -35,7 +35,7 @@ client :: PortID -> IO () client port = do     h <--        connectTo "localhost" port `catch`+        connectTo "127.0.0.1" port `catch`         (\(SomeException e) ->               putStrLn                   ("Couldn't connect to psc-ide-server on port: " ++
psc-ide-server/Main.hs view
@@ -12,7 +12,6 @@ -- The server accepting commands for psc-ide ----------------------------------------------------------------------------- -{-# LANGUAGE ConstraintKinds       #-} {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings     #-}@@ -40,10 +39,10 @@ import           Language.PureScript.Ide.Error import           Language.PureScript.Ide.Types import           Language.PureScript.Ide.Watcher-import           Network                           hiding (socketPort)+import           Network                           hiding (socketPort, accept) import           Network.BSD                       (getProtocolNumber) import           Network.Socket                    hiding (PortNumber, Type,-                                                    accept, sClose)+                                                    sClose) import           Options.Applicative import           System.Directory import           System.FilePath@@ -73,12 +72,13 @@   { optionsDirectory  :: Maybe FilePath   , optionsOutputPath :: FilePath   , optionsPort       :: PortID+  , optionsNoWatch    :: Bool   , optionsDebug      :: Bool   }  main :: IO () main = do-  Options dir outputPath port debug  <- execParser opts+  Options dir outputPath port noWatch debug  <- execParser opts   maybe (pure ()) setCurrentDirectory dir   serverState <- newTVarIO emptyPscIdeState   cwd <- getCurrentDirectory@@ -89,31 +89,23 @@     (do putStrLn ("Your output directory didn't exist. I'll create it at: " <> fullOutputPath)         createDirectory fullOutputPath         putStrLn "This usually means you didn't compile your project yet."-        putStrLn "psc-ide needs you to compile your project (for example by running pulp build)"-    )+        putStrLn "psc-ide needs you to compile your project (for example by running pulp build)") -  _ <- forkFinally (watcher serverState fullOutputPath) print-  let conf =-        Configuration-        {-          confDebug = debug-        , confOutputPath = outputPath-        }-  let env =-        PscIdeEnvironment-        {-          envStateVar = serverState-        , envConfiguration = conf-        }+  unless noWatch $+    void (forkFinally (watcher serverState fullOutputPath) print)++  let conf = Configuration {confDebug = debug, confOutputPath = outputPath}+      env = PscIdeEnvironment {envStateVar = serverState, envConfiguration = conf}   startServer port env   where     parser =-      Options <$>-        optional (strOption (long "directory" <> short 'd')) <*>-        strOption (long "output-directory" <> value "output/") <*>-        (PortNumber . fromIntegral <$>-         option auto (long "port" <> short 'p' <> value (4242 :: Integer))) <*>-        switch (long "debug")+      Options+        <$> optional (strOption (long "directory" <> short 'd'))+        <*> strOption (long "output-directory" <> value "output/")+        <*> (PortNumber . fromIntegral <$>+             option auto (long "port" <> short 'p' <> value (4242 :: Integer)))+        <*> switch (long "no-watch")+        <*> switch (long "debug")     opts = info (version <*> helper <*> parser) mempty     version = abortOption       (InfoMsg (showVersion Paths.version))@@ -167,7 +159,9 @@       pure (cmd, h)   where    acceptConnection = liftIO $ do-     (h,_,_) <- accept sock+     -- Use low level accept to prevent accidental reverse name resolution+     (s,_) <- accept sock+     h     <- socketToHandle s ReadWriteMode      hSetEncoding h utf8      hSetBuffering h LineBuffering      pure h
psc/Main.hs view
@@ -1,56 +1,54 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-}  module Main where -import Control.Applicative-import Control.Monad-import Control.Monad.Error.Class (MonadError(..))-import Control.Monad.Writer.Strict+import           Control.Applicative+import           Control.Monad+import           Control.Monad.Writer.Strict -import Data.List (isSuffixOf, partition)-import Data.Version (showVersion)-import qualified Data.Map as M import qualified Data.Aeson as A+import           Data.Bool (bool) import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.UTF8 as BU8+import qualified Data.Map as M+import           Data.Version (showVersion) -import Options.Applicative as Opts+import qualified Language.PureScript as P+import           Language.PureScript.Errors.JSON+import           Language.PureScript.Make -import System.Exit (exitSuccess, exitFailure)-import System.IO (hSetEncoding, hPutStrLn, stdout, stderr, utf8)-import System.IO.UTF8-import System.FilePath.Glob (glob)+import           Options.Applicative as Opts -import qualified Language.PureScript as P import qualified Paths_purescript as Paths -import Language.PureScript.Make-import Language.PureScript.Errors.JSON+import qualified System.Console.ANSI as ANSI+import           System.Exit (exitSuccess, exitFailure)+import           System.FilePath.Glob (glob)+import           System.IO (hSetEncoding, hPutStrLn, stdout, stderr, utf8)+import           System.IO.UTF8  data PSCMakeOptions = PSCMakeOptions   { pscmInput        :: [FilePath]-  , pscmForeignInput :: [FilePath]   , pscmOutputDir    :: FilePath   , pscmOpts         :: P.Options   , pscmUsePrefix    :: Bool   , pscmJSONErrors   :: Bool   } -data InputOptions = InputOptions-  { ioInputFiles  :: [FilePath]-  }- -- | Argumnets: verbose, use JSON, warnings, errors printWarningsAndErrors :: Bool -> Bool -> P.MultipleErrors -> Either P.MultipleErrors a -> IO () printWarningsAndErrors verbose False warnings errors = do+  cc <- bool Nothing (Just P.defaultCodeColor) <$> ANSI.hSupportsANSI stderr+  let ppeOpts = P.defaultPPEOptions { P.ppeCodeColor = cc, P.ppeFull = verbose }   when (P.nonEmpty warnings) $-    hPutStrLn stderr (P.prettyPrintMultipleWarnings verbose warnings)+    hPutStrLn stderr (P.prettyPrintMultipleWarnings ppeOpts warnings)   case errors of     Left errs -> do-      hPutStrLn stderr (P.prettyPrintMultipleErrors verbose errs)+      hPutStrLn stderr (P.prettyPrintMultipleErrors ppeOpts errs)       exitFailure     Right _ -> return () printWarningsAndErrors verbose True warnings errors = do@@ -65,14 +63,12 @@   when (null input && not pscmJSONErrors) $ do     hPutStrLn stderr "psc: No input files."     exitFailure-  let (jsFiles, pursFiles) = partition (isSuffixOf ".js") input-  moduleFiles <- readInput (InputOptions pursFiles)-  inputForeign <- globWarningOnMisses (unless pscmJSONErrors . warnFileTypeNotFound) pscmForeignInput-  foreignFiles <- forM (inputForeign ++ jsFiles) (\inFile -> (inFile,) <$> readUTF8File inFile)+  moduleFiles <- readInput input   (makeErrors, makeWarnings) <- runMake pscmOpts $ do-    (ms, foreigns) <- parseInputs moduleFiles foreignFiles-    let filePathMap = M.fromList $ map (\(fp, P.Module _ _ mn _ _) -> (mn, fp)) ms-        makeActions = buildMakeActions pscmOutputDir filePathMap foreigns pscmUsePrefix+    ms <- P.parseModulesFromFiles id moduleFiles+    let filePathMap = M.fromList $ map (\(fp, P.Module _ _ mn _ _) -> (mn, Right fp)) ms+    foreigns <- inferForeignModules filePathMap+    let makeActions = buildMakeActions pscmOutputDir filePathMap foreigns pscmUsePrefix     P.make makeActions (map snd ms)   printWarningsAndErrors (P.optionsVerboseErrors pscmOpts) pscmJSONErrors makeWarnings makeErrors   exitSuccess@@ -89,28 +85,14 @@     return paths   concatMapM f = liftM concat . mapM f -readInput :: InputOptions -> IO [(Either P.RebuildPolicy FilePath, String)]-readInput InputOptions{..} = forM ioInputFiles $ \inFile -> (Right inFile, ) <$> readUTF8File inFile--parseInputs :: (MonadError P.MultipleErrors m, MonadWriter P.MultipleErrors m)-            => [(Either P.RebuildPolicy FilePath, String)]-            -> [(FilePath, P.ForeignJS)]-            -> m ([(Either P.RebuildPolicy FilePath, P.Module)], M.Map P.ModuleName FilePath)-parseInputs modules foreigns =-  (,) <$> P.parseModulesFromFiles (either (const "") id) modules-      <*> P.parseForeignModulesFromFiles foreigns+readInput :: [FilePath] -> IO [(FilePath, String)]+readInput inputFiles = forM inputFiles $ \inFile -> (inFile, ) <$> readUTF8File inFile  inputFile :: Parser FilePath inputFile = strArgument $      metavar "FILE"   <> help "The input .purs file(s)" -inputForeignFile :: Parser FilePath-inputForeignFile = strOption $-     short 'f'-  <> long "ffi"-  <> help "The input .js file(s) providing foreign import implementations"- outputDirectory :: Parser FilePath outputDirectory = strOption $      short 'o'@@ -119,12 +101,6 @@   <> showDefault   <> help "The output directory" -requirePath :: Parser (Maybe FilePath)-requirePath = optional $ strOption $-     short 'r'-  <> long "require-path"-  <> help "The path prefix to use for require() calls in the generated JavaScript [deprecated]"- noTco :: Parser Bool noTco = switch $      long "no-tco"@@ -175,12 +151,10 @@                     <*> noOpts                     <*> verboseErrors                     <*> (not <$> comments)-                    <*> requirePath                     <*> sourceMaps  pscMakeOptions :: Parser PSCMakeOptions pscMakeOptions = PSCMakeOptions <$> many inputFile-                                <*> many inputForeignFile                                 <*> outputDirectory                                 <*> options                                 <*> (not <$> noPrefix)
+ psci/Main.hs view
@@ -0,0 +1,132 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DoAndIfThenElse #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TupleSections #-}++module Main (main) where++import           Prelude ()+import           Prelude.Compat++import           Data.Monoid ((<>))+import           Data.Version (showVersion)++import           Control.Applicative (many)+import           Control.Monad+import           Control.Monad.IO.Class (liftIO)+import           Control.Monad.Trans.Class+import           Control.Monad.Trans.Except (ExceptT(..), runExceptT)+import           Control.Monad.Trans.State.Strict (StateT, evalStateT)+import           Control.Monad.Trans.Reader (ReaderT, runReaderT)++import qualified Language.PureScript as P+import           Language.PureScript.Interactive++import qualified Options.Applicative as Opts++import qualified Paths_purescript as Paths++import           System.Console.Haskeline+import           System.Exit+import           System.FilePath.Glob (glob)++-- | Command line options+data PSCiOptions = PSCiOptions+  { psciMultiLineMode     :: Bool+  , psciInputFile         :: [FilePath]+  , psciInputNodeFlags    :: [String]+  }++multiLineMode :: Opts.Parser Bool+multiLineMode = Opts.switch $+     Opts.long "multi-line-mode"+  <> Opts.short 'm'+  <> Opts.help "Run in multi-line mode (use ^D to terminate commands)"++inputFile :: Opts.Parser FilePath+inputFile = Opts.strArgument $+     Opts.metavar "FILE"+  <> Opts.help "Optional .purs files to load on start"++nodeFlagsFlag :: Opts.Parser [String]+nodeFlagsFlag = Opts.option parser $+     Opts.long "node-opts"+  <> Opts.metavar "NODE_OPTS"+  <> Opts.value []+  <> Opts.help "Flags to pass to node, separated by spaces"+  where+    parser = words <$> Opts.str++psciOptions :: Opts.Parser PSCiOptions+psciOptions = PSCiOptions <$> multiLineMode+                          <*> many inputFile+                          <*> nodeFlagsFlag++version :: Opts.Parser (a -> a)+version = Opts.abortOption (Opts.InfoMsg (showVersion Paths.version)) $+            Opts.long "version" <>+            Opts.help "Show the version number" <>+            Opts.hidden++getOpt :: IO PSCiOptions+getOpt = Opts.execParser opts+    where+      opts        = Opts.info (version <*> Opts.helper <*> psciOptions) infoModList+      infoModList = Opts.fullDesc <> headerInfo <> footerInfo+      headerInfo  = Opts.header   "psci - Interactive mode for PureScript"+      footerInfo  = Opts.footer $ "psci " ++ showVersion Paths.version++-- | Parses the input and returns either a command, or an error as a 'String'.+getCommand :: forall m. MonadException m => Bool -> InputT m (Either String (Maybe Command))+getCommand singleLineMode = handleInterrupt (return (Right Nothing)) $ do+  firstLine <- withInterrupt $ getInputLine "> "+  case firstLine of+    Nothing -> return (Right (Just QuitPSCi)) -- Ctrl-D when input is empty+    Just "" -> return (Right Nothing)+    Just s | singleLineMode || head s == ':' -> return . fmap Just $ parseCommand s+    Just s -> fmap Just . parseCommand <$> go [s]+  where+    go :: [String] -> InputT m String+    go ls = maybe (return . unlines $ reverse ls) (go . (:ls)) =<< getInputLine "  "++-- | Get command line options and drop into the REPL+main :: IO ()+main = getOpt >>= loop+  where+    loop :: PSCiOptions -> IO ()+    loop PSCiOptions{..} = do+        inputFiles <- concat <$> traverse glob psciInputFile+        e <- runExceptT $ do+          modules <- ExceptT (loadAllModules inputFiles)+          unless (supportModuleIsDefined (map snd modules)) . liftIO $ do+            putStrLn supportModuleMessage+            exitFailure+          (externs, env) <- ExceptT . runMake . make $ modules+          return (modules, externs, env)+        case e of+          Left errs -> putStrLn (P.prettyPrintMultipleErrors P.defaultPPEOptions errs) >> exitFailure+          Right (modules, externs, env) -> do+            historyFilename <- getHistoryFilename+            let settings = defaultSettings { historyFile = Just historyFilename }+                initialState = PSCiState [] [] (zip (map snd modules) externs)+                config = PSCiConfig inputFiles psciInputNodeFlags env+                runner = flip runReaderT config+                         . flip evalStateT initialState+                         . runInputT (setComplete completion settings)+            putStrLn prologueMessage+            runner go+      where+        go :: InputT (StateT PSCiState (ReaderT PSCiConfig IO)) ()+        go = do+          c <- getCommand (not psciMultiLineMode)+          case c of+            Left err -> outputStrLn err >> go+            Right Nothing -> go+            Right (Just QuitPSCi) -> outputStrLn quitMessage+            Right (Just c') -> do+              handleInterrupt (outputStrLn "Interrupted.")+                              (withInterrupt (lift (handleCommand c')))+              go
− psci/PSCi.hs
@@ -1,372 +0,0 @@-{-# LANGUAGE DoAndIfThenElse #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE TupleSections #-}-{-# LANGUAGE DataKinds #-}---- |--- PureScript Compiler Interactive.----module PSCi (runPSCi) where--import Prelude ()-import Prelude.Compat--import Data.Foldable (traverse_)-import Data.List (intercalate, nub, sort, find)-import Data.Tuple (swap)-import qualified Data.Map as M--import Control.Arrow (first)-import Control.Monad-import Control.Monad.Error.Class (MonadError(..))-import Control.Monad.Trans.Class-import Control.Monad.Trans.Except (ExceptT(), runExceptT)-import Control.Monad.Trans.State.Strict-import Control.Monad.IO.Class (liftIO)-import Control.Monad.Writer.Strict (Writer(), runWriter)--import System.Console.Haskeline-import System.Directory (doesFileExist, getHomeDirectory, getCurrentDirectory)-import System.Exit-import System.FilePath ((</>))-import System.FilePath.Glob (glob)-import System.Process (readProcessWithExitCode)-import System.IO.Error (tryIOError)-import System.IO.UTF8 (readUTF8File)--import qualified Language.PureScript as P-import qualified Language.PureScript.Names as N--import PSCi.Completion (completion)-import PSCi.Parser (parseCommand)-import PSCi.Option-import PSCi.Types-import PSCi.Message-import PSCi.IO-import PSCi.Printer-import PSCi.Module---- |--- PSCI monad----newtype PSCI a = PSCI { runPSCI :: InputT (StateT PSCiState IO) a } deriving (Functor, Applicative, Monad)--psciIO :: IO a -> PSCI a-psciIO io = PSCI . lift $ lift io---- |--- The runner----runPSCi :: IO ()-runPSCi = getOpt >>= loop---- |--- The PSCI main loop.----loop :: PSCiOptions -> IO ()-loop PSCiOptions{..} = do-  config <- loadUserConfig-  inputFiles <- concat <$> traverse glob psciInputFile-  foreignFiles <- concat <$> traverse glob psciForeignInputFiles-  modulesOrFirstError <- loadAllModules inputFiles-  case modulesOrFirstError of-    Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure-    Right modules -> do-      historyFilename <- getHistoryFilename-      let settings = defaultSettings { historyFile = Just historyFilename }-      foreignsOrError <- runMake $ do-        foreignFilesContent <- forM foreignFiles (\inFile -> (inFile,) <$> makeIO (const (P.ErrorMessage [] $ P.CannotReadFile inFile)) (readUTF8File inFile))-        P.parseForeignModulesFromFiles foreignFilesContent-      case foreignsOrError of-        Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure-        Right foreigns ->-          flip evalStateT (mkPSCiState [] modules foreigns [] psciInputNodeFlags) . runInputT (setComplete completion settings) $ do-            outputStrLn prologueMessage-            traverse_ (traverse_ (runPSCI . handleCommand)) config-            modules' <- lift $ gets psciLoadedModules-            unless (consoleIsDefined (map snd modules')) . outputStrLn $ unlines-              [ "PSCi requires the purescript-console module to be installed."-              , "For help getting started, visit http://wiki.purescript.org/PSCi"-              ]-            go-      where-        go :: InputT (StateT PSCiState IO) ()-        go = do-          c <- getCommand (not psciMultiLineMode)-          case c of-            Left err -> outputStrLn err >> go-            Right Nothing -> go-            Right (Just QuitPSCi) -> outputStrLn quitMessage-            Right (Just c') -> do-              handleInterrupt (outputStrLn "Interrupted.")-                              (withInterrupt (runPSCI (loadAllImportedModules >> handleCommand c')))-              go---- Compile the module---- |--- Load all modules, updating the application state----loadAllImportedModules :: PSCI ()-loadAllImportedModules = do-  files <- PSCI . lift $ fmap psciImportedFilenames get-  modulesOrFirstError <- psciIO $ loadAllModules files-  case modulesOrFirstError of-    Left errs -> PSCI $ printErrors errs-    Right modules -> PSCI . lift . modify $ updateModules modules---- | This is different than the runMake in 'Language.PureScript.Make' in that it specifies the--- options and ignores the warning messages.-runMake :: P.Make a -> IO (Either P.MultipleErrors a)-runMake mk = fst <$> P.runMake P.defaultOptions mk--makeIO :: (IOError -> P.ErrorMessage) -> IO a -> P.Make a-makeIO f io = do-  e <- liftIO $ tryIOError io-  either (throwError . P.singleError . f) return e--make :: PSCiState -> [P.Module] -> P.Make P.Environment-make st@PSCiState{..} ms = P.make actions' (map snd loadedModules ++ ms)-  where-  filePathMap = M.fromList $ (first P.getModuleName . swap) `map` allModules-  actions = P.buildMakeActions modulesDir filePathMap psciForeignFiles False-  actions' = actions { P.progress = const (return ()) }-  loadedModules = psciLoadedModules st-  allModules = map (first Right) loadedModules ++ map (Left P.RebuildAlways,) ms----- Commands---- |--- Parses the input and returns either a Metacommand, or an error as a string.----getCommand :: Bool -> InputT (StateT PSCiState IO) (Either String (Maybe Command))-getCommand singleLineMode = handleInterrupt (return (Right Nothing)) $ do-  firstLine <- withInterrupt $ getInputLine "> "-  case firstLine of-    Nothing -> return (Right (Just QuitPSCi)) -- Ctrl-D when input is empty-    Just "" -> return (Right Nothing)-    Just s | singleLineMode || head s == ':' -> return .fmap Just $ parseCommand s-    Just s -> fmap Just . parseCommand <$> go [s]-  where-    go :: [String] -> InputT (StateT PSCiState IO) String-    go ls = maybe (return . unlines $ reverse ls) (go . (:ls)) =<< getInputLine "  "---- |--- Performs an action for each meta-command given, and also for expressions.----handleCommand :: Command -> PSCI ()-handleCommand (Expression val) = handleExpression val-handleCommand ShowHelp = PSCI $ outputStrLn helpMessage-handleCommand (Import im) = handleImport im-handleCommand (Decls l) = handleDecls l-handleCommand (LoadFile filePath) = PSCI $ whenFileExists filePath $ \absPath -> do-  m <- lift . lift $ loadModule absPath-  case m of-    Left err -> outputStrLn err-    Right mods -> lift $ modify (updateModules (map (absPath,) mods))-handleCommand (LoadForeign filePath) = PSCI $ whenFileExists filePath $ \absPath -> do-  foreignsOrError <- lift . lift . runMake $ do-    foreignFile <- makeIO (const (P.ErrorMessage [] $ P.CannotReadFile absPath)) (readUTF8File absPath)-    P.parseForeignModulesFromFiles [(absPath, foreignFile)]-  case foreignsOrError of-    Left err -> outputStrLn $ P.prettyPrintMultipleErrors False err-    Right foreigns -> lift $ modify (updateForeignFiles foreigns)-handleCommand ResetState = do-  PSCI . lift . modify $ \st ->-    st { psciImportedModules = []-       , psciLetBindings     = []-       }-  loadAllImportedModules-handleCommand (TypeOf val) = handleTypeOf val-handleCommand (KindOf typ) = handleKindOf typ-handleCommand (BrowseModule moduleName) = handleBrowse moduleName-handleCommand (ShowInfo QueryLoaded) = handleShowLoadedModules-handleCommand (ShowInfo QueryImport) = handleShowImportedModules-handleCommand QuitPSCi = P.internalError "`handleCommand QuitPSCi` was called. This is a bug."----- |--- Takes a value expression and evaluates it with the current state.----handleExpression :: P.Expr -> PSCI ()-handleExpression val = do-  st <- PSCI $ lift get-  let m = createTemporaryModule True st val-  let nodeArgs = psciNodeFlags st ++ [indexFile]-  e <- psciIO . runMake $ make st [supportModule, m]-  case e of-    Left errs -> PSCI $ printErrors errs-    Right _ -> do-      psciIO $ writeFile indexFile "require('$PSCI')['$main']();"-      process <- psciIO findNodeProcess-      result  <- psciIO $ traverse (\node -> readProcessWithExitCode node nodeArgs "") process-      case result of-        Just (ExitSuccess,   out, _)   -> PSCI $ outputStrLn out-        Just (ExitFailure _, _,   err) -> PSCI $ outputStrLn err-        Nothing                        -> PSCI $ outputStrLn "Couldn't find node.js"---- |--- Takes a list of declarations and updates the environment, then run a make. If the declaration fails,--- restore the original environment.----handleDecls :: [P.Declaration] -> PSCI ()-handleDecls ds = do-  st <- PSCI $ lift get-  let st' = updateLets ds st-  let m = createTemporaryModule False st' (P.Literal (P.ObjectLiteral []))-  e <- psciIO . runMake $ make st' [m]-  case e of-    Left err -> PSCI $ printErrors err-    Right _ -> PSCI $ lift (put st')---- |--- Show actual loaded modules in psci.----handleShowLoadedModules :: PSCI ()-handleShowLoadedModules = do-  loadedModules <- PSCI $ lift $ gets psciLoadedModules-  psciIO $ readModules loadedModules >>= putStrLn-  return ()-  where readModules = return . unlines . sort . nub . map toModuleName-        toModuleName =  N.runModuleName . (\ (P.Module _ _ mdName _ _) -> mdName) . snd---- |--- Show the imported modules in psci.----handleShowImportedModules :: PSCI ()-handleShowImportedModules = do-  PSCiState { psciImportedModules = importedModules } <- PSCI $ lift get-  psciIO $ showModules importedModules >>= putStrLn-  return ()-  where-  showModules = return . unlines . sort . map showModule-  showModule (mn, declType, asQ) =-    "import " ++ N.runModuleName mn ++ showDeclType declType ++-    foldMap (\mn' -> " as " ++ N.runModuleName mn') asQ--  showDeclType P.Implicit = ""-  showDeclType (P.Explicit refs) = refsList refs-  showDeclType (P.Hiding refs) = " hiding " ++ refsList refs-  refsList refs = " (" ++ commaList (map showRef refs) ++ ")"--  showRef :: P.DeclarationRef -> String-  showRef (P.TypeRef pn dctors) = N.runProperName pn ++ "(" ++ maybe ".." (commaList . map N.runProperName) dctors ++ ")"-  showRef (P.TypeOpRef ident) = "type (" ++ N.runIdent ident ++ ")"-  showRef (P.ValueRef ident) = N.runIdent ident-  showRef (P.TypeClassRef pn) = "class " ++ N.runProperName pn-  showRef (P.ProperRef pn) = pn-  showRef (P.TypeInstanceRef ident) = N.runIdent ident-  showRef (P.ModuleRef name) = "module " ++ N.runModuleName name-  showRef (P.PositionedDeclarationRef _ _ ref) = showRef ref--  commaList :: [String] -> String-  commaList = intercalate ", "---- |--- Imports a module, preserving the initial state on failure.----handleImport :: ImportedModule -> PSCI ()-handleImport im = do-   st <- updateImportedModules im <$> PSCI (lift get)-   let m = createTemporaryModuleForImports st-   e <- psciIO . runMake $ make st [m]-   case e of-     Left errs -> PSCI $ printErrors errs-     Right _  -> do-       PSCI $ lift $ put st-       return ()---- |--- Takes a value and prints its type----handleTypeOf :: P.Expr -> PSCI ()-handleTypeOf val = do-  st <- PSCI $ lift get-  let m = createTemporaryModule False st val-  e <- psciIO . runMake $ make st [m]-  case e of-    Left errs -> PSCI $ printErrors errs-    Right env' ->-      case M.lookup (P.ModuleName [P.ProperName "$PSCI"], P.Ident "it") (P.names env') of-        Just (ty, _, _) -> PSCI . outputStrLn . P.prettyPrintType $ ty-        Nothing -> PSCI $ outputStrLn "Could not find type"---- |--- Browse a module and displays its signature (if module exists).----handleBrowse :: P.ModuleName -> PSCI ()-handleBrowse moduleName = do-  st <- PSCI $ lift get-  env <- psciIO . runMake $ make st []-  case env of-    Left errs -> PSCI $ printErrors errs-    Right env' ->-      if isModInEnv moduleName st-        then PSCI $ printModuleSignatures moduleName env'-        else case lookupUnQualifiedModName moduleName st of-          Just unQualifiedName ->-            if isModInEnv unQualifiedName st-              then PSCI $ printModuleSignatures unQualifiedName env'-              else failNotInEnv moduleName-          Nothing ->-            failNotInEnv moduleName-  where-    isModInEnv modName =-        any ((== modName) . P.getModuleName . snd) . psciLoadedModules-    failNotInEnv modName =-        PSCI $ outputStrLn $ "Module '" ++ N.runModuleName modName ++ "' is not valid."-    lookupUnQualifiedModName quaModName st =-        (\(modName,_,_) -> modName) <$> find ( \(_, _, mayQuaName) -> mayQuaName == Just quaModName) (psciImportedModules st)---- |--- Takes a value and prints its kind----handleKindOf :: P.Type -> PSCI ()-handleKindOf typ = do-  st <- PSCI $ lift get-  let m = createTemporaryModuleForKind st typ-      mName = P.ModuleName [P.ProperName "$PSCI"]-  e <- psciIO . runMake $ make st [m]-  case e of-    Left errs -> PSCI $ printErrors errs-    Right env' ->-      case M.lookup (P.Qualified (Just mName) $ P.ProperName "IT") (P.typeSynonyms env') of-        Just (_, typ') -> do-          let chk = (P.emptyCheckState env') { P.checkCurrentModule = Just mName }-              k   = check (P.kindOf typ') chk--              check :: StateT P.CheckState (ExceptT P.MultipleErrors (Writer P.MultipleErrors)) a -> P.CheckState -> Either P.MultipleErrors (a, P.CheckState)-              check sew = fst . runWriter . runExceptT . runStateT sew-          case k of-            Left errStack   -> PSCI . outputStrLn . P.prettyPrintMultipleErrors False $ errStack-            Right (kind, _) -> PSCI . outputStrLn . P.prettyPrintKind $ kind-        Nothing -> PSCI $ outputStrLn "Could not find kind"---- Misc---- |--- Attempts to read initial commands from '.psci' in the present working--- directory then the user's home----loadUserConfig :: IO (Maybe [Command])-loadUserConfig = onFirstFileMatching readCommands pathGetters-  where-  pathGetters = [getCurrentDirectory, getHomeDirectory]-  readCommands :: IO FilePath -> IO (Maybe [Command])-  readCommands path = do-    configFile <- (</> ".psci") <$> path-    exists <- doesFileExist configFile-    if exists-    then do-      ls <- lines <$> readUTF8File configFile-      case traverse parseCommand ls of-        Left err -> print err >> exitFailure-        Right cs -> return $ Just cs-    else-      return Nothing---- | Checks if the Console module is defined-consoleIsDefined :: [P.Module] -> Bool-consoleIsDefined = any ((== P.ModuleName (map P.ProperName [ "Control", "Monad", "Eff", "Console" ])) . P.getModuleName)
− psci/PSCi/Completion.hs
@@ -1,226 +0,0 @@-{-# LANGUAGE DataKinds #-}--module PSCi.Completion where--import Prelude ()-import Prelude.Compat--import Data.Maybe (mapMaybe)-import Data.List (nub, nubBy, sortBy, isPrefixOf, stripPrefix)-import Data.Char (isUpper)-import Data.Function (on)--import Control.Arrow (second)-import Control.Monad.Trans.Reader (asks, runReaderT, ReaderT)-import Control.Monad.Trans.State.Strict--import System.Console.Haskeline--import qualified Language.PureScript as P-import qualified Language.PureScript.Names as N--import qualified PSCi.Directive as D-import PSCi.Types---- Completions may read the state, but not modify it.-type CompletionM = ReaderT PSCiState IO---- Lift a `CompletionM` action to a `StateT PSCiState IO` one.-liftCompletionM :: CompletionM a -> StateT PSCiState IO a-liftCompletionM act = StateT (\s -> (\a -> (a, s)) <$> runReaderT act s)---- Haskeline completions--data CompletionContext-  = CtxDirective String-  | CtxFilePath String-  | CtxModule-  | CtxIdentifier-  | CtxType-  | CtxFixed String-  deriving (Show, Read)---- |--- Loads module, function, and file completions.----completion :: CompletionFunc (StateT PSCiState IO)-completion = liftCompletionM . completion'--completion' :: CompletionFunc CompletionM-completion' = completeWordWithPrev Nothing " \t\n\r" findCompletions---- |--- Decide what kind of completion we need based on input. This function expects--- a list of complete words (to the left of the cursor) as the first argument,--- and the current word as the second argument.-completionContext :: [String] -> String -> [CompletionContext]-completionContext [] _ = [CtxDirective "", CtxIdentifier, CtxFixed "import"]-completionContext ws w | headSatisfies (":" `isPrefixOf`) ws = completeDirective ws w-completionContext ws w | headSatisfies (== "import") ws = completeImport ws w-completionContext _ _ = [CtxIdentifier]--completeDirective :: [String] -> String -> [CompletionContext]-completeDirective ws w =-  case ws of-    []    -> [CtxDirective w]-    [dir] -> case D.directivesFor <$> stripPrefix ":" dir of-                -- only offer completions if the directive is unambiguous-                Just [dir'] -> directiveArg w dir'-                _           -> []--    -- All directives take exactly one argument. If we haven't yet matched,-    -- that means one argument has already been supplied. So don't complete-    -- any others.-    _     -> []--directiveArg :: String -> Directive -> [CompletionContext]-directiveArg _ Browse      = [CtxModule]-directiveArg w Load        = [CtxFilePath w]-directiveArg w Foreign     = [CtxFilePath w]-directiveArg _ Quit        = []-directiveArg _ Reset       = []-directiveArg _ Help        = []-directiveArg _ Show        = map CtxFixed replQueryStrings-directiveArg _ Type        = [CtxIdentifier]-directiveArg _ Kind        = [CtxType]--completeImport :: [String] -> String -> [CompletionContext]-completeImport ws w' =-  case (ws, w') of-    (["import"], w) | headSatisfies isUpper w -> [CtxModule]-    (["import"], _)                           -> [CtxModule, CtxFixed "qualified"]-    (["import", "qualified"], _)              -> [CtxModule]-    _                                         -> []--headSatisfies :: (a -> Bool) -> [a] -> Bool-headSatisfies p str =-  case str of-    (c:_)  -> p c-    _     -> False---- | Callback for Haskeline's `completeWordWithPrev`.--- Expects:---   * Line contents to the left of the word, reversed---   * Word to be completed-findCompletions :: String -> String -> CompletionM [Completion]-findCompletions prev word = do-  let ctx = completionContext (words (reverse prev)) word-  completions <- concat <$> traverse getCompletions ctx-  return $ sortBy directivesFirst completions-  where-  getCompletions :: CompletionContext -> CompletionM [Completion]-  getCompletions = fmap (mapMaybe (either (prefixedBy word) Just)) . getCompletion--  prefixedBy :: String -> String -> Maybe Completion-  prefixedBy w cand = if w `isPrefixOf` cand-                        then Just (simpleCompletion cand)-                        else Nothing--getCompletion :: CompletionContext -> CompletionM [Either String Completion]-getCompletion ctx =-  case ctx of-    CtxFilePath f        -> map Right <$> listFiles f-    CtxModule            -> map Left <$> getModuleNames-    CtxIdentifier        -> map Left <$> ((++) <$> getIdentNames <*> getDctorNames)-    CtxType              -> map Left <$> getTypeNames-    CtxFixed str         -> return [Left str]-    CtxDirective d       -> return (map Left (completeDirectives d))--  where-  completeDirectives :: String -> [String]-  completeDirectives = map (':' :) . D.directiveStringsFor---getLoadedModules :: CompletionM [P.Module]-getLoadedModules = asks (map snd . psciLoadedModules)--getImportedModules :: CompletionM [ImportedModule]-getImportedModules = asks psciImportedModules--getModuleNames :: CompletionM [String]-getModuleNames = moduleNames <$> getLoadedModules--mapLoadedModulesAndQualify :: (a -> String) -> (P.Module -> [(a, P.Declaration)]) -> CompletionM [String]-mapLoadedModulesAndQualify sho f = do-  ms <- getLoadedModules-  let argPairs = do m <- ms-                    fm <- f m-                    return (m, fm)-  concat <$> traverse (uncurry (getAllQualifications sho)) argPairs--getIdentNames :: CompletionM [String]-getIdentNames = mapLoadedModulesAndQualify P.showIdent identNames--getDctorNames :: CompletionM [String]-getDctorNames = mapLoadedModulesAndQualify P.runProperName dctorNames--getTypeNames :: CompletionM [String]-getTypeNames = mapLoadedModulesAndQualify P.runProperName typeDecls---- | Given a module and a declaration in that module, return all possible ways--- it could have been referenced given the current PSCiState - including fully--- qualified, qualified using an alias, and unqualified.-getAllQualifications :: (a -> String) -> P.Module -> (a, P.Declaration) -> CompletionM [String]-getAllQualifications sho m (declName, decl) = do-  imports <- getAllImportsOf m-  let fullyQualified = qualifyWith (Just (P.getModuleName m))-  let otherQuals = nub (concatMap qualificationsUsing imports)-  return $ fullyQualified : otherQuals-  where-  qualifyWith mMod = P.showQualified sho (P.Qualified mMod declName)-  referencedBy refs = P.isExported (Just refs) decl--  qualificationsUsing (_, importType, asQ') =-    let q = qualifyWith asQ'-    in case importType of-          P.Implicit      -> [q]-          P.Explicit refs -> [q | referencedBy refs]-          P.Hiding refs   -> [q | not $ referencedBy refs]----- | Returns all the ImportedModule values referring to imports of a particular--- module.-getAllImportsOf :: P.Module -> CompletionM [ImportedModule]-getAllImportsOf = asks . allImportsOf--nubOnFst :: Eq a => [(a, b)] -> [(a, b)]-nubOnFst = nubBy ((==) `on` fst)--typeDecls :: P.Module -> [(N.ProperName 'N.TypeName, P.Declaration)]-typeDecls = mapMaybe getTypeName . filter P.isDataDecl . P.exportedDeclarations-  where-  getTypeName :: P.Declaration -> Maybe (N.ProperName 'N.TypeName, P.Declaration)-  getTypeName d@(P.TypeSynonymDeclaration name _ _) = Just (name, d)-  getTypeName d@(P.DataDeclaration _ name _ _) = Just (name, d)-  getTypeName (P.PositionedDeclaration _ _ d) = getTypeName d-  getTypeName _ = Nothing--identNames :: P.Module -> [(N.Ident, P.Declaration)]-identNames = nubOnFst . concatMap getDeclNames . P.exportedDeclarations-  where-  getDeclNames :: P.Declaration -> [(P.Ident, P.Declaration)]-  getDeclNames d@(P.ValueDeclaration ident _ _ _)  = [(ident, d)]-  getDeclNames d@(P.TypeDeclaration ident _ ) = [(ident, d)]-  getDeclNames d@(P.ExternDeclaration ident _) = [(ident, d)]-  getDeclNames d@(P.TypeClassDeclaration _ _ _ ds) = map (second (const d)) $ concatMap getDeclNames ds-  getDeclNames (P.PositionedDeclaration _ _ d) = getDeclNames d-  getDeclNames _ = []--dctorNames :: P.Module -> [(N.ProperName 'N.ConstructorName, P.Declaration)]-dctorNames = nubOnFst . concatMap go . P.exportedDeclarations-  where-  go :: P.Declaration -> [(N.ProperName 'N.ConstructorName, P.Declaration)]-  go decl@(P.DataDeclaration _ _ _ ctors) = map (\n -> (n, decl)) (map fst ctors)-  go (P.PositionedDeclaration _ _ d) = go d-  go _ = []--moduleNames :: [P.Module] -> [String]-moduleNames ms = nub [P.runModuleName moduleName | P.Module _ _ moduleName _ _ <- ms]--directivesFirst :: Completion -> Completion -> Ordering-directivesFirst (Completion _ d1 _) (Completion _ d2 _) = go d1 d2-  where-  go (':' : xs) (':' : ys) = compare xs ys-  go (':' : _) _ = LT-  go _ (':' : _) = GT-  go xs ys = compare xs ys
− psci/PSCi/Directive.hs
@@ -1,119 +0,0 @@------------------------------------------------------------------------------------ Module      :  Directive--- Copyright   :--- License     :  MIT------ Maintainer  :--- Stability   :  experimental--- Portability :------ |--- Directives for PSCI.-----------------------------------------------------------------------------------module PSCi.Directive where--import Prelude ()-import Prelude.Compat---import Data.Maybe (fromJust, listToMaybe)-import Data.List (isPrefixOf)-import Data.Tuple (swap)--import PSCi.Types---- |--- List of all avaliable directives.----directives :: [Directive]-directives = map fst directiveStrings---- |--- A mapping of directives to the different strings that can be used to invoke--- them.----directiveStrings :: [(Directive, [String])]-directiveStrings =-    [ (Help   , ["?", "help"])-    , (Quit   , ["quit"])-    , (Reset  , ["reset"])-    , (Browse , ["browse"])-    , (Load   , ["load", "module"])-    , (Foreign, ["foreign"])-    , (Type   , ["type"])-    , (Kind   , ["kind"])-    , (Show   , ["show"])-    ]---- |--- Like directiveStrings, but the other way around.----directiveStrings' :: [(String, Directive)]-directiveStrings' = concatMap go directiveStrings-  where-  go (dir, strs) = map (\s -> (s, dir)) strs---- |--- List of all directive strings.----strings :: [String]-strings = concatMap snd directiveStrings---- |--- Returns all possible string representations of a directive.----stringsFor :: Directive -> [String]-stringsFor d = fromJust (lookup d directiveStrings)---- |--- Returns the default string representation of a directive.----stringFor :: Directive -> String-stringFor = head . stringsFor---- |--- Returns the list of directives which could be expanded from the string--- argument, together with the string alias that matched.----directivesFor' :: String -> [(Directive, String)]-directivesFor' str = go directiveStrings'-  where-  go = map swap . filter ((str `isPrefixOf`) . fst)--directivesFor :: String -> [Directive]-directivesFor = map fst . directivesFor'--directiveStringsFor :: String -> [String]-directiveStringsFor = map snd . directivesFor'--parseDirective :: String -> Maybe Directive-parseDirective = listToMaybe . directivesFor---- |--- True if the given directive takes an argument, false otherwise.-hasArgument :: Directive -> Bool-hasArgument Help = False-hasArgument Quit = False-hasArgument Reset = False-hasArgument _ = True---- |--- The help menu.----help :: [(Directive, String, String)]-help =-  [ (Help,    "",         "Show this help menu")-  , (Quit,    "",         "Quit PSCi")-  , (Reset,   "",         "Discard all imported modules and declared bindings")-  , (Browse,  "<module>", "See all functions in <module>")-  , (Load,    "<file>",   "Load <file> for importing")-  , (Foreign, "<file>",   "Load foreign module <file>")-  , (Type,    "<expr>",   "Show the type of <expr>")-  , (Kind,    "<type>",   "Show the kind of <type>")-  , (Show,    "import",   "Show all imported modules")-  , (Show,    "loaded",   "Show all loaded modules")-  ]-
− psci/PSCi/IO.hs
@@ -1,68 +0,0 @@------------------------------------------------------------------------------------ Module      :  IO--- Copyright   :  (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :------ |-----------------------------------------------------------------------------------module PSCi.IO where--import Prelude ()-import Prelude.Compat--import System.Directory (createDirectoryIfMissing, getHomeDirectory, findExecutable, doesFileExist)-import System.FilePath (takeDirectory, (</>), isPathSeparator)-import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)-import Control.Monad (msum)-import Control.Monad.IO.Class (MonadIO, liftIO)-import System.Console.Haskeline (outputStrLn, InputT)--mkdirp :: FilePath -> IO ()-mkdirp = createDirectoryIfMissing True . takeDirectory---- File helpers--onFirstFileMatching :: Monad m => (b -> m (Maybe a)) -> [b] -> m (Maybe a)-onFirstFileMatching f pathVariants = runMaybeT . msum $ map (MaybeT . f) pathVariants---- |--- Locates the node executable.--- Checks for either @nodejs@ or @node@.----findNodeProcess :: IO (Maybe String)-findNodeProcess = onFirstFileMatching findExecutable names-  where names = ["nodejs", "node"]---- |--- Grabs the filename where the history is stored.----getHistoryFilename :: IO FilePath-getHistoryFilename = do-  home <- getHomeDirectory-  let filename = home </> ".purescript" </> "psci_history"-  mkdirp filename-  return filename----- |--- Expands tilde in path.----expandTilde :: FilePath -> IO FilePath-expandTilde ('~':p:rest) | isPathSeparator p = (</> rest) <$> getHomeDirectory-expandTilde p = return p---whenFileExists :: MonadIO m => FilePath -> (FilePath -> InputT m ()) -> InputT m ()-whenFileExists filePath f = do-  absPath <- liftIO $ expandTilde filePath-  exists <- liftIO $ doesFileExist absPath-  if exists-    then f absPath-    else outputStrLn $ "Couldn't locate: " ++ filePath
− psci/PSCi/Message.hs
@@ -1,53 +0,0 @@-module PSCi.Message where---import Data.List (intercalate)-import qualified PSCi.Directive as D-import PSCi.Types---- Messages---- |--- The help message.----helpMessage :: String-helpMessage = "The following commands are available:\n\n    " ++-  intercalate "\n    " (map line D.help) ++-  "\n\n" ++ extraHelp-  where-  line :: (Directive, String, String) -> String-  line (dir, arg, desc) =-    let cmd = ':' : D.stringFor dir-    in unwords [ cmd-               , replicate (11 - length cmd) ' '-               , arg-               , replicate (11 - length arg) ' '-               , desc-               ]--  extraHelp =-    "Further information is available on the PureScript wiki:\n" ++-    " --> https://github.com/purescript/purescript/wiki/psci"----- |--- The welcome prologue.----prologueMessage :: String-prologueMessage = intercalate "\n"-  [ " ____                 ____            _       _   "-  , "|  _ \\ _   _ _ __ ___/ ___|  ___ _ __(_)_ __ | |_ "-  , "| |_) | | | | '__/ _ \\___ \\ / __| '__| | '_ \\| __|"-  , "|  __/| |_| | | |  __/___) | (__| |  | | |_) | |_ "-  , "|_|    \\__,_|_|  \\___|____/ \\___|_|  |_| .__/ \\__|"-  , "                                       |_|        "-  , ""-  , ":? shows help"-  ]---- |--- The quit message.----quitMessage :: String-quitMessage = "See ya!"-
− psci/PSCi/Module.hs
@@ -1,107 +0,0 @@-module PSCi.Module where--import Prelude ()-import Prelude.Compat--import qualified Language.PureScript as P-import PSCi.Types-import System.FilePath (pathSeparator)-import System.IO.UTF8 (readUTF8File)-import Control.Monad---- | The name of the PSCI support module-supportModuleName :: P.ModuleName-supportModuleName = P.ModuleName [P.ProperName "$PSCI", P.ProperName "Support"]---- | Support module, contains code to evaluate terms-supportModule :: P.Module-supportModule =-  case P.parseModulesFromFiles id [("", code)] of-    Right [(_, P.Module ss cs _ ds exps)] -> P.Module ss cs supportModuleName ds exps-    _ -> P.internalError "Support module could not be parsed"-  where-  code :: String-  code = unlines-    [ "module S where"-    , ""-    , "import Prelude"-    , "import Control.Monad.Eff"-    , "import Control.Monad.Eff.Console"-    , "import Control.Monad.Eff.Unsafe"-    , ""-    , "class Eval a where"-    , "  eval :: a -> Eff (console :: CONSOLE) Unit"-    , ""-    , "instance evalShow :: (Show a) => Eval a where"-    , "  eval = print"-    , ""-    , "instance evalEff :: (Eval a) => Eval (Eff eff a) where"-    , "  eval x = unsafeInterleaveEff x >>= eval"-    ]---- Module Management---- |--- Loads a file for use with imports.----loadModule :: FilePath -> IO (Either String [P.Module])-loadModule filename = do-  content <- readUTF8File filename-  return $ either (Left . P.prettyPrintMultipleErrors False) (Right . map snd) $ P.parseModulesFromFiles id [(filename, content)]---- |--- Load all modules.----loadAllModules :: [FilePath] -> IO (Either P.MultipleErrors [(FilePath, P.Module)])-loadAllModules files = do-  filesAndContent <- forM files $ \filename -> do-    content <- readUTF8File filename-    return (filename, content)-  return $ P.parseModulesFromFiles id filesAndContent----- |--- Makes a volatile module to execute the current expression.----createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module-createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindings = lets} val =-  let-    moduleName = P.ModuleName [P.ProperName "$PSCI"]-    trace = P.Var (P.Qualified (Just supportModuleName) (P.Ident "eval"))-    mainValue = P.App trace (P.Var (P.Qualified Nothing (P.Ident "it")))-    itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val-    mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue-    decls = if exec then [itDecl, mainDecl] else [itDecl]-  in-    P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName ((importDecl `map` imports) ++ lets ++ decls) Nothing----- |--- Makes a volatile module to hold a non-qualified type synonym for a fully-qualified data type declaration.----createTemporaryModuleForKind :: PSCiState -> P.Type -> P.Module-createTemporaryModuleForKind PSCiState{psciImportedModules = imports, psciLetBindings = lets} typ =-  let-    moduleName = P.ModuleName [P.ProperName "$PSCI"]-    itDecl = P.TypeSynonymDeclaration (P.ProperName "IT") [] typ-  in-    P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName ((importDecl `map` imports) ++ lets ++ [itDecl]) Nothing---- |--- Makes a volatile module to execute the current imports.----createTemporaryModuleForImports :: PSCiState -> P.Module-createTemporaryModuleForImports PSCiState{psciImportedModules = imports} =-  let-    moduleName = P.ModuleName [P.ProperName "$PSCI"]-  in-    P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName (importDecl `map` imports) Nothing--importDecl :: ImportedModule -> P.Declaration-importDecl (mn, declType, asQ) = P.ImportDeclaration mn declType asQ False--indexFile :: FilePath-indexFile = ".psci_modules" ++ pathSeparator : "index.js"--modulesDir :: FilePath-modulesDir = ".psci_modules" ++ pathSeparator : "node_modules"
− psci/PSCi/Option.hs
@@ -1,57 +0,0 @@-module PSCi.Option (-  getOpt-) where--import Prelude ()-import Prelude.Compat--import Options.Applicative as Opts-import Data.Version (showVersion)--import PSCi.Types-import qualified Paths_purescript as Paths---- Parse Command line option--multiLineMode :: Parser Bool-multiLineMode = switch $-     long "multi-line-mode"-  <> short 'm'-  <> Opts.help "Run in multi-line mode (use ^D to terminate commands)"--inputFile :: Parser FilePath-inputFile = strArgument $-     metavar "FILE"-  <> Opts.help "Optional .purs files to load on start"--inputForeignFile :: Parser FilePath-inputForeignFile = strOption $-     short 'f'-  <> long "ffi"-  <> help "The input .js file(s) providing foreign import implementations"--nodeFlagsFlag :: Parser [String]-nodeFlagsFlag = option parser $-     long "node-opts"-  <> metavar "NODE_OPTS"-  <> value []-  <> Opts.help "Flags to pass to node, separated by spaces"-  where-    parser = words <$> str--psciOptions :: Parser PSCiOptions-psciOptions = PSCiOptions <$> multiLineMode-                          <*> many inputFile-                          <*> many inputForeignFile-                          <*> nodeFlagsFlag--version :: Parser (a -> a)-version = abortOption (InfoMsg (showVersion Paths.version)) $ long "version" <> Opts.help "Show the version number" <> hidden--getOpt :: IO PSCiOptions-getOpt = execParser opts-    where-      opts        = info (version <*> helper <*> psciOptions) infoModList-      infoModList = fullDesc <> headerInfo <> footerInfo-      headerInfo  = header   "psci - Interactive mode for PureScript"-      footerInfo  = footer $ "psci " ++ showVersion Paths.version
− psci/PSCi/Parser.hs
@@ -1,140 +0,0 @@------------------------------------------------------------------------------------ Module      :  Parser--- Copyright   :  (c) Phil Freeman 2014--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :------ |--- Parser for PSCI.-----------------------------------------------------------------------------------module PSCi.Parser-  ( parseCommand-  ) where--import Prelude ()-import Prelude.Compat hiding (lex)--import Data.Char (isSpace)-import Data.List (intercalate)--import Text.Parsec hiding ((<|>))--import qualified Language.PureScript as P-import Language.PureScript.Parser.Common (mark, same)--import qualified PSCi.Directive as D-import PSCi.Types---- |--- Parses PSCI metacommands or expressions input from the user.----parseCommand :: String -> Either String Command-parseCommand cmdString =-  case cmdString of-    (':' : cmd) -> parseDirective cmd-    _ -> parseRest psciCommand cmdString--parseRest :: P.TokenParser a -> String -> Either String a-parseRest p s = either (Left . show) Right $ do-  ts <- P.lex "" s-  P.runTokenParser "" (p <* eof) ts--psciCommand :: P.TokenParser Command-psciCommand = choice (map try parsers)-  where-  parsers =-    [ psciLet-    , psciImport-    , psciOtherDeclaration-    , psciExpression-    ]--trim :: String -> String-trim = trimEnd . trimStart--trimStart :: String -> String-trimStart = dropWhile isSpace--trimEnd :: String -> String-trimEnd = reverse . trimStart . reverse--parseDirective :: String -> Either String Command-parseDirective cmd =-  case D.directivesFor' dstr of-    [(d, _)] -> commandFor d-    []       -> Left "Unrecognized directive. Type :? for help."-    ds       -> Left ("Ambiguous directive. Possible matches: " ++-                  intercalate ", " (map snd ds) ++ ". Type :? for help.")-  where-  (dstr, arg) = break isSpace cmd--  commandFor d = case d of-    Help    -> return ShowHelp-    Quit    -> return QuitPSCi-    Reset   -> return ResetState-    Browse  -> BrowseModule <$> parseRest P.moduleName arg-    Load    -> return $ LoadFile (trim arg)-    Foreign -> return $ LoadForeign (trim arg)-    Show    -> ShowInfo <$> parseReplQuery' (trim arg)-    Type    -> TypeOf <$> parseRest P.parseValue arg-    Kind    -> KindOf <$> parseRest P.parseType arg---- |--- Parses expressions entered at the PSCI repl.----psciExpression :: P.TokenParser Command-psciExpression = Expression <$> P.parseValue---- |--- PSCI version of @let@.--- This is essentially let from do-notation.--- However, since we don't support the @Eff@ monad,--- we actually want the normal @let@.----psciLet :: P.TokenParser Command-psciLet = Decls <$> (P.reserved "let" *> P.indented *> manyDecls)-  where-  manyDecls :: P.TokenParser [P.Declaration]-  manyDecls = mark (many1 (same *> P.parseLocalDeclaration))---- | Imports must be handled separately from other declarations, so that--- :show import works, for example.-psciImport :: P.TokenParser Command-psciImport = do-  (mn, declType, asQ, _) <- P.parseImportDeclaration'-  return $ Import (mn, declType, asQ)---- | Any other declaration that we don't need a 'special case' parser for--- (like let or import declarations).-psciOtherDeclaration :: P.TokenParser Command-psciOtherDeclaration = Decls . (:[]) <$> do-  decl <- discardPositionInfo <$> P.parseDeclaration-  if acceptable decl-    then return decl-    else fail "this kind of declaration is not supported in psci"--discardPositionInfo :: P.Declaration -> P.Declaration-discardPositionInfo (P.PositionedDeclaration _ _ d) = d-discardPositionInfo d = d--acceptable :: P.Declaration -> Bool-acceptable P.DataDeclaration{} = True-acceptable P.TypeSynonymDeclaration{} = True-acceptable P.ExternDeclaration{} = True-acceptable P.ExternDataDeclaration{} = True-acceptable P.TypeClassDeclaration{} = True-acceptable P.TypeInstanceDeclaration{} = True-acceptable _ = False--parseReplQuery' :: String -> Either String ReplQuery-parseReplQuery' str =-  case parseReplQuery str of-    Nothing -> Left ("Don't know how to show " ++ str ++ ". Try one of: " ++-                      intercalate ", " replQueryStrings ++ ".")-    Just query -> Right query
− psci/PSCi/Printer.hs
@@ -1,131 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE DataKinds #-}--module PSCi.Printer where--import Prelude ()-import Prelude.Compat--import qualified Language.PureScript as P-import qualified Text.PrettyPrint.Boxes as Box-import qualified Data.Map as M-import System.Console.Haskeline-import Data.Maybe (mapMaybe)-import Data.List (intersperse)-import Control.Monad.IO.Class (MonadIO)---- Printers---- |--- Pretty print a module's signatures----printModuleSignatures :: MonadIO m => P.ModuleName -> P.Environment -> InputT m ()-printModuleSignatures moduleName (P.Environment {..}) =-    -- get relevant components of a module from environment-    let moduleNamesIdent = (filter ((== moduleName) . fst) . M.keys) names-        moduleTypeClasses = (filter (\(P.Qualified maybeName _) -> maybeName == Just moduleName) . M.keys) typeClasses-        moduleTypes = (filter (\(P.Qualified maybeName _) -> maybeName == Just moduleName) . M.keys) types--  in-    -- print each component-    (outputStr . unlines . map trimEnd . lines . Box.render . Box.vsep 1 Box.left)-      [ printModule's (mapMaybe (showTypeClass . findTypeClass typeClasses)) moduleTypeClasses -- typeClasses-      , printModule's (mapMaybe (showType typeClasses dataConstructors typeSynonyms . findType types)) moduleTypes -- types-      , printModule's (map (showNameType . findNameType names)) moduleNamesIdent -- functions-      ]--  where printModule's showF = Box.vsep 1 Box.left . showF--        findNameType :: M.Map (P.ModuleName, P.Ident) (P.Type, P.NameKind, P.NameVisibility) -> (P.ModuleName, P.Ident) -> (P.Ident, Maybe (P.Type, P.NameKind, P.NameVisibility))-        findNameType envNames m@(_, mIdent) = (mIdent, M.lookup m envNames)--        showNameType :: (P.Ident, Maybe (P.Type, P.NameKind, P.NameVisibility)) -> Box.Box-        showNameType (mIdent, Just (mType, _, _)) = Box.text (P.showIdent mIdent ++ " :: ") Box.<> P.typeAsBox mType-        showNameType _ = P.internalError "The impossible happened in printModuleSignatures."--        findTypeClass-          :: M.Map (P.Qualified (P.ProperName 'P.ClassName)) ([(String, Maybe P.Kind)], [(P.Ident, P.Type)], [P.Constraint])-          -> P.Qualified (P.ProperName 'P.ClassName)-          -> (P.Qualified (P.ProperName 'P.ClassName), Maybe ([(String, Maybe P.Kind)], [(P.Ident, P.Type)], [P.Constraint]))-        findTypeClass envTypeClasses name = (name, M.lookup name envTypeClasses)--        showTypeClass-          :: (P.Qualified (P.ProperName 'P.ClassName), Maybe ([(String, Maybe P.Kind)], [(P.Ident, P.Type)], [P.Constraint]))-          -> Maybe Box.Box-        showTypeClass (_, Nothing) = Nothing-        showTypeClass (P.Qualified _ name, Just (vars, body, constrs)) =-            let constraints =-                    if null constrs-                    then Box.text ""-                    else Box.text "("-                         Box.<> Box.hcat Box.left (intersperse (Box.text ", ") $ map (\(P.Qualified _ pn, lt) -> Box.text (P.runProperName pn) Box.<+> Box.hcat Box.left (map P.typeAtomAsBox lt)) constrs)-                         Box.<> Box.text ") <= "-                className =-                    Box.text (P.runProperName name)-                    Box.<> Box.text (concatMap ((' ':) . fst) vars)-                classBody =-                    Box.vcat Box.top (map (\(i, t) -> Box.text (P.showIdent i ++ " ::") Box.<+> P.typeAsBox t) body)--            in-              Just $-                (Box.text "class "-                Box.<> constraints-                Box.<> className-                Box.<+> if null body then Box.text "" else Box.text "where")-                Box.// Box.moveRight 2 classBody---        findType-          :: M.Map (P.Qualified (P.ProperName 'P.TypeName)) (P.Kind, P.TypeKind)-          -> P.Qualified (P.ProperName 'P.TypeName)-          -> (P.Qualified (P.ProperName 'P.TypeName), Maybe (P.Kind, P.TypeKind))-        findType envTypes name = (name, M.lookup name envTypes)--        showType-          :: M.Map (P.Qualified (P.ProperName 'P.ClassName)) ([(String, Maybe P.Kind)], [(P.Ident, P.Type)], [P.Constraint])-          -> M.Map (P.Qualified (P.ProperName 'P.ConstructorName)) (P.DataDeclType, P.ProperName 'P.TypeName, P.Type, [P.Ident])-          -> M.Map (P.Qualified (P.ProperName 'P.TypeName)) ([(String, Maybe P.Kind)], P.Type)-          -> (P.Qualified (P.ProperName 'P.TypeName), Maybe (P.Kind, P.TypeKind))-          -> Maybe Box.Box-        showType typeClassesEnv dataConstructorsEnv typeSynonymsEnv (n@(P.Qualified modul name), typ) =-          case (typ, M.lookup n typeSynonymsEnv) of-            (Just (_, P.TypeSynonym), Just (typevars, dtType)) ->-                if M.member (fmap P.coerceProperName n) typeClassesEnv-                then-                  Nothing-                else-                  Just $-                    Box.text ("type " ++ P.runProperName name ++ concatMap ((' ':) . fst) typevars)-                    Box.// Box.moveRight 2 (Box.text "=" Box.<+> P.typeAsBox dtType)--            (Just (_, P.DataType typevars pt), _) ->-              let prefix =-                    case pt of-                      [(dtProperName,_)] ->-                        case M.lookup (P.Qualified modul dtProperName) dataConstructorsEnv of-                          Just (dataDeclType, _, _, _) -> P.showDataDeclType dataDeclType-                          _ -> "data"-                      _ -> "data"--              in-                Just $ Box.text (prefix ++ " " ++ P.runProperName name ++ concatMap ((' ':) . fst) typevars) Box.// printCons pt--            _ ->-              Nothing--          where printCons pt =-                    Box.moveRight 2 $-                    Box.vcat Box.left $-                    mapFirstRest (Box.text "=" Box.<+>) (Box.text "|" Box.<+>) $-                    map (\(cons,idents) -> (Box.text (P.runProperName cons) Box.<> Box.hcat Box.left (map prettyPrintType idents))) pt--                prettyPrintType t = Box.text " " Box.<> P.typeAtomAsBox t--                mapFirstRest _ _ [] = []-                mapFirstRest f g (x:xs) = f x : map g xs--        trimEnd = reverse . dropWhile (== ' ') . reverse---- | Pretty-print errors-printErrors :: MonadIO m => P.MultipleErrors -> InputT m ()-printErrors = outputStrLn . P.prettyPrintMultipleErrors False
− psci/PSCi/Types.hs
@@ -1,218 +0,0 @@------------------------------------------------------------------------------------ Module      :  Types--- Copyright   :  (c) Phil Freeman 2014--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :------ |--- Type declarations and associated basic functions for PSCI.-----------------------------------------------------------------------------------module PSCi.Types where--import Prelude ()-import Prelude.Compat--import Control.Arrow (second)-import Data.Map (Map)-import qualified Data.Map as Map-import qualified Language.PureScript as P--data PSCiOptions = PSCiOptions-  { psciMultiLineMode     :: Bool-  , psciInputFile         :: [FilePath]-  , psciForeignInputFiles :: [FilePath]-  , psciInputNodeFlags    :: [String]-  }---- |--- The PSCI state.--- Holds a list of imported modules, loaded files, and partial let bindings.--- The let bindings are partial,--- because it makes more sense to apply the binding to the final evaluated expression.----data PSCiState = PSCiState-  { psciImportedModules     :: [ImportedModule]-  , _psciLoadedModules      :: Map FilePath [P.Module]-  , psciForeignFiles        :: Map P.ModuleName FilePath-  , psciLetBindings         :: [P.Declaration]-  , psciNodeFlags           :: [String]-  }--initialPSCiState :: PSCiState-initialPSCiState =-  PSCiState [] Map.empty Map.empty [] []--mkPSCiState :: [ImportedModule]-            -> [(FilePath, P.Module)]-            -> Map P.ModuleName FilePath-            -> [P.Declaration]-            -> [String]-            -> PSCiState-mkPSCiState imported loaded foreigns lets nodeFlags =-  (initialPSCiState-    |> each imported updateImportedModules-    |> updateModules loaded)-    { psciForeignFiles = foreigns-    , psciLetBindings = lets-    , psciNodeFlags = nodeFlags-    }-  where-  x |> f = f x-  each xs f st = foldl (flip f) st xs----  Public psci state accessors---- | Get the imported filenames as a list.-psciImportedFilenames :: PSCiState -> [FilePath]-psciImportedFilenames = Map.keys . _psciLoadedModules---- | Get the loaded modules as a list.-psciLoadedModules :: PSCiState -> [(FilePath, P.Module)]-psciLoadedModules = collect . Map.toList . _psciLoadedModules-  where-  collect :: [(k, [v])] -> [(k, v)]-  collect vss = [ (k, v) | (k, vs) <- vss, v <- vs ]---- | All of the data that is contained by an ImportDeclaration in the AST.--- That is:------ * A module name, the name of the module which is being imported--- * An ImportDeclarationType which specifies whether there is an explicit---   import list, a hiding list, or neither.--- * If the module is imported qualified, its qualified name in the importing---   module. Otherwise, Nothing.----type ImportedModule = (P.ModuleName, P.ImportDeclarationType, Maybe P.ModuleName)--psciImportedModuleNames :: PSCiState -> [P.ModuleName]-psciImportedModuleNames (PSCiState{psciImportedModules = is}) =-  map (\(mn, _, _) -> mn) is--allImportsOf :: P.Module -> PSCiState -> [ImportedModule]-allImportsOf m (PSCiState{psciImportedModules = is}) =-  filter isImportOfThis is-  where-  name = P.getModuleName m-  isImportOfThis (name', _, _) = name == name'---- State helpers---- |--- Updates the state to have more imported modules.----updateImportedModules :: ImportedModule -> PSCiState -> PSCiState-updateImportedModules im st = st { psciImportedModules = im : psciImportedModules st }---- |--- Updates the state to have more loaded modules (available for import, but--- not necessarily imported).----updateModules :: [(FilePath, P.Module)] -> PSCiState -> PSCiState-updateModules modules st =-  st { _psciLoadedModules = Map.union (go modules) (_psciLoadedModules st) }-  where-  go = Map.fromListWith (++) . map (second (:[]))---- |--- Updates the state to have more let bindings.----updateLets :: [P.Declaration] -> PSCiState -> PSCiState-updateLets ds st = st { psciLetBindings = psciLetBindings st ++ ds }---- |--- Updates the state to have more let bindings.----updateForeignFiles :: Map P.ModuleName FilePath -> PSCiState -> PSCiState-updateForeignFiles fs st = st { psciForeignFiles = psciForeignFiles st `Map.union` fs }---- |--- Valid Meta-commands for PSCI----data Command-  -- |-  -- A purescript expression-  ---  = Expression P.Expr-  -- |-  -- Show the help (ie, list of directives)-  ---  | ShowHelp-  -- |-  -- Import a module from a loaded file-  ---  | Import ImportedModule-  -- |-  -- Browse a module-  ---  | BrowseModule P.ModuleName-  -- |-  -- Load a file for use with importing-  ---  | LoadFile FilePath-  -- |-  -- Load a foreign module-  ---  | LoadForeign FilePath-  -- |-  -- Exit PSCI-  ---  | QuitPSCi-  -- |-  -- Reset the state of the REPL-  ---  | ResetState-  -- |-  -- Add some declarations to the current evaluation context.-  ---  | Decls [P.Declaration]-  -- |-  -- Find the type of an expression-  ---  | TypeOf P.Expr-  -- |-  -- Find the kind of an expression-  ---  | KindOf P.Type-  -- |-  -- Shows information about the current state of the REPL-  ---  | ShowInfo ReplQuery--data ReplQuery-  = QueryLoaded-  | QueryImport-  deriving (Eq, Show)---- | A list of all ReplQuery values.-replQueries :: [ReplQuery]-replQueries = [QueryLoaded, QueryImport]--replQueryStrings :: [String]-replQueryStrings = map showReplQuery replQueries--showReplQuery :: ReplQuery -> String-showReplQuery QueryLoaded = "loaded"-showReplQuery QueryImport = "import"--parseReplQuery :: String -> Maybe ReplQuery-parseReplQuery "loaded" = Just QueryLoaded-parseReplQuery "import" = Just QueryImport-parseReplQuery _ = Nothing--data Directive-  = Help-  | Quit-  | Reset-  | Browse-  | Load-  | Foreign-  | Type-  | Kind-  | Show-  deriving (Eq, Show)
− psci/main/Main.hs
@@ -1,6 +0,0 @@-module Main where--import PSCi--main :: IO ()-main = runPSCi
purescript.cabal view
@@ -1,5 +1,5 @@ name: purescript-version: 0.8.5.0+version: 0.9.1 cabal-version: >=1.8 build-type: Simple license: MIT@@ -20,27 +20,73 @@ tested-with: GHC==7.10.3  extra-source-files: examples/passing/*.purs+                  , examples/passing/*.js+                  , examples/passing/2018/*.purs+                  , examples/passing/2138/*.purs+                  , examples/passing/ClassRefSyntax/*.purs+                  , examples/passing/DctorOperatorAlias/*.purs+                  , examples/passing/ExplicitImportReExport/*.purs+                  , examples/passing/ExportExplicit/*.purs+                  , examples/passing/ExportExplicit2/*.purs+                  , examples/passing/Import/*.purs+                  , examples/passing/ImportExplicit/*.purs+                  , examples/passing/ImportQualified/*.purs+                  , examples/passing/Module/*.purs+                  , examples/passing/ModuleDeps/*.purs+                  , examples/passing/ModuleExport/*.purs+                  , examples/passing/ModuleExportDupes/*.purs+                  , examples/passing/ModuleExportExcluded/*.purs+                  , examples/passing/ModuleExportQualified/*.purs+                  , examples/passing/ModuleExportSelf/*.purs+                  , examples/passing/NonConflictingExports/*.purs+                  , examples/passing/OperatorAliasElsewhere/*.purs+                  , examples/passing/Operators/*.purs+                  , examples/passing/PendingConflictingImports/*.purs+                  , examples/passing/PendingConflictingImports2/*.purs+                  , examples/passing/QualifiedNames/*.purs+                  , examples/passing/RedefinedFixity/*.purs+                  , examples/passing/ReExportQualified/*.purs+                  , examples/passing/ResolvableScopeConflict/*.purs+                  , examples/passing/ResolvableScopeConflict2/*.purs+                  , examples/passing/ResolvableScopeConflict3/*.purs+                  , examples/passing/ShadowedModuleName/*.purs+                  , examples/passing/TransitiveImport/*.purs+                  , examples/passing/TypeOperators/*.purs+                  , examples/passing/TypeWithoutParens/*.purs                   , examples/failing/*.purs+                  , examples/failing/1733/*.purs+                  , examples/failing/ConflictingExports/*.purs+                  , examples/failing/ConflictingImports/*.purs+                  , examples/failing/ConflictingImports2/*.purs+                  , examples/failing/ConflictingQualifiedImports/*.purs+                  , examples/failing/ConflictingQualifiedImports2/*.purs+                  , examples/failing/ExportConflictClass/*.purs+                  , examples/failing/ExportConflictCtor/*.purs+                  , examples/failing/ExportConflictType/*.purs+                  , examples/failing/ExportConflictTypeOp/*.purs+                  , examples/failing/ExportConflictValue/*.purs+                  , examples/failing/ExportConflictValueOp/*.purs+                  , examples/failing/ExportExplicit1/*.purs+                  , examples/failing/ExportExplicit3/*.purs+                  , examples/failing/ImportExplicit/*.purs+                  , examples/failing/ImportExplicit2/*.purs+                  , examples/failing/ImportHidingModule/*.purs+                  , examples/failing/ImportModule/*.purs+                  , examples/failing/InstanceExport/*.purs+                  , examples/failing/OrphanInstance/*.purs+                  , examples/warning/*.purs+                  , examples/warning/*.js                   , examples/docs/bower_components/purescript-prelude/src/*.purs                   , examples/docs/bower.json                   , examples/docs/src/*.purs-                  , tests/support/setup.js                   , tests/support/package.json-                  , tests/support/prelude/bower.json-                  , tests/support/prelude/src/*.purs-                  , tests/support/prelude/src/*.js-                  , tests/support/prelude/LICENSE                   , tests/support/bower.json                   , tests/support/setup-win.cmd-                  , tests/support/flattened/*.purs-                  , tests/support/flattened/*.js                   , tests/support/psci/*.purs                   , tests/support/pscide/src/*.purs                   , tests/support/pscide/src/*.js                   , tests/support/pscide/src/*.fail                   , stack.yaml-                  , stack-lts-5.yaml-                  , stack-nightly.yaml                   , README.md                   , INSTALL.md                   , CONTRIBUTORS.md@@ -52,47 +98,49 @@  library     build-depends: base >=4.8 && <5,+                   aeson >= 0.8 && < 0.12,+                   aeson-better-errors >= 0.8,+                   ansi-terminal >= 0.6.2 && < 0.7,                    base-compat >=0.6.0,-                   lifted-base >= 0.2.3 && < 0.2.4,-                   monad-control >= 1.0.0.0 && < 1.1,-                   transformers-base >= 0.4.0 && < 0.5,+                   bower-json >= 0.8,+                   boxes >= 0.1.4 && < 0.2.0,+                   bytestring -any,                    containers -any,-                   unordered-containers -any,-                   dlist -any,                    directory >= 1.2,+                   dlist -any,+                   edit-distance -any,                    filepath -any,+                   fsnotify >= 0.2.1,+                   Glob >= 0.7 && < 0.8,+                   haskeline >= 0.7.0.0,+                   http-types -any,+                   language-javascript == 0.6.*,+                   lifted-base >= 0.2.3 && < 0.2.4,+                   monad-control >= 1.0.0.0 && < 1.1,+                   monad-logger >= 0.3 && < 0.4,                    mtl >= 2.1.0 && < 2.3.0,-                   parsec -any,-                   transformers >= 0.3.0 && < 0.6,-                   transformers-compat >= 0.3.0,-                   utf8-string >= 1 && < 2,+                   parallel >= 3.2 && < 3.3,+                   parsec >=3.1.10,                    pattern-arrows >= 0.0.2 && < 0.1,-                   time -any,-                   boxes >= 0.1.4 && < 0.2.0,-                   aeson >= 0.8 && < 0.12,-                   vector -any,-                   bower-json >= 0.8,-                   aeson-better-errors >= 0.8,-                   bytestring -any,-                   text -any,-                   split -any,-                   language-javascript == 0.6.*,-                   syb -any,-                   Glob >= 0.7 && < 0.8,+                   pipes >= 4.0.0 && < 4.2.0,+                   pipes-http -any,                    process >= 1.2.0 && < 1.5,+                   regex-tdfa -any,                    safe >= 0.3.9 && < 0.4,                    semigroups >= 0.16.2 && < 0.19,-                   parallel >= 3.2 && < 3.3,                    sourcemap >= 0.1.6,+                   spdx == 0.2.*,+                   split -any,                    stm >= 0.2.4.0,-                   regex-tdfa -any,-                   edit-distance -any,-                   fsnotify >= 0.2.1,-                   monad-logger >= 0.3 && < 0.4,-                   pipes >= 4.0.0 && < 4.2.0 ,-                   pipes-http -any,-                   http-types -any,-                   spdx == 0.2.*+                   syb -any,+                   text -any,+                   time -any,+                   transformers >= 0.3.0 && < 0.6,+                   transformers-base >= 0.4.0 && < 0.5,+                   transformers-compat >= 0.3.0,+                   unordered-containers -any,+                   utf8-string >= 1 && < 2,+                   vector -any      exposed-modules: Language.PureScript                      Language.PureScript.AST@@ -142,7 +190,6 @@                      Language.PureScript.Parser.Lexer                      Language.PureScript.Parser.Common                      Language.PureScript.Parser.Declarations-                     Language.PureScript.Parser.JS                      Language.PureScript.Parser.Kinds                      Language.PureScript.Parser.State                      Language.PureScript.Parser.Types@@ -158,9 +205,10 @@                      Language.PureScript.Sugar.CaseDeclarations                      Language.PureScript.Sugar.DoNotation                      Language.PureScript.Sugar.Names+                     Language.PureScript.Sugar.Names.Common                      Language.PureScript.Sugar.Names.Env-                     Language.PureScript.Sugar.Names.Imports                      Language.PureScript.Sugar.Names.Exports+                     Language.PureScript.Sugar.Names.Imports                      Language.PureScript.Sugar.ObjectWildcards                      Language.PureScript.Sugar.Operators                      Language.PureScript.Sugar.Operators.Common@@ -220,13 +268,38 @@                      Language.PureScript.Ide.Util                      Language.PureScript.Ide.Rebuild +                     Language.PureScript.Interactive+                     Language.PureScript.Interactive.Types+                     Language.PureScript.Interactive.Parser+                     Language.PureScript.Interactive.Directive+                     Language.PureScript.Interactive.Completion+                     Language.PureScript.Interactive.IO+                     Language.PureScript.Interactive.Message+                     Language.PureScript.Interactive.Module+                     Language.PureScript.Interactive.Printer+                      Control.Monad.Logger                      Control.Monad.Supply                      Control.Monad.Supply.Class                       System.IO.UTF8 -    extensions:      DataKinds+    extensions:      ConstraintKinds+                     DataKinds+                     DeriveFunctor+                     EmptyDataDecls+                     FlexibleContexts+                     KindSignatures+                     LambdaCase+                     MultiParamTypeClasses+                     NoImplicitPrelude+                     PatternGuards+                     PatternSynonyms+                     RankNTypes+                     RecordWildCards+                     ScopedTypeVariables+                     TupleSections+                     ViewPatterns     exposed: True     buildable: True     hs-source-dirs: src@@ -234,11 +307,23 @@     ghc-options: -Wall -O2  executable psc-    build-depends: base >=4 && <5, base-compat >=0.6.0,-                   containers -any, directory -any, filepath -any,-                   mtl -any, optparse-applicative >= 0.12.1, parsec -any, purescript -any,-                   time -any, transformers -any, transformers-compat -any, Glob >= 0.7 && < 0.8,-                   aeson >= 0.8 && < 0.12, bytestring -any, utf8-string >= 1 && < 2+    build-depends: base >=4 && <5,+                   purescript -any,+                   aeson >= 0.8 && < 0.12,+                   ansi-terminal >= 0.6.2 && < 0.7,+                   base-compat >=0.6.0,+                   bytestring -any,+                   containers -any,+                   directory -any,+                   filepath -any,+                   Glob >= 0.7 && < 0.8,+                   mtl -any,+                   optparse-applicative >= 0.12.1,+                   parsec -any,+                   time -any,+                   transformers -any,+                   transformers-compat -any,+                   utf8-string >= 1 && < 2     main-is: Main.hs     buildable: True     hs-source-dirs: psc@@ -246,33 +331,40 @@     ghc-options: -Wall -O2 -fno-warn-unused-do-bind -threaded -rtsopts "-with-rtsopts=-N"  executable psci-    build-depends: base >=4 && <5, containers -any, directory -any, filepath -any,-                   mtl -any, optparse-applicative >= 0.12.1, parsec -any,-                   haskeline >= 0.7.0.0, purescript -any, transformers -any,-                   transformers-compat -any, process -any, time -any, Glob -any, base-compat >=0.6.0,-                   boxes >= 0.1.4 && < 0.2.0-+    build-depends: base >=4 && <5,+                   purescript -any,+                   base-compat >=0.6.0,+                   boxes >= 0.1.4 && < 0.2.0,+                   containers -any,+                   directory -any,+                   filepath -any,+                   Glob -any,+                   haskeline >= 0.7.0.0,+                   mtl -any,+                   optparse-applicative >= 0.12.1,+                   parsec -any,+                   process -any,+                   time -any,+                   transformers -any,+                   transformers-compat -any     main-is: Main.hs     buildable: True-    hs-source-dirs: psci psci/main-    other-modules: PSCi-                   PSCi.Types-                   PSCi.Parser-                   PSCi.Directive-                   PSCi.Completion-                   PSCi.IO-                   PSCi.Message-                   PSCi.Option-                   PSCi.Module-                   PSCi.Printer-                   Paths_purescript+    hs-source-dirs: psci+    other-modules: Paths_purescript     ghc-options: -Wall -O2  executable psc-docs-    build-depends: base >=4 && <5, purescript -any,-                   optparse-applicative >= 0.12.1, process -any, mtl -any,-                   split -any, ansi-wl-pprint -any, directory -any,-                   filepath -any, Glob -any, transformers -any,+    build-depends: base >=4 && <5,+                   purescript -any,+                   ansi-wl-pprint -any,+                   directory -any,+                   filepath -any,+                   Glob -any,+                   mtl -any,+                   optparse-applicative >= 0.12.1,+                   process -any,+                   split -any,+                   transformers -any,                    transformers-compat -any     main-is: Main.hs     other-modules: Paths_purescript@@ -284,7 +376,11 @@     ghc-options: -Wall -O2  executable psc-publish-    build-depends: base >=4 && <5, purescript -any, bytestring -any, aeson -any, optparse-applicative -any+    build-depends: base >=4 && <5,+                   purescript -any,+                   aeson -any,+                   bytestring -any,+                   optparse-applicative -any     main-is: Main.hs     other-modules: Paths_purescript     buildable: True@@ -292,9 +388,15 @@     ghc-options: -Wall -O2  executable psc-hierarchy-    build-depends: base >=4 && <5, purescript -any, optparse-applicative >= 0.12.1,-                   process -any, mtl -any, parsec -any, filepath -any, directory -any,-                   Glob -any+    build-depends: base >=4 && <5,+                   purescript -any,+                   directory -any,+                   filepath -any,+                   Glob -any,+                   mtl -any,+                   optparse-applicative >= 0.12.1,+                   parsec -any,+                   process -any     main-is: Main.hs     other-modules: Paths_purescript     buildable: True@@ -308,13 +410,13 @@   other-extensions:   build-depends:       base >=4 && <5,                        purescript -any,-                       filepath -any,                        directory -any,+                       filepath -any,+                       Glob -any,                        mtl -any,-                       transformers -any,-                       transformers-compat -any,                        optparse-applicative >= 0.12.1,-                       Glob -any+                       transformers -any,+                       transformers-compat -any   ghc-options:         -Wall -O2   hs-source-dirs:      psc-bundle @@ -322,19 +424,19 @@   main-is:             Main.hs   other-modules:       Paths_purescript   other-extensions:-  build-depends:       base >=4 && <5-                     , purescript -any-                     , directory -any-                     , filepath -any-                     , monad-logger -any-                     , mtl -any-                     , transformers -any-                     , transformers-compat -any-                     , network -any-                     , optparse-applicative >= 0.12.1-                     , stm -any-                     , text -any-                     , base-compat >=0.6.0+  build-depends:       base >=4 && <5,+                       purescript -any,+                       base-compat >=0.6.0,+                       directory -any,+                       filepath -any,+                       monad-logger -any,+                       mtl -any,+                       network -any,+                       optparse-applicative >= 0.12.1,+                       stm -any,+                       text -any,+                       transformers -any,+                       transformers-compat -any   ghc-options:         -Wall -O2 -threaded   hs-source-dirs:      psc-ide-server @@ -342,23 +444,43 @@   main-is:             Main.hs   other-modules:       Paths_purescript   other-extensions:-  build-depends:       base >=4 && <5-                     , mtl -any-                     , text -any-                     , optparse-applicative >= 0.12.1-                     , network -any-                     , base-compat >=0.6.0+  build-depends:       base >=4 && <5,+                       base-compat >=0.6.0,+                       mtl -any,+                       network -any,+                       optparse-applicative >= 0.12.1,+                       text -any   ghc-options:         -Wall -O2   hs-source-dirs:      psc-ide-client  test-suite tests-    build-depends: base >=4 && <5, containers -any, directory -any,-                   filepath -any, mtl -any, parsec -any, purescript -any,-                   transformers -any, process -any, transformers-compat -any, time -any,-                   Glob -any, aeson-better-errors -any, bytestring -any, aeson -any,-                   base-compat -any, haskeline >= 0.7.0.0, optparse-applicative -any,-                   boxes -any, HUnit -any, hspec -any, hspec-discover -any, stm -any, text -any,-                   vector -any, utf8-string -any+    build-depends: base >=4 && <5,+                   purescript -any,+                   aeson -any,+                   aeson-better-errors -any,+                   base-compat -any,+                   boxes -any,+                   bytestring -any,+                   containers -any,+                   directory -any,+                   filepath -any,+                   Glob -any,+                   haskeline >= 0.7.0.0,+                   hspec -any,+                   hspec-discover -any,+                   HUnit -any,+                   mtl -any,+                   optparse-applicative -any,+                   parsec -any,+                   process -any,+                   silently -any,+                   stm -any,+                   text -any,+                   time -any,+                   transformers -any,+                   transformers-compat -any,+                   utf8-string -any,+                   vector -any     ghc-options: -Wall     type: exitcode-stdio-1.0     main-is: Main.hs@@ -377,9 +499,5 @@                    Language.PureScript.Ide.RebuildSpec                    Language.PureScript.Ide.ReexportsSpec                    Language.PureScript.IdeSpec-                   PSCi.Completion-                   PSCi.Directive-                   PSCi.Module-                   PSCi.Types     buildable: True-    hs-source-dirs: tests psci+    hs-source-dirs: tests
src/Control/Monad/Logger.hs view
@@ -1,33 +1,20 @@------------------------------------------------------------------------------------ Module      :  Control.Monad.Logger--- Author      :  Phil Freeman--- License     :  MIT (http://opensource.org/licenses/MIT)------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :------ | A replacement for WriterT IO which uses mutable references.---------------------------------------------------------------------------------- {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} +-- |+-- A replacement for WriterT IO which uses mutable references.+-- module Control.Monad.Logger where -import Prelude () import Prelude.Compat -import Data.IORef- import Control.Monad (ap)-import Control.Monad.IO.Class-import Control.Monad.Writer.Class import Control.Monad.Base (MonadBase(..))+import Control.Monad.IO.Class import Control.Monad.Trans.Control (MonadBaseControl(..))+import Control.Monad.Writer.Class++import Data.IORef  -- | A replacement for WriterT IO which uses mutable references. newtype Logger w a = Logger { runLogger :: IORef w -> IO a }
src/Control/Monad/Supply.hs view
@@ -1,31 +1,18 @@------------------------------------------------------------------------------------ Module      :  Control.Monad.Supply--- Copyright   :  (c) Phil Freeman 2014--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :---+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+ -- | -- Fresh variable supply ----------------------------------------------------------------------------------{-# LANGUAGE GeneralizedNewtypeDeriving #-}- module Control.Monad.Supply where -import Prelude () import Prelude.Compat -import Data.Functor.Identity--import Control.Monad.State import Control.Monad.Error.Class (MonadError(..)) import Control.Monad.Reader+import Control.Monad.State import Control.Monad.Writer++import Data.Functor.Identity  newtype SupplyT m a = SupplyT { unSupplyT :: StateT Integer m a }   deriving (Functor, Applicative, Monad, MonadTrans, MonadError e, MonadWriter w, MonadReader r)
src/Control/Monad/Supply/Class.hs view
@@ -1,24 +1,24 @@-{-# LANGUAGE MultiParamTypeClasses #-}- -- | -- A class for monads supporting a supply of fresh names -- module Control.Monad.Supply.Class where +import Prelude.Compat+ import Control.Monad.Supply import Control.Monad.State -class (Monad m) => MonadSupply m where+class Monad m => MonadSupply m where   fresh :: m Integer -instance (Monad m) => MonadSupply (SupplyT m) where+instance Monad m => MonadSupply (SupplyT m) where   fresh = SupplyT $ do     n <- get     put (n + 1)     return n -instance (MonadSupply m) => MonadSupply (StateT s m) where+instance MonadSupply m => MonadSupply (StateT s m) where   fresh = lift fresh -freshName :: (MonadSupply m) => m String+freshName :: MonadSupply m => m String freshName = fmap (('$' :) . show) fresh
src/Language/PureScript.hs view
@@ -1,33 +1,22 @@------------------------------------------------------------------------------------ Module      :  Language.PureScript--- Copyright   :  (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :--- -- | -- The main compiler module ----------------------------------------------------------------------------------{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE ScopedTypeVariables #-}- module Language.PureScript   ( module P   , version   ) where ++import Control.Monad.Supply as P+ import Data.Version (Version)  import Language.PureScript.AST as P-import Language.PureScript.Crash as P import Language.PureScript.Comments as P+import Language.PureScript.Crash as P import Language.PureScript.Environment as P import Language.PureScript.Errors as P hiding (indent)+import Language.PureScript.Externs as P import Language.PureScript.Kinds as P import Language.PureScript.Linter as P import Language.PureScript.Make as P@@ -38,7 +27,6 @@ import Language.PureScript.Pretty as P import Language.PureScript.Renamer as P import Language.PureScript.Sugar as P-import Control.Monad.Supply as P import Language.PureScript.TypeChecker as P import Language.PureScript.Types as P 
src/Language/PureScript/AST/Binders.hs view
@@ -3,6 +3,8 @@ -- module Language.PureScript.AST.Binders where +import Prelude.Compat+ import Language.PureScript.AST.SourcePos import Language.PureScript.AST.Literals import Language.PureScript.Names@@ -33,7 +35,7 @@   -- A operator alias binder. During the rebracketing phase of desugaring,   -- this data constructor will be removed.   ---  | OpBinder (Qualified Ident)+  | OpBinder (Qualified (OpName 'ValueOpName))   -- |   -- Binary operator application. During the rebracketing phase of desugaring,   -- this data constructor will be removed.
src/Language/PureScript/AST/Declarations.hs view
@@ -1,23 +1,17 @@-{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE LambdaCase #-}  -- | -- Data types for modules and declarations -- module Language.PureScript.AST.Declarations where -import Prelude () import Prelude.Compat -import Data.Aeson.TH-import Data.List (nub, (\\))-import Data.Maybe (mapMaybe)+import Control.Monad.Identity +import Data.Aeson.TH import qualified Data.Map as M -import Control.Monad.Identity- import Language.PureScript.AST.Binders import Language.PureScript.AST.Literals import Language.PureScript.AST.Operators@@ -47,9 +41,9 @@ addDefaultImport :: ModuleName -> Module -> Module addDefaultImport toImport m@(Module ss coms mn decls exps)  =   if isExistingImport `any` decls || mn == toImport then m-  else Module ss coms mn (ImportDeclaration toImport Implicit Nothing False : decls) exps+  else Module ss coms mn (ImportDeclaration toImport Implicit Nothing : decls) exps   where-  isExistingImport (ImportDeclaration mn' _ _ _) | mn' == toImport = True+  isExistingImport (ImportDeclaration mn' _ _) | mn' == toImport = True   isExistingImport (PositionedDeclaration _ _ d) = isExistingImport d   isExistingImport _ = False @@ -64,16 +58,20 @@   -- |   -- A type operator   ---  | TypeOpRef Ident+  | TypeOpRef (OpName 'TypeOpName)   -- |   -- A value   --   | ValueRef Ident   -- |+  -- A value-level operator+  --+  | ValueOpRef (OpName 'ValueOpName)+  -- |   -- A type class   --   | TypeClassRef (ProperName 'ClassName)-    -- |+  -- |   -- A type class instance, created during typeclass desugaring (name, class name, instance types)   --   | TypeInstanceRef Ident@@ -82,10 +80,6 @@   --   | ModuleRef ModuleName   -- |-  -- An unspecified ProperName ref. This will be replaced with a TypeClassRef-  -- or TypeRef during name desugaring.-  | ProperRef String-  -- |   -- A declaration reference with source position information   --   | PositionedDeclarationRef SourceSpan [Comment] DeclarationRef@@ -95,42 +89,45 @@   (TypeRef name dctors)  == (TypeRef name' dctors') = name == name' && dctors == dctors'   (TypeOpRef name)       == (TypeOpRef name')       = name == name'   (ValueRef name)        == (ValueRef name')        = name == name'+  (ValueOpRef name)      == (ValueOpRef name')      = name == name'   (TypeClassRef name)    == (TypeClassRef name')    = name == name'   (TypeInstanceRef name) == (TypeInstanceRef name') = name == name'   (ModuleRef name)       == (ModuleRef name')       = name == name'-  (ProperRef name)       == (ProperRef name')       = name == name'   (PositionedDeclarationRef _ _ r) == r' = r == r'   r == (PositionedDeclarationRef _ _ r') = r == r'   _ == _ = False +getTypeRef :: DeclarationRef -> Maybe (ProperName 'TypeName, Maybe [ProperName 'ConstructorName])+getTypeRef (TypeRef name dctors) = Just (name, dctors)+getTypeRef (PositionedDeclarationRef _ _ r) = getTypeRef r+getTypeRef _ = Nothing++getTypeOpRef :: DeclarationRef -> Maybe (OpName 'TypeOpName)+getTypeOpRef (TypeOpRef op) = Just op+getTypeOpRef (PositionedDeclarationRef _ _ r) = getTypeOpRef r+getTypeOpRef _ = Nothing++getValueRef :: DeclarationRef -> Maybe Ident+getValueRef (ValueRef name) = Just name+getValueRef (PositionedDeclarationRef _ _ r) = getValueRef r+getValueRef _ = Nothing++getValueOpRef :: DeclarationRef -> Maybe (OpName 'ValueOpName)+getValueOpRef (ValueOpRef op) = Just op+getValueOpRef (PositionedDeclarationRef _ _ r) = getValueOpRef r+getValueOpRef _ = Nothing++getTypeClassRef :: DeclarationRef -> Maybe (ProperName 'ClassName)+getTypeClassRef (TypeClassRef name) = Just name+getTypeClassRef (PositionedDeclarationRef _ _ r) = getTypeClassRef r+getTypeClassRef _ = Nothing+ isModuleRef :: DeclarationRef -> Bool isModuleRef (PositionedDeclarationRef _ _ r) = isModuleRef r isModuleRef (ModuleRef _) = True isModuleRef _ = False  -- |--- Finds duplicate values in a list of declaration refs. The returned values--- are the duplicate refs with data constructors elided, and then a separate--- list of duplicate data constructors.----findDuplicateRefs :: [DeclarationRef] -> ([DeclarationRef], [ProperName 'ConstructorName])-findDuplicateRefs refs =-  let positionless = stripPosInfo `map` refs-      simplified = simplifyTypeRefs `map` positionless-      dupeRefs = nub $ simplified \\ nub simplified-      dupeCtors = concat $ flip mapMaybe positionless $ \case-        TypeRef _ (Just dctors) ->-          let dupes = dctors \\ nub dctors-          in if null dupes then Nothing else Just dupes-        _ -> Nothing-  in (dupeRefs, dupeCtors)-  where-  stripPosInfo (PositionedDeclarationRef _ _ ref) = stripPosInfo ref-  stripPosInfo other = other-  simplifyTypeRefs (TypeRef pn _) = TypeRef pn Nothing-  simplifyTypeRefs other = other---- | -- The data type which specifies type of import declaration -- data ImportDeclarationType@@ -193,14 +190,13 @@   --   | ExternDataDeclaration (ProperName 'TypeName) Kind   -- |-  -- A fixity declaration (fixity data, operator name, value the operator is an alias for)+  -- A fixity declaration   ---  | FixityDeclaration Fixity String (Maybe (Qualified FixityAlias))+  | FixityDeclaration (Either ValueFixity TypeFixity)   -- |   -- A module import (module name, qualified/unqualified/hiding, optional "qualified as" name)-  -- TODO: also a boolean specifying whether the old `qualified` syntax was used, so a warning can be raised in desugaring (remove for 0.9)   ---  | ImportDeclaration ModuleName ImportDeclarationType (Maybe ModuleName) Bool+  | ImportDeclaration ModuleName ImportDeclarationType (Maybe ModuleName)   -- |   -- A type class declaration (name, argument, implies, member declarations)   --@@ -216,30 +212,14 @@   | PositionedDeclaration SourceSpan [Comment] Declaration   deriving (Show, Read) -data FixityAlias-  = AliasValue Ident-  | AliasConstructor (ProperName 'ConstructorName)-  | AliasType (ProperName 'TypeName)+data ValueFixity = ValueFixity Fixity (Qualified (Either Ident (ProperName 'ConstructorName))) (OpName 'ValueOpName)   deriving (Eq, Ord, Show, Read) -foldFixityAlias-  :: (Ident -> a)-  -> (ProperName 'ConstructorName -> a)-  -> (ProperName 'TypeName -> a)-  -> FixityAlias-  -> a-foldFixityAlias f _ _ (AliasValue name) = f name-foldFixityAlias _ g _ (AliasConstructor name) = g name-foldFixityAlias _ _ h (AliasType name) = h name--getValueAlias :: FixityAlias -> Maybe (Either Ident (ProperName 'ConstructorName))-getValueAlias (AliasValue name) = Just $ Left name-getValueAlias (AliasConstructor name) = Just $ Right name-getValueAlias _ = Nothing+data TypeFixity = TypeFixity Fixity (Qualified (ProperName 'TypeName)) (OpName 'TypeOpName)+  deriving (Eq, Ord, Show, Read) -getTypeAlias :: FixityAlias -> Maybe (ProperName 'TypeName)-getTypeAlias (AliasType name) = Just name-getTypeAlias _ = Nothing+pattern ValueFixityDeclaration fixity name op = FixityDeclaration (Left (ValueFixity fixity name op))+pattern TypeFixityDeclaration fixity name op = FixityDeclaration (Right (TypeFixity fixity name op))  -- | The members of a type class instance declaration data TypeInstanceBody@@ -298,6 +278,11 @@ isFixityDecl (PositionedDeclaration _ _ d) = isFixityDecl d isFixityDecl _ = False +getFixityDecl :: Declaration -> Maybe (Either ValueFixity TypeFixity)+getFixityDecl (FixityDeclaration fixity) = Just fixity+getFixityDecl (PositionedDeclaration _ _ d) = getFixityDecl d+getFixityDecl _ = Nothing+ -- | -- Test if a declaration is a foreign import --@@ -361,12 +346,8 @@   --   | Parens Expr   -- |-  -- Operator section. This will be removed during desugaring and replaced with lambda.-  ---  | OperatorSection Expr (Either Expr Expr)-  -- |-  -- An object property getter (e.g. `_.x`). This will be removed during-  -- desugaring and expanded into a lambda that reads a property from an object.+  -- A record property getter (e.g. `_.x`). This will be removed during+  -- desugaring and expanded into a lambda that reads a property from a record.   --   | ObjectGetter String   -- |@@ -390,6 +371,11 @@   --   | Var (Qualified Ident)   -- |+  -- An operator. This will be desugared into a function during the "operators"+  -- phase of desugaring.+  --+  | Op (Qualified (OpName 'ValueOpName))+  -- |   -- Conditional (if-then-else expression)   --   | IfThenElse Expr Expr Expr@@ -487,4 +473,3 @@  $(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''DeclarationRef) $(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''ImportDeclarationType)-$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''FixityAlias)
src/Language/PureScript/AST/Exported.hs view
@@ -3,7 +3,10 @@   , isExported   ) where +import Prelude.Compat+ import Control.Category ((>>>))+ import Data.Maybe (mapMaybe)  import Language.PureScript.AST.Declarations@@ -99,7 +102,7 @@   Left className : (concatMap fromConstraint constraints ++ concatMap fromType tys)   where -  fromConstraint (name, tys') = Left name : concatMap fromType tys'+  fromConstraint c = Left (constraintClass c) : concatMap fromType (constraintArgs c)   fromType = everythingOnTypes (++) go    -- Note that type synonyms are disallowed in instance declarations, so@@ -124,21 +127,15 @@ isExported exps (PositionedDeclaration _ _ d) = isExported exps d isExported (Just exps) decl = any (matches decl) exps   where-  matches (TypeDeclaration ident _)          (ValueRef ident')     = ident == ident'-  matches (ValueDeclaration ident _ _ _)     (ValueRef ident')     = ident == ident'-  matches (ExternDeclaration ident _)        (ValueRef ident')     = ident == ident'-  matches (DataDeclaration _ ident _ _)      (TypeRef ident' _)    = ident == ident'-  matches (ExternDataDeclaration ident _)    (TypeRef ident' _)    = ident == ident'-  matches (TypeSynonymDeclaration ident _ _) (TypeRef ident' _)    = ident == ident'+  matches (TypeDeclaration ident _) (ValueRef ident') = ident == ident'+  matches (ValueDeclaration ident _ _ _) (ValueRef ident') = ident == ident'+  matches (ExternDeclaration ident _) (ValueRef ident') = ident == ident'+  matches (DataDeclaration _ ident _ _) (TypeRef ident' _) = ident == ident'+  matches (ExternDataDeclaration ident _) (TypeRef ident' _) = ident == ident'+  matches (TypeSynonymDeclaration ident _ _) (TypeRef ident' _) = ident == ident'   matches (TypeClassDeclaration ident _ _ _) (TypeClassRef ident') = ident == ident'--  matches (DataDeclaration _ ident _ _)      (ProperRef ident')    = runProperName ident == ident'-  matches (TypeClassDeclaration ident _ _ _) (ProperRef ident')    = runProperName ident == ident'--  matches (FixityDeclaration _ name (Just (Qualified _ (AliasValue _)))) (ValueRef ident') = name == runIdent ident'-  matches (FixityDeclaration _ name (Just (Qualified _ (AliasConstructor _)))) (ValueRef ident') = name == runIdent ident'-  matches (FixityDeclaration _ name (Just (Qualified _ (AliasType _)))) (TypeOpRef ident') = name == runIdent ident'-+  matches (ValueFixityDeclaration _ _ op) (ValueOpRef op') = op == op'+  matches (TypeFixityDeclaration _ _ op) (TypeOpRef op') = op == op'   matches (PositionedDeclaration _ _ d) r = d `matches` r   matches d (PositionedDeclarationRef _ _ r) = d `matches` r   matches _ _ = False
src/Language/PureScript/AST/Literals.hs view
@@ -1,9 +1,9 @@-{-# LANGUAGE DeriveFunctor #-}- -- | -- The core functional representation for literal values. -- module Language.PureScript.AST.Literals where++import Prelude.Compat  -- | -- Data type for literal values. Parameterised so it can be used for Exprs and
src/Language/PureScript/AST/Operators.hs view
@@ -5,6 +5,8 @@ -- module Language.PureScript.AST.Operators where +import Prelude.Compat+ import Data.Aeson ((.=)) import qualified Data.Aeson as A 
src/Language/PureScript/AST/SourcePos.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-}  -- |@@ -7,7 +5,6 @@ -- module Language.PureScript.AST.SourcePos where -import Prelude () import Prelude.Compat  import Data.Aeson ((.=), (.:))
src/Language/PureScript/AST/Traversals.hs view
@@ -1,21 +1,18 @@-{-# LANGUAGE ScopedTypeVariables #-}- -- | -- AST traversal helpers -- module Language.PureScript.AST.Traversals where -import Prelude () import Prelude.Compat -import Data.Maybe (mapMaybe)-import Data.List (mapAccumL)-import Data.Foldable (fold)-import qualified Data.Set as S- import Control.Monad import Control.Arrow ((***), (+++)) +import Data.Foldable (fold)+import Data.List (mapAccumL)+import Data.Maybe (mapMaybe)+import qualified Data.Set as S+ import Language.PureScript.AST.Binders import Language.PureScript.AST.Literals import Language.PureScript.AST.Declarations@@ -47,8 +44,6 @@   g' (UnaryMinus v) = g (UnaryMinus (g' v))   g' (BinaryNoParens op v1 v2) = g (BinaryNoParens (g' op) (g' v1) (g' v2))   g' (Parens v) = g (Parens (g' v))-  g' (OperatorSection op (Left v)) = g (OperatorSection (g' op) (Left $ g' v))-  g' (OperatorSection op (Right v)) = g (OperatorSection (g' op) (Right $ g' v))   g' (TypeClassDictionaryConstructorApp name v) = g (TypeClassDictionaryConstructorApp name (g' v))   g' (Accessor prop v) = g (Accessor prop (g' v))   g' (ObjectUpdate obj vs) = g (ObjectUpdate (g' obj) (map (fmap g') vs))@@ -116,8 +111,6 @@   g' (UnaryMinus v) = UnaryMinus <$> (g v >>= g')   g' (BinaryNoParens op v1 v2) = BinaryNoParens <$> (g op >>= g') <*> (g v1 >>= g') <*> (g v2 >>= g')   g' (Parens v) = Parens <$> (g v >>= g')-  g' (OperatorSection op (Left v)) = OperatorSection <$> (g op >>= g') <*> (Left <$> (g v >>= g'))-  g' (OperatorSection op (Right v)) = OperatorSection <$> (g op >>= g') <*> (Right <$> (g v >>= g'))   g' (TypeClassDictionaryConstructorApp name v) = TypeClassDictionaryConstructorApp name <$> (g v >>= g')   g' (Accessor prop v) = Accessor prop <$> (g v >>= g')   g' (ObjectUpdate obj vs) = ObjectUpdate <$> (g obj >>= g') <*> traverse (sndM (g' <=< g)) vs@@ -185,8 +178,6 @@   g' (UnaryMinus v) = (UnaryMinus <$> g' v) >>= g   g' (BinaryNoParens op v1 v2) = (BinaryNoParens <$> g' op <*> g' v1 <*> g' v2) >>= g   g' (Parens v) = (Parens <$> g' v) >>= g-  g' (OperatorSection op (Left v)) = (OperatorSection <$> g' op <*> (Left <$> g' v)) >>= g-  g' (OperatorSection op (Right v)) = (OperatorSection <$> g' op <*> (Right <$> g' v)) >>= g   g' (TypeClassDictionaryConstructorApp name v) = (TypeClassDictionaryConstructorApp name <$> g' v) >>= g   g' (Accessor prop v) = (Accessor prop <$> g' v) >>= g   g' (ObjectUpdate obj vs) = (ObjectUpdate <$> g' obj <*> traverse (sndM g') vs) >>= g@@ -259,8 +250,6 @@   g' v@(UnaryMinus v1) = g v <> g' v1   g' v@(BinaryNoParens op v1 v2) = g v <> g' op <> g' v1 <> g' v2   g' v@(Parens v1) = g v <> g' v1-  g' v@(OperatorSection op (Left v1)) = g v <> g' op <> g' v1-  g' v@(OperatorSection op (Right v1)) = g v <> g' op <> g' v1   g' v@(TypeClassDictionaryConstructorApp _ v1) = g v <> g' v1   g' v@(Accessor _ v1) = g v <> g' v1   g' v@(ObjectUpdate obj vs) = foldl (<>) (g v <> g' obj) (map (g' . snd) vs)@@ -338,8 +327,6 @@   g' s (UnaryMinus v1) = g'' s v1   g' s (BinaryNoParens op v1 v2) = g'' s op <> g'' s v1 <> g'' s v2   g' s (Parens v1) = g'' s v1-  g' s (OperatorSection op (Left v)) = g'' s op <> g'' s v-  g' s (OperatorSection op (Right v)) = g'' s op <> g'' s v   g' s (TypeClassDictionaryConstructorApp _ v1) = g'' s v1   g' s (Accessor _ v1) = g'' s v1   g' s (ObjectUpdate obj vs) = foldl (<>) (g'' s obj) (map (g'' s . snd) vs)@@ -419,8 +406,6 @@   g' s (UnaryMinus v) = UnaryMinus <$> g'' s v   g' s (BinaryNoParens op v1 v2) = BinaryNoParens <$> g'' s op <*> g'' s v1 <*> g'' s v2   g' s (Parens v) = Parens <$> g'' s v-  g' s (OperatorSection op (Left v)) = OperatorSection <$> g'' s op <*> (Left <$> g'' s v)-  g' s (OperatorSection op (Right v)) = OperatorSection <$> g'' s op <*> (Right <$> g'' s v)   g' s (TypeClassDictionaryConstructorApp name v) = TypeClassDictionaryConstructorApp name <$> g'' s v   g' s (Accessor prop v) = Accessor prop <$> g'' s v   g' s (ObjectUpdate obj vs) = ObjectUpdate <$> g'' s obj <*> traverse (sndM (g'' s)) vs@@ -510,8 +495,6 @@   g' s (UnaryMinus v1) = g'' s v1   g' s (BinaryNoParens op v1 v2) = g'' s op <> g'' s v1 <> g'' s v2   g' s (Parens v1) = g'' s v1-  g' s (OperatorSection op (Left v)) = g'' s op <> g'' s v-  g' s (OperatorSection op (Right v)) = g'' s op <> g'' s v   g' s (TypeClassDictionaryConstructorApp _ v1) = g'' s v1   g' s (Accessor _ v1) = g'' s v1   g' s (ObjectUpdate obj vs) = g'' s obj <> foldMap (g'' s . snd) vs@@ -593,13 +576,13 @@   where   forDecls (DataDeclaration _ _ _ dctors) = mconcat (concatMap (map f . snd) dctors)   forDecls (ExternDeclaration _ ty) = f ty-  forDecls (TypeClassDeclaration _ _ implies _) = mconcat (concatMap (map f . snd) implies)-  forDecls (TypeInstanceDeclaration _ cs _ tys _) = mconcat (concatMap (map f . snd) cs) `mappend` mconcat (map f tys)+  forDecls (TypeClassDeclaration _ _ implies _) = mconcat (concatMap (map f . constraintArgs) implies)+  forDecls (TypeInstanceDeclaration _ cs _ tys _) = mconcat (concatMap (map f . constraintArgs) cs) `mappend` mconcat (map f tys)   forDecls (TypeSynonymDeclaration _ _ ty) = f ty   forDecls (TypeDeclaration _ ty) = f ty   forDecls _ = mempty -  forValues (TypeClassDictionary (_, cs) _) = mconcat (map f cs)+  forValues (TypeClassDictionary c _) = mconcat (map f (constraintArgs c))   forValues (SuperClassDictionary _ tys) = mconcat (map f tys)   forValues (TypedValue _ _ ty) = f ty   forValues _ = mempty
src/Language/PureScript/Bundle.hs view
@@ -1,48 +1,32 @@------------------------------------------------------------------------------------ Module      :  psc-bundle--- Copyright   :  (c) Phil Freeman 2015--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :------ | Bundles compiled PureScript modules for the browser.+-- |+-- Bundles compiled PureScript modules for the browser. -- -- This module takes as input the individual generated modules from 'Language.PureScript.Make' and -- performs dead code elimination, filters empty modules, -- and generates the final Javascript bundle.--------------------------------------------------------------------------------{-# LANGUAGE PatternGuards #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TupleSections #-}--module Language.PureScript.Bundle (-     bundle-   , ModuleIdentifier(..)-   , moduleName-   , ModuleType(..)-   , ErrorMessage(..)-   , printErrorMessage-   , getExportedIdentifiers-) where+module Language.PureScript.Bundle+  ( bundle+  , ModuleIdentifier(..)+  , moduleName+  , ModuleType(..)+  , ErrorMessage(..)+  , printErrorMessage+  , getExportedIdentifiers+  ) where -import Prelude () import Prelude.Compat -import Data.List (nub, stripPrefix)-import Data.Maybe (mapMaybe, catMaybes, fromMaybe)+import Control.Monad+import Control.Monad.Error.Class++import Data.Char (chr, digitToInt) import Data.Generics (everything, everywhere, mkQ, mkT) import Data.Graph+import Data.List (nub, stripPrefix)+import Data.Maybe (mapMaybe, catMaybes) import Data.Version (showVersion)- import qualified Data.Set as S -import Control.Monad-import Control.Monad.Error.Class import Language.JavaScript.Parser import Language.JavaScript.Parser.AST @@ -134,13 +118,13 @@     name ++ " (" ++ showModuleType ty ++ ")"  -- | Calculate the ModuleIdentifier which a require(...) statement imports.-checkImportPath :: Maybe FilePath -> String -> ModuleIdentifier -> S.Set String -> Either String ModuleIdentifier-checkImportPath _ "./foreign" m _ =+checkImportPath :: String -> ModuleIdentifier -> S.Set String -> Either String ModuleIdentifier+checkImportPath "./foreign" m _ =   Right (ModuleIdentifier (moduleName m) Foreign)-checkImportPath requirePath name _ names-  | Just name' <- stripPrefix (fromMaybe "../" requirePath) name+checkImportPath name _ names+  | Just name' <- stripPrefix "../" name   , name' `S.member` names = Right (ModuleIdentifier name' Regular)-checkImportPath _ name _ _ = Left name+checkImportPath name _ _ = Left name  -- | Compute the dependencies of all elements in a module, and add them to the tree. --@@ -203,11 +187,34 @@  -- String literals include the quote chars fromStringLiteral :: JSExpression -> Maybe String-fromStringLiteral (JSStringLiteral _ str) = Just $ trimStringQuotes str+fromStringLiteral (JSStringLiteral _ str) = Just $ strValue str fromStringLiteral _ = Nothing -trimStringQuotes :: String -> String-trimStringQuotes str = reverse $ drop 1 $ reverse $ drop 1 $ str+strValue :: String -> String+strValue str = go $ drop 1 str+  where+  go ('\\' : 'b' : xs) = '\b' : go xs+  go ('\\' : 'f' : xs) = '\f' : go xs+  go ('\\' : 'n' : xs) = '\n' : go xs+  go ('\\' : 'r' : xs) = '\r' : go xs+  go ('\\' : 't' : xs) = '\t' : go xs+  go ('\\' : 'v' : xs) = '\v' : go xs+  go ('\\' : '0' : xs) = '\0' : go xs+  go ('\\' : 'x' : a : b : xs) = chr (a' + b') : go xs+    where+    a' = 16 * digitToInt a+    b' = digitToInt b+  go ('\\' : 'u' : a : b : c : d : xs) = chr (a' + b' + c' + d') : go xs+    where+    a' = 16 * 16 * 16 * digitToInt a+    b' = 16 * 16 * digitToInt b+    c' = 16 * digitToInt c+    d' = digitToInt d+  go ('\\' : x : xs) = x : go xs+  go "\"" = ""+  go "'" = ""+  go (x : xs) = x : go xs+  go "" = ""  commaList :: JSCommaList a -> [a] commaList JSLNil = []@@ -222,8 +229,8 @@ -- -- Each type of module element is matched using pattern guards, and everything else is bundled into the -- Other constructor.-toModule :: forall m. (MonadError ErrorMessage m) => Maybe FilePath -> S.Set String -> ModuleIdentifier -> JSAST -> m Module-toModule requirePath mids mid top+toModule :: forall m. (MonadError ErrorMessage m) => S.Set String -> ModuleIdentifier -> JSAST -> m Module+toModule mids mid top   | JSAstProgram smts _ <- top = Module mid <$> traverse toModuleElement smts   | otherwise = err InvalidTopLevel   where@@ -231,7 +238,7 @@    toModuleElement :: JSStatement -> m ModuleElement   toModuleElement stmt-    | Just (importName, importPath) <- matchRequire requirePath mids mid stmt+    | Just (importName, importPath) <- matchRequire mids mid stmt     = pure (Require stmt importName importPath)   toModuleElement stmt     | Just (exported, name, decl) <- matchMember stmt@@ -291,12 +298,11 @@  -- Matches JS statements like this: -- var ModuleName = require("file");-matchRequire :: Maybe FilePath-                -> S.Set String+matchRequire :: S.Set String                 -> ModuleIdentifier                 -> JSStatement                 -> Maybe (String, Either String ModuleIdentifier)-matchRequire requirePath mids mid stmt+matchRequire mids mid stmt   | JSVariable _ jsInit _ <- stmt   , [JSVarInitExpression var varInit] <- commaList jsInit   , JSIdentifier _ importName <- var@@ -304,7 +310,7 @@   , JSMemberExpression req _ argsE _ <- jsInitEx   , JSIdentifier _ "require" <- req   , [ Just importPath ] <- map fromStringLiteral (commaList argsE)-  , importPath' <- checkImportPath requirePath importPath mid mids+  , importPath' <- checkImportPath importPath mid mids   = Just (importName, importPath')   | otherwise   = Nothing@@ -350,7 +356,7 @@   = Nothing  extractLabel :: JSPropertyName -> Maybe String-extractLabel (JSPropertyString _ nm) = Just (trimStringQuotes nm)+extractLabel (JSPropertyString _ nm) = Just $ strValue nm extractLabel (JSPropertyIdent _ nm) = Just nm extractLabel _ = Nothing @@ -590,16 +596,15 @@        -> [ModuleIdentifier] -- ^ Entry points.  These module identifiers are used as the roots for dead-code elimination        -> Maybe String -- ^ An optional main module.        -> String -- ^ The namespace (e.g. PS).-       -> Maybe FilePath -- ^ The require path prefix        -> m String-bundle inputStrs entryPoints mainModule namespace requirePath = do+bundle inputStrs entryPoints mainModule namespace = do   input <- forM inputStrs $ \(ident, js) -> do                 ast <- either (throwError . ErrorInModule ident . UnableToParseModule) pure $ parse js (moduleName ident)                 return (ident, ast)    let mids = S.fromList (map (moduleName . fst) input) -  modules <- traverse (fmap withDeps . uncurry (toModule requirePath mids)) input+  modules <- traverse (fmap withDeps . uncurry (toModule mids)) input    let compiled = compile modules entryPoints       sorted   = sortModules (filter (not . isModuleEmpty) compiled)
src/Language/PureScript/CodeGen.hs view
@@ -1,20 +1,8 @@------------------------------------------------------------------------------------ Module      :  Language.PureScript.CodeGen--- Copyright   :  (c) Phil Freeman 2013--- License     :  MIT------ Maintainer  :  Phil Freeman <paf31@cantab.net>--- Stability   :  experimental--- Portability :------ |--- A collection of modules related to code generation:------  [@Language.PureScript.CodeGen.JS@] Code generator for Javascript-----------------------------------------------------------------------------------module Language.PureScript.CodeGen (module C) where--import Language.PureScript.CodeGen.JS as C+-- |
+-- A collection of modules related to code generation:
+--
+--  [@Language.PureScript.CodeGen.JS@] Code generator for Javascript
+--
+module Language.PureScript.CodeGen (module C) where
+
+import Language.PureScript.CodeGen.JS as C
src/Language/PureScript/CodeGen/JS.hs view
@@ -1,8 +1,3 @@-{-# LANGUAGE GADTs #-}-{-# LANGUAGE ViewPatterns #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE ScopedTypeVariables #-}- -- | -- This module generates code in the simplified Javascript intermediate representation from Purescript code --@@ -12,29 +7,28 @@   , moduleToJs   ) where -import Prelude () import Prelude.Compat -import Data.List ((\\), delete, intersect)-import Data.Maybe (isNothing, fromMaybe)-import qualified Data.Map as M-import qualified Data.Foldable as F-import qualified Data.Traversable as T- import Control.Arrow ((&&&)) import Control.Monad (replicateM, forM, void) import Control.Monad.Error.Class (MonadError(..)) import Control.Monad.Reader (MonadReader, asks) import Control.Monad.Supply.Class -import Language.PureScript.Crash+import Data.List ((\\), delete, intersect)+import Data.Maybe (isNothing, fromMaybe)+import qualified Data.Foldable as F+import qualified Data.Map as M+import qualified Data.Traversable as T+ import Language.PureScript.AST.SourcePos import Language.PureScript.CodeGen.JS.AST as AST import Language.PureScript.CodeGen.JS.Common as Common+import Language.PureScript.CodeGen.JS.Optimizer import Language.PureScript.CoreFn-import Language.PureScript.Names+import Language.PureScript.Crash import Language.PureScript.Errors-import Language.PureScript.CodeGen.JS.Optimizer+import Language.PureScript.Names import Language.PureScript.Options import Language.PureScript.Traversals (sndM) import qualified Language.PureScript.Constants as C@@ -109,9 +103,8 @@   --   importToJs :: M.Map ModuleName (Ann, ModuleName) -> ModuleName -> m JS   importToJs mnLookup mn' = do-    path <- asks optionsRequirePath     let ((ss, _, _, _), mnSafe) = fromMaybe (internalError "Missing value in mnLookup") $ M.lookup mn' mnLookup-    let moduleBody = JSApp Nothing (JSVar Nothing "require") [JSStringLiteral Nothing (fromMaybe ".." path </> runModuleName mn')]+    let moduleBody = JSApp Nothing (JSVar Nothing "require") [JSStringLiteral Nothing (".." </> runModuleName mn')]     withPos ss $ JSVariableIntroduction Nothing (moduleNameToJs mnSafe) (Just moduleBody)    -- |@@ -180,7 +173,6 @@   --   accessor :: Ident -> JS -> JS   accessor (Ident prop) = accessorString prop-  accessor (Op op) = JSIndexer Nothing (JSStringLiteral Nothing op)   accessor (GenIdent _ _) = internalError "GenIdent in accessor"    accessorString :: String -> JS -> JS
src/Language/PureScript/CodeGen/JS/AST.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Common.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer/Blocks.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer/Common.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer/MagicDo.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer/TCO.hs view

file too large to diff

src/Language/PureScript/CodeGen/JS/Optimizer/Unused.hs view

file too large to diff

src/Language/PureScript/Comments.hs view

file too large to diff

src/Language/PureScript/Constants.hs view

file too large to diff

src/Language/PureScript/CoreFn.hs view

file too large to diff

src/Language/PureScript/CoreFn/Ann.hs view

file too large to diff

src/Language/PureScript/CoreFn/Binders.hs view

file too large to diff

src/Language/PureScript/CoreFn/Desugar.hs view

file too large to diff

src/Language/PureScript/CoreFn/Expr.hs view

file too large to diff

src/Language/PureScript/CoreFn/Meta.hs view

file too large to diff

src/Language/PureScript/CoreFn/Module.hs view

file too large to diff

src/Language/PureScript/CoreFn/Traversals.hs view

file too large to diff

src/Language/PureScript/Crash.hs view

file too large to diff

src/Language/PureScript/Docs.hs view

file too large to diff

src/Language/PureScript/Docs/AsMarkdown.hs view

file too large to diff

src/Language/PureScript/Docs/Convert.hs view

file too large to diff

src/Language/PureScript/Docs/Convert/ReExports.hs view

file too large to diff

src/Language/PureScript/Docs/Convert/Single.hs view

file too large to diff

src/Language/PureScript/Docs/ParseAndBookmark.hs view

file too large to diff

src/Language/PureScript/Docs/Render.hs view

file too large to diff

src/Language/PureScript/Docs/RenderedCode.hs view

file too large to diff

src/Language/PureScript/Docs/RenderedCode/Render.hs view

file too large to diff

src/Language/PureScript/Docs/RenderedCode/Types.hs view

file too large to diff

src/Language/PureScript/Docs/Types.hs view

file too large to diff

src/Language/PureScript/Environment.hs view

file too large to diff

src/Language/PureScript/Errors.hs view

file too large to diff

src/Language/PureScript/Errors/JSON.hs view

file too large to diff

src/Language/PureScript/Externs.hs view

file too large to diff

src/Language/PureScript/Ide.hs view

file too large to diff

src/Language/PureScript/Ide/CaseSplit.hs view

file too large to diff

src/Language/PureScript/Ide/Command.hs view

file too large to diff

src/Language/PureScript/Ide/Error.hs view

file too large to diff

src/Language/PureScript/Ide/Externs.hs view

file too large to diff

src/Language/PureScript/Ide/Filter.hs view

file too large to diff

src/Language/PureScript/Ide/Imports.hs view

file too large to diff

src/Language/PureScript/Ide/Matcher.hs view

file too large to diff

src/Language/PureScript/Ide/Pursuit.hs view

file too large to diff

src/Language/PureScript/Ide/Rebuild.hs view

file too large to diff

src/Language/PureScript/Ide/Reexports.hs view

file too large to diff

src/Language/PureScript/Ide/SourceFile.hs view

file too large to diff

src/Language/PureScript/Ide/State.hs view

file too large to diff

src/Language/PureScript/Ide/Types.hs view

file too large to diff

src/Language/PureScript/Ide/Util.hs view

file too large to diff

src/Language/PureScript/Ide/Watcher.hs view

file too large to diff

+ src/Language/PureScript/Interactive.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Completion.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Directive.hs view

file too large to diff

+ src/Language/PureScript/Interactive/IO.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Message.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Module.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Parser.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Printer.hs view

file too large to diff

+ src/Language/PureScript/Interactive/Types.hs view

file too large to diff

src/Language/PureScript/Kinds.hs view

file too large to diff

src/Language/PureScript/Linter.hs view

file too large to diff

src/Language/PureScript/Linter/Exhaustive.hs view

file too large to diff

src/Language/PureScript/Linter/Imports.hs view

file too large to diff

src/Language/PureScript/Make.hs view

file too large to diff

src/Language/PureScript/ModuleDependencies.hs view

file too large to diff

src/Language/PureScript/Names.hs view

file too large to diff

src/Language/PureScript/Options.hs view

file too large to diff

src/Language/PureScript/Parser.hs view

file too large to diff

src/Language/PureScript/Parser/Common.hs view

file too large to diff

src/Language/PureScript/Parser/Declarations.hs view

file too large to diff

− src/Language/PureScript/Parser/JS.hs

file too large to diff

src/Language/PureScript/Parser/Kinds.hs view

file too large to diff

src/Language/PureScript/Parser/Lexer.hs view

file too large to diff

src/Language/PureScript/Parser/State.hs view

file too large to diff

src/Language/PureScript/Parser/Types.hs view

file too large to diff

src/Language/PureScript/Pretty.hs view

file too large to diff

src/Language/PureScript/Pretty/Common.hs view

file too large to diff

src/Language/PureScript/Pretty/JS.hs view

file too large to diff

src/Language/PureScript/Pretty/Kinds.hs view

file too large to diff

src/Language/PureScript/Pretty/Types.hs view

file too large to diff

src/Language/PureScript/Pretty/Values.hs view

file too large to diff

src/Language/PureScript/Publish.hs view

file too large to diff

src/Language/PureScript/Publish/BoxesHelpers.hs view

file too large to diff

src/Language/PureScript/Publish/ErrorsWarnings.hs view

file too large to diff

src/Language/PureScript/Publish/Utils.hs view

file too large to diff

src/Language/PureScript/Renamer.hs view

file too large to diff

src/Language/PureScript/Sugar.hs view

file too large to diff

src/Language/PureScript/Sugar/BindingGroups.hs view

file too large to diff

src/Language/PureScript/Sugar/CaseDeclarations.hs view

file too large to diff

src/Language/PureScript/Sugar/DoNotation.hs view

file too large to diff

src/Language/PureScript/Sugar/Names.hs view

file too large to diff

+ src/Language/PureScript/Sugar/Names/Common.hs view

file too large to diff

src/Language/PureScript/Sugar/Names/Env.hs view

file too large to diff

src/Language/PureScript/Sugar/Names/Exports.hs view

file too large to diff

src/Language/PureScript/Sugar/Names/Imports.hs view

file too large to diff

src/Language/PureScript/Sugar/ObjectWildcards.hs view

file too large to diff

src/Language/PureScript/Sugar/Operators.hs view

file too large to diff

src/Language/PureScript/Sugar/Operators/Binders.hs view

file too large to diff

src/Language/PureScript/Sugar/Operators/Common.hs view

file too large to diff

src/Language/PureScript/Sugar/Operators/Expr.hs view

file too large to diff

src/Language/PureScript/Sugar/Operators/Types.hs view

file too large to diff

src/Language/PureScript/Sugar/TypeClasses.hs view

file too large to diff

src/Language/PureScript/Sugar/TypeClasses/Deriving.hs view

file too large to diff

src/Language/PureScript/Sugar/TypeDeclarations.hs view

file too large to diff

src/Language/PureScript/Traversals.hs view

file too large to diff

src/Language/PureScript/TypeChecker.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Entailment.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Kinds.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Monad.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Rows.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Skolems.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Subsumption.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Synonyms.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Types.hs view

file too large to diff

src/Language/PureScript/TypeChecker/Unify.hs view

file too large to diff

src/Language/PureScript/TypeClassDictionaries.hs view

file too large to diff

src/Language/PureScript/Types.hs view

file too large to diff

src/System/IO/UTF8.hs view

file too large to diff

− stack-lts-5.yaml

file too large to diff

− stack-nightly.yaml

file too large to diff

stack.yaml view

file too large to diff

tests/Language/PureScript/Ide/FilterSpec.hs view

file too large to diff

tests/Language/PureScript/Ide/Imports/IntegrationSpec.hs view

file too large to diff

tests/Language/PureScript/Ide/ImportsSpec.hs view

file too large to diff

tests/Language/PureScript/Ide/Integration.hs view

file too large to diff

tests/Language/PureScript/Ide/MatcherSpec.hs view

file too large to diff

tests/Language/PureScript/Ide/RebuildSpec.hs view

file too large to diff

tests/Language/PureScript/Ide/ReexportsSpec.hs view

file too large to diff

tests/Language/PureScript/IdeSpec.hs view

file too large to diff

tests/Main.hs view

file too large to diff

tests/TestCompiler.hs view

file too large to diff

tests/TestDocs.hs view

file too large to diff

tests/TestPscIde.hs view

file too large to diff

tests/TestPscPublish.hs view

file too large to diff

tests/TestPsci.hs view

file too large to diff

tests/TestUtils.hs view

file too large to diff

tests/support/bower.json view

file too large to diff

− tests/support/flattened/Control-Monad-Eff-Class.purs

file too large to diff

− tests/support/flattened/Control-Monad-Eff-Console.js

file too large to diff

− tests/support/flattened/Control-Monad-Eff-Console.purs

file too large to diff

− tests/support/flattened/Control-Monad-Eff-Unsafe.js

file too large to diff

− tests/support/flattened/Control-Monad-Eff-Unsafe.purs

file too large to diff

− tests/support/flattened/Control-Monad-Eff.js

file too large to diff

− tests/support/flattened/Control-Monad-Eff.purs

file too large to diff

− tests/support/flattened/Control-Monad-ST.js

file too large to diff

− tests/support/flattened/Control-Monad-ST.purs

file too large to diff

− tests/support/flattened/Data-Function.js

file too large to diff

− tests/support/flattened/Data-Function.purs

file too large to diff

− tests/support/flattened/Prelude.js

file too large to diff

− tests/support/flattened/Prelude.purs

file too large to diff

− tests/support/flattened/Test-Assert.js

file too large to diff

− tests/support/flattened/Test-Assert.purs

file too large to diff

tests/support/package.json view

file too large to diff

− tests/support/prelude/LICENSE

file too large to diff

− tests/support/prelude/bower.json

file too large to diff

− tests/support/prelude/src/Prelude.js

file too large to diff

− tests/support/prelude/src/Prelude.purs

file too large to diff

+ tests/support/pscide/src/RebuildSpecWithHiddenIdent.purs view

file too large to diff

− tests/support/setup.js

file too large to diff