-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72dda7c
commit 75a1dd6
Showing
31 changed files
with
1,122 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,13 @@ | ||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <xrom.xkov@gmail.com> | ||
Compatibility module for GHC types and functions. Reexports all | ||
required API to work with the GHC API. | ||
-} | ||
|
||
module Stan.Ghc.Compat | ||
( -- * Modules | ||
Module | ||
, ModuleName | ||
, moduleNameString | ||
, moduleName | ||
, moduleStableString | ||
, moduleUnitId | ||
|
||
-- * Names | ||
, Name | ||
, isExternalName | ||
, isSymOcc | ||
, nameModule | ||
, nameOccName | ||
, nameStableString | ||
, occNameString | ||
|
||
-- * Source locations | ||
, RealSrcSpan | ||
, srcSpanEndCol | ||
, srcSpanStartCol | ||
, srcSpanStartLine | ||
, srcSpanEndLine | ||
, srcSpanFile | ||
|
||
-- * Other common types (for debugging and not only) | ||
, ArgFlag (..) | ||
, AvailInfo (..) | ||
, FastString | ||
, FieldLbl (..) | ||
, IfaceTyCon (..) | ||
, IfaceTyConInfo (..) | ||
, IfaceTyConSort (..) | ||
, IfaceTyLit (..) | ||
, PromotionFlag (..) | ||
, TupleSort (..) | ||
) where | ||
|
||
import Avail (AvailInfo (..)) | ||
import BasicTypes (PromotionFlag (..), TupleSort (..)) | ||
import FastString (FastString) | ||
import FieldLabel (FieldLbl (..)) | ||
import IfaceType (IfaceTyCon (..), IfaceTyConInfo (..), IfaceTyConSort (..), IfaceTyLit (..)) | ||
import Module (Module, ModuleName, moduleName, moduleNameString, moduleStableString, moduleUnitId) | ||
import Name (Name, isExternalName, nameModule, nameOccName, nameStableString) | ||
import OccName (isSymOcc, occNameString) | ||
import SrcLoc (RealSrcSpan, srcSpanEndCol, srcSpanEndLine, srcSpanFile, srcSpanStartCol, | ||
srcSpanStartLine) | ||
import Var (ArgFlag (..)) | ||
{-# LANGUAGE CPP #-} | ||
|
||
module Stan.Ghc.Compat (module Compat) where | ||
|
||
#if __GLASGOW_HASKELL__ <= 810 | ||
import Stan.Ghc.Compat810 as Compat | ||
#elif __GLASGOW_HASKELL__ == 900 | ||
import Stan.Ghc.Compat900 as Compat | ||
#elif __GLASGOW_HASKELL__ == 902 | ||
import Stan.Ghc.Compat902 as Compat | ||
#elif __GLASGOW_HASKELL__ == 904 | ||
import Stan.Ghc.Compat902 as Compat | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{-# LANGUAGE CPP #-} | ||
|
||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <xrom.xkov@gmail.com> | ||
Compatibility module for GHC types and functions. Reexports all | ||
required API to work with the GHC API. | ||
-} | ||
|
||
module Stan.Ghc.Compat810 | ||
#if __GLASGOW_HASKELL__ <= 810 | ||
( -- * Modules | ||
Module | ||
, ModuleName | ||
, moduleNameString | ||
, moduleName | ||
, moduleStableString | ||
, moduleUnitId | ||
|
||
-- * Names | ||
, Name | ||
, isExternalName | ||
, isSymOcc | ||
, nameModule | ||
, nameOccName | ||
, nameStableString | ||
, occNameString | ||
|
||
-- * Source locations | ||
, RealSrcSpan | ||
, srcSpanEndCol | ||
, srcSpanStartCol | ||
, srcSpanStartLine | ||
, srcSpanEndLine | ||
, srcSpanFile | ||
, mkRealSrcLoc | ||
, mkRealSrcSpan | ||
|
||
-- * Other common types (for debugging and not only) | ||
, ArgFlag (..) | ||
, AvailInfo (..) | ||
, FastString | ||
, mkFastString | ||
, FieldLbl (..) | ||
, IfaceTyCon (..) | ||
, IfaceTyConInfo (..) | ||
, IfaceTyConSort (..) | ||
, IfaceTyLit (..) | ||
, PromotionFlag (..) | ||
, TupleSort (..) | ||
, showTUnitId | ||
) where | ||
|
||
import Avail (AvailInfo (..)) | ||
import BasicTypes (PromotionFlag (..), TupleSort (..)) | ||
import FastString (FastString, mkFastString) | ||
import FieldLabel (FieldLbl (..)) | ||
import IfaceType (IfaceTyCon (..), IfaceTyConInfo (..), IfaceTyConSort (..), IfaceTyLit (..)) | ||
import Module (Module, ModuleName, moduleName, moduleNameString, moduleStableString, moduleUnitId, | ||
UnitId, unitIdString) | ||
import Name (Name, isExternalName, nameModule, nameOccName, nameStableString) | ||
import OccName (isSymOcc, occNameString) | ||
import SrcLoc (RealSrcSpan, srcSpanEndCol, srcSpanEndLine, srcSpanFile, srcSpanStartCol, | ||
srcSpanStartLine, mkRealSrcLoc, mkRealSrcSpan) | ||
import Var (ArgFlag (..)) | ||
|
||
import qualified Data.Text as T | ||
|
||
showTUnitId :: UnitId -> Text | ||
showTUnitId = T.pack . unitIdString | ||
#else | ||
where | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{-# LANGUAGE CPP #-} | ||
|
||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <xrom.xkov@gmail.com> | ||
Compatibility module for GHC types and functions. Reexports all | ||
required API to work with the GHC API. | ||
-} | ||
|
||
module Stan.Ghc.Compat900 | ||
#if __GLASGOW_HASKELL__ == 900 | ||
( -- * Modules | ||
Module | ||
, ModuleName | ||
, moduleNameString | ||
, moduleName | ||
, moduleStableString | ||
, moduleUnitId | ||
|
||
-- * Names | ||
, Name | ||
, isExternalName | ||
, isSymOcc | ||
, nameModule | ||
, nameOccName | ||
, nameStableString | ||
, occNameString | ||
|
||
-- * Source locations | ||
, RealSrcSpan | ||
, srcSpanEndCol | ||
, srcSpanStartCol | ||
, srcSpanStartLine | ||
, srcSpanEndLine | ||
, srcSpanFile | ||
, mkRealSrcLoc | ||
, mkRealSrcSpan | ||
|
||
-- * Other common types (for debugging and not only) | ||
, ArgFlag (..) | ||
, AvailInfo (..) | ||
, FastString | ||
, mkFastString | ||
, FieldLbl (..) | ||
, IfaceTyCon (..) | ||
, IfaceTyConInfo (..) | ||
, IfaceTyConSort (..) | ||
, IfaceTyLit (..) | ||
, PromotionFlag (..) | ||
, TupleSort (..) | ||
, showTUnitId | ||
) where | ||
|
||
import GHC.Types.Avail (AvailInfo (..)) | ||
import GHC.Types.Basic (PromotionFlag (..), TupleSort (..)) | ||
import GHC.Data.FastString (FastString, mkFastString) | ||
import GHC.Types.FieldLabel (FieldLbl (..)) | ||
import GHC.Iface.Type (IfaceTyCon (..), IfaceTyConInfo (..), IfaceTyConSort (..), IfaceTyLit (..)) | ||
import GHC.Unit.Types (Module, moduleName) | ||
import GHC.Unit.Module (moduleStableString) | ||
import GHC.Unit (moduleUnit, toUnitId, UnitId, unitIdString) | ||
import GHC.Unit.Module.Name (ModuleName, moduleNameString) | ||
import GHC.Types.Name (Name, isExternalName, nameModule, nameOccName, nameStableString) | ||
import GHC.Types.Name.Occurrence (isSymOcc, occNameString) | ||
import GHC.Types.SrcLoc (RealSrcSpan, srcSpanEndCol, srcSpanEndLine, srcSpanFile, srcSpanStartCol, | ||
srcSpanStartLine, mkRealSrcSpan, mkRealSrcLoc) | ||
import GHC.Types.Var (ArgFlag (..)) | ||
|
||
import qualified Data.Text as T | ||
|
||
moduleUnitId :: Module -> UnitId | ||
moduleUnitId = toUnitId . moduleUnit | ||
|
||
showTUnitId :: UnitId -> Text | ||
showTUnitId = T.pack . unitIdString | ||
#else | ||
() where | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{-# LANGUAGE CPP #-} | ||
|
||
module Stan.Ghc.Compat902 | ||
#if __GLASGOW_HASKELL__ == 902 || __GLASGOW_HASKELL__ == 904 | ||
( -- * Modules | ||
Module | ||
, ModuleName | ||
, moduleNameString | ||
, moduleName | ||
, moduleStableString | ||
, moduleUnitId | ||
|
||
-- * Names | ||
, Name | ||
, isExternalName | ||
, isSymOcc | ||
, nameModule | ||
, nameOccName | ||
, nameStableString | ||
, occNameString | ||
|
||
-- * Source locations | ||
, RealSrcSpan | ||
, srcSpanEndCol | ||
, srcSpanStartCol | ||
, srcSpanStartLine | ||
, srcSpanEndLine | ||
, srcSpanFile | ||
, mkRealSrcLoc | ||
, mkRealSrcSpan | ||
|
||
-- * Other common types (for debugging and not only) | ||
, ArgFlag (..) | ||
, AvailInfo (..) | ||
, FastString | ||
, mkFastString | ||
, FieldLbl | ||
, FieldLabel (..) | ||
, IfaceTyCon (..) | ||
, IfaceTyConInfo (..) | ||
, IfaceTyConSort (..) | ||
, IfaceTyLit (..) | ||
, PromotionFlag (..) | ||
, TupleSort (..) | ||
, showTUnitId | ||
) where | ||
|
||
import GHC.Types.Avail (AvailInfo (..)) | ||
import GHC.Types.Basic (PromotionFlag (..), TupleSort (..)) | ||
import GHC.Data.FastString (FastString, mkFastString) | ||
import GHC.Types.FieldLabel (FieldLabel (..)) | ||
import GHC.Iface.Type (IfaceTyCon (..), IfaceTyConInfo (..), IfaceTyConSort (..), IfaceTyLit (..)) | ||
import GHC.Unit.Types (Module, moduleName) | ||
import GHC.Unit.Module (moduleStableString) | ||
import GHC.Unit (moduleUnit, toUnitId, UnitId, unitIdString) | ||
import GHC.Unit.Module.Name (ModuleName, moduleNameString) | ||
import GHC.Types.Name (Name, isExternalName, nameModule, nameOccName, nameStableString) | ||
import GHC.Types.Name.Occurrence (isSymOcc, occNameString) | ||
import GHC.Types.SrcLoc (RealSrcSpan, srcSpanEndCol, srcSpanEndLine, srcSpanFile, srcSpanStartCol, | ||
srcSpanStartLine, mkRealSrcSpan, mkRealSrcLoc) | ||
import GHC.Types.Var (ArgFlag (..)) | ||
|
||
import qualified Data.Text as T | ||
|
||
moduleUnitId :: Module -> UnitId | ||
moduleUnitId = toUnitId . moduleUnit | ||
|
||
showTUnitId :: UnitId -> Text | ||
showTUnitId = T.pack . unitIdString | ||
|
||
type FieldLbl = FieldLabel | ||
#else | ||
() where | ||
#endif |
Oops, something went wrong.