-- test file for Haskell syntax highlighting in KDE's Kate

-- The test file for literate Haskell can be easily created like this:
--  cat highlight.hs | sed -e "s|^|> |" -e "s|> -- ||" -e "s|^> $||" > highlight.lhs
-- You only have to manually edit the multi-line comment below.

-- this is a single-line comment

{- this is a multi-line comment

Things like "a string" or a 'c' character shouldn't be highlighted in here.

-- I could even start a new
-- one-line comment.

-}

-- a data definition

data Tree a = Br (Tree a) (Tree a) | Leaf a | Nil deriving (ShowEq)


-- function definition, "funnyfunction::", "Integer", "Int", "Bool" should be highlighted

funnyfunction::(Tree a)=>[a]->Integer->Int->Bool


-- strings and chars
-- first line of function definitions (type declaration) should be highlighted

strangefunction::Int->String
strangefunction 1 = "hello"
strangefunction 2 = "what's up"
strangefunction 3 = (strangefunction 1++ ", " ++ (strangefunction 2)
strangefunction 4 = 'a':'b':'c':'"':[] -- will return "abc"
strangefunction 5 = '\n':[]
strangefunction 6 = '\invalidhaskell':[]

-- function name including the single quote character
-- and infix operator (`div`)

justtesting'::Int->Int
justtesting' 2 = 2+1
justtesting' 9 = 7 `div` 2

-- same definition as above, slightly different function name and a couple more whitespaces

justtesting''   ::   Int -> Int
justtesting''   2 = 3
justtesting''   9   =   3 + 9 - 9

-- the following lines are copied out of Haskell's "Prelude.hs"

infixl 7  */`quot``rem``div``mod`:%%


-- everything highlighted except the "a"

class Bounded a where
    minBound, maxBound :: a

class (Num a, Ord a) => Real a where
    toRational     :: a -> Rational

-- finally, some keyword lists

-- keywords

caseclassdataderivingdoelseifininfixlinfixrinstanceletmoduleofprimitive,
thentype, where

-- infix operators

quotremdivmodelemnotElem, seq

-- this stuff is not handled yet

!!%&&$!$***-,./=<<==<<==>>=>>>>=^^^++||

-- functions

FilePathIOErrorabsacosacoshallandanyappendFile,
approxRationalasTypeOfasinasinhatanatan2atanhbasicIORun,
breakcatchceilingchrcompareconcatconcatMapconstcoscosh,
currycycledecodeFloatdenominatordigitToIntdivdivModdrop,
dropWhileeitherelemencodeFloatenumFromenumFromThen,
enumFromThenToenumFromToerrorevenexpexponentfailfilterflip,
floatDigitsfloatRadixfloatRangefloorfmapfoldlfoldl1foldr,
foldr1fromDoublefromEnumfromIntfromIntegerfromIntegral,
fromRationalfstgcdgetChargetContentsgetLineheadidinRange,
indexinitintToDigitinteractioErrorisAlphaisAlphaNumisAscii,
isControlisDenormalizedisDigitisHexDigitisIEEEisInfiniteisLower,
isNaNisNegativeZeroisOctDigitisPrintisSpaceisUpperiteratelast,
lcmlengthlexlexDigitslexLitCharlinesloglogBaselookupmap,
mapMmapM_maxmaxBoundmaximummaybeminminBoundminimummod,
negatenotnotElemnullnumeratoroddorordotherwisepipred,
primExitWithprintproductproperFractionputCharputStrputStrLn,
quotquotRemrangerangeSizereadreadDecreadFilereadFloat,
readHexreadIOreadIntreadListreadLitCharreadLnreadOctreadParen,
readSignedreadsreadsPrecrealToFracrecipremrepeatreplicate,
returnreverseroundscaleFloatscanlscanl1scanrscanr1seq,
sequencesequence_showshowCharshowIntshowListshowLitChar,
showParenshowSignedshowStringshowsshowsPrecsignificandsignum,
sinsinhsndspansplitAtsqrtsubtractsuccsumtailtake,
eitherelemencodeFloatenumFromenumFromThenenumFromThenTo,
enumFromToerrorevenexpexponentfailfilterflipfloatDigits,
floatRadixfloatRangefloorfmaptakeWhiletantanhthreadToIOResult,
toEnumtoInttoIntegertoLowertoRationaltoUppertruncateuncurry,
undefinedunlinesuntilunwordsunzipunzip3userErrorwords,
writeFilezipzip3zipWith, zipWith3

-- type constructors

BoolCharDoubleEitherFloatIOIntegerIntMaybeOrderingRationalRatioReadS,
ShowSString

-- classes

BoundedEnumEqFloatingFractionalFunctorIntegralIxMonadNumOrdReadRealFloat,
RealFracRealShow

-- data constructors

EQFalseGTJustLTLeftNothingRightTrue