Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
6c481c8
Add ES imports/exports to CoreImp AST
kl0tl Feb 6, 2020
52a692b
Print ES imports/exports
kl0tl Feb 6, 2020
cd40596
Codegen ES imports for PureScript modules
kl0tl Feb 6, 2020
607dd3d
Codegen ES imports for foreign modules
kl0tl Feb 6, 2020
19878e3
Codegen ES exports
kl0tl Feb 6, 2020
4889861
Extract both CJS and ES exports from foreign modules
kl0tl Feb 8, 2020
c03399f
Remove the redundant "use strict;" pragma from modules header
kl0tl Feb 8, 2020
71c2de3
Don’t emit empty statements for empty exports lists
kl0tl Feb 8, 2020
7d4ef3d
Bundle ES modules
kl0tl Feb 9, 2020
7f0c07e
Load ES modules with `esm` in the Node.js REPL and tests
kl0tl Feb 15, 2020
e006953
Escape primes in modules accessors
kl0tl Feb 15, 2020
243ec5e
Forbid unescaped primes in foreign modules exports
kl0tl Feb 15, 2020
ddbb2ad
Run tests against patched dependencies
kl0tl Feb 15, 2020
e5b1798
Rewrite ES modules in the browser REPL client
kl0tl Apr 23, 2020
47cdee9
Merge branch 'master' into es-modules
kl0tl Mar 20, 2021
c5ffab6
Revert "Load ES modules with `esm` in the Node.js REPL and tests"
kl0tl Mar 20, 2021
4713b2a
Allow Node.js to load .js files in the output directory as ES modules
kl0tl Mar 20, 2021
7784dd1
Import CommonJS foreign modules through an ES module wrapper
kl0tl Mar 20, 2021
1587749
Don't let tests nor the REPL compile into a node_modules directory
kl0tl Mar 20, 2021
ba9f084
Bundle re-exports
kl0tl Mar 20, 2021
65dab5d
Load bundles as CommonJS modules in tests
kl0tl Mar 20, 2021
830bbe2
Update Node.js version on CI
kl0tl Mar 20, 2021
4976eee
Disallow CommonJS exports named `default`
kl0tl Mar 20, 2021
f73c2bf
Disallow CommonJS exports and imports in ES foreign modules
kl0tl Mar 20, 2021
c56d3f5
Deprecate CommonJS foreign modules
kl0tl Mar 20, 2021
94af221
Convert CommonJS foreign modules in tests to ES modules
kl0tl Mar 20, 2021
15ebf0d
Don't optimize away dependencies of named ES exports of declarations
kl0tl Mar 21, 2021
8f19b7e
fixup! Import CommonJS foreign modules through an ES module wrapper
kl0tl Apr 3, 2021
7727c98
fixup! Don't optimize away dependencies of named ES exports of declar…
kl0tl Apr 3, 2021
bd45602
Revert "Disallow CommonJS exports named `default`"
kl0tl Jun 21, 2021
ca94c4b
Add tests for foreign CommonJS exports named default
kl0tl Jun 21, 2021
ec4dce5
Extend support to Node.js v12.0.0 with --experimental-modules
kl0tl Jul 2, 2021
0d6f928
Filter out Node.js experimental ES modules loader warning
kl0tl Jul 2, 2021
8e1caf8
Update bundler error messages
kl0tl Jul 2, 2021
7ef3aad
Merge branch 'master' into next
kl0tl Jul 3, 2021
d5437e0
Fix HLint warnings
kl0tl Jul 3, 2021
b0216af
Desugar record accessor to a special function call
zyla Jul 8, 2020
dfa92af
Overloaded record accessors
zyla Jul 8, 2020
ef5aca3
Fix warnings
zyla Oct 22, 2020
a896388
Optimize back the common case of `Record`
zyla Oct 27, 2020
4b3fe2b
Fix post-merge breakage
zyla Sep 28, 2021
3cda1fa
Run workflows on restaumatic branch
zyla Sep 28, 2021
ee2fb90
Add missing module
zyla Sep 28, 2021
728bc79
Merge branch 'feature/overloaded-records-0.14' into restaumatic
zyla Sep 28, 2021
abce72a
Bump version
zyla Oct 27, 2020
ac4ccab
Bump also version for ide exports
zyla Oct 13, 2021
41e2e0b
Merge remote-tracking branch 'upstream/master' into es-modules
zyla Oct 15, 2021
25c91d0
Merge branch 'es-modules' into restaumatic
zyla Oct 15, 2021
becb77c
Update version
zyla Oct 17, 2021
2df4148
Bundle: detect functions as internal members
zyla Oct 17, 2021
e0dccf4
Merge branch 'es-modules' into restaumatic
zyla Oct 17, 2021
e2a0fd0
Fix lint errors
zyla Oct 17, 2021
62a0a79
Merge branch 'feature/overloaded-records-0.14' into restaumatic
zyla Oct 17, 2021
4784e2d
Fix getField optimization for plain records
zyla Oct 22, 2021
a49097d
Merge branch 'feature/overloaded-records-0.14' into restaumatic
zyla Oct 26, 2021
675b993
Merge remote-tracking branch 'upstream/master' into restaumatic
zyla Oct 26, 2021
007ff26
Update version
zyla Oct 26, 2021
4fc451c
Merge remote-tracking branch 'origin/master' into restaumatic
jborkowski May 6, 2022
2a4d4ff
Merge pull request #1 from restaumatic/restaumatic-v0.15.0
jborkowski May 6, 2022
97a513e
Fix imports generated for OverloadedRecordFields (SProxy->Proxy)
zyla Jun 3, 2022
73d3ee9
Update version
zyla Jun 3, 2022
272bbe4
Fix test golden
zyla Jun 5, 2022
123d6fa
Merge remote-tracking branch 'origin/restaumatic' into restaumatic-0.…
usagi-z Aug 25, 2023
ba6f317
it typechecks, ship it!
usagi-z Aug 25, 2023
50aa943
bring back desugarAccessorModule
usagi-z Aug 28, 2023
3761609
bring back optimizeRecordGetField
usagi-z Aug 28, 2023
d1e32f5
enable CI
usagi-z Sep 1, 2023
37a66e8
whitespace 1
usagi-z Sep 1, 2023
c40bcd1
whitespace 2
usagi-z Sep 1, 2023
0f1e90b
ws 3
usagi-z Sep 1, 2023
29c9574
ws 4
usagi-z Sep 1, 2023
049673d
ws 5
usagi-z Sep 1, 2023
6cca3e1
fix tests at the cost of marking version as a company fork
usagi-z Sep 4, 2023
4e1934b
silence hlint
usagi-z Sep 4, 2023
60bf482
Use IsSymbol Ident
jborkowski Sep 5, 2023
6050c5c
Add pattern by hand
jborkowski Sep 5, 2023
85bd4c3
fix currentVersion
jborkowski Sep 5, 2023
5685625
Revert currentVersion
jborkowski Sep 6, 2023
71b85d3
Fix version used by IDE
zyla Sep 6, 2023
62d0661
Remove Show
jborkowski Sep 6, 2023
85f9dff
Cleanup Github Workfows
jborkowski Sep 6, 2023
919d2fe
Remove ;13u
jborkowski Sep 6, 2023
6ac5ae5
Update ci.yml
jborkowski Sep 13, 2023
be0d9ce
Merge pull request #2 from restaumatic/restaumatic-0.15.10
jborkowski Sep 13, 2023
969a39e
Merge remote-tracking branch 'upstream/master' into restaumatic
jborkowski Oct 6, 2023
7d04419
Merge pull request #3 from restaumatic/restaumatic-0.15.11
jborkowski Oct 6, 2023
4827f79
Update Externs.hs
jborkowski Jan 22, 2024
107964c
Merge branch 'master' into v0.15.15-restaumatic
jborkowski Feb 13, 2024
4ac46a5
set currentVersion to restaumatic1
jborkowski Feb 13, 2024
988c913
Merge pull request #5 from restaumatic/v0.15.15-restaumatic
jborkowski Feb 13, 2024
8648583
Merge remote-tracking branch 'upstream/master' into restaumatic
jborkowski Sep 3, 2024
3377aa0
Make cut-off, the main piece
wclr Dec 26, 2023
ac51b00
Fix linting error.
wclr Jun 18, 2023
1e07d60
Refactor externs diff and make api, fix some review sugs
wclr Dec 26, 2023
82198fa
Add comments to BuildPlan
wclr Jul 7, 2023
fa35d09
Added requested changes, don't recompile downstream after the error, …
wclr Feb 24, 2024
d34d0e1
Update ExternsDiff.checkUsage, add tests
wclr May 29, 2024
f58f5f0
ExternsDiff: normalize type
jborkowski Nov 30, 2024
6be0c52
Normalize SourceSpan path in Externs
jborkowski Dec 2, 2024
4b697be
Revert "Normalize SourceSpan path in Externs"
jborkowski Dec 2, 2024
6a96456
Make relative path to actualFile
jborkowski Dec 2, 2024
c9f6944
Revert 1 commits
jborkowski Dec 2, 2024
ce98272
Logger and Supply improvements
kozak May 7, 2025
7b26d48
Not needed in this compiler version
kozak May 7, 2025
2f017ad
Specialize logger to errors
kozak May 8, 2025
79596a9
A working version
kozak May 8, 2025
5996054
IntMap Lazy
kozak May 8, 2025
2bd2e98
Hacky specialization of TypeCheckM
zyla May 9, 2025
3033a4f
IntMap Lazy
kozak May 8, 2025
a2ad1fb
Merge branch 'improve-perf' into typecheckm-specialization
zyla May 9, 2025
22d8db6
Fix after merging
zyla May 9, 2025
c2f1e65
Memoize unifyTypes
kozak May 9, 2025
a1c4313
Memoize unify types really this time
kozak May 9, 2025
d2d0f1c
Merge branch 'improve-perf-memoize-unify' into various-perf-changes
kozak May 9, 2025
f8a5838
{-# INLINE #-} annoations on traversals
zyla May 12, 2025
98b1ff0
Replace Logger with Writer
zyla May 12, 2025
a9eb340
Writer CPS
zyla May 12, 2025
ca8799e
Merge remote-tracking branch 'origin/master' into various-perf-changes
zyla May 12, 2025
35218a6
add monoid import
jborkowski May 9, 2025
523bd5f
Remove duplicate instance
zyla May 12, 2025
75126e4
Remove redundant constraint
zyla May 12, 2025
c7c6e0f
Fix hlint warnings
zyla May 13, 2025
c492385
Bring back original Logger
zyla May 13, 2025
8f9bc92
ExternsDiff: compute deps of TypeSynonyms properly (#7)
zyla May 26, 2025
7478a3c
Use a simpler monad in occurs check and check valid kind
kozak May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CI"

on:
push:
branches: [ "master" ]
branches: ["master", "restaumatic"]
pull_request:
branches: [ "master" ]
branches: ["master", "restaumatic"]
paths:
- .github/workflows/**/*.yml
- app/**/*
Expand All @@ -24,7 +24,7 @@ on:
- update-changelog.hs
- weeder.dhall
release:
types: [ "published" ]
types: ["published"]

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion app/Command/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ compile PSCMakeOptions{..} = do
let filePathMap = M.fromList $ map (\(fp, pm) -> (P.getModuleName $ CST.resPartial pm, Right fp)) ms
foreigns <- inferForeignModules filePathMap
let makeActions = buildMakeActions pscmOutputDir filePathMap foreigns pscmUsePrefix
P.make makeActions (map snd ms)
P.make_ makeActions (map snd ms)
printWarningsAndErrors (P.optionsVerboseErrors pscmOpts) pscmJSONErrors moduleFiles makeWarnings makeErrors
exitSuccess

Expand Down
74 changes: 74 additions & 0 deletions app/static/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
var get = function get(uri, callback, onError) {
var request = new XMLHttpRequest();
request.addEventListener('load', function() {
callback(request.responseText);
});
request.addEventListener('error', onError);
request.open('GET', uri);
request.send();
};
var evaluate = function evaluate(js) {
var buffer = [];
// Save the old console.log function
var oldLog = console.log;
console.log = function(s) {
// Push log output into a temporary buffer
// which will be returned to PSCi.
buffer.push(s);
};
// Replace any require and import statements with lookups on the PSCI object
// and export statements with assignments to module.exports.
var replaced = js.replace(/require\("[^"]*"\)/g, function(s) {
return "PSCI['" + s.split('/')[1] + "']";
}).replace(/import \* as ([^\s]+) from "([^"]*)"/g, function (_, as, from) {
return "var " + as + " = PSCI['" + from.split('/')[1] + "']";
}).replace(/export \{([^}]+)\} from "\.\/foreign\.js";?/g, function (_, exports) {
return exports.replace(/^\s*([^,\s]+),?\s*$/gm, function (_, exported) {
return "module.exports." + exported + " = $foreign." + exported + ";";
});
}).replace(/export \{([^}]+)\};?/g, function (_, exports) {
return exports.replace(/^\s*([^,\s]+)(?: as ([^\s]+))?,?\s*$/gm, function (_, exported, as) {
return "module.exports." + (as || exported) + " = " + exported + ";";
});
});
// Wrap the module and evaluate it.
var wrapped =
[ 'var module = { exports: {} };'
, '(function(module) {'
, replaced
, '})(module);'
, 'return module.exports["$main"] && module.exports["$main"]();'
].join('\n');
new Function(wrapped)();
// Restore console.log
console.log = oldLog;
return buffer.join('\n');
};
window.onload = function() {
var socket = new WebSocket('ws://localhost:' + location.port);
var evalNext = function reload() {
get('js/latest.js', function(response) {
try {
var result = evaluate(response);
socket.send(result);
} catch (ex) {
socket.send(ex.stack);
}
}, function(err) {
socket.send('Error sending JavaScript');
});
};
socket.onopen = function() {
console.log('Connected');
socket.onmessage = function(event) {
switch (event.data) {
case 'eval':
evalNext();
break;
case 'reload':
location.reload();
break;
}
};
};
};
2 changes: 2 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cradle:
stack: {}
4 changes: 4 additions & 0 deletions purescript.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ common defaults
cheapskate >=0.1.1.2 && <0.2,
clock >=0.8.3 && <0.9,
containers >=0.6.5.1 && <0.7,
-- unordered-containers,
-- hashable,
cryptonite ==0.30.*,
data-ordlist >=0.4.7.0 && <0.5,
deepseq >=1.4.6.1 && <1.5,
Expand Down Expand Up @@ -336,6 +338,7 @@ library
Language.PureScript.Make.Actions
Language.PureScript.Make.BuildPlan
Language.PureScript.Make.Cache
Language.PureScript.Make.ExternsDiff
Language.PureScript.Make.Monad
Language.PureScript.ModuleDependencies
Language.PureScript.Names
Expand All @@ -353,6 +356,7 @@ library
Language.PureScript.Renamer
Language.PureScript.Roles
Language.PureScript.Sugar
Language.PureScript.Sugar.Accessor
Language.PureScript.Sugar.AdoNotation
Language.PureScript.Sugar.BindingGroups
Language.PureScript.Sugar.CaseDeclarations
Expand Down
21 changes: 15 additions & 6 deletions src/Control/Monad/Supply.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE UndecidableInstances #-}
-- |
-- Fresh variable supply
--
Expand All @@ -9,21 +10,29 @@ import Control.Applicative (Alternative)
import Control.Monad.Error.Class (MonadError(..))
import Control.Monad.Reader (MonadReader, MonadTrans)
import Control.Monad (MonadPlus)
import Control.Monad.State (StateT(..))
import Control.Monad.State (MonadState(..))
import Control.Monad.State.Strict (StateT(..))
import Control.Monad.Writer (MonadWriter)
import Data.Int (Int64)

