File: Monad.hs-boot

package info (click to toggle)
haskell-ghc-lib-parser 9.0.2.20211226-2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 8,668 kB
  • sloc: haskell: 94,206; ansic: 1,258; makefile: 12
file content (30 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Created this hs-boot file to remove circular dependencies from the use of
-- Plugins. Plugins needs CoreToDo and CoreM types to define core-to-core
-- transformations.
-- However GHC.Core.Opt.Monad does much more than defining these, and because Plugins are
-- activated in various modules, the imports become circular. To solve this I
-- extracted CoreToDo and CoreM into this file.
-- I needed to write the whole definition of these types, otherwise it created
-- a data-newtype conflict.

module GHC.Core.Opt.Monad ( CoreToDo, CoreM ) where

import GHC.Prelude

import GHC.Data.IOEnv ( IOEnv )

type CoreIOEnv = IOEnv CoreReader

data CoreReader

newtype CoreWriter = CoreWriter {
        cw_simpl_count :: SimplCount
}

data SimplCount

newtype CoreM a = CoreM { unCoreM :: CoreIOEnv (a, CoreWriter) }

instance Monad CoreM

data CoreToDo