Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove optimization phases, update package.yaml-s #382

Merged
merged 2 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 5 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- syb >= 0.7 && < 0.8
- stm >= 2 && < 3
- template-haskell >= 2.12.0.0 && < 3
- th-abstraction >= 0.3.1.0 && < 0.4
- th-abstraction >= 0.3.1.0 && < 0.5
- transformers >= 0.5.2.0 && < 0.6
- first-class-families >= 0.5.0.0 && < 0.9
- unagi-chan >= 0.4.0.0 && < 0.5
Expand Down Expand Up @@ -77,6 +77,8 @@ library:
ghc-options: -Wall
source-dirs: src
other-modules: Polysemy.Internal.PluginLookup
generated-other-modules:
- Paths_polysemy

when:
- condition: flag(dump-core)
Expand Down Expand Up @@ -119,6 +121,8 @@ tests:
- inspection-testing >= 0.4.2 && < 0.5
- hspec >= 2.6.0 && < 3
- doctest >= 0.16.0.1 && < 0.17
generated-other-modules:
- Build_doctests
googleson78 marked this conversation as resolved.
Show resolved Hide resolved

benchmarks:
polysemy-bench:
Expand Down
4 changes: 4 additions & 0 deletions polysemy-plugin/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ custom-setup:

library:
source-dirs: src
generated-other-modules:
- Paths_polysemy_plugin

flags:
corelint:
Expand Down Expand Up @@ -63,6 +65,8 @@ tests:
- should-not-typecheck >= 2.1.0 && < 3
- inspection-testing >= 0.4.2 && < 0.5
- doctest >= 0.16.0.1 && < 0.17
generated-other-modules:
- Build_doctests

default-extensions:
- DataKinds
Expand Down
10 changes: 7 additions & 3 deletions polysemy-plugin/polysemy-plugin.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.24
cabal-version: 2.0

-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 0f4635d86ee9b6424b575257afd4fc1a42b0ddbbf2270bdcb1a71b8e54f0226d
-- hash: 44327db7470ebcb50b7141a3a17ffde2130f69401c24dbed443290623f8547dc

name: polysemy-plugin
version: 0.2.5.1
Expand Down Expand Up @@ -45,9 +45,10 @@ library
Polysemy.Plugin.Fundep.Stuff
Polysemy.Plugin.Fundep.Unification
Polysemy.Plugin.Fundep.Utils
Polysemy.Plugin.Phases
other-modules:
Paths_polysemy_plugin
autogen-modules:
Paths_polysemy_plugin
hs-source-dirs:
src
default-extensions: DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications TypeOperators TypeFamilies UnicodeSyntax
Expand All @@ -74,6 +75,9 @@ test-suite polysemy-plugin-test
TypeErrors
VDQSpec
Paths_polysemy_plugin
Build_doctests
autogen-modules:
Build_doctests
hs-source-dirs:
test
default-extensions: DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications TypeOperators TypeFamilies UnicodeSyntax
Expand Down
29 changes: 0 additions & 29 deletions polysemy-plugin/src/Polysemy/Plugin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,43 +62,14 @@ module Polysemy.Plugin
) where

import Polysemy.Plugin.Fundep
#if __GLASGOW_HASKELL__ >= 810
import Polysemy.Plugin.Phases
import Data.Bool (bool)
#endif

import GhcPlugins


------------------------------------------------------------------------------
plugin :: Plugin
plugin = defaultPlugin
{ tcPlugin = const $ Just fundepPlugin
, installCoreToDos = const installTodos
#if __GLASGOW_HASKELL__ >= 806
, pluginRecompile = purePlugin
#endif
}

------------------------------------------------------------------------------
#if __GLASGOW_HASKELL__ >= 810
polysemyInternal :: ModuleName
polysemyInternal = mkModuleName "Polysemy.Internal"
#endif

------------------------------------------------------------------------------
installTodos :: [CoreToDo] -> CoreM [CoreToDo]
installTodos todos = do
dflags <- getDynFlags

case optLevel dflags of
0 -> pure todos
_ -> do
#if __GLASGOW_HASKELL__ >= 810
mods <- moduleSetElts <$> getVisibleOrphanMods
pure $ todos ++ bool []
(extraPhases dflags)
(any ((== polysemyInternal) . moduleName) mods)
#else
pure todos
#endif
63 changes: 0 additions & 63 deletions polysemy-plugin/src/Polysemy/Plugin/Phases.hs

This file was deleted.

12 changes: 9 additions & 3 deletions polysemy.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.24
cabal-version: 2.0

-- This file has been generated from package.yaml by hpack version 0.34.2.
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 6f6080a4e65486639af03142e56fdf232ed5c7747e77c24b378b0bb8033a079d
-- hash: 1ca26628a20b44d39a0c528cd42cb065833e803157c026d19b1ecacc770f59dc

name: polysemy
version: 1.3.0.0
Expand Down Expand Up @@ -87,6 +87,9 @@ library
Polysemy.Writer
other-modules:
Polysemy.Internal.PluginLookup
Paths_polysemy
autogen-modules:
Paths_polysemy
hs-source-dirs:
src
default-extensions: DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications TypeOperators TypeFamilies UnicodeSyntax
Expand Down Expand Up @@ -145,6 +148,9 @@ test-suite polysemy-test
ViewSpec
WriterSpec
Paths_polysemy
Build_doctests
autogen-modules:
Build_doctests
hs-source-dirs:
test
default-extensions: DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications TypeOperators TypeFamilies UnicodeSyntax
Expand Down