import Data.Functor.Identity (Identity(..))
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Trans (lift)

newtype SupplyT m a = SupplyT { unSupplyT :: StateT Integer m a }
deriving (Functor, Applicative, Monad, MonadTrans, MonadError e, MonadWriter w, MonadReader r, Alternative, MonadPlus)
newtype SupplyT m a = SupplyT { unSupplyT :: StateT Int64 m a }
deriving (Functor, Applicative, Monad, MonadTrans, MonadError e, MonadWriter w, MonadReader r, Alternative, MonadPlus, MonadIO)

runSupplyT :: Integer -> SupplyT m a -> m (a, Integer)
runSupplyT :: Int64 -> SupplyT m a -> m (a, Int64)
runSupplyT n = flip runStateT n . unSupplyT

evalSupplyT :: (Functor m) => Integer -> SupplyT m a -> m a
evalSupplyT :: (Functor m) => Int64 -> SupplyT m a -> m a
evalSupplyT n = fmap fst . runSupplyT n

type Supply = SupplyT Identity

runSupply :: Integer -> Supply a -> (a, Integer)
runSupply :: Int64 -> Supply a -> (a, Int64)
runSupply n = runIdentity . runSupplyT n

instance MonadState s m => MonadState s (SupplyT m) where
get = lift get
put = lift . put
16 changes: 12 additions & 4 deletions src/Control/Monad/Supply/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,33 @@ import Control.Monad.State (StateT)
import Control.Monad.Supply (SupplyT(..))
import Control.Monad.Writer (WriterT)
import Data.Text (Text, pack)
import Data.Int (Int64)

