text:
.. _extending-ghc:

Extending and using GHC as a Library
====================================

GHC exposes its internal APIs to users through the built-in ghc package.
It allows you to write programs that leverage GHC's entire compilation
driver, in order to analyze or compile Haskell code programmatically.
Furthermore, GHC gives users the ability to load compiler plugins during
compilation - modules which are allowed to view and change GHC's
internal intermediate representation, Core. Plugins are suitable for
things like experimental optimizations or analysis, and offer a lower
barrier of entry to compiler development for many common cases.

Furthermore, GHC offers a lightweight annotation mechanism that you can
use to annotate your source code with metadata, which you can later
inspect with either the compiler API or a compiler plugin.

.. _annotation-pragmas:

Source annotations
------------------

Annotations are small pragmas that allow you to attach data to
identifiers in source code, which are persisted when compiled. These
pieces of data can then inspected and utilized when using GHC as a
library or writing a compiler plugin.

.. _ann-pragma:

Annotating values
~~~~~~~~~~~~~~~~~

.. index::
   single: ANN pragma
   single: pragma; ANN
   single: source annotations

Any expression that has both ``Typeable`` and ``Data`` instances may be
attached to a top-level value binding using an ``ANN`` pragma. In
particular, this means you can use ``ANN`` to annotate data constructors
(e.g. ``Just``) as well as normal values (e.g. ``take``). By way of
example, to annotate the function ``foo`` with the annotation
``Just "Hello"`` you would do this:

