module Hydra.Ext.Haskell.Language where
import Hydra.All
import qualified Data.Set as S
haskellLanguage :: Language m
haskellLanguage :: forall m. Language m
haskellLanguage = forall m. LanguageName -> LanguageConstraints m -> Language m
Language (String -> LanguageName
LanguageName String
"hydra/ext/haskell") forall a b. (a -> b) -> a -> b
$ LanguageConstraints {
languageConstraintsEliminationVariants :: Set EliminationVariant
languageConstraintsEliminationVariants = forall a. Ord a => [a] -> Set a
S.fromList [EliminationVariant]
eliminationVariants,
languageConstraintsLiteralVariants :: Set LiteralVariant
languageConstraintsLiteralVariants = forall a. Ord a => [a] -> Set a
S.fromList [
LiteralVariant
LiteralVariantBoolean, LiteralVariant
LiteralVariantFloat, LiteralVariant
LiteralVariantInteger, LiteralVariant
LiteralVariantString],
languageConstraintsFloatTypes :: Set FloatType
languageConstraintsFloatTypes = forall a. Ord a => [a] -> Set a
S.fromList [
FloatType
FloatTypeFloat32,
FloatType
FloatTypeFloat64],
languageConstraintsFunctionVariants :: Set FunctionVariant
languageConstraintsFunctionVariants = forall a. Ord a => [a] -> Set a
S.fromList [FunctionVariant]
functionVariants,
languageConstraintsIntegerTypes :: Set IntegerType
languageConstraintsIntegerTypes = forall a. Ord a => [a] -> Set a
S.fromList [IntegerType
IntegerTypeBigint, IntegerType
IntegerTypeInt32],
languageConstraintsTermVariants :: Set TermVariant
languageConstraintsTermVariants = forall a. Ord a => [a] -> Set a
S.fromList [
TermVariant
TermVariantApplication,
TermVariant
TermVariantElement,
TermVariant
TermVariantFunction,
TermVariant
TermVariantList,
TermVariant
TermVariantLiteral,
TermVariant
TermVariantMap,
TermVariant
TermVariantNominal,
TermVariant
TermVariantOptional,
TermVariant
TermVariantProduct,
TermVariant
TermVariantRecord,
TermVariant
TermVariantSet,
TermVariant
TermVariantUnion,
TermVariant
TermVariantVariable],
languageConstraintsTypeVariants :: Set TypeVariant
languageConstraintsTypeVariants = forall a. Ord a => [a] -> Set a
S.fromList [
TypeVariant
TypeVariantAnnotated,
TypeVariant
TypeVariantApplication,
TypeVariant
TypeVariantElement,
TypeVariant
TypeVariantFunction,
TypeVariant
TypeVariantLambda,
TypeVariant
TypeVariantList,
TypeVariant
TypeVariantLiteral,
TypeVariant
TypeVariantMap,
TypeVariant
TypeVariantNominal,
TypeVariant
TypeVariantOptional,
TypeVariant
TypeVariantProduct,
TypeVariant
TypeVariantRecord,
TypeVariant
TypeVariantSet,
TypeVariant
TypeVariantUnion,
TypeVariant
TypeVariantVariable],
languageConstraintsTypes :: Type m -> Bool
languageConstraintsTypes = forall a b. a -> b -> a
const Bool
True }
reservedWords :: S.Set String
reservedWords :: Set String
reservedWords = forall a. Ord a => [a] -> Set a
S.fromList forall a b. (a -> b) -> a -> b
$ [String]
preludeSymbols forall a. [a] -> [a] -> [a]
++ [String]
extSymbols
where
preludeSymbols :: [String]
preludeSymbols = [
String
"Bool", String
"Bounded", String
"Char", String
"Double", String
"EQ", String
"Either", String
"Enum", String
"Eq", String
"False", String
"Float", String
"Floating", String
"Fractional",
String
"Functor", String
"GT", String
"IO", String
"Int", String
"Integer", String
"Integral", String
"Just", String
"LT", String
"Left", String
"Maybe", String
"Monad", String
"Nothing", String
"Num",
String
"Ord", String
"Ordering", String
"Rational", String
"Real", String
"RealFloat", String
"RealFrac", String
"Right", String
"String", String
"True", String
"abs", String
"acos", String
"acosh",
String
"asTypeOf", String
"asin", String
"asinh", String
"atan", String
"atan2", String
"atanh", String
"ceiling", String
"compare", String
"const", String
"cos", String
"cosh", String
"curry",
String
"decodeFloat", String
"div", String
"divMod", String
"either", String
"encodeFloat", String
"enumFrom", String
"enumFromThen", String
"enumFromThenTo",
String
"enumFromTo", String
"error", String
"even", String
"exp", String
"exponent", String
"fail", String
"flip", String
"floatDigits", String
"floatRadix", String
"floatRange",
String
"floor", String
"fmap", String
"fromEnum", String
"fromInteger", String
"fromIntegral", String
"fromRational", String
"fst", String
"gcd", String
"id", String
"isDenormalized",
String
"isIEEE", String
"isInfinite", String
"isNaN", String
"isNegativeZero", String
"lcm", String
"log", String
"logBase", String
"mapM", String
"mapM_", String
"max", String
"maxBound",
String
"maybe", String
"min", String
"minBound", String
"mod", String
"negate", String
"not", String
"odd", String
"otherwise", String
"pi", String
"pred", String
"properFraction", String
"quot",
String
"quotRem", String
"realToFrac", String
"recip", String
"rem", String
"return", String
"round", String
"scaleFloat", String
"seq", String
"sequence", String
"sequence_",
String
"significand", String
"signum", String
"sin", String
"sinh", String
"snd", String
"sqrt", String
"subtract", String
"succ", String
"tan", String
"tanh", String
"toEnum", String
"toInteger",
String
"toRational", String
"truncate", String
"uncurry", String
"undefined", String
"until"]
extSymbols :: [String]
extSymbols = [String
"Map", String
"Set"]