class Monad m => MonadSupply m where
fresh :: m Integer
peek :: m Integer
default fresh :: (MonadTrans t, MonadSupply n, m ~ t n) => m Integer
fresh :: m Int64
peek :: m Int64
consumeUpTo :: Int64 -> m ()
default fresh :: (MonadTrans t, MonadSupply n, m ~ t n) => m Int64
fresh = lift fresh
default peek :: (MonadTrans t, MonadSupply n, m ~ t n) => m Integer
default peek :: (MonadTrans t, MonadSupply n, m ~ t n) => m Int64
peek = lift peek
default consumeUpTo :: (MonadTrans t, MonadSupply n, m ~ t n) => Int64 -> m ()
consumeUpTo n = lift (consumeUpTo n)

instance Monad m => MonadSupply (SupplyT m) where
fresh = SupplyT $ do
n <- get
put (n + 1)
return n
peek = SupplyT get
consumeUpTo n = SupplyT $ do
m <- get
put $ max n m

instance MonadSupply m => MonadSupply (StateT s m)
instance (Monoid w, MonadSupply m) => MonadSupply (WriterT w m)
instance (Monoid w, MonadSupply m) => MonadSupply (RWST r w s m)

freshName :: MonadSupply m => m Text
freshName = fmap (("$" <> ) . pack . show) fresh