::

    {-# ANN foo (Just "Hello") #-}
    foo = ...

A number of restrictions apply to use of annotations:

-  The binder being annotated must be at the top level (i.e. no nested
   binders)

-  The binder being annotated must be declared in the current module

-  The expression you are annotating with must have a type with
   ``Typeable`` and ``Data`` instances

-  The :ref:`Template Haskell staging restrictions <th-usage>` apply to the
   expression being annotated with, so for example you cannot run a
   function from the module being compiled.

   To be precise, the annotation ``{-# ANN x e #-}`` is well staged if
   and only if ``$(e)`` would be (disregarding the usual type
   restrictions of the splice syntax, and the usual restriction on
   splicing inside a splice - ``$([|1|])`` is fine as an annotation,
   albeit redundant).

If you feel strongly that any of these restrictions are too onerous,
:ghc-wiki:`please give the GHC team a shout <mailing-lists-and-irc>`.

However, apart from these restrictions, many things are allowed,
including expressions which are not fully evaluated! Annotation
expressions will be evaluated by the compiler just like Template Haskell
splices are. So, this annotation is fine:

::

    {-# ANN f SillyAnnotation { foo = (id 10) + $([| 20 |]), bar = 'f } #-}
    f = ...

.. _typeann-pragma:

Annotating types
~~~~~~~~~~~~~~~~

.. index::
   single: ANN pragma; on types

You can annotate types with the ``ANN`` pragma by using the ``type``
keyword. For example:

::

    {-# ANN type Foo (Just "A `Maybe String' annotation") #-}
    data Foo = ...

.. _modann-pragma:

Annotating modules
~~~~~~~~~~~~~~~~~~

.. index::
   single: ANN pragma; on modules

You can annotate modules with the ``ANN`` pragma by using the ``module``
keyword. For example:

::

    {-# ANN module (Just "A `Maybe String' annotation") #-}

.. _ghc-as-a-library:

Using GHC as a Library
----------------------

The ``ghc`` package exposes most of GHC's frontend to users, and thus
allows you to write programs that leverage it. This library is actually
the same library used by GHC's internal, frontend compilation driver,
and thus allows you to write tools that programmatically compile source
code and inspect it. Such functionality is useful in order to write
things like IDE or refactoring tools. As a simple example, here's a
program which compiles a module, much like ghc itself does by default
when invoked:

::

    import GHC
    import GHC.Paths ( libdir )
    import DynFlags ( defaultFatalMessager, defaultFlushOut )

    main =
        defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
          runGhc (Just libdir) $ do
            dflags <- getSessionDynFlags
            setSessionDynFlags dflags
            target <- guessTarget "test_main.hs" Nothing
            setTargets [target]
            load LoadAllTargets

The argument to ``runGhc`` is a bit tricky. GHC needs this to find its
libraries, so the argument must refer to the directory that is printed
by ``ghc --print-libdir`` for the same version of GHC that the program
is being compiled with. Above we therefore use the ``ghc-paths`` package
which provides this for us.

Compiling it results in:

.. code-block:: none

    $ cat test_main.hs
    main = putStrLn "hi"
    $ ghc -package ghc simple_ghc_api.hs
    [1 of 1] Compiling Main             ( simple_ghc_api.hs, simple_ghc_api.o )
    Linking simple_ghc_api ...
    $ ./simple_ghc_api
    $ ./test_main
    hi
    $

For more information on using the API, as well as more samples and
references, please see `this Haskell.org wiki
page <http://haskell.org/haskellwiki/GHC/As_a_library>`__.

.. _compiler-plugins:

Compiler Plugins
----------------

GHC has the ability to load compiler plugins at compile time. The
feature is similar to the one provided by
`GCC <http://gcc.gnu.org/wiki/plugins>`__, and allows users to write
plugins that can adjust the behaviour of the constraint solver, inspect
and modify the compilation pipeline, as well as transform and inspect
GHC's intermediate language, Core. Plugins are suitable for experimental
analysis or optimization, and require no changes to GHC's source code to
use.

Plugins cannot optimize/inspect C-\\-, nor can they implement things like
parser/front-end modifications like GCC, apart from limited changes to
the constraint solver. If you feel strongly that any of these
restrictions are too onerous,
:ghc-wiki:`please give the GHC team a shout <mailing-lists-and-irc>`.

Plugins do not work with ``-fexternal-interpreter``. If you need to run plugins
with ``-fexternal-interpreter`` let GHC developers know in :ghc-ticket:`14335`.

.. _using-compiler-plugins:

Using compiler plugins
~~~~~~~~~~~~~~~~~~~~~~

Plugins can be added on the command line with the :ghc-flag:`-fplugin=⟨module⟩`
option where ⟨module⟩ is a module in a registered package that exports the
plugin. Arguments can be passed to the plugins with the
:ghc-flag:`-fplugin-opt=⟨module⟩:⟨args⟩` option. The list of enabled plugins can
be reset with the :ghc-flag:`-fclear-plugins` option.

.. ghc-flag:: -fplugin=⟨module⟩
    :shortdesc: Load a plugin exported by a given module
    :type: dynamic
    :category: plugins

    Load the plugin in the given module. The module must be a member of a
    package registered in GHC's package database.

.. ghc-flag:: -fplugin-opt=⟨module⟩:⟨args⟩
    :shortdesc: Give arguments to a plugin module; module must be specified with
        :ghc-flag:`-fplugin=⟨module⟩`
    :type: dynamic
    :category: plugins

    Give arguments to a plugin module; module must be specified with
    :ghc-flag:`-fplugin=⟨module⟩`.

.. ghc-flag:: -fplugin-trustworthy
    :shortdesc: Trust the used plugins and no longer mark the compiled module
        as unsafe
    :type: dynamic
    :category: plugins

    By default, when a module is compiled with plugins, it will be marked as
    unsafe. With this flag passed, all plugins are treated as trustworthy
    and the safety inference will no longer be affected.

.. ghc-flag:: -fclear-plugins
    :shortdesc: Clear the list of active plugins
    :type: dynamic
    :category: plugins

    Clear the list of plugins previously specified with
    :ghc-flag:`-fplugin <-fplugin=⟨module⟩>`. This is useful in GHCi where
    simply removing the :ghc-flag:`-fplugin <-fplugin=⟨module⟩>` options from
    the command line is not possible. Instead ``:set -fclear-plugins`` can be
    used.

As an example, in order to load the plugin exported by ``Foo.Plugin`` in
the package ``foo-ghc-plugin``, and give it the parameter "baz", we
would invoke GHC like this:

.. code-block:: none

    $ ghc -fplugin Foo.Plugin -fplugin-opt Foo.Plugin:baz Test.hs
    [1 of 1] Compiling Main             ( Test.hs, Test.o )
    Loading package ghc-prim ... linking ... done.
    Loading package integer-gmp ... linking ... done.
    Loading package base ... linking ... done.
    Loading package ffi-1.0 ... linking ... done.
    Loading package foo-ghc-plugin-0.1 ... linking ... done.
    ...
    Linking Test ...
    $

Alternatively, core plugins can be specified with Template Haskell.

::

   addCorePlugin "Foo.Plugin"

This inserts the plugin as a core-to-core pass. Unlike `-fplugin=(module)`,
the plugin module can't reside in the same package as the module calling
:th-ref:`Language.Haskell.TH.Syntax.addCorePlugin`. This way, the
implementation can expect the plugin to be built by the time
it is needed.

Plugin modules live in a separate namespace from
the user import namespace.  By default, these two namespaces are
the same; however, there are a few command line options which
control specifically plugin packages:

.. ghc-flag:: -plugin-package ⟨pkg⟩
    :shortdesc: Expose ⟨pkg⟩ for plugins
    :type: dynamic
    :category: plugins

    This option causes the installed package ⟨pkg⟩ to be exposed for plugins,
    such as :ghc-flag:`-fplugin=⟨module⟩`. The package ⟨pkg⟩ can be specified
    in full with its version number (e.g.  ``network-1.0``) or the version
    number can be omitted if there is only one version of the package
    installed. If there are multiple versions of ⟨pkg⟩ installed and
    :ghc-flag:`-hide-all-plugin-packages` was not specified, then all other
    versions will become hidden.  :ghc-flag:`-plugin-package ⟨pkg⟩` supports
    thinning and renaming described in :ref:`package-thinning-and-renaming`.

    Unlike :ghc-flag:`-package ⟨pkg⟩`, this option does NOT cause package ⟨pkg⟩
    to be linked into the resulting executable or shared object.

.. ghc-flag:: -plugin-package-id ⟨pkg-id⟩
    :shortdesc: Expose ⟨pkg-id⟩ for plugins
    :type: dynamic
    :category: plugins

    Exposes a package in the plugin namespace like :ghc-flag:`-plugin-package
    ⟨pkg⟩`, but the package is named by its installed package ID rather than by
    name.  This is a more robust way to name packages, and can be used to
    select packages that would otherwise be shadowed. Cabal passes
    :ghc-flag:`-plugin-package-id ⟨pkg-id⟩` flags to GHC.
    :ghc-flag:`-plugin-package-id ⟨pkg-id⟩` supports thinning and renaming
    described in :ref:`package-thinning-and-renaming`.

.. ghc-flag:: -hide-all-plugin-packages
    :shortdesc: Hide all packages for plugins by default
    :type: dynamic
    :category: plugins

    By default, all exposed packages in the normal, source import namespace are
    also available for plugins.  This causes those packages to be hidden by
    default.  If you use this flag, then any packages with plugins you require
    need to be explicitly exposed using :ghc-flag:`-plugin-package ⟨pkg⟩`
    options.

At the moment, the only way to specify a dependency on a plugin
in Cabal is to put it in ``build-depends`` (which uses the conventional
:ghc-flag:`-package-id ⟨unit-id⟩` flag); however, in the future there
will be a separate field for specifying plugin dependencies specifically.

.. _writing-compiler-plugins:

Writing compiler plugins
~~~~~~~~~~~~~~~~~~~~~~~~

Plugins are modules that export at least a single identifier,
``plugin``, of type ``GhcPlugins.Plugin``. All plugins should
``import GhcPlugins`` as it defines the interface to the compilation
pipeline.

A ``Plugin`` effectively holds a function which installs a compilation
pass into the compiler pipeline. By default there is the empty plugin
which does nothing, ``GhcPlugins.defaultPlugin``, which you should
override with record syntax to specify your installation function. Since
the exact fields of the ``Plugin`` type are open to change, this is the
best way to ensure your plugins will continue to work in the future with
minimal interface impact.

``Plugin`` exports a field, ``installCoreToDos`` which is a function of
type ``[CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]``. A
``CommandLineOption`` is effectively just ``String``, and a ``CoreToDo``
is basically a function of type ``Core -> Core``. A ``CoreToDo`` gives
your pass a name and runs it over every compiled module when you invoke
GHC.

As a quick example, here is a simple plugin that just does nothing and
just returns the original compilation pipeline, unmodified, and says
'Hello':

::

    module DoNothing.Plugin (plugin) where
    import GhcPlugins

    plugin :: Plugin
    plugin = defaultPlugin {
      installCoreToDos = install
      }

    install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
    install _ todo = do
      putMsgS "Hello!"
      return todo

Provided you compiled this plugin and registered it in a package (with
cabal for instance,) you can then use it by just specifying
``-fplugin=DoNothing.Plugin`` on the command line, and during the
compilation you should see GHC say 'Hello'.

Running multiple plugins is also supported, by passing
multiple ``-fplugin=...`` options. GHC will load the plugins
in the order in which they are specified on the command line
and, when appropriate, compose their effects in the same
order. That is, if we had two Core plugins, ``Plugin1`` and
``Plugin2``, each defining an ``install`` function like
the one above, then GHC would first run ``Plugin1.install``
on the default ``[CoreToDo]``, take the result and feed it to
``Plugin2.install``. ``-fplugin=Plugin1 -fplugin=Plugin2``
will update the Core pipeline by applying
``Plugin1.install opts1 >=> Plugin2.install opts2`` (where
``opts1`` and ``opts2`` are the options passed to each plugin
using ``-fplugin-opt=...``). This is not specific to Core
plugins but holds for all the types of plugins that can be
composed or sequenced in some way: the first plugin to appear
on the GHC command line will always act first.

.. _core-plugins-in-more-detail:

Core plugins in more detail
~~~~~~~~~~~~~~~~~~~~~~~~~~~

``CoreToDo`` is effectively a data type that describes all the kinds of
optimization passes GHC does on Core. There are passes for
simplification, CSE, etc. There is a specific case for
plugins, ``CoreDoPluginPass :: String -> PluginPass -> CoreToDo`` which
should be what you always use when inserting your own pass into the
pipeline. The first parameter is the name of the plugin, and the second
is the pass you wish to insert.

``CoreM`` is a monad that all of the Core optimizations live and operate
inside of.

A plugin's installation function (``install`` in the above example)
takes a list of ``CoreToDo``\ s and returns a list of ``CoreToDo``.
Before GHC begins compiling modules, it enumerates all the needed
plugins you tell it to load, and runs all of their installation
functions, initially on a list of passes that GHC specifies itself.
After doing this for every plugin, the final list of passes is given to
the optimizer, and are run by simply going over the list in order.

You should be careful with your installation function, because the list
of passes you give back isn't questioned or double checked by GHC at the
time of this writing. An installation function like the following:

::

    install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
    install _ _ = return []

is certainly valid, but also certainly not what anyone really wants.

.. _manipulating-bindings:

Manipulating bindings
^^^^^^^^^^^^^^^^^^^^^

In the last section we saw that besides a name, a ``CoreDoPluginPass``
takes a pass of type ``PluginPass``. A ``PluginPass`` is a synonym for
``(ModGuts -> CoreM ModGuts)``. ``ModGuts`` is a type that represents
the one module being compiled by GHC at any given time.

A ``ModGuts`` holds all of the module's top level bindings which we can
examine. These bindings are of type ``CoreBind`` and effectively
represent the binding of a name to body of code. Top-level module
bindings are part of a ``ModGuts`` in the field ``mg_binds``.
Implementing a pass that manipulates the top level bindings merely needs
to iterate over this field, and return a new ``ModGuts`` with an updated
``mg_binds`` field. Because this is such a common case, there is a
function provided named ``bindsOnlyPass`` which lifts a function of type
``([CoreBind] -> CoreM [CoreBind])`` to type
``(ModGuts -> CoreM ModGuts)``.

Continuing with our example from the last section, we can write a simple
plugin that just prints out the name of all the non-recursive bindings
in a module it compiles:

::

    module SayNames.Plugin (plugin) where
    import GhcPlugins

    plugin :: Plugin
    plugin = defaultPlugin {
      installCoreToDos = install
      }

    install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
    install _ todo = do
      return (CoreDoPluginPass "Say name" pass : todo)

    pass :: ModGuts -> CoreM ModGuts
    pass guts = do dflags <- getDynFlags
                   bindsOnlyPass (mapM (printBind dflags)) guts
      where printBind :: DynFlags -> CoreBind -> CoreM CoreBind
            printBind dflags bndr@(NonRec b _) = do
              putMsgS $ "Non-recursive binding named " ++ showSDoc dflags (ppr b)
              return bndr
            printBind _ bndr = return bndr

.. _getting-annotations:

Using Annotations
^^^^^^^^^^^^^^^^^

Previously we discussed annotation pragmas (:ref:`annotation-pragmas`),
which we mentioned could be used to give compiler plugins extra guidance
or information. Annotations for a module can be retrieved by a plugin,
but you must go through the modules ``ModGuts`` in order to get it.
Because annotations can be arbitrary instances of ``Data`` and
``Typeable``, you need to give a type annotation specifying the proper
type of data to retrieve from the interface file, and you need to make
sure the annotation type used by your users is the same one your plugin
uses. For this reason, we advise distributing annotations as part of the
package which also provides compiler plugins if possible.

To get the annotations of a single binder, you can use
``getAnnotations`` and specify the proper type. Here's an example that
will print out the name of any top-level non-recursive binding with the
``SomeAnn`` annotation:

::

    {-# LANGUAGE DeriveDataTypeable #-}
    module SayAnnNames.Plugin (plugin, SomeAnn(..)) where
    import GhcPlugins
    import Control.Monad (unless)
    import Data.Data

    data SomeAnn = SomeAnn deriving Data

    plugin :: Plugin
    plugin = defaultPlugin {
      installCoreToDos = install
      }

    install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
    install _ todo = do
      return (CoreDoPluginPass "Say name" pass : todo)

    pass :: ModGuts -> CoreM ModGuts
    pass g = do
              dflags <- getDynFlags
              mapM_ (printAnn dflags g) (mg_binds g) >> return g
      where printAnn :: DynFlags -> ModGuts -> CoreBind -> CoreM CoreBind
            printAnn dflags guts bndr@(NonRec b _) = do
              anns <- annotationsOn guts b :: CoreM [SomeAnn]
              unless (null anns) $ putMsgS $ "Annotated binding found: " ++  showSDoc dflags (ppr b)
              return bndr
            printAnn _ _ bndr = return bndr

    annotationsOn :: Data a => ModGuts -> CoreBndr -> CoreM [a]
    annotationsOn guts bndr = do
      anns <- getAnnotations deserializeWithData guts
      return $ lookupWithDefaultUFM anns [] (varUnique bndr)

Please see the GHC API documentation for more about how to use internal
APIs, etc.

.. _typechecker-plugins:

Typechecker plugins
~~~~~~~~~~~~~~~~~~~

In addition to Core plugins, GHC has experimental support for
typechecker plugins, which allow the behaviour of the constraint solver
to be modified. For example, they make it possible to interface the
compiler to an SMT solver, in order to support a richer theory of
type-level arithmetic expressions than the theory built into GHC (see
:ref:`typelit-tyfuns`).

The ``Plugin`` type has a field ``tcPlugin`` of type
``[CommandLineOption] -> Maybe TcPlugin``, where the ``TcPlugin`` type
is defined thus:

::

    data TcPlugin = forall s . TcPlugin
      { tcPluginInit  :: TcPluginM s
      , tcPluginSolve :: s -> TcPluginSolver
      , tcPluginStop  :: s -> TcPluginM ()
      }

    type TcPluginSolver = [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginResult

    data TcPluginResult = TcPluginContradiction [Ct] | TcPluginOk [(EvTerm,Ct)] [Ct]

(The details of this representation are subject to change as we gain
more experience writing typechecker plugins. It should not be assumed to
be stable between GHC releases.)

The basic idea is as follows:

-  When type checking a module, GHC calls ``tcPluginInit`` once before
   constraint solving starts. This allows the plugin to look things up
   in the context, initialise mutable state or open a connection to an
   external process (e.g. an external SMT solver). The plugin can return
   a result of any type it likes, and the result will be passed to the
   other two fields.

-  During constraint solving, GHC repeatedly calls ``tcPluginSolve``.
   This function is provided with the current set of constraints, and
   should return a ``TcPluginResult`` that indicates whether a
   contradiction was found or progress was made. If the plugin solver
   makes progress, GHC will re-start the constraint solving pipeline,
   looping until a fixed point is reached.

-  Finally, GHC calls ``tcPluginStop`` after constraint solving is
   finished, allowing the plugin to dispose of any resources it has
   allocated (e.g. terminating the SMT solver process).

Plugin code runs in the ``TcPluginM`` monad, which provides a restricted
interface to GHC API functionality that is relevant for typechecker
plugins, including ``IO`` and reading the environment. If you need
functionality that is not exposed in the ``TcPluginM`` module, you can
use ``unsafeTcPluginTcM :: TcM a -> TcPluginM a``, but are encouraged to
contact the GHC team to suggest additions to the interface. Note that
``TcPluginM`` can perform arbitrary IO via
``tcPluginIO :: IO a -> TcPluginM a``, although some care must be taken
with side effects (particularly in ``tcPluginSolve``). In general, it is
up to the plugin author to make sure that any IO they do is safe.

.. _constraint-solving-with-plugins:

Constraint solving with plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The key component of a typechecker plugin is a function of type
``TcPluginSolver``, like this:

::

    solve :: [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginResult
    solve givens deriveds wanteds = ...

This function will be invoked at two points in the constraint solving
process: after simplification of given constraints, and after
unflattening of wanted constraints. The two phases can be distinguished
because the deriveds and wanteds will be empty in the first case. In
each case, the plugin should either

-  return ``TcPluginContradiction`` with a list of impossible
   constraints (which must be a subset of those passed in), so they can
   be turned into errors; or

-  return ``TcPluginOk`` with lists of solved and new constraints (the
   former must be a subset of those passed in and must be supplied with
   corresponding evidence terms).

If the plugin cannot make any progress, it should return
``TcPluginOk [] []``. Otherwise, if there were any new constraints, the
main constraint solver will be re-invoked to simplify them, then the
plugin will be invoked again. The plugin is responsible for making sure
that this process eventually terminates.

Plugins are provided with all available constraints (including
equalities and typeclass constraints), but it is easy for them to
discard those that are not relevant to their domain, because they need
return only those constraints for which they have made progress (either
by solving or contradicting them).

Constraints that have been solved by the plugin must be provided with
evidence in the form of an ``EvTerm`` of the type of the constraint.
This evidence is ignored for given and derived constraints, which GHC
"solves" simply by discarding them; typically this is used when they are
uninformative (e.g. reflexive equations). For wanted constraints, the
evidence will form part of the Core term that is generated after
typechecking, and can be checked by ``-dcore-lint``. It is possible for
the plugin to create equality axioms for use in evidence terms, but GHC
does not check their consistency, and inconsistent axiom sets may lead
to segfaults or other runtime misbehaviour.

.. _source-plugins:

Source plugins
~~~~~~~~~~~~~~

In addition to core and type checker plugins, you can install plugins that can
access different representations of the source code. The main purpose of these
plugins is to make it easier to implement development tools.

There are several different access points that you can use for defining plugins
that access the representations. All these fields receive the list of
``CommandLineOption`` strings that are passed to the compiler using the
:ghc-flag:`-fplugin-opt=⟨module⟩:⟨args⟩` flags.

::

    plugin :: Plugin
    plugin = defaultPlugin {
        parsedResultAction = parsed
      , typeCheckResultAction = typechecked
      , spliceRunAction = spliceRun
      , interfaceLoadAction = interfaceLoad
      , renamedResultAction = renamed
      }

Parsed representation
^^^^^^^^^^^^^^^^^^^^^

When you want to define a plugin that uses the syntax tree of the source code,
you would like to override the ``parsedResultAction`` field. This access point
enables you to get access to information about the lexical tokens and comments
in the source code as well as the original syntax tree of the compiled module.

::

    parsed :: [CommandLineOption] -> ModSummary -> HsParsedModule
                -> Hsc HsParsedModule

The ``ModSummary`` contains useful
meta-information about the compiled module. The ``HsParsedModule`` contains the
lexical and syntactical information we mentioned before. The result that you
return will change the result of the parsing. If you don't want to change the
result, just return the ``HsParsedModule`` that you received as the argument.

Type checked representation
^^^^^^^^^^^^^^^^^^^^^^^^^^^

When you want to define a plugin that needs semantic information about the
source code, use the ``typeCheckResultAction`` field. For example, if your
plugin have to decide if two names are referencing the same definition or it has
to check the type of a function it is using semantic information. In this case
you need to access the renamed or type checked version of the syntax tree with
``typeCheckResultAction`` or ``renamedResultAction``.

::

    typechecked :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
    renamed :: [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)

By overriding the ``renamedResultAction`` field we can modify each ``HsGroup``
after it has been renamed. A source file is separated into groups depending on
the location of template haskell splices so the contents of these groups may
not be intuitive. In order to save the entire renamed AST for inspection
at the end of typechecking you can set ``renamedResultAction`` to ``keepRenamedSource``
which is provided by the ``Plugins`` module.
This is important because some parts of the renamed
syntax tree (for example, imports) are not found in the typechecked one.

Evaluated code
^^^^^^^^^^^^^^

When the compiler type checks the source code, :ref:`template-haskell` Splices
and :ref:`th-quasiquotation` will be replaced by the syntax tree fragments
generated from them. However for tools that operate on the source code the
code generator is usually more interesting than the generated code. For this
reason we included ``spliceRunAction``. This field is invoked on each expression
before they are evaluated. The input is type checked, so semantic information is
available for these syntax tree fragments. If you return a different expression
you can change the code that is generated.

::

    spliceRun :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc)

However take care that the generated definitions are still in the input of
``typeCheckResultAction``. If your don't take care to filter the typechecked
input, the behavior of your tool might be inconsistent.

Interface files
^^^^^^^^^^^^^^^

Sometimes when you are writing a tool, knowing the source code is not enough,
you also have to know details about the modules that you import. In this case we
suggest using the ``interfaceLoadAction``. This will be called each time when
the code of an already compiled module is loaded. It will be invoked for modules
from installed packages and even modules that are installed with GHC. It will
NOT be invoked with your own modules.

::

    interfaceLoad :: forall lcl . [CommandLineOption] -> ModIface
                                    -> IfM lcl ModIface

In the ``ModIface`` datatype you can find lots of useful information, including
the exported definitions and type class instances.

Source plugin example
^^^^^^^^^^^^^^^^^^^^^

In this example, we inspect all available details of the compiled source code.
We don't change any of the representation, but write out the details to the
standard output. The pretty printed representation of the parsed, renamed and
type checked syntax tree will be in the output as well as the evaluated splices
and quasi quotes. The name of the interfaces that are loaded will also be
displayed.

::

    module SourcePlugin where

    import Control.Monad.IO.Class
    import DynFlags (getDynFlags)
    import Plugins
    import HscTypes
    import TcRnTypes
    import GHC.Hs.Extension
    import GHC.Hs.Decls
    import GHC.Hs.Expr
    import GHC.Hs.ImpExp
    import Avail
    import Outputable
    import GHC.Hs.Doc

    plugin :: Plugin
    plugin = defaultPlugin
      { parsedResultAction = parsedPlugin
      , renamedResultAction = renamedAction
      , typeCheckResultAction = typecheckPlugin
      , spliceRunAction = metaPlugin
      , interfaceLoadAction = interfaceLoadPlugin
      }

    parsedPlugin :: [CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule
    parsedPlugin _ _ pm
      = do dflags <- getDynFlags
           liftIO $ putStrLn $ "parsePlugin: \n" ++ (showSDoc dflags $ ppr $ hpm_module pm)
           return pm

    renamedAction :: [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
    renamedAction _ tc gr = do
      dflags <- getDynFlags
      liftIO $ putStrLn $ "typeCheckPlugin (rn): " ++ (showSDoc dflags $ ppr gr)
      return (tc, gr)

    typecheckPlugin :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
    typecheckPlugin _ _ tc
      = do dflags <- getDynFlags
           liftIO $ putStrLn $ "typeCheckPlugin (rn): \n" ++ (showSDoc dflags $ ppr $ tcg_rn_decls tc)
           liftIO $ putStrLn $ "typeCheckPlugin (tc): \n" ++ (showSDoc dflags $ ppr $ tcg_binds tc)
           return tc

    metaPlugin :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc)
    metaPlugin _ meta
      = do dflags <- getDynFlags
           liftIO $ putStrLn $ "meta: " ++ (showSDoc dflags $ ppr meta)
           return meta

    interfaceLoadPlugin :: [CommandLineOption] -> ModIface -> IfM lcl ModIface
    interfaceLoadPlugin _ iface
      = do dflags <- getDynFlags
           liftIO $ putStrLn $ "interface loaded: " ++ (showSDoc dflags $ ppr $ mi_module iface)
           return iface

When you compile a simple module that contains Template Haskell splice

::

    {-# OPTIONS_GHC -fplugin SourcePlugin #-}
    {-# LANGUAGE TemplateHaskell #-}
    module A where

    a = ()

$(return [])

with the compiler flags ``-fplugin SourcePlugin`` it will give the following
output:

.. code-block:: none

    parsePlugin:
    module A where
    a = ()
    $(return [])
    interface loaded: Prelude
    interface loaded: GHC.Float
    interface loaded: GHC.Base
    interface loaded: Language.Haskell.TH.Lib.Internal
    interface loaded: Language.Haskell.TH.Syntax
    interface loaded: GHC.Types
    meta: return []
    interface loaded: GHC.Integer.Type
    typeCheckPlugin (rn):
    Just a = ()
    typeCheckPlugin (tc):
    {$trModule = Module (TrNameS "main"#) (TrNameS "A"#), a = ()}

.. _hole-fit-plugins:

Hole fit plugins
~~~~~~~~~~~~~~~~

Hole-fit plugins are plugins that are called when a typed-hole error message is
being generated, and allows you to access information about the typed-hole at
compile time, and allows you to customize valid hole fit suggestions.

Using hole-fit plugins, you can extend the behavior of valid hole fit
suggestions to use e.g. Hoogle or other external tools to find and/or synthesize
valid hole fits, with the same information about the typed-hole that GHC uses.

There are two access points are bundled together for defining hole fit plugins,
namely a candidate plugin and a fit plugin, for modifying the candidates to be
checked and fits respectively.

::

    type CandPlugin = TypedHole -> [HoleFitCandidate] -> TcM [HoleFitCandidate]

    type FitPlugin =  TypedHole -> [HoleFit] -> TcM [HoleFit]

    data HoleFitPlugin = HoleFitPlugin
      { candPlugin :: CandPlugin
         -- ^ A plugin for modifying hole fit candidates before they're checked
      , fitPlugin :: FitPlugin
         -- ^ A plugin for modifying valid hole fits after they've been found.
      }

Where ``TypedHole`` contains all the information about the hole available to GHC
at error generation.

::

    data TypedHole = TyH { tyHRelevantCts :: Cts
                          -- ^ Any relevant Cts to the hole
                        , tyHImplics :: [Implication]
                          -- ^ The nested implications of the hole with the
                          --   innermost implication first.
                        , tyHCt :: Maybe Ct
                          -- ^ The hole constraint itself, if available.
                        }

``HoleFitPlugins`` are then defined as follows

::

    plugin :: Plugin
    plugin = defaultPlugin {
        holeFitPlugin = (fmap . fmap) fromPureHFPlugin hfPlugin
      }

    hfPlugin :: [CommandLineOption] -> Maybe HoleFitPlugin

Where ``fromPureHFPlugin :: HoleFitPlugin -> HoleFitPluginR`` is a convencience
function provided in the ``TcHoleErrors`` module, for defining plugins that do
not require internal state.

Stateful hole fit plugins
^^^^^^^^^^^^^^^^^^^^^^^^^

``HoleFitPlugins`` are wrapped in a ``HoleFitPluginR``, which provides a
``TcRef`` for the plugin to use to track internal state, and to facilitate
communication between the candidate and fit plugin.

::

    -- | HoleFitPluginR adds a TcRef to hole fit plugins so that plugins can
    -- track internal state. Note the existential quantification, ensuring that
    -- the state cannot be modified from outside the plugin.
    data HoleFitPluginR = forall s. HoleFitPluginR
      { hfPluginInit :: TcM (TcRef s)
        -- ^ Initializes the TcRef to be passed to the plugin
      , hfPluginRun :: TcRef s -> HoleFitPlugin
        -- ^ The function defining the plugin itself
      , hfPluginStop :: TcRef s -> TcM ()
        -- ^ Cleanup of state, guaranteed to be called even on error
      }

The plugin is then defined as by providing a value for the ``holeFitPlugin``
field, a function that takes the ``CommandLineOption`` strings that are passed
to the compiler using the :ghc-flag:`-fplugin-opt=⟨module⟩:⟨args⟩` flags and returns a
``HoleFitPluginR``. This function can be used to pass the ``CommandLineOption``
strings along to the candidate and fit plugins respectively.

Hole fit plugin example
^^^^^^^^^^^^^^^^^^^^^^^

The following plugins allows users to limit the search for valid hole fits to
certain modules, to sort the hole fits by where they originated (in ascending or
descending order), as well as allowing users to put a limit on how much time is
spent on searching for valid hole fits, after which new searches are aborted.

::

    {-# LANGUAGE TypeApplications, RecordWildCards #-}
    module HolePlugin where

    import GhcPlugins hiding ((<>))

    import TcHoleErrors

    import Data.List (stripPrefix, sortOn)

    import TcRnTypes

    import TcRnMonad

    import Data.Time (UTCTime, NominalDiffTime)
    import qualified Data.Time as Time

    import Text.Read

    data HolePluginState = HPS { timeAlloted :: Maybe NominalDiffTime
                              , elapsedTime :: NominalDiffTime
                              , timeCurStarted :: UTCTime }

    bumpElapsed :: NominalDiffTime -> HolePluginState -> HolePluginState
    bumpElapsed ad (HPS a e t) = HPS a (e + ad) t

    setAlloted :: Maybe NominalDiffTime -> HolePluginState -> HolePluginState
    setAlloted a (HPS _ e t) = HPS a e t

    setCurStarted :: UTCTime -> HolePluginState -> HolePluginState
    setCurStarted nt (HPS a e _) = HPS a e nt

    hpStartState :: HolePluginState
    hpStartState = HPS Nothing zero undefined
      where zero = fromInteger @NominalDiffTime 0

    initPlugin :: [CommandLineOption] -> TcM (TcRef HolePluginState)
    initPlugin [msecs] = newTcRef $ hpStartState { timeAlloted = alloted }
      where
        errMsg = "Invalid amount of milliseconds given to plugin: " <> show msecs
        alloted = case readMaybe @Integer msecs of
          Just millisecs -> Just $ fromInteger @NominalDiffTime millisecs / 1000
          _ -> error errMsg
    initPlugin _ = newTcRef hpStartState

    fromModule :: HoleFitCandidate -> [String]
    fromModule (GreHFCand gre) =
      map (moduleNameString . importSpecModule) $ gre_imp gre
    fromModule _ = []

    toHoleFitCommand :: TypedHole -> String -> Maybe String
    toHoleFitCommand TyH{tyHCt = Just (CHoleCan _ h)} str
        = stripPrefix ("_" <> str) $ occNameString $ holeOcc h
    toHoleFitCommand _ _ = Nothing

    -- | This candidate plugin filters the candidates by module,
    -- using the name of the hole as module to search in
    modFilterTimeoutP :: [CommandLineOption] -> TcRef HolePluginState -> CandPlugin
    modFilterTimeoutP _ ref hole cands = do
      curTime <- liftIO Time.getCurrentTime
      HPS {..} <- readTcRef ref
      updTcRef ref (setCurStarted curTime)
      return $ case timeAlloted of
        -- If we're out of time we remove all the candidates. Then nothing is checked.
        Just sofar | elapsedTime > sofar -> []
        _ -> case toHoleFitCommand hole "only_" of

              Just modName -> filter (inScopeVia modName) cands
              _ -> cands
      where inScopeVia modNameStr cand@(GreHFCand _) =
              elem (toModName modNameStr) $ fromModule cand
            inScopeVia _ _ = False
            toModName = replace '_' '.'
            replace :: Eq a => a -> a -> [a] -> [a]
            replace _ _ [] = []
            replace a b (x:xs) = (if x == a then b else x):replace a b xs

    modSortP :: [CommandLineOption] -> TcRef HolePluginState -> FitPlugin
    modSortP _ ref hole hfs = do
      curTime <- liftIO Time.getCurrentTime
      HPS {..} <- readTcRef ref
      updTcRef ref $ bumpElapsed (Time.diffUTCTime curTime timeCurStarted)
      return $ case timeAlloted of
        -- If we're out of time, remove any candidates, so nothing is checked.
        Just sofar | elapsedTime > sofar -> [RawHoleFit $ text msg]
        _ -> case toHoleFitCommand hole "sort_by_mod" of
                -- If only_ is on, the fits will all be from the same module.
                Just ('_':'d':'e':'s':'c':_) -> reverse hfs
                Just _ -> orderByModule hfs
                _ ->  hfs
      where orderByModule :: [HoleFit] -> [HoleFit]
            orderByModule = sortOn (fmap fromModule . mbHFCand)
            mbHFCand :: HoleFit -> Maybe HoleFitCandidate
            mbHFCand HoleFit {hfCand = c} = Just c
            mbHFCand _ = Nothing
            msg = hang (text "Error: The time ran out, and the search was aborted for this hole.")
                   7 $ text "Try again with a longer timeout."

    plugin :: Plugin
    plugin = defaultPlugin { holeFitPlugin = holeFitP, pluginRecompile = purePlugin}

    holeFitP :: [CommandLineOption] -> Maybe HoleFitPluginR
    holeFitP opts = Just (HoleFitPluginR initP pluginDef stopP)
      where initP = initPlugin opts
            stopP = const $ return ()
            pluginDef ref = HoleFitPlugin { candPlugin = modFilterTimeoutP opts ref
                                          , fitPlugin  = modSortP opts ref }

When you then compile a module containing the following

::

    {-# OPTIONS -fplugin=HolePlugin
                -fplugin-opt=HolePlugin:600
                -funclutter-valid-hole-fits #-}
    module Main where

    import Prelude hiding (head, last)

    import Data.List (head, last)

    f, g, h, i, j :: [Int] -> Int
    f = _too_long
    j = _
    i = _sort_by_mod_desc
    g = _only_Data_List
    h = _only_Prelude

    main :: IO ()
    main = return ()

The output is as follows:

.. code-block:: none

    Main.hs:12:5: error:
        • Found hole: _too_long :: [Int] -> Int
          Or perhaps '_too_long' is mis-spelled, or not in scope
        • In the expression: _too_long
          In an equation for 'f': f = _too_long
        • Relevant bindings include
            f :: [Int] -> Int (bound at Main.hs:12:1)
          Valid hole fits include
            Error: The time ran out, and the search was aborted for this hole.
                   Try again with a longer timeout.
      |
    12 | f = _too_long
      |     ^^^^^^^^^

    Main.hs:13:5: error:
        • Found hole: _ :: [Int] -> Int
        • In the expression: _
          In an equation for 'j': j = _
        • Relevant bindings include
            j :: [Int] -> Int (bound at Main.hs:13:1)
          Valid hole fits include
            j :: [Int] -> Int
            f :: [Int] -> Int
            g :: [Int] -> Int
            h :: [Int] -> Int
            i :: [Int] -> Int
            head :: forall a. [a] -> a
            (Some hole fits suppressed; use -fmax-valid-hole-fits=N or -fno-max-valid-hole-fits)
      |
    13 | j = _
      |     ^

    Main.hs:14:5: error:
        • Found hole: _sort_by_mod_desc :: [Int] -> Int
          Or perhaps '_sort_by_mod_desc' is mis-spelled, or not in scope
        • In the expression: _sort_by_mod_desc
          In an equation for 'i': i = _sort_by_mod_desc
        • Relevant bindings include
            i :: [Int] -> Int (bound at Main.hs:14:1)
          Valid hole fits include
            sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
            product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
            minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
            maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
            length :: forall (t :: * -> *) a. Foldable t => t a -> Int
            last :: forall a. [a] -> a
            (Some hole fits suppressed; use -fmax-valid-hole-fits=N or -fno-max-valid-hole-fits)
      |
    14 | i = _sort_by_mod_desc
      |     ^^^^^^^^^^^^^^^^^

    Main.hs:15:5: error:
        • Found hole: _only_Data_List :: [Int] -> Int
          Or perhaps '_only_Data_List' is mis-spelled, or not in scope
        • In the expression: _only_Data_List
          In an equation for 'g': g = _only_Data_List
        • Relevant bindings include
            g :: [Int] -> Int (bound at Main.hs:15:1)
          Valid hole fits include
            head :: forall a. [a] -> a
            last :: forall a. [a] -> a
      |
    15 | g = _only_Data_List
      |     ^^^^^^^^^^^^^^^

    Main.hs:16:5: error:
        • Found hole: _only_Prelude :: [Int] -> Int
          Or perhaps '_only_Prelude' is mis-spelled, or not in scope
        • In the expression: _only_Prelude
          In an equation for 'h': h = _only_Prelude
        • Relevant bindings include
            h :: [Int] -> Int (bound at Main.hs:16:1)
          Valid hole fits include
            length :: forall (t :: * -> *) a. Foldable t => t a -> Int
            maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
            minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
            product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
            sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
      |
    16 | h = _only_Prelude
      |     ^^^^^^^^^^^^^

.. _plugin_recompilation:

Controlling Recompilation
~~~~~~~~~~~~~~~~~~~~~~~~~

By default, modules compiled with plugins are always recompiled even if the source file is
unchanged. This most conservative option is taken due to the ability of plugins
to perform arbitrary IO actions. In order to control the recompilation behaviour
you can modify the ``pluginRecompile`` field in ``Plugin``. ::

    plugin :: Plugin
    plugin = defaultPlugin {
      installCoreToDos = install,
      pluginRecompile = purePlugin
      }

By inspecting the example ``plugin`` defined above, we can see that it is pure. This
means that if the two modules have the same fingerprint then the plugin
will always return the same result. Declaring a plugin as pure means that
the plugin will never cause a module to be recompiled.

In general, the ``pluginRecompile`` field has the following type::

    pluginRecompile :: [CommandLineOption] -> IO PluginRecompile

The ``PluginRecompile`` data type is an enumeration determining how the plugin
should affect recompilation. ::

    data PluginRecompile = ForceRecompile | NoForceRecompile | MaybeRecompile Fingerprint

A plugin which declares itself impure using ``ForceRecompile`` will always
trigger a recompilation of the current module. ``NoForceRecompile`` is used
for "pure" plugins which don't need to be rerun unless a module would ordinarily
be recompiled. ``MaybeRecompile`` computes a ``Fingerprint`` and if this ``Fingerprint``
is different to a previously computed ``Fingerprint`` for the plugin, then
we recompile the module.

As such, ``purePlugin`` is defined as a function which always returns ``NoForceRecompile``. ::

  purePlugin :: [CommandLineOption] -> IO PluginRecompile
  purePlugin _ = return NoForceRecompile

Users can use the same functions that GHC uses internally to compute fingerprints.
The `GHC.Fingerprint
<https://hackage.haskell.org/package/base-4.10.1.0/docs/GHC-Fingerprint.html>`_ module provides useful functions for constructing fingerprints. For example, combining
together ``fingerprintFingerprints`` and ``fingerprintString`` provides an easy to
to naively fingerprint the arguments to a plugin. ::

    pluginFlagRecompile :: [CommandLineOption] -> IO PluginRecompile
    pluginFlagRecompile =
      return . MaybeRecompile . fingerprintFingerprints . map fingerprintString . sort

``defaultPlugin`` defines ``pluginRecompile`` to be ``impurePlugin`` which
is the most conservative and backwards compatible option. ::

    impurePlugin :: [CommandLineOption] -> IO PluginRecompile
    impurePlugin _ = return ForceRecompile

.. _frontend_plugins:

Frontend plugins
~~~~~~~~~~~~~~~~

A frontend plugin allows you to add new major modes to GHC.  You may prefer
this over a traditional program which calls the GHC API, as GHC manages a lot
of parsing flags and administrative nonsense which can be difficult to
manage manually.  To load a frontend plugin exported by ``Foo.FrontendPlugin``,
we just invoke GHC with the :ghc-flag:`--frontend ⟨module⟩` flag as follows:

.. code-block:: none

    $ ghc --frontend Foo.FrontendPlugin ...other options...

Frontend plugins, like compiler plugins, are exported by registered plugins.
However, unlike compiler modules, frontend plugins are modules that export
at least a single identifier ``frontendPlugin`` of type
``GhcPlugins.FrontendPlugin``.

``FrontendPlugin`` exports a field ``frontend``, which is a function
``[String] -> [(String, Maybe Phase)] -> Ghc ()``.  The first argument
is a list of extra flags passed to the frontend with ``-ffrontend-opt``;
the second argument is the list of arguments, usually source files
and module names to be compiled (the ``Phase`` indicates if an ``-x``
flag was set), and a frontend simply executes some operation in the
``Ghc`` monad (which, among other things, has a ``Session``).

As a quick example, here is a frontend plugin that prints the arguments that
were passed to it, and then exits.

::

    module DoNothing.FrontendPlugin (frontendPlugin) where
    import GhcPlugins

    frontendPlugin :: FrontendPlugin
    frontendPlugin = defaultFrontendPlugin {
      frontend = doNothing
      }

    doNothing :: [String] -> [(String, Maybe Phase)] -> Ghc ()
    doNothing flags args = do
        liftIO $ print flags
        liftIO $ print args

Provided you have compiled this plugin and registered it in a package,
you can just use it by specifying ``--frontend DoNothing.FrontendPlugin``
on the command line to GHC.

.. _dynflags_plugins:

DynFlags plugins
~~~~~~~~~~~~~~~~

A DynFlags plugin allows you to modify the ``DynFlags`` that GHC
is going to use when processing a given (set of) file(s).
``DynFlags`` is a record containing all sorts of configuration
and command line data, from verbosity level to the integer library
to use, including compiler hooks, plugins and pretty-printing options.
DynFlags plugins allow plugin authors to update any of those values
before GHC starts doing any actual work, effectively meaning that
the updates specified by the plugin will be taken into account and
influence GHC's behaviour.

One of the motivating examples was the ability to register
compiler hooks from a plugin. For example, one might want to modify
the way Template Haskell code is executed. This is achievable by
updating the ``hooks`` field of the ``DynFlags`` type, recording
our custom "meta hook" in the right place. A simple application of
this idea can be seen below:

::

    module DynFlagsPlugin (plugin) where

    import BasicTypes
    import GhcPlugins
    import GHC.Hs.Expr
    import GHC.Hs.Extension
    import GHC.Hs.Lit
    import Hooks
    import TcRnMonad

    plugin :: Plugin
    plugin = defaultPlugin { dynflagsPlugin = hooksP }

    hooksP :: [CommandLineOption] -> DynFlags -> IO DynFlags
    hooksP opts dflags = return $ dflags
      { hooks = (hooks dflags)
        { runMetaHook = Just (fakeRunMeta opts) }
      }

    -- This meta hook doesn't actually care running code in splices,
    -- it just replaces any expression splice with the "0"
    -- integer literal, and errors out on all other types of
    -- meta requests.
    fakeRunMeta :: [CommandLineOption] -> MetaHook TcM
    fakeRunMeta opts (MetaE r) _ = do
      liftIO . putStrLn $ "Options = " ++ show opts
      pure $ r zero

      where zero :: LHsExpr GhcPs
            zero = L noSrcSpan $ HsLit NoExtField $
              HsInt NoExtField (mkIntegralLit (0 :: Int))

    fakeRunMeta _ _ _ = error "fakeRunMeta: unimplemented"

This simple plugin takes over the execution of Template Haskell code,
replacing any expression splice it encounters by ``0`` (at type
``Int``), and errors out on any other type of splice.

Therefore, if we run GHC against the following code using the plugin
from above:

::

    {-# OPTIONS -fplugin=DynFlagsPlugin #-}
    {-# LANGUAGE TemplateHaskell #-}
    module Main where

    main :: IO ()
    main = print $( [|1|] )

This will not actually evaluate ``[|1|]``, but instead replace it
with the ``0 :: Int`` literal.

Just like the other types of plugins, you can write ``DynFlags`` plugins
that can take and make use of some options that you can then specify
using the ``-fplugin-opt`` flag. In the ``DynFlagsPlugin`` code from
above, the said options would be available in the ``opts`` argument of
``hooksP``.

Finally, since those ``DynFlags`` updates happen after the plugins are loaded,
you cannot from a ``DynFlags`` plugin register other plugins by just adding them
to the ``plugins`` field of ``DynFlags``. In order to achieve this, you would
have to load them yourself and store the result into the ``cachedPlugins``
field of ``DynFlags``.


Latest water product from Zapata, Flyride® enables you to fly and slide on the water, providing new sensations. Easy to use, it was especially designed to be accessible to all, regardless to the user's level. This product is perfect for recreational use, by one person or more, in a sport way as well as a stroll spirit.
Flyride is available for pre-order now and will begin shipping end of March, 2018. Contact your nearest dealer to reserve one now.


text:
A Magazine for Parents and Teachers of Blind Children published by
the American Action Fund for Blind Children and Adults in partnership
with the National Organization of Parents of Blind Children.
Volume 28 Number 2 Summer 2009
Deborah Kent Stein, Editor
Copyright © 2009 American Action Fund for Blind Children and Adults
www.nfb.org/nopbc � nfb@nfb.org • dkent5817@worldnet.att.net
by Deborah Kent Stein
The Way It All Began: Building a Magazine for Parents and Teachers of Blind Children
A New Model of Education for Blind and Low Vision Students
by Dr. Denise Robinson
Celebrations: A Year in the Life of My Resource Room
by Gloria Moyer
My Canadian Education Experience
by Ana Gschwend
The Blind Child and Its Development
by Kate M. Foley
Enriching Your Child's Life with Foreign-Language Braille
by Dr. Eric Vasiliauskas
What Braille Means to Me
by Lindsay Upschulte
Beginnings and Blueprints
by Mary Jo Thorpe-Hartle
Sleep Baby, Sleep
by Stephanie Kieszak-Holloway
Music to Teach By
by Amber Bobnar
The Girl at Disney World
by Kim Cunningham
Witnessing History
by Sean M. Whalen
Dating and Marriage
by Doris Willoughby
Music, Music, Music!
What We Did Last Summer
Empowerment through Knowledge: A Review of Courses for Parents of Blind Children
from Hadley School for the Blind
Welcome to the New NOPBC Board!
Braille Readers Are Leaders! Winners of the 2008-09 Contest
The 2009 Louis Braille
Bicentennial Silver Dollar
Proof Coin: $41.95
Uncirculated Coin: $33.95
Visit <www.usmint.gov> or call 1-800-USA-mint
TTY: 1-800-321-mint
About the Coin
The 2009 Louis Braille Bicentennial Silver Dollar is considered US legal tender.
Both the proof and uncirculated coins are composed of 90 percent silver and 10 percent copper. The proof coin has a mirror-like background and a frost foreground. The blanks are specially treated and the dies are highly polished to create a cameo effect.
Mintage Limit: 400,000.
Check <www.usmint.gov> for additional product and purchasing information.
The 2009 Louis Braille Bicentennial Silver Dollar commemorates the two hundredth anniversary of the birth of Louis Braille, inventor of the Braille system, which is used by the blind to read and write. Now for the first time in history, a United States coin features readable Braille and is available in both proof and uncirculated versions. Surcharges from sales of the 2009 Louis Braille Bicentennial Silver Dollar are authorized to be paid to the National Federation of the Blind to further its Braille literacy programs. For more information about the NFB's Braille literacy initiatives, please visit <www.Braille.org>.
Join the NOPBC
Subscribe to Future Reflections
For thousands of parents and friends of blind children, PARENT POWER means membership in the National Organization of Parents of Blind Children. The NOPBC is a national membership organization that provides vital support, encouragement, training, and information about blindness to members and to the broader community. As an affiliate of the National Federation of the Blind, the NOPBC is a bridge that connects families to blind role models and mentors. NOPBC is also a vehicle for expanding resources for parents, changing public attitudes about blindness, and creating greater opportunities for blind and visually impaired kids everywhere. Your NOPBC membership matters. NOPBC is a 501(c)(3) not-for-profit organization.
NOPBC Membership Application * Subscription to Future Reflections
Membership in the NOPBC includes membership-at-large in the NFB. Future Reflections is FREE and there is no requirement that you join the NOPBC to receive the magazine. If you wish to join the NOPBC and/or take advantage of the free subscription, please use the form below. (Please print)
Name(s) ______________________________________________ Date _______________
(Please include the first and last names of both parents if appropriate)
[ ] Parent(s)/caregiver [ ] Teacher [ ] Other
Address _____________________________________________________________________
City _______________________ State ___________ Zip_________ *Country ____________
E-mail ________________________________ Phone ____________________________
(Please designate if this is a home, cell, or work phone)
If you are parents, please include the following information for each blind/VI child in the family:
Name (first and last) of blind/VI child ______________________________________________
Birth date _________________ Sex: M [ ] F [ ]
Dues/donation. Enclosed is a check or money order made payable to the NOPBC:
[ ] $8 [ ] $15 [ ] $25 [ ] $50 [ ] Other $_________
NOTE: One dollar per adult is counted as dues, the balance is a charitable donation.
I wish to receive Future Reflections in (check all that apply) [ ] Regular print [ ] Tape [ ] E-mail
This is a: [ ] New subscription [ ] Change or correction:
Please print old or duplicate name and/or address as it appears on your magazine label:
[ ] I do not wish to join the NOPBC. Please send me a free subscription to Future Reflections.
Mail to NOPBC, 1800 Johnson Street, Baltimore, Maryland 21230 U.S.A.
*International Subscribers: There is no shipping and handling fee for residents of the USA, USA territories, Canada, and Mexico. Residents of all other countries are asked to pay a fee in USA currency of $20 for a one-year subscription and $55 for a three-year subscription. Send checks or money orders made payable to the National Federation of the Blind. Enclosed: $______ shipping and handling for a (check one) [ ] One-year subscription [ ] Three-year subscription

redpajama_set_name: RedPajamaCommonCrawl


text:
Herbert Croly Legal Quotes
American Author
Born: January 23, 1869, Died: May 17, 1930, at the age of 61 0
Our country was thereby saved from the consequences of its distracting individualistic conception of democracy, and its merely legal conception of nationality. It was because the followers of Jackson and Douglas did fight for it, that the Union was preserved.
- Herbert Croly , American Author
Distracting
Individualistic
Thereby

Our country was thereby saved from the consequences of its distracting individualistic conception of democracy, and its merely legal conception of nationality. It was because the followers of Jackson and Douglas did fight for it, that the Union was preserved.

Herbert Croly

[url=http://www.quotehd.com/Quotes/herbert-croly-author-our-country-was-thereby-saved-from-the-consequences-of-its][img=http://www.quotehd.com/imagequotes/authors55/tmb/herbert-croly-author-our-country-was-thereby-saved-from-the.jpg[/img][/url]
More Legal Quotes
Herbert Croly Top Quotes


Discussion in 'AV Stands, Cabinets, Seating & Furniture' started by CiaranMcNulty, Mar 5, 2013.
I have this Samsung model with the 'iconic' big-X tabletop stand. However, I want to use a Sound Bar with my TV and there is not enough room to the frot of the stand for the sound bar to fit.


The service experience and quality of the product actually says more about the club; as million dollar locker rooms shouldn't have dollar store amenities.
Body wash, shampoo and conditioner.
A fourth bottle contains shaving cream for men who shave in the shower and for women when shaving their legs.
Also available in 5 or 6 units by special order.
Another use is to mount on wall above and in between bathroom sinks for handsoap, lotion, sunscreen, mouthwash, shaving cream, after shave balm and/or hair gel.
24 ounce capacity in a variety of colors.
Safe keeping of razors in the showers.
Attaches directly to the mirror or wall.


text:
Charles Churchill
Born February, 1731
Died November 04, 1764
in Boulogne, France
from a fever
English poet and satirist. He went to school with Robert Lloyd and William Cowley at Westminister School. In 1756 he became curate of South Cadbury, but in 1761, following a divorce, he moved to London where he began his literary career. He met John Wilkes whom he joined in writing the critical periodical The North Briton, for which Wilkes was temporarily imprisoned in 1763.
He was a lifelong friend of Robert Lloyd, who, apparently, died following the news of Churchill's death. Churchill's sister was engaged to Lloyd and died soon afterwards.
Charles Churchill's poems were published, for the most part, by William Flexney. In one of them, the Ghost, Dr Johnson features prominently as Pomposo of whom the poem tells us that "He for subscribers baits his hook - and takes your cash, but where's the book?", which was an allusion to Johnson's long overdue edition of Shakespeare. Johnson on his part said about Churchill (to Boswell and Goldsmith) that "I have a better opinion of him now than I had at first, as he has shown more fertility than I expected. To be sure, he is a tree that cannot produce true fruit. He only bears crabs. But, Sir, a tree that produces a great many crabs is better than one which produces only a few crabs." 1
According to Irène Simon (writing in 1959), "Churchill's reputation has had a strange course: he was highly eulogized and attacked bitterly in his own day, and in our own he has been variously acclaimed as a forerunner of the romantic revival and praised for his neo-classical virtues."2
1. Boswell's London Journal entry July 1, 1763
2. Simon, I. (1959) "An Eighteenth-Century Satirist. Charles Churchill" in Revue belge de Philologie et d'Histoire, 37-3, pp. 645-682
Boswell had seen Churchill a few times (at Lord Eglinton's in November 1762 and at Westminister School in December 1762), but apparently was not actually introduced to him until they met at Bonnell Thornton's on May 24, 1763. Boswell was a frequent reader of The North Briton, and he admired the group of people associated with Wilkes and Churchill (i.e. Thornton, Robert Lloyd and William Cowper). Churchill and Boswell sat next to each other at a theatre performance on June 20, 1763, to Boswell's great joy ("I was vain to be seen talking with that great bard", he wrote in his journal afterwards).
Twenty years after Churchill's death, Boswell mentioned him in his Journal of a Tour to the Hebrides (1784), as on August 17, 1773, Boswell and Johnson had discussed the legal aspects of literary property and taxes:
I mentioned an argument of mine: that literary performances are not taxed. As Churchill says, 'No statesman yet has thought it worth his pains / To tax our labours, or excise our brains', and therefore they are not property. "Yet," said [Johnson], "we hang a man for stealing a horse, and horses are not taxed."
From Amazon.co.uk
The Nonsense Club: Literature and Popular Culture, 1749-64
Poetical Works
Selected Poems of Thomas Gray, Charles Churchill and William Cowper.
It is often possible to find various writings by Charles Churchill at the AbeBooks used books search engine. Among them are The Correspondence of John Wilkes and Charles Churchill and The Poetical Works of Charles Churchill.
Charles Churchill (Wikipedia)
Portraits of Charles Churchill (NPG)
Boswell's London Journal 1762-1763


One of the best parts of being a woman is the fun we get to have with makeup.
We have so many fabulous colors to apply to our nails and faces, it's ridiculous.
Some of my favorite makeup pallets include some kind of shimmer in them.
Check out the video to see how I achieved this look.
On reading this post it is really awesome. Can you tell me what is Bronze booster and natural origin bronzer?


CNC routing is an everyday part of the service that Peerless provide to clients and customers. As technology advances, precision engineering comes as standard and our new CNC Router offers excellent machining speeds alongside unrivalled precision and finishes. Our latest CNC Router is a Tekcel EXR which features a 3 x 2 metre bed and drill motor offering a maximum speed of 600mm per second. We are also able to profile parts thicker than ever before and plastic up to 40mm is now possible.
From our HQ in Thetford, Norfolk, this new machinery enables Peerless to offer increased quality standards with a much higher accuracy on tolerances and repeatability for CNC machined and profiled parts. The larger router bed offers not only the opportunity to machine larger parts but also increase productivity and economy with smaller parts – maximising the total yield per sheet.
An automatic tool changer is present without the need of manual intervention – this aids quicker processing times on multiple passes, including combining cutting and edged chamfers. There are also a selection of polishing tools to give a polished edge finish should they be required.
As well as the new CNC router, we are also able to offer a full suite of CNC Programming to turn your designs or drawing into full fledged machining plans.
For more information on our CNC machining service, call us on 0845 519 9079 or email us at hello@peerless-coatings.co.uk. Based just near the A11 at Thetford in Norfolk, our factory is the perfect position for all CNC Machining in the East of England.


Many good Catholic men have been deceived into becoming Masons. In this powerful little book, a Catholic attorney and former 32nd degree Mason, John Salza, clearly shows why joining Masonry (including the Shriners) means embracing a false religion.Having authored Masonry Unmasked for general readership, here John Salza writes specifically for Catholics, showing why the Church has always condemmed Freemasonry, and continues to condemn Freemasonry today (despite mistaken claims to the contrary.) He explains Masonic doctrines, history, rituals, oaths and curses, showing that Masonry is totally incompatible with Christianity and the Catholic Faith.He answers the questions: Who is the god of Freemasonry? How does Freemasonry view the Holy Bible? What are the self-curses of Freemasonry? Why does Freemasonry appear to be compatible with the Christian Faith? What have the Popes said about Freemasonry? Are Catholics involved in Freemasonry excommunicated? How does a Catholic exit Freemasonry?Packed with facts and very well documented, Why Catholics Cannot Be Masons is a brief but potent revelation by a man who has been there - and then returned to the One True Faith. John Salza has appeared on EWTN, and he hosts Catholic radio programs on Relevant Radio and EWTN Radio. He is the author of several apologetics books including: The Biblical Basis for Purgatory, The Mystery of Predestination, and The Biblical Basis for the Papacy.


text:
Equitable Recovery Strategies: Why public ownership and democratic control must be at the heart of Green and Integrated Public Healthcare Deals
New strategies for a post-pandemic economy – Markets and deals – Green Deals – Integrated Public Healthcare System Deals – 'Just transition' policies, jobs and quality of employment – Financing new economic policies, Green and Healthcare System deals – A new surge of privatisation – Strategic issues
• There is a need for new economic strategies combining a Green Deal and an Integrated Public Healthcare System Deal.
• Globally, renewable energy projects are primarily owned and operated by private companies and private equity funds. Public finance is mainly used to attract private investment in renewable energy projects.
• A global secondary market operates with merger and acquisition deals that include renewable energy
manufacturers, project developers, project owners and renewable energy funds which seek to increase market share.
The renewable energy sector could ultimately mirror the private ownership and control of the fossil fuel sector but it will not be under democratic control and its equality, employment and social policies are likely to be business as usual.
• Green Deals must revert the commercialisation of nature and biodiversity, which should be treated as public goods with public protection and strong regulatory frameworks.
• Retrofitting housing is very important because heating and hot water for UK homes account for 25% of total energy use and 15.3% of greenhouse gas emissions in 2018. However, it is vital to draw on the lessons of earlier failed schemes, to recognise the complexity of retrofitting 27m public and private homes and the estimated £911bn (€1,007bn) cost.
• The Covid-19 pandemic has highlighted the urgent need to integrate public health, primary care, medical care and social care to create an Integrated Public Healthcare System.
• Equality and political, economic, social and environmental justice must be the core objective of public policy planning and management.
• Government and public authorities should develop a Conversion Strategy and should consist of a
national organisation or agency to develop alternative use proposals; identify international, national and regional demand for green products and services; provide technical support or grants to trade union and community organisations; develop national training and reskilling programmes for workers; and economic development programmes for areas affected by fossil fuel closures.
• A 16-part Code of Practice for Quality Employment is for a 'just transition' and must apply to all jobs in the economy.
• The economic consequences of the Covid-19 pandemic are still unfolding with a steep fall in GDP,
soaring rate of unemployment, rising levels of public and private debt and increasing budget deficits.
• Measures to increase revenue by £81.9bn (€90.5bn) per annum or £409.5bn (€452.5bn) over a five-year period would make a significant contribution towards addressing the cost of the Covid-19 pandemic in the UK and longer-term financing of new economic policies, Green and Public Healthcare Deals.
• Recovery strategies must establish certain parameters to include: no austerity measures; no tax increases for employees up to and including the average industrial wage; no privatisation and no reinvention of public private partnerships.
• The decarbonisation target will hopefully beachieved, but unless the decommodification of public services and adoption of radical public management is undertaken at the same time a new surge of privatisation would be preceded by further financialisation and marketisation with profound consequences for services and jobs.
• Key strategic issues are identified together with examples of organising, building alliances and alternative plans.
Equitable Recovery Strategies
Published on 4th July 2020.


text:
Home Education & Scholarships NVTI COURSES AND FEES
NVTI COURSES AND FEES. January 2023
Second cycle education in Ghana has often been focused on grammar education, with only a small portion of Junior High School Graduates opting for vocational and technical training.
The body in charge of vocational and technical training in Ghana, the National Vocational Training Institute, was founded in 1967 with aid of the United Nations Development Programme Special Fund.
It was founded at the time, with the aim of assessing and meeting Ghana's manpower requirement needs in the various sectors of young and newly independent nation.
Several decades later, the institution is still standing strong and carrying out its mandate in providing training for prospective members of the vocational workforce.
In this article, we will tell you about the various courses on offer from the National Vocational Training Institute and the fees applicable for each course at any of the institute's 34 campuses scattered across the country.
NVTI Courses on Offer
Courses offered by the National Vocational Training Institute can be broadly grouped into two; there is the Apprentice Training Program (under which there is the School-Based Apprenticeship and Workshop-Based Apprenticeship) and the Training and Development Program.
Apprentice Training Program
School-Based Apprenticeship
Under this training program, candidates who are enrolled go through a 4-year certification program at the end of which they are awarded a Certificate II Certificate. Persons who are eligible to be enrolled in this program are;
applicants bearing Basic Education Certificate Examination (BECE) certificates with passes in Mathematics, General Studies and English,
Holders of Middle School Leaving Certificate
Sponsored apprentices with basic educational background
Persons with evidence of at least 2 years Secondary School or SHS education
Students enrolled in this program are expected to provide their own uniforms in accordance to the prescriptions of their various centres. Tools for practical work are also available at the facilities for loaning out.
Workshop-Based Apprenticeship
As this name implies, this part of the Training Program is carried out with heavy focus on the practical aspects of skills needed by craftsmen under training.
As a result this mostly takes place in the workshop, accounting for the name of the program. This program is handled by the Apprenticeship Department which is responsible for planning and organizing apprenticeship training for shop, floor and middle level craftsmen.
The goal of this training is to make the trainees ready for employment by industry-standard and also equip them skills for self-employment.
Training and Development Program
The second stream of courses on offer from the National Vocational Training Institute is the Training and Development Program. It is organised and run by the Training and Development Department.
This program has a wide array of courses for interested persons to choose from, which will be listed below. However, this program seems to be targeted at persons who are already in the workforce.
Most of persons included in the target group are persons who are already operating infields to which the courses are related.
Here is a list of the Training and Development courses run by the Training and Development Department;
Secretarial Proficiency
In-plant Training (Which is custom made)
Instructional Techniques Course
Instructional Techniques Course for Driver Instructors
Driver Instructor Course
Receptionist and Front Desk Officers Course
Transport Management Course
Safety and Security Course
Strategic Driving Course
Book-keeping Course
Upgrading Printing Course
Since the addition of NVTI to the Free SHS Scheme came into effect in 2021, students of NVTIs no longer have to pay school fees.
However, they may have to pay fees for their certification examinations. Find below fees for the various examinations in pictures acquired from the year 2015. They may have been subjected to some changes.
New Examination Fees 2015
Previous articleSOUTH AFRICA VISA FEES. January 2023
Next articlePAYMENT FOR NATIONAL SERVICE SCHEME 2022/2023. January 2023
5 dead from suspected food poisoning at Oyibi. January 2023
Nike sues BAPE for trademark infringement. January 2023


190°C/Fan 170°C/Gas 5 25 mins Snap the compartments in half, place the Butter Chicken on a baking tray in the centre of a pre-heated oven for 10 minutes. Peel back film lid, stir, re-cover, then add the rice compartment onto the baking tray and heat both for a further 15 minutes. Leave to stand for 2 minutes after heating. Stir well before serving.
For best results microwave heat. Remove outer sleeve and pierce film lid several times.


implement policies and guidelines in the production of learning objects including the university policy on intellectual property rights.
The center's main functions are to produce multimedia materials, monitor, and evaluate applications for and outcomes of instructional multimedia projects, ensure the accessibility of materials to students and faculty, organize training sessions on instructional technologies, maintain and upgrade equipments and facilities, and enforce policies that ensure the quality of materials. To realize its functions, ILC sponsors trainings for users who are not proficient with the necessary software. Moreover, the ILC Director accepts proposals from the faculty to develop learning objects (LOs) specially for courses with high enrollment, high attrition, high failure rate and core or appreciation courses that are best presented using interactive multimedia technology and for which no suitable learning object (foreign or local) are available.
How to contact the ILC?


You are able to count on French Door Local Experts to offer the most impressive service when it comes to French Doors in Chaumont, NY. We have a staff of experienced contractors and the most advanced solutions in the industry to give you everything that you want. We use high quality products and affordable strategies to be sure you'll get the most effective service at the greatest value. Call us by dialing 888-669-5583 to learn more.
At French Door Local Experts, absolutely nothing is more essential than customer service. You need to be satisfied with the tasks we carry out, and we are going to work to meet up with all of your preferences and objectives. We understand your concerns and questions, and we're there to help. When you call us, we will respond to all of your concerns, and we'll also resolve the concerns and questions which you didn't remember to address. We have the practical experience and information to assist you to put together the best decisions about your job.
At French Door Local Experts, we are aware that you must stay within your financial budget and spend less money wherever it's possible to. You'll still need to have professional quality work on French Doors in Chaumont, NY, and you can put your confidence in our team to save you a little money while continually supplying the best quality results. Our endeavors to conserve your funds are not going to eliminate the superior quality of our results. We work with the very best products and solutions to ensure that the work will hold up against the test of time, and we conserve your funds with methods which do not alter the excellence of any job. It will be attainable because we know the way to save you time and resources on materials and labor. Connect with French Door Local Experts when you need the highest quality services at the best cost. You'll be able to reach our business at 888-669-5583 to get started.
French Doors are available in Chaumont, NY.
If you're considering French Doors in Chaumont, NY, you'll need to be informed to come up with the best judgments. We ensure you know exactly what to expect. You won't need to encounter any surprises whenever you work with French Door Local Experts. The first step is to contact us by dialing 888-669-5583 to arrange your work. Within this call, you're going to get all your questions answered, and we will establish a time to initiate services. We will work together with you all through the entire process, and our company will show up promptly and prepared.
You have many good reasons to consider French Door Local Experts for French Doors in Chaumont, NY. Our materials are of the highest quality, our money saving solutions are helpful and powerful, and our customer satisfaction scores can't be topped. We offer the expertise that you need to satisfy all your goals and objectives. When you need French Doors in Chaumont, choose French Door Local Experts by dialing 888-669-5583, and we'll be beyond pleased to help you.


It's probably time to change my DNS registrar... I'm using dotster.com (old namezero.com) for my websites (http://alinconstantin.com / http://alinconstantin.net ), and I just discovered the sites were not forwarding anymore URLs to the dynamic DNS http://alinconstantin.dtdns.net and http://alinconstantin.homeip.net . For some reason, they decided to change the domain from 'URL forwarding' to 'Parked' which pointed to a page with spam links.
I changed that and now the root of the website redirects correctly, but folders and direct page links are still broken, they display some 'page not found' frame with the same spam links instead of redirecting to the matching folder on the dtdns.net site.
Meanwhile, if you can't access direct links to my website, use instead the dynamic DNS addresses I mentioned above.
Finally, the domain transfer is complete and the website is back up. I got my e-mail address back, yay!


Cheese ravioli create a surprising crust for this square pan pizza. They bake up crisp on the bottom, like crust, but the top is still pillowy and cheesy -- adding a new dimension to your favorite pizza toppings.
Move an oven rack to the bottom position and preheat to 425 degrees F. Bring a large pot of salted water to boil for the pasta. Brush a rimmed half-sheet pan with olive oil and coat the bottom and sides with 1/2 cup grated Parmesan.
Cook the ravioli until al dente, 1 to 2 minutes less than the package cooking time. Drain and pat dry. Toss the ravioli in a large bowl with the eggs, olive oil, 1/2 cup grated Parmesan and 1/2 teaspoon salt. Arrange the ravioli on the sheet pan in a single layer with only the edges overlapping. Sprinkle with 1/2 cup Parmesan.
Bake the ravioli until golden brown and the tops and bottoms are crisp, about 25 minutes.
Preheat the broiler. Spread the pizza sauce on the ravioli crust. Sprinkle with the mozzarella and the remaining 1/4 cup Parmesan. Top with the sausage, pepperoni, bell pepper, mushrooms, onion and ham. Broil until the cheese is browned and bubbly, about 3 minutes. Scatter the basil over the top before serving.


text:
The Tomorrow Show Full Shows
Exotic Vivian's Tips to Be an Escort + We Survived An Earthquake
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: The Tomorrow Show studio is getting a facelift! What you can expect to see in the future! —- Escort "Exotic Vivian" guests and details how we get into the "companion" business, plus guys' WILDEST requests! —- Roxy turns 23…for the 6th straight year! She opens up about struggles and silver linings of pursuing one's passions —- Earthquakes rattle LA, but are we prepared for The Big One?? —- Keven was thrown under the (non-electric) bus with Elon Musk
https://anchor.fm/s/b990fb0/podcast/play/3829026/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-6-11%2FExotic-Vivian-s-Tips-to-Be-an--6014f08fbc1d8.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-07-10 22:50:052019-07-10 23:16:00Exotic Vivian's Tips to Be an Escort + We Survived An Earthquake
Keven Attends A Wild Illuminati Party
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Keven shares secret details from the Illuminati party he attended —- We're officially on the 2019 Christmas train and we can't be more excited!!! —- Should Taylor Swift just Shake It Off regarding Scooter Braun owning her masters —- Trump is about to throw the biggest America party ever
https://anchor.fm/s/b990fb0/podcast/play/3762374/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-6-4%2FKeven-Attends-A-Wild-Illuminat-d9ac554d9a128.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-07-03 22:28:502019-07-03 22:49:32Keven Attends A Wild Illuminati Party
Hamish McLaren: Australia's Biggest Scammer & Wedding Planner Kev
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Captain Kev is back at the helm and shares his new career as a wedding planner and how he saved someone's big day during a hail storm —- Judi Dench stands up for Harvey Weinstein and Kevin Spacey's creative works —- Are we about to see a Breaking Bad reboot? —- Greg Bearup joins us to talk about Australia's greatest scammer, Hamish McLaren, who stole nearly $70 million
https://anchor.fm/s/b990fb0/podcast/play/3691602/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-5-27%2FHamish-McLaren--Australia-s-Bi-cdda4a5768f11.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-06-26 22:24:312019-06-26 22:47:04Hamish McLaren: Australia's Biggest Scammer & Wedding Planner Kev
OJ Joins Twitter, Then Cosby and Cusack Say "Hold My Beer"
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Roxy's hoarding comes back to bite her —- Twitter goes CRAZY as OJ, Bill Cosby, and John Cusack play "hold my beer" —- Avengers: Endgame is rereleased with bonus footage, but is it worth it? — Trump puts his foot into his mouth again ahead of 2020 bid —- Whoopi Goldberg and Bella Thorne feud over nudes
https://anchor.fm/s/b990fb0/podcast/play/3620928/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-5-20%2FOJ-Joins-Twitter--Then-Cosby-a-dd9b77b3c3257.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-06-19 21:10:582019-06-19 21:14:54OJ Joins Twitter, Then Cosby and Cusack Say "Hold My Beer"
Bachelorette Blues & Bieber vs. Tom Cruise
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Roxy shares wild (whipped cream filled) details about her Nantucket Bachelorette party —- Was Justin Bieber joking when he challenged Tom Cruise to a fight? —- Is it legit that an actress bought a billboard to get Tyler Perry's attention? —- Max Landis is a pile of garbage… allegedly —- Jon Stewart FTW, getting first responders what they deserve
https://anchor.fm/s/b990fb0/podcast/play/3553165/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-5-13%2FBachelorette-Blues---Bieber-vs-238afe38ac61e.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-06-12 21:49:052019-06-12 22:21:32Bachelorette Blues & Bieber vs. Tom Cruise
The 30 Year Old Virgin
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Michael officially becomes the 30-year-old virgin! How does he do it?? —- Roxy leads us in playing a birthday quiz game to measure how high you hold the big day! —- Why Tiffany Haddish secretly recorded her casting directors —- Which celebrity would you take to prom? —- The next big thing millennials are ruining!
https://anchor.fm/s/b990fb0/podcast/play/3482471/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-5-6%2FThe-30-Year-Old-Virgin-e58a7c481e4d4.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-06-05 21:15:532019-06-05 21:41:53The 30 Year Old Virgin
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Admiral Maria Menounos and WWE Superstar Sonya Deville (Daria Berenato) join the ship —- Daria explains how she was given the ring name Sonya Deville —- What are the differences between Sonya and Daria? —- Climbing Mount Everest is now riskier than ever —- What would you do if you came home and a burglar cleaned your house??
https://anchor.fm/s/b990fb0/podcast/play/3407674/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-4-30%2FSonya-Deville-ca20b7ab2705a.m4a
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-05-29 22:24:302019-05-29 22:39:09Sonya Deville
Sean "X-Pac" Waltman
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Sean "X-PAC" Waltman joins the ship to talk all things wrestling and WWE —- Sean shares who is the rising star in NXT —- Why Sean says Cathy Kelley is THE BEST female on the mic in WWE —- Do you agree with Selena Gomez that social media is "terrible?" —- A new study ranks the sexiest accents in the US!
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-05-22 23:20:192019-05-22 23:20:37Sean "X-Pac" Waltman
Mary Mouser
On Tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: Mary Mouser from YouTube's Cobra Kai joins the ship —- Mouser shares an OG Karate Kid deleted scene referenced in Cobra Kai —- Roxy makes her first appearance in Playboy! —- Keven share business tips after pitching AfterBuzz at Scaramucci's SALT conference in Vegas —- How a scary-real Snapchat filter is being used to catfish people —- Why Sonic's new look is literally the worst for Millennials
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-05-15 23:19:412019-05-15 23:19:43Mary Mouser
11 Things That Piss Us Off At Work
On tonight's episode of The NotSam Network's The Tomorrow Show with Keven Undergaro & Roxy Striar: The 11 actions of coworkers that piss us off! —- Do you wash your raw chicken before cooking it?? —- Breaking down the Kentucky Derby disaster —- If you could pick your nickname, what would it be?
http://thetomorrowshow.com/wp-content/uploads/2019/05/Icon_TTS_Podcast_2019_05_02-1.jpg 3000 3000 Tomorrow Show http://thetomorrowshow.com/wp-content/uploads/2016/05/TTS_New_Logo_2016_05_05_BW.png Tomorrow Show2019-05-08 21:53:182019-05-08 21:53:1911 Things That Piss Us Off At Work