diff options
Diffstat (limited to 'hypsrc-test')
-rw-r--r-- | hypsrc-test/Utils.hs | 47 | ||||
-rwxr-xr-x | hypsrc-test/accept.hs | 27 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Classes.html | 1065 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Constructors.html | 940 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Identifiers.html | 935 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Literals.html | 428 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Operators.html | 837 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Records.html | 993 | ||||
-rw-r--r-- | hypsrc-test/ref/src/Types.html | 1057 | ||||
-rwxr-xr-x | hypsrc-test/run.hs | 122 | ||||
-rw-r--r-- | hypsrc-test/src/Classes.hs | 38 | ||||
-rw-r--r-- | hypsrc-test/src/Constructors.hs | 35 | ||||
-rw-r--r-- | hypsrc-test/src/Identifiers.hs | 28 | ||||
-rw-r--r-- | hypsrc-test/src/Literals.hs | 17 | ||||
-rw-r--r-- | hypsrc-test/src/Operators.hs | 22 | ||||
-rw-r--r-- | hypsrc-test/src/Polymorphism.hs | 66 | ||||
-rw-r--r-- | hypsrc-test/src/Records.hs | 34 | ||||
-rw-r--r-- | hypsrc-test/src/Types.hs | 42 |
18 files changed, 6733 insertions, 0 deletions
diff --git a/hypsrc-test/Utils.hs b/hypsrc-test/Utils.hs new file mode 100644 index 00000000..e15fabee --- /dev/null +++ b/hypsrc-test/Utils.hs @@ -0,0 +1,47 @@ +{-# LANGUAGE CPP #-} + + +module Utils + ( baseDir, rootDir + , srcDir, refDir, outDir, refDir', outDir' + , haddockPath + , stripLocalAnchors, stripLocalLinks, stripLocalReferences + ) where + + +import Data.List + +import System.FilePath + + +baseDir, rootDir :: FilePath +baseDir = takeDirectory __FILE__ +rootDir = baseDir </> ".." + +srcDir, refDir, outDir, refDir', outDir' :: FilePath +srcDir = baseDir </> "src" +refDir = baseDir </> "ref" +outDir = baseDir </> "out" +refDir' = refDir </> "src" +outDir' = outDir </> "src" + +haddockPath :: FilePath +haddockPath = rootDir </> "dist" </> "build" </> "haddock" </> "haddock" + + +replaceBetween :: Eq a => [a] -> a -> [a] -> [a] -> [a] +replaceBetween _ _ _ [] = [] +replaceBetween pref end val html@(x:xs') = case stripPrefix pref html of + Just strip -> pref ++ val ++ (replaceBetween' . dropWhile (/= end)) strip + Nothing -> x:(replaceBetween' xs') + where + replaceBetween' = replaceBetween pref end val + +stripLocalAnchors :: String -> String +stripLocalAnchors = replaceBetween "<a name=\"local-" '\"' "0" + +stripLocalLinks :: String -> String +stripLocalLinks = replaceBetween "<a href=\"#local-" '\"' "0" + +stripLocalReferences :: String -> String +stripLocalReferences = stripLocalLinks . stripLocalAnchors diff --git a/hypsrc-test/accept.hs b/hypsrc-test/accept.hs new file mode 100755 index 00000000..4606b2df --- /dev/null +++ b/hypsrc-test/accept.hs @@ -0,0 +1,27 @@ +#!/usr/bin/env runhaskell +{-# LANGUAGE CPP #-} + + +import System.Directory +import System.FilePath +import System.Environment + +import Utils + + +main :: IO () +main = do + args <- getArgs + files <- filter isHtmlFile <$> getDirectoryContents outDir' + let files' = if args == ["--all"] || args == ["-a"] + then files + else filter ((`elem` args) . takeBaseName) files + mapM_ copy files' + where + isHtmlFile = (== ".html") . takeExtension + + +copy :: FilePath -> IO () +copy file = do + content <- stripLocalReferences <$> readFile (outDir' </> file) + writeFile (refDir' </> file) content diff --git a/hypsrc-test/ref/src/Classes.html b/hypsrc-test/ref/src/Classes.html new file mode 100644 index 00000000..74a7a427 --- /dev/null +++ b/hypsrc-test/ref/src/Classes.html @@ -0,0 +1,1065 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Classes</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-2" + ></a + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span class="hs-keyword" + >class</span + ><span + > </span + ><a name="Foo" + ><a href="Classes.html#Foo" + ><span class="hs-identifier" + >Foo</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-5" + ></a + ><span + > </span + ><a name="bar" + ><a href="Classes.html#bar" + ><span class="hs-identifier" + >bar</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-6" + ></a + ><span + > </span + ><a name="baz" + ><a href="Classes.html#baz" + ><span class="hs-identifier" + >baz</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-7" + ></a + ><span + > +</span + ><a name="line-8" + ></a + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Classes.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-9" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#bar" + ><span class="hs-identifier" + >bar</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >id</span + ><span + > +</span + ><a name="line-10" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#baz" + ><span class="hs-identifier" + >baz</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-11" + ></a + ><span + > +</span + ><a name="line-12" + ></a + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Classes.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-13" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#bar" + ><span class="hs-identifier" + >bar</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >length</span + ><span + > +</span + ><a name="line-14" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#baz" + ><span class="hs-identifier" + >baz</span + ></a + ></a + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-15" + ></a + ><span + > +</span + ><a name="line-16" + ></a + ><span + > +</span + ><a name="line-17" + ></a + ><span class="hs-keyword" + >class</span + ><span + > </span + ><a href="Classes.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=></span + ><span + > </span + ><a name="Foo%27" + ><a href="Classes.html#Foo%27" + ><span class="hs-identifier" + >Foo'</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-18" + ></a + ><span + > </span + ><a name="quux" + ><a href="Classes.html#quux" + ><span class="hs-identifier" + >quux</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > +</span + ><a name="line-19" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#quux" + ><span class="hs-identifier" + >quux</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Classes.html#norf" + ><span class="hs-identifier hs-var" + >norf</span + ></a + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-20" + ></a + ><span + > +</span + ><a name="line-21" + ></a + ><span + > </span + ><a name="norf" + ><a href="Classes.html#norf" + ><span class="hs-identifier" + >norf</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > +</span + ><a name="line-22" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#norf" + ><span class="hs-identifier" + >norf</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Classes.html#quux" + ><span class="hs-identifier hs-var" + >quux</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><a href="Classes.html#baz" + ><span class="hs-identifier hs-var" + >baz</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><span class="hs-identifier hs-var" + >sum</span + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><span class="hs-identifier hs-var" + >map</span + ><span + > </span + ><a href="Classes.html#bar" + ><span class="hs-identifier hs-var" + >bar</span + ></a + ><span + > +</span + ><a name="line-23" + ></a + ><span + > +</span + ><a name="line-24" + ></a + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Classes.html#Foo%27" + ><span class="hs-identifier hs-type" + >Foo'</span + ></a + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-25" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#norf" + ><span class="hs-identifier" + >norf</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >sum</span + ><span + > +</span + ><a name="line-26" + ></a + ><span + > +</span + ><a name="line-27" + ></a + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Classes.html#Foo%27" + ><span class="hs-identifier hs-type" + >Foo'</span + ></a + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-28" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#quux" + ><span class="hs-identifier" + >quux</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >uncurry</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-operator hs-var" + >++</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-29" + ></a + ><span + > +</span + ><a name="line-30" + ></a + ><span + > +</span + ><a name="line-31" + ></a + ><span class="hs-keyword" + >class</span + ><span + > </span + ><a name="Plugh" + ><a href="Classes.html#Plugh" + ><span class="hs-identifier" + >Plugh</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >p</span + ></a + ></a + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-32" + ></a + ><span + > </span + ><a name="plugh" + ><a href="Classes.html#plugh" + ><span class="hs-identifier" + >plugh</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >p</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >p</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >b</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >b</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >p</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >b</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >b</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-33" + ></a + ><span + > +</span + ><a name="line-34" + ></a + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Classes.html#Plugh" + ><span class="hs-identifier hs-type" + >Plugh</span + ></a + ><span + > </span + ><span class="hs-identifier hs-type" + >Either</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-35" + ></a + ><span + > </span + ><a name="local-0" + ><a href="Classes.html#plugh" + ><span class="hs-identifier" + >plugh</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier hs-var" + >Left</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >Right</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><span class="hs-identifier hs-var" + >const</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > +</span + ><a name="line-36" + ></a + ><span + > </span + ><span class="hs-identifier" + >plugh</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier hs-var" + >Right</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >Right</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><span class="hs-identifier hs-var" + >const</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > +</span + ><a name="line-37" + ></a + ><span + > </span + ><span class="hs-identifier" + >plugh</span + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier hs-var" + >Left</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >Left</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><span class="hs-identifier hs-var" + >const</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span + > +</span + ><a name="line-38" + ></a + ><span + > </span + ><span class="hs-identifier" + >plugh</span + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier hs-var" + >Right</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >Left</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><span class="hs-identifier hs-var" + >const</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span + > +</span + ><a name="line-39" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/Constructors.html b/hypsrc-test/ref/src/Constructors.html new file mode 100644 index 00000000..86a482f6 --- /dev/null +++ b/hypsrc-test/ref/src/Constructors.html @@ -0,0 +1,940 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Constructors</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-2" + ></a + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span class="hs-keyword" + >data</span + ><span + > </span + ><a name="Foo" + ><a href="Constructors.html#Foo" + ><span class="hs-identifier" + >Foo</span + ></a + ></a + ><span + > +</span + ><a name="line-5" + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="Bar" + ><a href="Constructors.html#Bar" + ><span class="hs-identifier" + >Bar</span + ></a + ></a + ><span + > +</span + ><a name="line-6" + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><a name="Baz" + ><a href="Constructors.html#Baz" + ><span class="hs-identifier" + >Baz</span + ></a + ></a + ><span + > +</span + ><a name="line-7" + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><a name="Quux" + ><a href="Constructors.html#Quux" + ><span class="hs-identifier" + >Quux</span + ></a + ></a + ><span + > </span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-8" + ></a + ><span + > +</span + ><a name="line-9" + ></a + ><span class="hs-keyword" + >newtype</span + ><span + > </span + ><a name="Norf" + ><a href="Constructors.html#Norf" + ><span class="hs-identifier" + >Norf</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="Norf" + ><a href="Constructors.html#Norf" + ><span class="hs-identifier" + >Norf</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >]</span + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-10" + ></a + ><span + > +</span + ><a name="line-11" + ></a + ><span + > +</span + ><a name="line-12" + ></a + ><span class="hs-identifier" + >bar</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >baz</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >quux</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > +</span + ><a name="line-13" + ></a + ><a name="bar" + ><a href="Constructors.html#bar" + ><span class="hs-identifier" + >bar</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Constructors.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span + > +</span + ><a name="line-14" + ></a + ><a name="baz" + ><a href="Constructors.html#baz" + ><span class="hs-identifier" + >baz</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Constructors.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span + > +</span + ><a name="line-15" + ></a + ><a name="quux" + ><a href="Constructors.html#quux" + ><span class="hs-identifier" + >quux</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Constructors.html#Quux" + ><span class="hs-identifier hs-var" + >Quux</span + ></a + ><span + > </span + ><a href="Constructors.html#quux" + ><span class="hs-identifier hs-var" + >quux</span + ></a + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-16" + ></a + ><span + > +</span + ><a name="line-17" + ></a + ><span + > +</span + ><a name="line-18" + ></a + ><span class="hs-identifier" + >unfoo</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-19" + ></a + ><a name="unfoo" + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier" + >unfoo</span + ></a + ></a + ><span + > </span + ><a href="Constructors.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-20" + ></a + ><span class="hs-identifier" + >unfoo</span + ><span + > </span + ><a href="Constructors.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-21" + ></a + ><span class="hs-identifier" + >unfoo</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Quux" + ><span class="hs-identifier hs-var" + >Quux</span + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >foo</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >n</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >42</span + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >n</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier hs-var" + >unfoo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >foo</span + ></a + ><span + > +</span + ><a name="line-22" + ></a + ><span + > +</span + ><a name="line-23" + ></a + ><span + > +</span + ><a name="line-24" + ></a + ><span class="hs-identifier" + >unnorf</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Constructors.html#Norf" + ><span class="hs-identifier hs-type" + >Norf</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="Constructors.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-25" + ></a + ><a name="unnorf" + ><a href="Constructors.html#unnorf" + ><span class="hs-identifier" + >unnorf</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Norf" + ><span class="hs-identifier hs-var" + >Norf</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >xs</span + ></a + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Constructors.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >xs</span + ></a + ><span + > +</span + ><a name="line-26" + ></a + ><span class="hs-identifier" + >unnorf</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Norf" + ><span class="hs-identifier hs-var" + >Norf</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >xs</span + ></a + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Constructors.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >reverse</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >xs</span + ></a + ><span + > +</span + ><a name="line-27" + ></a + ><span class="hs-identifier" + >unnorf</span + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >undefined</span + ><span + > +</span + ><a name="line-28" + ></a + ><span + > +</span + ><a name="line-29" + ></a + ><span + > +</span + ><a name="line-30" + ></a + ><span class="hs-identifier" + >unnorf'</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Constructors.html#Norf" + ><span class="hs-identifier hs-type" + >Norf</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-31" + ></a + ><a name="unnorf%27" + ><a href="Constructors.html#unnorf%27" + ><span class="hs-identifier" + >unnorf'</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span class="hs-glyph" + >@</span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Norf" + ><span class="hs-identifier hs-var" + >Norf</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >f1</span + ></a + ></a + ><span class="hs-glyph" + >@</span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Quux" + ><span class="hs-identifier hs-var" + >Quux</span + ></a + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >n</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span class="hs-special" + >,</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >f2</span + ></a + ></a + ><span class="hs-glyph" + >@</span + ><span class="hs-special" + >(</span + ><a href="Constructors.html#Quux" + ><span class="hs-identifier hs-var" + >Quux</span + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >f3</span + ></a + ></a + ><span + > </span + ><span class="hs-identifier" + >_</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > +</span + ><a name="line-32" + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x'</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >n</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier hs-var" + >unfoo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >f1</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >aux</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >f3</span + ></a + ><span + > +</span + ><a name="line-33" + ></a + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-34" + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >aux</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >fx</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier hs-var" + >unfoo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >f2</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier hs-var" + >unfoo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >fx</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier hs-var" + >unfoo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >f3</span + ></a + ><span + > +</span + ><a name="line-35" + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x'</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >sum</span + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><span class="hs-identifier hs-var" + >map</span + ><span + > </span + ><a href="Constructors.html#unfoo" + ><span class="hs-identifier hs-var" + >unfoo</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><a href="Constructors.html#unnorf" + ><span class="hs-identifier hs-var" + >unnorf</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > +</span + ><a name="line-36" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/Identifiers.html b/hypsrc-test/ref/src/Identifiers.html new file mode 100644 index 00000000..7680b3ef --- /dev/null +++ b/hypsrc-test/ref/src/Identifiers.html @@ -0,0 +1,935 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Identifiers</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-2" + ></a + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span class="hs-identifier" + >foo</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >bar</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >baz</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-5" + ></a + ><a name="foo" + ><a href="Identifiers.html#foo" + ><span class="hs-identifier" + >foo</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="Identifiers.html#bar" + ><span class="hs-identifier hs-var" + >bar</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > +</span + ><a name="line-6" + ></a + ><a name="bar" + ><a href="Identifiers.html#bar" + ><span class="hs-identifier" + >bar</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-</span + ><span + > </span + ><a href="Identifiers.html#baz" + ><span class="hs-identifier hs-var" + >baz</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > +</span + ><a name="line-7" + ></a + ><a name="baz" + ><a href="Identifiers.html#baz" + ><span class="hs-identifier" + >baz</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > +</span + ><a name="line-8" + ></a + ><span + > +</span + ><a name="line-9" + ></a + ><span class="hs-identifier" + >quux</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-10" + ></a + ><a name="quux" + ><a href="Identifiers.html#quux" + ><span class="hs-identifier" + >quux</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Identifiers.html#foo" + ><span class="hs-identifier hs-var" + >foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Identifiers.html#bar" + ><span class="hs-identifier hs-var" + >bar</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Identifiers.html#bar" + ><span class="hs-identifier hs-var" + >bar</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-11" + ></a + ><span + > +</span + ><a name="line-12" + ></a + ><span class="hs-identifier" + >norf</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-13" + ></a + ><a name="norf" + ><a href="Identifiers.html#norf" + ><span class="hs-identifier" + >norf</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >z</span + ></a + ></a + ><span + > +</span + ><a name="line-14" + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + ><</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Identifiers.html#quux" + ><span class="hs-identifier hs-var" + >quux</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > +</span + ><a name="line-15" + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + ><</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Identifiers.html#quux" + ><span class="hs-identifier hs-var" + >quux</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > +</span + ><a name="line-16" + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >z</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + ><</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Identifiers.html#quux" + ><span class="hs-identifier hs-var" + >quux</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >z</span + ></a + ><span + > +</span + ><a name="line-17" + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><span class="hs-identifier hs-var" + >otherwise</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Identifiers.html#norf" + ><span class="hs-identifier hs-var" + >norf</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-glyph" + >-</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-glyph" + >-</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-glyph" + >-</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >z</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-18" + ></a + ><span + > +</span + ><a name="line-19" + ></a + ><span + > +</span + ><a name="line-20" + ></a + ><span class="hs-identifier" + >main</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >IO</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-21" + ></a + ><a name="main" + ><a href="Identifiers.html#main" + ><span class="hs-identifier" + >main</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-keyword" + >do</span + ><span + > +</span + ><a name="line-22" + ></a + ><span + > </span + ><span class="hs-identifier hs-var" + >putStrLn</span + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><span class="hs-identifier hs-var" + >show</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><a href="Identifiers.html#foo" + ><span class="hs-identifier hs-var" + >foo</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > +</span + ><a name="line-23" + ></a + ><span + > </span + ><span class="hs-identifier hs-var" + >putStrLn</span + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><span class="hs-identifier hs-var" + >show</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><a href="Identifiers.html#quux" + ><span class="hs-identifier hs-var" + >quux</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >z</span + ></a + ><span + > +</span + ><a name="line-24" + ></a + ><span + > </span + ><span class="hs-identifier hs-var" + >putStrLn</span + ><span + > </span + ><span class="hs-operator hs-var" + >.</span + ><span + > </span + ><span class="hs-identifier hs-var" + >show</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><a href="Identifiers.html#norf" + ><span class="hs-identifier hs-var" + >Identifiers</span + ><span class="hs-operator hs-var" + >.</span + ><span class="hs-identifier hs-var" + >norf</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >z</span + ></a + ><span + > +</span + ><a name="line-25" + ></a + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-26" + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >10</span + ><span + > +</span + ><a name="line-27" + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >20</span + ><span + > +</span + ><a name="line-28" + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >z</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >30</span + ><span + > +</span + ><a name="line-29" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/Literals.html b/hypsrc-test/ref/src/Literals.html new file mode 100644 index 00000000..a009a502 --- /dev/null +++ b/hypsrc-test/ref/src/Literals.html @@ -0,0 +1,428 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Literals</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-2" + ></a + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span class="hs-identifier" + >str</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >String</span + ><span + > +</span + ><a name="line-5" + ></a + ><a name="str" + ><a href="Literals.html#str" + ><span class="hs-identifier" + >str</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-string" + >"str literal"</span + ><span + > +</span + ><a name="line-6" + ></a + ><span + > +</span + ><a name="line-7" + ></a + ><span class="hs-identifier" + >num</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Num</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > +</span + ><a name="line-8" + ></a + ><a name="num" + ><a href="Literals.html#num" + ><span class="hs-identifier" + >num</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><span class="hs-number" + >1</span + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><span class="hs-number" + >1010011</span + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><span class="hs-number" + >41231</span + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><span class="hs-number" + >12131</span + ><span + > +</span + ><a name="line-9" + ></a + ><span + > +</span + ><a name="line-10" + ></a + ><span class="hs-identifier" + >frac</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Fractional</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > +</span + ><a name="line-11" + ></a + ><a name="frac" + ><a href="Literals.html#frac" + ><span class="hs-identifier" + >frac</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >42.0000001</span + ><span + > +</span + ><a name="line-12" + ></a + ><span + > +</span + ><a name="line-13" + ></a + ><span class="hs-identifier" + >list</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-14" + ></a + ><a name="list" + ><a href="Literals.html#list" + ><span class="hs-identifier" + >list</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-15" + ></a + ><span + > +</span + ><a name="line-16" + ></a + ><span class="hs-identifier" + >pair</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-17" + ></a + ><a name="pair" + ><a href="Literals.html#pair" + ><span class="hs-identifier" + >pair</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-18" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/Operators.html b/hypsrc-test/ref/src/Operators.html new file mode 100644 index 00000000..fe690db2 --- /dev/null +++ b/hypsrc-test/ref/src/Operators.html @@ -0,0 +1,837 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Operators</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-2" + ></a + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >+++</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-5" + ></a + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="%2B%2B%2B" + ><a href="Operators.html#%2B%2B%2B" + ><span class="hs-operator" + >+++</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >++</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >++</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > +</span + ><a name="line-6" + ></a + ><span + > +</span + ><a name="line-7" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >$$$</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-8" + ></a + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="%24%24%24" + ><a href="Operators.html#%24%24%24" + ><span class="hs-operator" + >$$$</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span + > </span + ><a href="Operators.html#%2B%2B%2B" + ><span class="hs-operator hs-var" + >+++</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > +</span + ><a name="line-9" + ></a + ><span + > +</span + ><a name="line-10" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >***</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-11" + ></a + ><span class="hs-special" + >(</span + ><a name="%2A%2A%2A" + ><a href="Operators.html#%2A%2A%2A" + ><span class="hs-operator" + >***</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > +</span + ><a name="line-12" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >***</span + ><span class="hs-special" + >)</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier" + >_</span + ><span class="hs-glyph" + >:</span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > </span + ><a href="Operators.html#%2B%2B%2B" + ><span class="hs-operator hs-var" + >+++</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > </span + ><a href="Operators.html#%2A%2A%2A" + ><span class="hs-operator hs-var" + >***</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-13" + ></a + ><span + > +</span + ><a name="line-14" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >*/\*</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-15" + ></a + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="%2A%2F%5C%2A" + ><a href="Operators.html#%2A%2F%5C%2A" + ><span class="hs-operator" + >*/\*</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >concatMap</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Operators.html#%2A%2A%2A" + ><span class="hs-operator hs-var" + >***</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > +</span + ><a name="line-16" + ></a + ><span + > +</span + ><a name="line-17" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >**/\**</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >]</span + ><span class="hs-special" + >]</span + ><span + > +</span + ><a name="line-18" + ></a + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="%2A%2A%2F%5C%2A%2A" + ><a href="Operators.html#%2A%2A%2F%5C%2A%2A" + ><span class="hs-operator" + >**/\**</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >zipWith</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Operators.html#%2A%2F%5C%2A" + ><span class="hs-operator hs-var" + >*/\*</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >[</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > </span + ><a href="Operators.html#%2B%2B%2B" + ><span class="hs-operator hs-var" + >+++</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span class="hs-special" + >]</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span + > </span + ><a href="Operators.html#%24%24%24" + ><span class="hs-operator hs-var" + >$$$</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-19" + ></a + ><span + > +</span + ><a name="line-20" + ></a + ><span + > +</span + ><a name="line-21" + ></a + ><span class="hs-special" + >(</span + ><span class="hs-operator" + >#.#</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >b</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >c</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >a</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-type" + >b</span + ></a + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-22" + ></a + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="%23.%23" + ><a href="Operators.html#%23.%23" + ><span class="hs-operator" + >#.#</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-identifier hs-var" + >const</span + ><span + > </span + ><span class="hs-operator hs-var" + >$</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >a</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >b</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-23" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/Records.html b/hypsrc-test/ref/src/Records.html new file mode 100644 index 00000000..eb4e0fbb --- /dev/null +++ b/hypsrc-test/ref/src/Records.html @@ -0,0 +1,993 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE NamedFieldPuns #-}</span + ><span + > +</span + ><a name="line-2" + ></a + ><span class="hs-pragma" + >{-# LANGUAGE RecordWildCards #-}</span + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span + > +</span + ><a name="line-5" + ></a + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Records</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-6" + ></a + ><span + > +</span + ><a name="line-7" + ></a + ><span + > +</span + ><a name="line-8" + ></a + ><span class="hs-keyword" + >data</span + ><span + > </span + ><a name="Point" + ><a href="Records.html#Point" + ><span class="hs-identifier" + >Point</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="Point" + ><a href="Records.html#Point" + ><span class="hs-identifier" + >Point</span + ></a + ></a + ><span + > +</span + ><a name="line-9" + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a name="x" + ><a href="Records.html#x" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-glyph" + >!</span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-10" + ></a + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><a name="y" + ><a href="Records.html#y" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-glyph" + >!</span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-11" + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span + > +</span + ><a name="line-12" + ></a + ><span + > +</span + ><a name="line-13" + ></a + ><span + > +</span + ><a name="line-14" + ></a + ><span class="hs-identifier" + >point</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > +</span + ><a name="line-15" + ></a + ><a name="point" + ><a href="Records.html#point" + ><span class="hs-identifier" + >point</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-var" + >Point</span + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a href="Records.html#x" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Records.html#y" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span + > +</span + ><a name="line-16" + ></a + ><span + > +</span + ><a name="line-17" + ></a + ><span + > +</span + ><a name="line-18" + ></a + ><span class="hs-identifier" + >lengthSqr</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-19" + ></a + ><a name="lengthSqr" + ><a href="Records.html#lengthSqr" + ><span class="hs-identifier" + >lengthSqr</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-var" + >Point</span + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a href="Records.html#x" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Records.html#y" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > +</span + ><a name="line-20" + ></a + ><span + > +</span + ><a name="line-21" + ></a + ><span class="hs-identifier" + >lengthSqr'</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-22" + ></a + ><a name="lengthSqr%27" + ><a href="Records.html#lengthSqr%27" + ><span class="hs-identifier" + >lengthSqr'</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-var" + >Point</span + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a href="Records.html#x" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Records.html#y" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >*</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > +</span + ><a name="line-23" + ></a + ><span + > +</span + ><a name="line-24" + ></a + ><span + > +</span + ><a name="line-25" + ></a + ><span class="hs-identifier" + >translateX</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >translateY</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > +</span + ><a name="line-26" + ></a + ><a name="translateX" + ><a href="Records.html#translateX" + ><span class="hs-identifier" + >translateX</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >p</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >d</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >p</span + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a href="Records.html#x" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Records.html#x" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >p</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >d</span + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span + > +</span + ><a name="line-27" + ></a + ><a name="translateY" + ><a href="Records.html#translateY" + ><span class="hs-identifier" + >translateY</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >p</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >d</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >p</span + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a href="Records.html#y" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="Records.html#y" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >p</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >d</span + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span + > +</span + ><a name="line-28" + ></a + ><span + > +</span + ><a name="line-29" + ></a + ><span class="hs-identifier" + >translate</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-type" + >Point</span + ></a + ><span + > +</span + ><a name="line-30" + ></a + ><a name="translate" + ><a href="Records.html#translate" + ><span class="hs-identifier" + >translate</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >x</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >y</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >p</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > +</span + ><a name="line-31" + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >aux</span + ></a + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >p</span + ></a + ><span + > +</span + ><a name="line-32" + ></a + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-33" + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >dx</span + ></a + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >dy</span + ></a + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-34" + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >aux</span + ></a + ></a + ><span + > </span + ><a href="Records.html#Point" + ><span class="hs-identifier hs-var" + >Point</span + ></a + ><span class="hs-special" + >{</span + ><span class="hs-glyph" + >..</span + ><span class="hs-special" + >}</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >p</span + ></a + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><a href="Records.html#x" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >x</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >dx</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Records.html#y" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >y</span + ></a + ><span + > </span + ><span class="hs-operator hs-var" + >+</span + ><span + > </span + ><a href="#local-0" + ><span class="hs-identifier hs-var" + >dy</span + ></a + ><span + > </span + ><span class="hs-special" + >}</span + ><span + > +</span + ><a name="line-35" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/Types.html b/hypsrc-test/ref/src/Types.html new file mode 100644 index 00000000..d59f61f8 --- /dev/null +++ b/hypsrc-test/ref/src/Types.html @@ -0,0 +1,1057 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE TypeFamilies #-}</span + ><span + > +</span + ><a name="line-2" + ></a + ><span + > +</span + ><a name="line-3" + ></a + ><span + > +</span + ><a name="line-4" + ></a + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Types</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><a name="line-5" + ></a + ><span + > +</span + ><a name="line-6" + ></a + ><span + > +</span + ><a name="line-7" + ></a + ><span class="hs-keyword" + >data</span + ><span + > </span + ><a name="Quux" + ><a href="Types.html#Quux" + ><span class="hs-identifier" + >Quux</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="Bar" + ><a href="Types.html#Bar" + ><span class="hs-identifier" + >Bar</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >|</span + ><span + > </span + ><a name="Baz" + ><a href="Types.html#Baz" + ><span class="hs-identifier" + >Baz</span + ></a + ></a + ><span + > +</span + ><a name="line-8" + ></a + ><span + > +</span + ><a name="line-9" + ></a + ><span class="hs-keyword" + >newtype</span + ><span + > </span + ><a name="Foo" + ><a href="Types.html#Foo" + ><span class="hs-identifier" + >Foo</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="Foo" + ><a href="Types.html#Foo" + ><span class="hs-identifier" + >Foo</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-10" + ></a + ><span + > +</span + ><a name="line-11" + ></a + ><span class="hs-keyword" + >type</span + ><span + > </span + ><a name="FooQuux" + ><a href="Types.html#FooQuux" + ><span class="hs-identifier" + >FooQuux</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-12" + ></a + ><span class="hs-keyword" + >type</span + ><span + > </span + ><a name="QuuxFoo" + ><a href="Types.html#QuuxFoo" + ><span class="hs-identifier" + >QuuxFoo</span + ></a + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-13" + ></a + ><span + > +</span + ><a name="line-14" + ></a + ><span + > +</span + ><a name="line-15" + ></a + ><span class="hs-keyword" + >data</span + ><span + > </span + ><span class="hs-keyword" + >family</span + ><span + > </span + ><a name="Norf" + ><a href="Types.html#Norf" + ><span class="hs-identifier" + >Norf</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > +</span + ><a name="line-16" + ></a + ><span + > +</span + ><a name="line-17" + ></a + ><span class="hs-keyword" + >data</span + ><span + > </span + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Types.html#Norf" + ><span class="hs-identifier hs-type" + >Norf</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="NFQ" + ><a href="Types.html#NFQ" + ><span class="hs-identifier" + >NFQ</span + ></a + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > +</span + ><a name="line-18" + ></a + ><span class="hs-keyword" + >data</span + ><span + > </span + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Types.html#Norf" + ><span class="hs-identifier hs-type" + >Norf</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><a name="NQF" + ><a href="Types.html#NQF" + ><span class="hs-identifier" + >NQF</span + ></a + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > +</span + ><a name="line-19" + ></a + ><span + > +</span + ><a name="line-20" + ></a + ><span + > +</span + ><a name="line-21" + ></a + ><span class="hs-keyword" + >type</span + ><span + > </span + ><span class="hs-keyword" + >family</span + ><span + > </span + ><a name="Norf%27" + ><a href="Types.html#Norf%27" + ><span class="hs-identifier" + >Norf'</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >a</span + ></a + ></a + ><span + > </span + ><a name="local-0" + ><a href="#local-0" + ><span class="hs-identifier" + >b</span + ></a + ></a + ><span + > +</span + ><a name="line-22" + ></a + ><span + > +</span + ><a name="line-23" + ></a + ><span class="hs-keyword" + >type</span + ><span + > </span + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Types.html#Norf%27" + ><span class="hs-identifier hs-type" + >Norf'</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-24" + ></a + ><span class="hs-keyword" + >type</span + ><span + > </span + ><span class="hs-keyword" + >instance</span + ><span + > </span + ><a href="Types.html#Norf%27" + ><span class="hs-identifier hs-type" + >Norf'</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span class="hs-special" + >)</span + ><span + > +</span + ><a name="line-25" + ></a + ><span + > +</span + ><a name="line-26" + ></a + ><span + > +</span + ><a name="line-27" + ></a + ><span class="hs-identifier" + >norf1</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Types.html#Norf" + ><span class="hs-identifier hs-type" + >Norf</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-28" + ></a + ><a name="norf1" + ><a href="Types.html#norf1" + ><span class="hs-identifier" + >norf1</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#NFQ" + ><span class="hs-identifier hs-var" + >NFQ</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><a href="Types.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-29" + ></a + ><span class="hs-identifier" + >norf1</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#NFQ" + ><span class="hs-identifier hs-var" + >NFQ</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><a href="Types.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >1</span + ><span + > +</span + ><a name="line-30" + ></a + ><span + > +</span + ><a name="line-31" + ></a + ><span class="hs-identifier" + >norf2</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Types.html#Norf" + ><span class="hs-identifier hs-type" + >Norf</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-32" + ></a + ><a name="norf2" + ><a href="Types.html#norf2" + ><span class="hs-identifier" + >norf2</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#NQF" + ><span class="hs-identifier hs-var" + >NQF</span + ></a + ><span + > </span + ><a href="Types.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-33" + ></a + ><span class="hs-identifier" + >norf2</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#NQF" + ><span class="hs-identifier hs-var" + >NQF</span + ></a + ><span + > </span + ><a href="Types.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >1</span + ><span + > +</span + ><a name="line-34" + ></a + ><span + > +</span + ><a name="line-35" + ></a + ><span + > +</span + ><a name="line-36" + ></a + ><span class="hs-identifier" + >norf1'</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Types.html#Norf%27" + ><span class="hs-identifier hs-type" + >Norf'</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-37" + ></a + ><a name="norf1%27" + ><a href="Types.html#norf1%27" + ><span class="hs-identifier" + >norf1'</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-38" + ></a + ><span class="hs-identifier" + >norf1'</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >1</span + ><span + > +</span + ><a name="line-39" + ></a + ><span + > +</span + ><a name="line-40" + ></a + ><span class="hs-identifier" + >norf2'</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><a href="Types.html#Norf%27" + ><span class="hs-identifier hs-type" + >Norf'</span + ></a + ><span + > </span + ><a href="Types.html#Quux" + ><span class="hs-identifier hs-type" + >Quux</span + ></a + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-type" + >Foo</span + ></a + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-identifier hs-type" + >Int</span + ><span + > +</span + ><a name="line-41" + ></a + ><a name="norf2%27" + ><a href="Types.html#norf2%27" + ><span class="hs-identifier" + >norf2'</span + ></a + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Bar" + ><span class="hs-identifier hs-var" + >Bar</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >0</span + ><span + > +</span + ><a name="line-42" + ></a + ><span class="hs-identifier" + >norf2'</span + ><span + > </span + ><span class="hs-special" + >(</span + ><a href="Types.html#Baz" + ><span class="hs-identifier hs-var" + >Baz</span + ></a + ><span class="hs-special" + >,</span + ><span + > </span + ><a href="Types.html#Foo" + ><span class="hs-identifier hs-var" + >Foo</span + ></a + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-special" + >)</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-number" + >1</span + ><span + > +</span + ><a name="line-43" + ></a + ></pre + ></body + ></html +> diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs new file mode 100755 index 00000000..853c4f09 --- /dev/null +++ b/hypsrc-test/run.hs @@ -0,0 +1,122 @@ +#!/usr/bin/env runhaskell +{-# LANGUAGE CPP #-} + + +import Control.Monad + +import Data.List +import Data.Maybe + +import System.Directory +import System.Environment +import System.Exit +import System.FilePath +import System.Process + +import Distribution.Verbosity +import Distribution.Simple.Utils hiding (die) + +import Utils + + +main :: IO () +main = do + haddockAvailable <- doesFileExist haddockPath + unless haddockAvailable $ die "Haddock exectuable not available" + + (args, mods) <- partition ("-" `isPrefixOf`) <$> getArgs + let args' = filter (\arg -> not $ arg == "--all" || arg == "-a") args + mods' <- map (srcDir </>) <$> case args of + [] -> getAllSrcModules + _ -> return $ map (++ ".hs") mods + + putHaddockVersion + putGhcVersion + + putStrLn "Running tests..." + runHaddock $ + [ "--odir=" ++ outDir + , "--no-warnings" + , "--hyperlinked-source" + , "--pretty-html" + ] ++ args' ++ mods' + + forM_ mods' $ check True + + +check :: Bool -> FilePath -> IO () +check strict mdl = do + hasReference <- doesFileExist refFile + if hasReference + then do + ref <- readFile refFile + out <- readFile outFile + compareOutput strict mdl ref out + else do + putStrLn $ "Pass: " ++ mdl ++ " (no reference file)" + where + refFile = refDir' </> takeBaseName mdl ++ ".html" + outFile = outDir' </> takeBaseName mdl ++ ".html" + + +compareOutput :: Bool -> FilePath -> String -> String -> IO () +compareOutput strict mdl ref out = do + if ref' == out' + then putStrLn $ "Pass: " ++ mdl + else do + putStrLn $ "Fail: " ++ mdl + diff mdl ref' out' + when strict $ die "Aborting further tests." + where + ref' = stripLocalReferences ref + out' = stripLocalReferences out + + +diff :: FilePath -> String -> String -> IO () +diff mdl ref out = do + colorDiffPath <- findProgramLocation silent "colordiff" + let cmd = fromMaybe "diff" colorDiffPath + + writeFile refFile ref + writeFile outFile out + + result <- system $ cmd ++ " " ++ refFile ++ " " ++ outFile + unless (result == ExitSuccess) $ die "Failed to run `diff` command." + where + refFile = outDir </> takeBaseName mdl ++ ".ref.nolinks" + outFile = outDir </> takeBaseName mdl ++ ".nolinks" + + + +getAllSrcModules :: IO [FilePath] +getAllSrcModules = + filter isHaskellFile <$> getDirectoryContents srcDir + where + isHaskellFile = (== ".hs") . takeExtension + + +putHaddockVersion :: IO () +putHaddockVersion = do + putStrLn "Haddock version:" + runHaddock ["--version"] + putStrLn "" + + +putGhcVersion :: IO () +putGhcVersion = do + putStrLn "GHC version:" + runHaddock ["--ghc-version"] + putStrLn "" + + +runHaddock :: [String] -> IO () +runHaddock args = do + menv <- Just <$> getEnvironment + handle <- runProcess haddockPath args Nothing menv Nothing Nothing Nothing + waitForSuccess handle $ "Failed to invoke haddock with " ++ show args + + +waitForSuccess :: ProcessHandle -> String -> IO () +waitForSuccess handle msg = do + result <- waitForProcess handle + unless (result == ExitSuccess) $ die msg diff --git a/hypsrc-test/src/Classes.hs b/hypsrc-test/src/Classes.hs new file mode 100644 index 00000000..b3c3f785 --- /dev/null +++ b/hypsrc-test/src/Classes.hs @@ -0,0 +1,38 @@ +module Classes where + + +class Foo a where + bar :: a -> Int + baz :: Int -> (a, a) + +instance Foo Int where + bar = id + baz x = (x, x) + +instance Foo [a] where + bar = length + baz _ = ([], []) + + +class Foo a => Foo' a where + quux :: (a, a) -> a + quux (x, y) = norf [x, y] + + norf :: [a] -> a + norf = quux . baz . sum . map bar + +instance Foo' Int where + norf = sum + +instance Foo' [a] where + quux = uncurry (++) + + +class Plugh p where + plugh :: p a a -> p b b -> p (a -> b) (b -> a) + +instance Plugh Either where + plugh (Left a) _ = Right $ const a + plugh (Right a) _ = Right $ const a + plugh _ (Left b) = Left $ const b + plugh _ (Right b) = Left $ const b diff --git a/hypsrc-test/src/Constructors.hs b/hypsrc-test/src/Constructors.hs new file mode 100644 index 00000000..8cb46535 --- /dev/null +++ b/hypsrc-test/src/Constructors.hs @@ -0,0 +1,35 @@ +module Constructors where + + +data Foo + = Bar + | Baz + | Quux Foo Int + +newtype Norf = Norf (Foo, [Foo], Foo) + + +bar, baz, quux :: Foo +bar = Bar +baz = Baz +quux = Quux quux 0 + + +unfoo :: Foo -> Int +unfoo Bar = 0 +unfoo Baz = 0 +unfoo (Quux foo n) = 42 * n + unfoo foo + + +unnorf :: Norf -> [Foo] +unnorf (Norf (Bar, xs, Bar)) = xs +unnorf (Norf (Baz, xs, Baz)) = reverse xs +unnorf _ = undefined + + +unnorf' :: Norf -> Int +unnorf' x@(Norf (f1@(Quux _ n), _, f2@(Quux f3 _))) = + x' + n * unfoo f1 + aux f3 + where + aux fx = unfoo f2 * unfoo fx * unfoo f3 + x' = sum . map unfoo . unnorf $ x diff --git a/hypsrc-test/src/Identifiers.hs b/hypsrc-test/src/Identifiers.hs new file mode 100644 index 00000000..173c3ba7 --- /dev/null +++ b/hypsrc-test/src/Identifiers.hs @@ -0,0 +1,28 @@ +module Identifiers where + + +foo, bar, baz :: Int -> Int -> Int +foo x y = x + x * bar y x * y + y +bar x y = y + x - baz x y - x + y +baz x y = x * y * y * y * x + +quux :: Int -> Int +quux x = foo (bar x x) (bar x x) + +norf :: Int -> Int -> Int -> Int +norf x y z + | x < 0 = quux x + | y < 0 = quux y + | z < 0 = quux z + | otherwise = norf (-x) (-y) (-z) + + +main :: IO () +main = do + putStrLn . show $ foo x y + putStrLn . show $ quux z + putStrLn . show $ Identifiers.norf x y z + where + x = 10 + y = 20 + z = 30 diff --git a/hypsrc-test/src/Literals.hs b/hypsrc-test/src/Literals.hs new file mode 100644 index 00000000..997b6615 --- /dev/null +++ b/hypsrc-test/src/Literals.hs @@ -0,0 +1,17 @@ +module Literals where + + +str :: String +str = "str literal" + +num :: Num a => a +num = 0 + 1 + 1010011 * 41231 + 12131 + +frac :: Fractional a => a +frac = 42.0000001 + +list :: [[[[a]]]] +list = [[], [[]], [[[]]]] + +pair :: ((), ((), (), ()), ()) +pair = ((), ((), (), ()), ()) diff --git a/hypsrc-test/src/Operators.hs b/hypsrc-test/src/Operators.hs new file mode 100644 index 00000000..8e86ab0b --- /dev/null +++ b/hypsrc-test/src/Operators.hs @@ -0,0 +1,22 @@ +module Operators where + + +(+++) :: [a] -> [a] -> [a] +a +++ b = a ++ b ++ a + +($$$) :: [a] -> [a] -> [a] +a $$$ b = b +++ a + +(***) :: [a] -> [a] -> [a] +(***) a [] = a +(***) a (_:b) = a +++ (a *** b) + +(*/\*) :: [[a]] -> [a] -> [a] +a */\* b = concatMap (*** b) a + +(**/\**) :: [[a]] -> [[a]] -> [[a]] +a **/\** b = zipWith (*/\*) [a +++ b] (a $$$ b) + + +(#.#) :: a -> b -> (c -> (a, b)) +a #.# b = const $ (a, b) diff --git a/hypsrc-test/src/Polymorphism.hs b/hypsrc-test/src/Polymorphism.hs new file mode 100644 index 00000000..a74ac492 --- /dev/null +++ b/hypsrc-test/src/Polymorphism.hs @@ -0,0 +1,66 @@ +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + + +module Polymorphism where + + +foo :: a -> a -> a +foo = undefined + +foo' :: forall a. a -> a -> a +foo' = undefined + +bar :: a -> b -> (a, b) +bar = undefined + +bar' :: forall a b. a -> b -> (a, b) +bar' = undefined + +baz :: a -> (a -> [a -> a] -> b) -> b +baz = undefined + +baz' :: forall a b. a -> (a -> [a -> a] -> b) -> b +baz' = undefined + +quux :: a -> (forall a. a -> a) -> a +quux = undefined + +quux' :: forall a. a -> (forall a. a -> a) -> a +quux' = undefined + + +num :: Num a => a -> a -> a +num = undefined + +num' :: forall a. Num a => a -> a -> a +num' = undefined + +eq :: (Eq a, Eq b) => [a] -> [b] -> (a, b) +eq = undefined + +eq' :: forall a b. (Eq a, Eq b) => [a] -> [b] -> (a, b) +eq' = undefined + +mon :: Monad m => (a -> m a) -> m a +mon = undefined + +mon' :: forall m a. Monad m => (a -> m a) -> m a +mon' = undefined + + +norf :: a -> (forall a. Ord a => a -> a) -> a +norf = undefined + +norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a +norf' = undefined + + +plugh :: forall a. a -> a +plugh x = x :: a + +thud :: forall a b. (a -> b) -> a -> (a, b) +thud f x = + (x :: a, y) :: (a, b) + where + y = (f :: a -> b) x :: b diff --git a/hypsrc-test/src/Records.hs b/hypsrc-test/src/Records.hs new file mode 100644 index 00000000..40a01121 --- /dev/null +++ b/hypsrc-test/src/Records.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RecordWildCards #-} + + +module Records where + + +data Point = Point + { x :: !Int + , y :: !Int + } + + +point :: Int -> Int -> Point +point x y = Point { x = x, y = y } + + +lengthSqr :: Point -> Int +lengthSqr (Point { x = x, y = y }) = x * x + y * y + +lengthSqr' :: Point -> Int +lengthSqr' (Point { x, y }) = y * y + x * x + + +translateX, translateY :: Point -> Int -> Point +translateX p d = p { x = x p + d } +translateY p d = p { y = y p + d } + +translate :: Int -> Int -> Point -> Point +translate x y p = + aux p + where + (dx, dy) = (x, y) + aux Point{..} = p { x = x + dx, y = y + dy } diff --git a/hypsrc-test/src/Types.hs b/hypsrc-test/src/Types.hs new file mode 100644 index 00000000..b63a825b --- /dev/null +++ b/hypsrc-test/src/Types.hs @@ -0,0 +1,42 @@ +{-# LANGUAGE TypeFamilies #-} + + +module Types where + + +data Quux = Bar | Baz + +newtype Foo = Foo () + +type FooQuux = (Foo, Quux) +type QuuxFoo = (Quux, Foo) + + +data family Norf a b + +data instance Norf Foo Quux = NFQ Foo Quux +data instance Norf Quux Foo = NQF Quux Foo + + +type family Norf' a b + +type instance Norf' Foo Quux = (Foo, Quux) +type instance Norf' Quux Foo = (Quux, Foo) + + +norf1 :: Norf Foo Quux -> Int +norf1 (NFQ (Foo ()) Bar) = 0 +norf1 (NFQ (Foo ()) Baz) = 1 + +norf2 :: Norf Quux Foo -> Int +norf2 (NQF Bar (Foo ())) = 0 +norf2 (NQF Baz (Foo ())) = 1 + + +norf1' :: Norf' Foo Quux -> Int +norf1' (Foo (), Bar) = 0 +norf1' (Foo (), Baz) = 1 + +norf2' :: Norf' Quux Foo -> Int +norf2' (Bar, Foo ()) = 0 +norf2' (Baz, Foo ()) = 1 |