2 changes: 1 addition & 1 deletion src/Language/PureScript/AST/Declarations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ importPrim =
. addDefaultImport (Qualified ByNullSourcePos primModName)

data NameSource = UserNamed | CompilerNamed
deriving (Show, Generic, NFData, Serialise)
deriving (Eq, Show, Generic, NFData, Serialise)

-- |
-- An item in a list of explicit imports or exports
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/AST/Declarations/ChainId.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Language.PureScript.AST.Declarations.ChainId
( ChainId
( ChainId(..)
, mkChainId
) where

Expand Down
17 changes: 16 additions & 1 deletion src/Language/PureScript/Constants/Libs.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE TemplateHaskell #-}

-- | Various constants which refer to things in the Prelude and other core libraries
module Language.PureScript.Constants.Libs where

import Protolude qualified as P

import Data.String (IsString)
import Language.PureScript.PSString (PSString)
import Language.PureScript.Constants.TH qualified as TH
import Language.PureScript.PSString (PSString)
import Language.PureScript.Names (Ident (..), Qualified (..), QualifiedBy (..))

-- Core lib values

Expand Down Expand Up @@ -166,6 +168,7 @@ $(TH.declare do

TH.mod "Data.Symbol" do
TH.cls "IsSymbol"
TH.asIdent do TH.var "IsSymbol"

-- purescript-arrays

Expand Down Expand Up @@ -261,4 +264,16 @@ $(TH.declare do
TH.mod "Unsafe.Coerce" do
TH.asPair do TH.var "unsafeCoerce"

TH.mod "Type.Proxy" do
TH.dty "Proxy" ["Proxy"]
TH.asIdent do
TH.var "Proxy"
TH.mod "Data.Record" do
TH.asIdent do
TH.var "getField"
TH.var "hasFieldRecord"

)

pattern IsSymbolDict :: Qualified Ident
pattern IsSymbolDict = Qualified (ByModuleName M_Data_Symbol) (Ident "IsSymbol$Dict")
29 changes: 28 additions & 1 deletion src/Language/PureScript/CoreFn/Optimizer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import Language.PureScript.CoreFn.Expr (Bind, Expr(..))
import Language.PureScript.CoreFn.Module (Module(..))
import Language.PureScript.CoreFn.Traversals (everywhereOnValues)
import Language.PureScript.Constants.Libs qualified as C

-- import Language.PureScript.CoreImp.AST (AST(StringLiteral, ObjectLiteral))
import Language.PureScript.AST.Literals (Literal(..))
-- |
-- CoreFn optimization pass.
--
Expand All @@ -22,6 +23,32 @@ optimizeModuleDecls = map transformBinds
(transformBinds, _, _) = everywhereOnValues identity transformExprs identity
transformExprs
= optimizeDataFunctionApply
. optimizeRecordGetField

-- | Optimize
-- `Data_Record.getField(Data_Record.hasFieldRecord(new Data_Symbol.IsSymbol(function() { return "f"; }))())(Type_Proxy.Proxy.value)(x)`
-- into
-- `x.f`
optimizeRecordGetField :: Expr a -> Expr a
optimizeRecordGetField
(App ann
(App _
(App _
(Var _ C.I_getField)
(App _
(App _
(Var _ C.I_hasFieldRecord)
(App _
(Var _ C.IsSymbolDict)
(Literal _ (ObjectLiteral
[ ("reflectSymbol", Abs _ _
(Literal _ (StringLiteral label)))
]))))
_))
(Var _ C.I_Proxy))
object) =
Accessor ann label object
optimizeRecordGetField e = e

optimizeDataFunctionApply :: Expr a -> Expr a
optimizeDataFunctionApply e = case e of
Expand Down
8 changes: 8 additions & 0 deletions src/Language/PureScript/CoreImp/AST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ data AST
-- ^ instanceof check
| Comment CIComments AST
-- ^ Commented JavaScript
-- | Import (Maybe SourceSpan) Text PSString
-- -- ^ Imported identifier and path to its module
-- | Export (Maybe SourceSpan) (NEL.NonEmpty Text) (Maybe PSString)
-- -- ^ Exported identifiers and optional path to their module (for re-exports)
deriving (Show, Eq)

withSourceSpan :: SourceSpan -> AST -> AST
Expand Down Expand Up @@ -140,6 +144,8 @@ withSourceSpan withSpan = go where
go (Throw _ js) = Throw ss js
go (InstanceOf _ j1 j2) = InstanceOf ss j1 j2
go c@Comment{} = c
-- go (Import _ ident from) = Import ss ident from
-- go (Export _ idents from) = Export ss idents from

getSourceSpan :: AST -> Maybe SourceSpan
getSourceSpan = go where
Expand Down Expand Up @@ -168,6 +174,8 @@ getSourceSpan = go where
go (Throw ss _) = ss
go (InstanceOf ss _ _) = ss
go (Comment _ _) = Nothing
-- go (Import ss _ _) = ss
-- go (Export ss _ _) = ss

everywhere :: (AST -> AST) -> AST -> AST
everywhere f = go where
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/Docs/Collect.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ compileForDocs outputDir inputFiles = do
foreigns <- P.inferForeignModules filePathMap
let makeActions =
(P.buildMakeActions outputDir filePathMap foreigns False)
{ P.progress = liftIO . TIO.hPutStr stdout . (<> "\n") . P.renderProgressMessage "Compiling documentation for "
{ P.progress = liftIO . TIO.hPutStr stdout . (<> "\n") . P.renderProgressMessage "documentation for "
}
P.make makeActions (map snd ms)
either throwError return result
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/Environment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ data FunctionalDependency = FunctionalDependency
-- ^ the type arguments which determine the determined type arguments
, fdDetermined :: [Int]
-- ^ the determined type arguments
} deriving (Show, Generic)
} deriving (Eq, Show, Generic)

instance NFData FunctionalDependency
instance Serialise FunctionalDependency
Expand Down
6 changes: 3 additions & 3 deletions src/Language/PureScript/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Data.List (transpose, nubBy, partition, dropWhileEnd, sortOn, uncons)
import Data.List.NonEmpty qualified as NEL
import Data.List.NonEmpty (NonEmpty((:|)))
import Data.Maybe (maybeToList, fromMaybe, isJust, mapMaybe)
import Data.Map qualified as M
import Data.IntMap.Strict qualified as M
import Data.Ord (Down(..))
import Data.Set qualified as S
import Data.Text qualified as T
Expand Down Expand Up @@ -418,9 +418,9 @@ addHints hints = onErrorMessages $ \(ErrorMessage hints' se) -> ErrorMessage (hi

-- | A map from rigid type variable name/unknown variable pairs to new variables.
data TypeMap = TypeMap
{ umSkolemMap :: M.Map Int (String, Int, Maybe SourceSpan)
{ umSkolemMap :: M.IntMap (String, Int, Maybe SourceSpan)
-- ^ a map from skolems to their new names, including source and naming info
, umUnknownMap :: M.Map Int Int
, umUnknownMap :: M.IntMap Int
-- ^ a map from unification variables to their new names
, umNextIndex :: Int
-- ^ unknowns and skolems share a source of names during renaming, to
Expand Down
Loading