Skip to content
This repository was archived by the owner on Nov 12, 2017. It is now read-only.
This repository was archived by the owner on Nov 12, 2017. It is now read-only.

Preprocessor imports Text.Interpol unqualified #3

@Deewiant

Description

@Deewiant

The preprocessor should import qualified Text.Interpol to avoid conflicts with other (^-^) operators. The following code results in "ambiguous occurrence" errors:

{-# OPTIONS_GHC -F -pgmF interpol #-}

module Bug where

(^-^) :: String -> Int -> String
(^-^) s n = s ++ "hello {n}"

As an aside, I think you should just add the import every time. The strstr "^-^" (prettyPrint m) check in the preprocessor is expensive and isn't even accurate (it matches strings containing "^-^" in addition to uses of the operator). To avoid unused import warnings, you can use the form import qualified Text.Interpol ().

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions