free-compiler-0.3.0.0: A Haskell to Coq compiler.

Safe HaskellNone
LanguageHaskell2010

FreeC.Pass.ImplicitPreludePass

Description

This module contains a compiler pass that add an import declaration for the Prelude module to the imports of a module if it does not import the Prelude explicitly.

Example

If a module does not have an explicit import of the Prelude module

module Queue where

import Test.QuickCheck

type Queue a = ([a], [a])

{- ... -}

an import for the Prelude module is added to the import list

module Queue where

import Prelude
import Test.QuickCheck

type Queue a = ([a], [a])

{- ... -}

Specification

Preconditions

There are no special requirements.

Translation

If the module does not contain an import of the form import Prelude it is added to the top of the import list.

Postconditions

There is an explicit import for the Prelude module.

Synopsis

Documentation

implicitPreludePass :: Pass Module Module Source #

A compiler pass that adds an import declaration for the Prelude module if there is no such import.