-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Disambiguate obvious uses of effects. -- -- Please see the README on GitHub at -- https://github.com/isovector/polysemy/tree/master/polysemy-plugin#readme @package polysemy-plugin @version 0.2.0.3 module Polysemy.Plugin.Fundep fundepPlugin :: TcPlugin instance GHC.Classes.Eq Polysemy.Plugin.Fundep.OrdType instance GHC.Classes.Ord Polysemy.Plugin.Fundep.OrdType module Polysemy.Plugin.InlineRecursiveCalls inlineRecursiveCalls :: ModGuts -> CoreM ModGuts -- | A typechecker plugin that can disambiguate "obvious" uses of effects -- in Polysemy. -- -- Example: -- -- Consider the following program: -- --
-- foo :: Member (State Int) r => Sem r () -- foo = put 10 ---- -- What does this program do? Any human will tell you that it changes the -- state of the Int to 10, which is clearly what's meant. -- -- Unfortunately, Polysemy can't work this out on its own. Its reasoning -- is "maybe you wanted to change some other State effect which is -- also a Num, but you just forgot to add a Member -- constraint for it." -- -- This is obviously insane, but it's the way the cookie crumbles. -- Plugin is a typechecker plugin which will disambiguate the -- above program (and others) so the compiler will do what you want. -- -- Usage: -- -- Add the following line to your package configuration: -- --
-- ghc-options: -fplugin=Polysemy.Plugin ---- -- Limitations: -- -- The Plugin will only disambiguate effects if there is exactly -- one relevant constraint in scope. For example, it will not -- disambiguate the following program: -- --
-- bar :: Members '[ State Int -- , State Double -- ] r => Sem r () -- bar = put 10 ---- -- because it is now unclear whether you're attempting to set the -- Int or the Double. Instead, you can manually write a -- type application in this case. -- --
-- bar :: Members '[ State Int -- , State Double -- ] r => Sem r () -- bar = put @Int 10 --module Polysemy.Plugin plugin :: Plugin module Polysemy.Plugin.Phases extraPhases :: DynFlags -> [CoreToDo]