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 1 commit
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
4 changes: 3 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 @@ -119,6 +119,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
2 changes: 2 additions & 0 deletions polysemy-plugin/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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
8 changes: 5 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: c7e130178c5199be49659c43bf9e2d9dc5792c21c41b81b7ba50279ebea963e0

name: polysemy-plugin
version: 0.2.5.1
Expand Down Expand Up @@ -45,7 +45,6 @@ library
Polysemy.Plugin.Fundep.Stuff
Polysemy.Plugin.Fundep.Unification
Polysemy.Plugin.Fundep.Utils
Polysemy.Plugin.Phases
other-modules:
Paths_polysemy_plugin
hs-source-dirs:
Expand Down Expand Up @@ -74,6 +73,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.

9 changes: 6 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: fa7aaa2419a7bc1c1779979b304e87f5840d10146f3f23d1b4d93ac1ddbc028f

name: polysemy
version: 1.3.0.0
Expand Down Expand Up @@ -145,6 +145,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