Aufgabe_4, Aufgabe_5, Aufgabe_6

This commit is contained in:
WickedJack99
2024-01-13 09:46:15 +01:00
parent 7dee7d0eb2
commit e5432cb30d
199 changed files with 5356 additions and 0 deletions

20
Aufgabe_6/CHANGES.txt Executable file
View File

@@ -0,0 +1,20 @@
ÄNDERUNGSHISTORIE
2023-12-11T14:08:41+01:00
Geänderte, hinzugefügte oder gelöschte Dateien:
* ./
* huffman.pdf
* code/
* code/.hlint.yaml
* code/hitchhiker.txt
* code/package.yaml
* code/stack.yaml
* code/.vscode/
* code/.vscode/settings.json
* code/exe/
* code/exe/Main.hs
* code/src/
* code/src/Auxiliaries.hs
* code/src/Huffman.hs
* code/test/
* code/test/Tests.hs

Binary file not shown.

31
Aufgabe_6/code/.hlint.yaml Executable file
View File

@@ -0,0 +1,31 @@
# HLint configuration file
# https://github.com/ndmitchell/hlint
# Ignore some builtin hints
- ignore: {name: "Avoid lambda using `infix`"}
- ignore: {name: "Avoid lambda"}
- ignore: {name: "Eta reduce"}
- ignore: {name: "Move brackets to avoid $"}
- ignore: {name: "Reduce duplication" }
- ignore: {name: "Redundant $!" }
- ignore: {name: "Redundant bracket"}
- ignore: {name: "Redundant do"}
- ignore: {name: "Redundant pure"}
- ignore: {name: "Redundant return"}
- ignore: {name: "Replace case with maybe"}
- ignore: {name: "Use $>" }
- ignore: {name: "Use <$>"}
- ignore: {name: "Use camelCase" }
- ignore: {name: "Use const"}
- ignore: {name: "Use fmap" }
- ignore: {name: "Use foldr"}
- ignore: {name: "Use guards"}
- ignore: {name: "Use if"}
- ignore: {name: "Use list comprehension"}
- ignore: {name: "Use maybe"}
- ignore: {name: "Use newtype instead of data"}
- ignore: {name: "Use notElem"}
- ignore: {name: "Use second" }
- ignore: {name: "Use section" }
- ignore: {name: "Use tuple-section"}
- ignore: {name: "Use uncurry" }

View File

@@ -0,0 +1,74 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_huffman (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/bin"
libdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
dynlibdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7"
datadir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/share/x86_64-linux-ghc-9.4.7/huffman-0.1"
libexecdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/libexec/x86_64-linux-ghc-9.4.7/huffman-0.1"
sysconfdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/etc"
getBinDir = catchIO (getEnv "huffman_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "huffman_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "huffman_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "huffman_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "huffman_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "huffman_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,183 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package huffman-0.1 */
#ifndef VERSION_huffman
#define VERSION_huffman "0.1"
#endif /* VERSION_huffman */
#ifndef MIN_VERSION_huffman
#define MIN_VERSION_huffman(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_huffman */
/* package base-4.17.2.0 */
#ifndef VERSION_base
#define VERSION_base "4.17.2.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 17 || \
(major1) == 4 && (major2) == 17 && (minor) <= 2)
#endif /* MIN_VERSION_base */
/* package binary-0.8.9.1 */
#ifndef VERSION_binary
#define VERSION_binary "0.8.9.1"
#endif /* VERSION_binary */
#ifndef MIN_VERSION_binary
#define MIN_VERSION_binary(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 8 || \
(major1) == 0 && (major2) == 8 && (minor) <= 9)
#endif /* MIN_VERSION_binary */
/* package bytestring-0.11.5.2 */
#ifndef VERSION_bytestring
#define VERSION_bytestring "0.11.5.2"
#endif /* VERSION_bytestring */
#ifndef MIN_VERSION_bytestring
#define MIN_VERSION_bytestring(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 11 || \
(major1) == 0 && (major2) == 11 && (minor) <= 5)
#endif /* MIN_VERSION_bytestring */
/* package containers-0.6.7 */
#ifndef VERSION_containers
#define VERSION_containers "0.6.7"
#endif /* VERSION_containers */
#ifndef MIN_VERSION_containers
#define MIN_VERSION_containers(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 6 || \
(major1) == 0 && (major2) == 6 && (minor) <= 7)
#endif /* MIN_VERSION_containers */
/* package filepath-1.4.2.2 */
#ifndef VERSION_filepath
#define VERSION_filepath "1.4.2.2"
#endif /* VERSION_filepath */
#ifndef MIN_VERSION_filepath
#define MIN_VERSION_filepath(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 4 || \
(major1) == 1 && (major2) == 4 && (minor) <= 2)
#endif /* MIN_VERSION_filepath */
/* tool alex-3.2.5 */
#ifndef TOOL_VERSION_alex
#define TOOL_VERSION_alex "3.2.5"
#endif /* TOOL_VERSION_alex */
#ifndef MIN_TOOL_VERSION_alex
#define MIN_TOOL_VERSION_alex(major1,major2,minor) (\
(major1) < 3 || \
(major1) == 3 && (major2) < 2 || \
(major1) == 3 && (major2) == 2 && (minor) <= 5)
#endif /* MIN_TOOL_VERSION_alex */
/* tool gcc-11 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 0 || \
(major1) == 11 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.4.7 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.4.7"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.4.7 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.4.7"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.27.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.27.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 27 || \
(major1) == 2 && (major2) == 27 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool happy-1.19.12 */
#ifndef TOOL_VERSION_happy
#define TOOL_VERSION_happy "1.19.12"
#endif /* TOOL_VERSION_happy */
#ifndef MIN_TOOL_VERSION_happy
#define MIN_TOOL_VERSION_happy(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 19 || \
(major1) == 1 && (major2) == 19 && (minor) <= 12)
#endif /* MIN_TOOL_VERSION_happy */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.8 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.8"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 8)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool hscolour-1.24 */
#ifndef TOOL_VERSION_hscolour
#define TOOL_VERSION_hscolour "1.24"
#endif /* TOOL_VERSION_hscolour */
#ifndef MIN_TOOL_VERSION_hscolour
#define MIN_TOOL_VERSION_hscolour(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 24 || \
(major1) == 1 && (major2) == 24 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hscolour */
/* tool runghc-9.4.7 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.4.7"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.38 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.38"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 38 || \
(major1) == 2 && (major2) == 38 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_PACKAGE_KEY
#define CURRENT_PACKAGE_KEY "huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
#endif /* CURRENT_packageKey */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1"
#endif /* CURRENT_PACKAGE_VERSION */

View File

@@ -0,0 +1,74 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_huffman (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/bin"
libdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-7oGsPwnMV4MIdxe92R26Zp-huffman-exe"
dynlibdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7"
datadir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/share/x86_64-linux-ghc-9.4.7/huffman-0.1"
libexecdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/libexec/x86_64-linux-ghc-9.4.7/huffman-0.1"
sysconfdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/etc"
getBinDir = catchIO (getEnv "huffman_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "huffman_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "huffman_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "huffman_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "huffman_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "huffman_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,150 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package huffman-0.1 */
#ifndef VERSION_huffman
#define VERSION_huffman "0.1"
#endif /* VERSION_huffman */
#ifndef MIN_VERSION_huffman
#define MIN_VERSION_huffman(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_huffman */
/* package base-4.17.2.0 */
#ifndef VERSION_base
#define VERSION_base "4.17.2.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 17 || \
(major1) == 4 && (major2) == 17 && (minor) <= 2)
#endif /* MIN_VERSION_base */
/* package huffman-0.1 */
#ifndef VERSION_huffman
#define VERSION_huffman "0.1"
#endif /* VERSION_huffman */
#ifndef MIN_VERSION_huffman
#define MIN_VERSION_huffman(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_huffman */
/* tool alex-3.2.5 */
#ifndef TOOL_VERSION_alex
#define TOOL_VERSION_alex "3.2.5"
#endif /* TOOL_VERSION_alex */
#ifndef MIN_TOOL_VERSION_alex
#define MIN_TOOL_VERSION_alex(major1,major2,minor) (\
(major1) < 3 || \
(major1) == 3 && (major2) < 2 || \
(major1) == 3 && (major2) == 2 && (minor) <= 5)
#endif /* MIN_TOOL_VERSION_alex */
/* tool gcc-11 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 0 || \
(major1) == 11 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.4.7 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.4.7"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.4.7 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.4.7"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.27.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.27.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 27 || \
(major1) == 2 && (major2) == 27 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool happy-1.19.12 */
#ifndef TOOL_VERSION_happy
#define TOOL_VERSION_happy "1.19.12"
#endif /* TOOL_VERSION_happy */
#ifndef MIN_TOOL_VERSION_happy
#define MIN_TOOL_VERSION_happy(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 19 || \
(major1) == 1 && (major2) == 19 && (minor) <= 12)
#endif /* MIN_TOOL_VERSION_happy */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.8 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.8"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 8)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool hscolour-1.24 */
#ifndef TOOL_VERSION_hscolour
#define TOOL_VERSION_hscolour "1.24"
#endif /* TOOL_VERSION_hscolour */
#ifndef MIN_TOOL_VERSION_hscolour
#define MIN_TOOL_VERSION_hscolour(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 24 || \
(major1) == 1 && (major2) == 24 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hscolour */
/* tool runghc-9.4.7 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.4.7"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.38 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.38"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 38 || \
(major1) == 2 && (major2) == 38 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-7oGsPwnMV4MIdxe92R26Zp-huffman-exe"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1"
#endif /* CURRENT_PACKAGE_VERSION */

View File

@@ -0,0 +1,74 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_huffman (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/bin"
libdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-7He5PbLnsBEFUTWGgrF0f-unit-tests"
dynlibdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7"
datadir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/share/x86_64-linux-ghc-9.4.7/huffman-0.1"
libexecdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/libexec/x86_64-linux-ghc-9.4.7/huffman-0.1"
sysconfdir = "/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/etc"
getBinDir = catchIO (getEnv "huffman_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "huffman_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "huffman_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "huffman_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "huffman_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "huffman_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,170 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package huffman-0.1 */
#ifndef VERSION_huffman
#define VERSION_huffman "0.1"
#endif /* VERSION_huffman */
#ifndef MIN_VERSION_huffman
#define MIN_VERSION_huffman(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_huffman */
/* package HUnit-1.6.2.0 */
#ifndef VERSION_HUnit
#define VERSION_HUnit "1.6.2.0"
#endif /* VERSION_HUnit */
#ifndef MIN_VERSION_HUnit
#define MIN_VERSION_HUnit(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 6 || \
(major1) == 1 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_VERSION_HUnit */
/* package base-4.17.2.0 */
#ifndef VERSION_base
#define VERSION_base "4.17.2.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 17 || \
(major1) == 4 && (major2) == 17 && (minor) <= 2)
#endif /* MIN_VERSION_base */
/* package containers-0.6.7 */
#ifndef VERSION_containers
#define VERSION_containers "0.6.7"
#endif /* VERSION_containers */
#ifndef MIN_VERSION_containers
#define MIN_VERSION_containers(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 6 || \
(major1) == 0 && (major2) == 6 && (minor) <= 7)
#endif /* MIN_VERSION_containers */
/* package huffman-0.1 */
#ifndef VERSION_huffman
#define VERSION_huffman "0.1"
#endif /* VERSION_huffman */
#ifndef MIN_VERSION_huffman
#define MIN_VERSION_huffman(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_huffman */
/* tool alex-3.2.5 */
#ifndef TOOL_VERSION_alex
#define TOOL_VERSION_alex "3.2.5"
#endif /* TOOL_VERSION_alex */
#ifndef MIN_TOOL_VERSION_alex
#define MIN_TOOL_VERSION_alex(major1,major2,minor) (\
(major1) < 3 || \
(major1) == 3 && (major2) < 2 || \
(major1) == 3 && (major2) == 2 && (minor) <= 5)
#endif /* MIN_TOOL_VERSION_alex */
/* tool gcc-11 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 0 || \
(major1) == 11 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.4.7 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.4.7"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.4.7 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.4.7"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.27.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.27.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 27 || \
(major1) == 2 && (major2) == 27 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool happy-1.19.12 */
#ifndef TOOL_VERSION_happy
#define TOOL_VERSION_happy "1.19.12"
#endif /* TOOL_VERSION_happy */
#ifndef MIN_TOOL_VERSION_happy
#define MIN_TOOL_VERSION_happy(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 19 || \
(major1) == 1 && (major2) == 19 && (minor) <= 12)
#endif /* MIN_TOOL_VERSION_happy */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.8 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.8"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 8)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool hscolour-1.24 */
#ifndef TOOL_VERSION_hscolour
#define TOOL_VERSION_hscolour "1.24"
#endif /* TOOL_VERSION_hscolour */
#ifndef MIN_TOOL_VERSION_hscolour
#define MIN_TOOL_VERSION_hscolour(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 24 || \
(major1) == 1 && (major2) == 24 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hscolour */
/* tool runghc-9.4.7 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.4.7"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.38 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.38"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 38 || \
(major1) == 2 && (major2) == 38 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-7He5PbLnsBEFUTWGgrF0f-unit-tests"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1"
#endif /* CURRENT_PACKAGE_VERSION */

View File

@@ -0,0 +1,36 @@
name: huffman
version: 0.1
visibility: public
id: huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
key: huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
license: BSD-3-Clause
synopsis: huffman
abi: inplace
exposed: True
exposed-modules: Auxiliaries Huffman
hidden-modules: Paths_huffman
import-dirs:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build
library-dirs:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build
library-dirs-static:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build
dynamic-library-dirs:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build
data-dir:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.
hs-libraries: HShuffman-0.1-FYSjga9JLF2kZjOZ6zeLt
depends:
base-4.17.2.0 binary-0.8.9.1 bytestring-0.11.5.2 containers-0.6.7
filepath-1.4.2.2
haddock-interfaces:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/doc/html/huffman/huffman.haddock
haddock-html:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/doc/html/huffman

View File

@@ -0,0 +1,14 @@
/home/student/.ghcup/ghc/9.4.7/lib/ghc-9.4.7/lib/x86_64-linux-ghc-9.4.7/rts-1.0.2/include/ghcversion.h:
hash: ee548d48ca5c94d7c7fab127ec07be47b01afa24d6495358aa9ff6cfc8541c81
? /home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/huffman-exe/autogen/Paths_huffman.hs
: hash: 8a456e753c1244bc62514cb60e0675fd1c93561cf1c05e7aceb12c1288b9818e
? /home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/huffman-exe/autogen/cabal_macros.h
: hash: 2f9b0927bc6eda0e1f672edabce3ffeca3f2772f9f0ab8ca374e4001e76f2f30
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/exe/Main.hs:
hash: bc321c5e6dea106198eca53ccb8e31b17746ac198c7de206483c2989e73b1fd0
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/huffman.cabal:
hash: 0f828acaf94c12587e96d013bb3f48a4c4abac1e2efe6cce31dbffe48864d1f2
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/package.yaml:
hash: e9fcddf7857388c0e51188152e25a1d446e2e46628ed45552bdc3b635472171c
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -0,0 +1,16 @@
/home/student/.ghcup/ghc/9.4.7/lib/ghc-9.4.7/lib/x86_64-linux-ghc-9.4.7/rts-1.0.2/include/ghcversion.h:
hash: ee548d48ca5c94d7c7fab127ec07be47b01afa24d6495358aa9ff6cfc8541c81
? /home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/autogen/Paths_huffman.hs
: hash: 8181da2c9859111448e558f18f8211c15a827d375fbd1d790a980cf7333f9975
? /home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/autogen/cabal_macros.h
: hash: 7a75b0f56b750cd2d8d0f5377a45d228da9ded0ce02d89ee1902fc9712840c62
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/huffman.cabal:
hash: 0f828acaf94c12587e96d013bb3f48a4c4abac1e2efe6cce31dbffe48864d1f2
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/package.yaml:
hash: e9fcddf7857388c0e51188152e25a1d446e2e46628ed45552bdc3b635472171c
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/src/Auxiliaries.hs:
hash: 5a404af397ad51d6d268ac0a318157dd9511d113c3fbfce35cc238d42974425f
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/src/Huffman.hs:
hash: 73ec1a50a698556eb56e225b69c8712a3cd2fd1406496741e1c60b1b9b85b185
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -0,0 +1,14 @@
/home/student/.ghcup/ghc/9.4.7/lib/ghc-9.4.7/lib/x86_64-linux-ghc-9.4.7/rts-1.0.2/include/ghcversion.h:
hash: ee548d48ca5c94d7c7fab127ec07be47b01afa24d6495358aa9ff6cfc8541c81
? /home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/unit-tests/autogen/Paths_huffman.hs
: hash: 0de0de783b417d7503ea205681e0ae630d9c29c741bcd02496561b575c86aea8
? /home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/unit-tests/autogen/cabal_macros.h
: hash: 959dd270a53e0bbac74b1139154d612f8e91d1560400991d552c1b6d84bd8dba
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/huffman.cabal:
hash: 0f828acaf94c12587e96d013bb3f48a4c4abac1e2efe6cce31dbffe48864d1f2
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/package.yaml:
hash: e9fcddf7857388c0e51188152e25a1d446e2e46628ed45552bdc3b635472171c
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/test/Tests.hs:
hash: 0189e9ebf9498389b73efcb50cf30fc46f21889d0185d806168aff69fa099fe1
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -0,0 +1 @@
Just used for its modification time

View File

@@ -0,0 +1 @@
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/

View File

@@ -0,0 +1 @@
Just used for its modification time

View File

@@ -0,0 +1 @@
success

View File

@@ -0,0 +1,186 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package huffman-0.1 */
#ifndef VERSION_huffman
#define VERSION_huffman "0.1"
#endif /* VERSION_huffman */
#ifndef MIN_VERSION_huffman
#define MIN_VERSION_huffman(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_huffman */
/* package base-4.17.2.0 */
#ifndef VERSION_base
#define VERSION_base "4.17.2.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 17 || \
(major1) == 4 && (major2) == 17 && (minor) <= 2)
#endif /* MIN_VERSION_base */
/* package binary-0.8.9.1 */
#ifndef VERSION_binary
#define VERSION_binary "0.8.9.1"
#endif /* VERSION_binary */
#ifndef MIN_VERSION_binary
#define MIN_VERSION_binary(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 8 || \
(major1) == 0 && (major2) == 8 && (minor) <= 9)
#endif /* MIN_VERSION_binary */
/* package bytestring-0.11.5.2 */
#ifndef VERSION_bytestring
#define VERSION_bytestring "0.11.5.2"
#endif /* VERSION_bytestring */
#ifndef MIN_VERSION_bytestring
#define MIN_VERSION_bytestring(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 11 || \
(major1) == 0 && (major2) == 11 && (minor) <= 5)
#endif /* MIN_VERSION_bytestring */
/* package containers-0.6.7 */
#ifndef VERSION_containers
#define VERSION_containers "0.6.7"
#endif /* VERSION_containers */
#ifndef MIN_VERSION_containers
#define MIN_VERSION_containers(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 6 || \
(major1) == 0 && (major2) == 6 && (minor) <= 7)
#endif /* MIN_VERSION_containers */
/* package filepath-1.4.2.2 */
#ifndef VERSION_filepath
#define VERSION_filepath "1.4.2.2"
#endif /* VERSION_filepath */
#ifndef MIN_VERSION_filepath
#define MIN_VERSION_filepath(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 4 || \
(major1) == 1 && (major2) == 4 && (minor) <= 2)
#endif /* MIN_VERSION_filepath */
/* tool alex-3.2.5 */
#ifndef TOOL_VERSION_alex
#define TOOL_VERSION_alex "3.2.5"
#endif /* TOOL_VERSION_alex */
#ifndef MIN_TOOL_VERSION_alex
#define MIN_TOOL_VERSION_alex(major1,major2,minor) (\
(major1) < 3 || \
(major1) == 3 && (major2) < 2 || \
(major1) == 3 && (major2) == 2 && (minor) <= 5)
#endif /* MIN_TOOL_VERSION_alex */
/* tool gcc-11 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 0 || \
(major1) == 11 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.4.7 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.4.7"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.4.7 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.4.7"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.27.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.27.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 27 || \
(major1) == 2 && (major2) == 27 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool happy-1.19.12 */
#ifndef TOOL_VERSION_happy
#define TOOL_VERSION_happy "1.19.12"
#endif /* TOOL_VERSION_happy */
#ifndef MIN_TOOL_VERSION_happy
#define MIN_TOOL_VERSION_happy(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 19 || \
(major1) == 1 && (major2) == 19 && (minor) <= 12)
#endif /* MIN_TOOL_VERSION_happy */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.8 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.8"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 8)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool hscolour-1.24 */
#ifndef TOOL_VERSION_hscolour
#define TOOL_VERSION_hscolour "1.24"
#endif /* TOOL_VERSION_hscolour */
#ifndef MIN_TOOL_VERSION_hscolour
#define MIN_TOOL_VERSION_hscolour(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 24 || \
(major1) == 1 && (major2) == 24 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hscolour */
/* tool runghc-9.4.7 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.4.7"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 4 || \
(major1) == 9 && (major2) == 4 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.38 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.38"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 38 || \
(major1) == 2 && (major2) == 38 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_PACKAGE_KEY
#define CURRENT_PACKAGE_KEY "huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
#endif /* CURRENT_packageKey */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1"
#endif /* CURRENT_PACKAGE_VERSION */
#undef CURRENT_PACKAGE_KEY
#undef CURRENT_COMPONENT_ID

View File

@@ -0,0 +1,36 @@
name: huffman
version: 0.1
visibility: public
id: huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
key: huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
license: BSD-3-Clause
synopsis: huffman
abi: 5af1db6672629be997b9440d7ecf09b9
exposed: True
exposed-modules: Auxiliaries Huffman
hidden-modules: Paths_huffman
import-dirs:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
library-dirs:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
library-dirs-static:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
dynamic-library-dirs:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7
data-dir:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/share/x86_64-linux-ghc-9.4.7/huffman-0.1
hs-libraries: HShuffman-0.1-FYSjga9JLF2kZjOZ6zeLt
depends:
base-4.17.2.0 binary-0.8.9.1 bytestring-0.11.5.2 containers-0.6.7
filepath-1.4.2.2
haddock-interfaces:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/doc/huffman-0.1/huffman.haddock
haddock-html:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/doc/huffman-0.1

Binary file not shown.

3
Aufgabe_6/code/.vscode/settings.json vendored Executable file
View File

@@ -0,0 +1,3 @@
{
"haskell.plugin.hlint.codeActionsOn": false
}

Binary file not shown.

6
Aufgabe_6/code/exe/Main.hs Executable file
View File

@@ -0,0 +1,6 @@
module Main where
-- import Huffman
main :: IO ()
main = pure ()

166
Aufgabe_6/code/hitchhiker.txt Executable file
View File

@@ -0,0 +1,166 @@
The house stood on a slight rise just on the edge of the village. It stood on its own and looked over a broad spread of West Country farmland. Not a remarkable house by any means it was about thirty years old, squattish, squarish, made of brick, and had four windows set in the front of a size and proportion which more or less exactly failed to please the eye.
The only person for whom the house was in any way special was Arthur Dent, and that was only because it happened to be the one he lived in. He had lived in it for about three years, ever since he had moved out of London because it made him nervous and irritable. He was about thirty as well, dark haired and never quite at ease with himself. The thing that used to worry him most was the fact that people always used to ask him what he was looking so worried about. He worked in local radio which he always used to tell his friends was a lot more interesting than they probably thought. It was, too most of his friends worked in advertising.
It hadn't properly registered with Arthur that the council wanted to knock down his house and build an bypass instead.
At eight o'clock on Thursday morning Arthur didn't feel very good. He woke up blearily, got up, wandered blearily round his room, opened a window, saw a bulldozer, found his slippers, and stomped off to the bathroom to wash.
Toothpaste on the brush so. Scrub.
Shaving mirror pointing at the ceiling. He adjusted it. For a moment it reflected a second bulldozer through the bathroom window. Properly adjusted, it reflected Arthur Dent's bristles. He shaved them off, washed, dried, and stomped off to the kitchen to find something pleasant to put in his mouth.
Kettle, plug, fridge, milk, coffee. Yawn.
The word bulldozer wandered through his mind for a moment in search of something to connect with.
The bulldozer outside the kitchen window was quite a big one.
He stared at it.
"Yellow," he thought and stomped off back to his bedroom to get dressed.
Passing the bathroom he stopped to drink a large glass of water, and another. He began to suspect that he was hung over. Why was he hung over? Had he been drinking the night before? He supposed that he must have been. He caught a glint in the shaving mirror. "Yellow," he thought and stomped on to the bedroom.
He stood and thought. The pub, he thought. Oh dear, the pub. He vaguely remembered being angry, angry about something that seemed important. He'd been telling people about it, telling people about it at great length, he rather suspected: his clearest visual recollection was of glazed looks on other people's faces. Something about a new bypass he had just found out about. It had been in the pipeline for months only no one seemed to have known about it. Ridiculous. He took a swig of water. It would sort itself out, he'd decided, no one wanted a bypass, the council didn't have a leg to stand on. It would sort itself out.
God what a terrible hangover it had earned him though. He looked at himself in the wardrobe mirror. He stuck out his tongue. "Yellow," he thought. The word yellow wandered through his mind in search of something to connect with.
Fifteen seconds later he was out of the house and lying in front of a big yellow bulldozer that was advancing up his garden path.
Mr. L Prosser was, as they say, only human. In other words he was a carbon-based life form descended from an ape. More specifically he was forty, fat and shabby and worked for the local council. Curiously enough, though he didn't know it, he was also a direct male-line descendant of Genghis Khan, though intervening generations and racial mixing had so juggled his genes that he had no discernible Mongoloid characteristics, and the only vestiges left in Mr. L Prosser of his mighty ancestry were a pronounced stoutness about the tum and a predilection for little fur hats.
He was by no means a great warrior: in fact he was a nervous worried man. Today he was particularly nervous and worried because
something had gone seriously wrong with his job which was to see that Arthur Dent's house got cleared out of the way before the day was out.
"Come off it, Mr. Dent,", he said, "you can't win you know. You can't lie in front of the bulldozer indefinitely." He tried to make his eyes blaze fiercely but they just wouldn't do it.
Arthur lay in the mud and squelched at him.
"I'm game," he said, "we'll see who rusts first."
"I'm afraid you're going to have to accept it," said Mr. Prosser gripping his fur hat and rolling it round the top of his head, "this bypass has got to be built and it's going to be built!"
"First I've heard of it," said Arthur, "why's it going to be built?"
Mr. Prosser shook his finger at him for a bit, then stopped and put it away again.
"What do you mean, why's it got to be built?" he said. "It's a bypass. You've got to build bypasses."
Bypasses are devices which allow some people to drive from point A to point B very fast whilst other people dash from point B to point A very fast. People living at point C, being a point directly in between, are often given to wonder what's so great about point A that so many people of point B are so keen to get there, and what's so great about point B that so many people of point A are so keen to get there. They often wish that people would just once and for all work out where the hell they wanted to be.
Mr. Prosser wanted to be at point D. Point D wasn't anywhere in particular, it was just any convenient point a very long way from points A, B and C. He would have a nice little cottage at point D, with axes over the door, and spend a pleasant amount of time at point E, which would be the nearest pub to point D. His wife of course wanted climbing roses, but he wanted axes. He didn't know why he just liked axes. He flushed hotly under the derisive grins of the bulldozer drivers.
He shifted his weight from foot to foot, but it was equally uncomfortable on each. Obviously somebody had been appallingly incompetent and he hoped to God it wasn't him.
Mr. Prosser said: "You were quite entitled to make any suggestions or protests at the appropriate time you know."
"Appropriate time?" hooted Arthur. "Appropriate time? The first I knew about it was when a workman arrived at my home yesterday. I asked him if he'd come to clean the windows and he said no he'd come to demolish the house. He didn't tell me straight away of course. Oh no. First he wiped a couple of windows and charged me a fiver. Then he told me."
"But Mr. Dent, the plans have been available in the local planning office for the last nine month."
"Oh yes, well as soon as I heard I went straight round to see them, yesterday afternoon. You hadn't exactly gone out of your way to call attention to them had you? I mean like actually telling anybody or anything."
"But the plans were on display..."
"On display? I eventually had to go down to the cellar to find them."
"That's the display department."
"With a torch."
"Ah, well the lights had probably gone."
"So had the stairs."
"But look, you found the notice didn't you?"
"Yes," said Arthur, "yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying Beware of the Leopard."
A cloud passed overhead. It cast a shadow over Arthur Dent as he lay propped up on his elbow in the cold mud. It cast a shadow over Arthur Dent's house. Mr. Prosser frowned at it.
"It's not as if it's a particularly nice house," he said. "I'm sorry, but I happen to like it."
"You'll like the bypass."
"Oh shut up," said Arthur Dent. "Shut up and go away, and take your bloody bypass with you. You haven't got a leg to stand on and you know it."
Mr. Prosser's mouth opened and closed a couple of times while his mind was for a moment filled with inexplicable but terribly attractive visions of Arthur Dent's house being consumed with fire and Arthur himself running screaming from the blazing ruin with at least three
hefty spears protruding from his back. Mr. Prosser was often bothered with visions like these and they made him feel very nervous. He stuttered for a moment and then pulled himself together.
"Mr. Dent," he said.
"Hello? Yes?" said Arthur.
"Some factual information for you. Have you any idea how much damage that bulldozer would suffer if I just let it roll straight over you?"
"How much?" said Arthur.
"None at all," said Mr. Prosser, and stormed nervously off wondering why his brain was filled with a thousand hairy horsemen all shouting at him.
By a curious coincidence, None at all is exactly how much suspicion the ape-descendant Arthur Dent had that one of his closest friends was not descended from an ape, but was in fact from a small planet in the vicinity of Betelgeuse and not from Guildford as he usually claimed.
Arthur Dent had never, ever suspected this.
This friend of his had first arrived on the planet some fifteen Earth years previously, and he had worked hard to blend himself into Earth society with, it must be said, some success. For instance he had spent those fifteen years pretending to be an out of work actor, which was plausible enough.
He had made one careless blunder though, because he had skimped a bit on his preparatory research. The information he had gathered had led him to choose the name "Ford Prefect" as being nicely inconspicuous.
He was not conspicuously tall, his features were striking but not conspicuously handsome. His hair was wiry and gingerish and brushed backwards from the temples. His skin seemed to be pulled backwards from the nose. There was something very slightly odd about him, but it was difficult to say what it was. Perhaps it was that his eyes didn't blink often enough and when you talked to him for any length of time your eyes began involuntarily to water on his behalf. Perhaps it was that he smiled slightly too broadly and gave people the unnerving impression that he was about to go for their neck.
He struck most of the friends he had made on Earth as an eccentric, but a harmless one an unruly boozer with some oddish habits. For instance he would often gatecrash university parties, get badly drunk and start making fun of any astrophysicist he could find till he got thrown out.
Sometimes he would get seized with oddly distracted moods and stare into the sky as if hypnotized until someone asked him what he was doing. Then he would start guiltily for a moment, relax and grin.
"Oh, just looking for flying saucers," he would joke and everyone would laugh and ask him what sort of flying saucers he was looking for.
"Green ones!" he would reply with a wicked grin, laugh wildly for a moment and then suddenly lunge for the nearest bar and buy an enormous round of drinks.
Evenings like this usually ended badly. Ford would get out of his skull on whisky, huddle into a corner with some girl and explain to her in slurred phrases that honestly the colour of the flying saucers didn't matter that much really.
Thereafter, staggering semi-paralytic down the night streets he would often ask passing policemen if they knew the way to Betelgeuse. The policemen would usually say something like, "Don't you think it's about time you went off home sir?"
"I'm trying to baby, I'm trying to," is what Ford invariably replied on these occasions.
In fact what he was really looking out for when he stared distractedly into the night sky was any kind of flying saucer at all. The reason he said green was that green was the traditional space livery of the Betelgeuse trading scouts.
Ford Prefect was desperate that any flying saucer at all would arrive soon because fifteen years was a long time to get stranded anywhere, particularly somewhere as mindboggingly dull as the Earth.
Ford wished that a flying saucer would arrive soon because he knew how to flag flying saucers down and get lifts from them. He knew how to see the Marvels of the Universe for less than thirty Altairan dollars a day.
In fact, Ford Prefect was a roving researcher for that wholly remarkable book The Hitchhiker's Guide to the Galaxy.
Human beings are great adaptors, and by lunchtime life in the environs of Arthur's house had settled into a steady routine. It was Arthur's accepted role to lie squelching in the mud making occasional demands to see his lawyer, his mother or a good book; it was Mr. Prosser's accepted role to tackle Arthur with the occasional new ploy such as the For the Public Good talk, the March of Progress talk, the They Knocked My House Down Once You Know, Never Looked Back talk and various other cajoleries and threats; and it was the bulldozer drivers' accepted role to sit around drinking coffee and experimenting with union regulations to see how they could turn the situation to their financial advantage.
The Earth moved slowly in its diurnal course.
The sun was beginning to dry out the mud Arthur lay in.
A shadow moved across him again.
"Hello Arthur," said the shadow.
Arthur looked up and squinting into the sun was startled to see Ford Prefect standing above him.
"Ford! Hello, how are you?"
"Fine," said Ford, "look, are you busy?"
"Am I busy?" exclaimed Arthur. "Well, I've just got all these bulldozers and things to lie in front of because they'll knock my house down if I don't, but other than that... well, no not especially, why?"
They don't have sarcasm on Betelgeuse, and Ford Prefect often failed to notice it unless he was concentrating. He said, "Good, is there anywhere we can talk?"
"What?" said Arthur Dent.
For a few seconds Ford seemed to ignore him, and stared fixedly into the sky like a rabbit trying to get run over by a car. Then suddenly he squatted down beside Arthur.
"We've got to talk," he said urgently.
"Fine," said Arthur, "talk."
"And drink," said Ford. "It's vitally important that we talk and drink. Now. We'll go to the pub in the village."
He looked into the sky again, nervous, expectant.
"Look, don't you understand?" shouted Arthur. He pointed at Prosser. "That man wants to knock my house down!"
Ford glanced at him, puzzled.
"Well he can do it while you're away can't he?" he asked. "But I don't want him to!"
"Ah."
"Look, what's the matter with you Ford?" said Arthur.
"Nothing. Nothing's the matter. Listen to me I've got to tell you the most important thing you've ever heard. I've got to tell you now, and I've got to tell you in the saloon bar of the Horse and Groom."
"But why?"
"Because you are going to need a very stiff drink."
Ford stared at Arthur, and Arthur was astonished to find that his will was beginning to weaken. He didn't realize that this was because of an old drinking game that Ford learned to play in the hyperspace ports that served the madranite mining belts in the star system of Orion Beta.
The game was not unlike the Earth game called Indian Wrestling, and was played like this:
Two contestants would sit either side of a table, with a glass in front of each of them.
Between them would be placed a bottle of Janx Spirit (as immortalized in that ancient Orion mining song "Oh don't give me none more of that Old Janx Spirit/ No, don't you give me none more of that Old Janx Spirit/ For my head will fly, my tongue will lie, my eyes will fry and I may die/ Won't you pour me one more of that sinful Old Janx Spirit").
Each of the two contestants would then concentrate their will on the bottle and attempt to tip it and pour spirit into the glass of his opponent who would then have to drink it.
The bottle would then be refilled. The game would be played again. And again.
Once you started to lose you would probably keep losing, because one of the effects of Janx spirit is to depress telepsychic power.
As soon as a predetermined quantity had been consumed, the final loser would have to perform a forfeit, which was usually obscenely biological.
Ford Prefect usually played to lose.
Ford stared at Arthur, who began to think that perhaps he did want to go to the Horse and Groom after all.
"But what about my house...?" he asked plaintively.
Ford looked across to Mr. Prosser, and suddenly a wicked thought struck him.
"He wants to knock your house down?"
"Yes, he wants to build..."
"And he can't because you're lying in front of the bulldozers?"
"Yes, and..."
"I'm sure we can come to some arrangement," said Ford. "Excuse me!" he shouted.
Mr. Prosser (who was arguing with a spokesman for the bulldozer drivers about whether or not Arthur Dent constituted a mental health hazard, and how much they should get paid if he did) looked around. He was surprised and slightly alarmed to find that Arthur had company.
"Yes? Hello?" he called. "Has Mr. Dent come to his senses yet?"
"Can we for the moment," called Ford, "assume that he hasn't?"
"Well?" sighed Mr. Prosser.
"And can we also assume," said Ford, "that he's going to be staying here all day?"
"So?"
"So all your men are going to be standing around all day doing nothing?"
"Could be, could be..."
"Well, if you're resigned to doing that anyway, you don't actually need him to lie here all the time do you?"
"What?"
"You don't," said Ford patiently, "actually need him here."
Mr. Prosser thought about this.
"Well no, not as such...", he said, "not exactly need..." Prosser was worried. He thought that one of them wasn't making a lot of sense.
Ford said, "So if you would just like to take it as read that he's actually here, then he and I could slip off down to the pub for half an hour. How does that sound?"
Mr. Prosser thought it sounded perfectly potty.
"That sounds perfectly reasonable," he said in a reassuring tone of voice, wondering who he was trying to reassure.
"And if you want to pop off for a quick one yourself later on," said Ford, "we can always cover up for you in return."
"Thank you very much," said Mr. Prosser who no longer knew how to play this at all, "thank you very much, yes, that's very kind..." He frowned, then smiled, then tried to do both at once, failed, grasped hold of his fur hat and rolled it fitfully round the top of his head. He could only assume that he had just won.
"So," continued Ford Prefect, "if you would just like to come over here and lie down..."
"What?" said Mr. Prosser.
"Ah, I'm sorry," said Ford, "perhaps I hadn't made myself fully clear. Somebody's got to lie in front of the bulldozers haven't they? Or there won't be anything to stop them driving into Mr. Dent's house will there?"
"What?" said Mr. Prosser again.
"It's very simple," said Ford, "my client, Mr. Dent, says that he will stop lying here in the mud on the sole condition that you come and take over from him."
"What are you talking about?" said Arthur, but Ford nudged him with his shoe to be quiet.
"You want me," said Mr. Prosser, spelling out this new thought to himself, "to come and lie there..."
"Yes."
"In front of the bulldozer?" "Yes."
"Instead of Mr. Dent." "Yes."
"In the mud."
"In, as you say it, the mud."
As soon as Mr. Prosser realized that he was substantially the loser after all, it was as if a weight lifted itself off his shoulders: this was more like the world as he knew it. He sighed.
"In return for which you will take Mr. Dent with you down to the pub?"
"That's it," said Ford. "That's it exactly."
Mr. Prosser took a few nervous steps forward and stopped. "Promise?"
"Promise," said Ford. He turned to Arthur.
"Come on," he said to him, "get up and let the man lie down." Arthur stood up, feeling as if he was in a dream.
Ford beckoned to Prosser who sadly, awkwardly, sat down in the mud. He felt that his whole life was some kind of dream and he sometimes wondered whose it was and whether they were enjoying it. The mud folded itself round his bottom and his arms and oozed into his shoes.
Ford looked at him severely.
"And no sneaky knocking down Mr. Dent's house whilst he's away, alright?" he said.
"The mere thought," growled Mr. Prosser, "hadn't even begun to speculate," he continued, settling himself back, "about the merest possibility of crossing my mind."
He saw the bulldozer driver's union representative approaching and let his head sink back and closed his eyes. He was trying to marshal his arguments for proving that he did not now constitute a mental health hazard himself. He was far from certain about this his mind seemed to be full of noise, horses, smoke, and the stench of blood. This always happened when he felt miserable and put upon, and he had never been able to explain it to himself. In a high dimension of which we know nothing the mighty Khan bellowed with rage, but Mr. Prosser only trembled slightly and whimpered. He began to fell little pricks of water behind the eyelids. Bureaucratic cock-ups, angry men lying in the mud, indecipherable strangers handing out inexplicable humiliations and an unidentified army of horsemen laughing at him in his head what a day.
What a day. Ford Prefect knew that it didn't matter a pair of
dingo's kidneys whether Arthur's house got knocked down or not now.
Arthur remained very worried.
"But can we trust him?" he said.
"Myself I'd trust him to the end of the Earth," said Ford.
"Oh yes," said Arthur, "and how far's that?"
"About twelve minutes away," said Ford, "come on, I need a drink."

View File

@@ -0,0 +1,93 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.35.2.
--
-- see: https://github.com/sol/hpack
name: huffman
version: 0.1
synopsis: huffman
license: BSD3
build-type: Simple
flag test-mode
description: By default, do not run instructor tests
manual: True
default: False
library
exposed-modules:
Huffman
Auxiliaries
other-modules:
Paths_huffman
hs-source-dirs:
src
default-extensions:
ScopedTypeVariables
ghc-options: -Werror -W -fwarn-unused-imports -fwarn-unused-binds -fwarn-orphans -fwarn-unused-matches -fwarn-unused-do-bind -fwarn-wrong-do-bind -fwarn-missing-signatures -fno-warn-partial-type-signatures -Wredundant-constraints -rtsopts
build-depends:
base
, binary
, bytestring
, containers
, filepath
default-language: Haskell2010
if flag(test-mode)
build-depends:
bytestring
, directory
, filepath
, haskell-src-meta
, main-tester
, template-haskell
else
executable huffman-exe
main-is: Main.hs
other-modules:
Paths_huffman
hs-source-dirs:
exe
default-extensions:
ScopedTypeVariables
ghc-options: -Werror -W -fwarn-unused-imports -fwarn-unused-binds -fwarn-orphans -fwarn-unused-matches -fwarn-unused-do-bind -fwarn-wrong-do-bind -fwarn-missing-signatures -fno-warn-partial-type-signatures -Wredundant-constraints -rtsopts
build-depends:
base
, huffman
default-language: Haskell2010
if flag(test-mode)
build-depends:
bytestring
, directory
, filepath
, haskell-src-meta
, main-tester
, template-haskell
else
test-suite unit-tests
type: exitcode-stdio-1.0
main-is: Tests.hs
other-modules:
Paths_huffman
hs-source-dirs:
test
default-extensions:
ScopedTypeVariables
ghc-options: -Werror -W -fwarn-unused-imports -fwarn-unused-binds -fwarn-orphans -fwarn-unused-matches -fwarn-unused-do-bind -fwarn-wrong-do-bind -fwarn-missing-signatures -fno-warn-partial-type-signatures -Wredundant-constraints -rtsopts
build-depends:
HUnit
, base
, containers
, huffman
default-language: Haskell2010
if flag(test-mode)
build-depends:
bytestring
, directory
, filepath
, haskell-src-meta
, main-tester
, template-haskell
else

64
Aufgabe_6/code/package.yaml Executable file
View File

@@ -0,0 +1,64 @@
name: huffman
version: 0.1
synopsis: huffman
license: BSD3
library:
exposed-modules:
- Huffman
- Auxiliaries
source-dirs: src
dependencies:
- base
- containers
- bytestring
- binary
- filepath
executables:
huffman-exe:
main: Main.hs
source-dirs: exe
dependencies:
- base
- huffman
tests:
unit-tests:
main: Tests.hs
source-dirs: test
dependencies:
- base
- HUnit
- containers
- huffman
ghc-options:
- -Werror -W -fwarn-unused-imports -fwarn-unused-binds -fwarn-orphans
- -fwarn-unused-matches -fwarn-unused-do-bind -fwarn-wrong-do-bind
- -fwarn-missing-signatures -fno-warn-partial-type-signatures
- -Wredundant-constraints -rtsopts
default-extensions:
- ScopedTypeVariables
# Setup for running tests in praktomat
flags:
test-mode:
description: "By default, do not run instructor tests"
manual: true
default: false
when:
- condition: flag(test-mode)
then:
dependencies:
- template-haskell
- haskell-src-meta
- filepath
- bytestring
- directory
- main-tester
else:
dependencies: []

View File

@@ -0,0 +1,84 @@
module Auxiliaries (
Bit(..), Bitlist(..), FileContent(..),
binaryToFile, binaryFromFile, fromWord8, toWord8
) where
import Data.Word
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import qualified Data.Binary as B
data Bit = Zero | One
deriving (Eq, Show)
newtype Bitlist = Bitlist [Bit]
instance B.Binary Bitlist where
put (Bitlist l) =
do B.put (length l)
B.put (bitsToByteString l)
get =
do n <- B.get
bs <- B.get
let bits = byteStringToBits n bs
return (Bitlist bits)
data FileContent
= FileContent
{ fc_codingTable :: [(Char, Bitlist)]
, fc_content :: Bitlist }
instance B.Binary FileContent where
put (FileContent table bits) =
do B.put table
B.put bits
get =
do table <- B.get
bits <- B.get
return (FileContent table bits)
byteStringToBits :: Int -> BS.ByteString -> [Bit]
byteStringToBits n bs =
let allBits = concatMap fromWord8 (BS.unpack bs)
in take n allBits -- remove padding bits
-- bitsToByteString pads the last Word8 in the resulting bytestring with zeros.
bitsToByteString :: [Bit] -> BS.ByteString
bitsToByteString topBits = BS.pack (toWord8List topBits)
where
toWord8List [] = []
toWord8List bits =
let (prefix, suffix) = splitAt 8 bits
in toWord8 prefix : toWord8List suffix
-- to list of bits must have <= 8 elements
toWord8 :: [Bit] -> Word8
toWord8 bits = go 7 bits
where
go :: Int -> [Bit] -> Word8
go _ [] = 0
go i (Zero:rest) = go (i - 1) rest
go i (One:rest) = 2^i + go (i - 1) rest
fromWord8 :: Word8 -> [Bit]
fromWord8 word = go 7 word
where
go :: Int -> Word8 -> [Bit]
go i w
| i < 0 = []
| otherwise =
let x = 2^i
this = w `div` x
rest = w `mod` x
bit = if this == 0 then Zero else One
in bit : go (i - 1) rest
binaryToFile :: B.Binary a => FilePath -> a -> IO ()
binaryToFile path x = do
let bs = BSL.toStrict (B.encode x)
BS.writeFile path bs
binaryFromFile :: B.Binary a => FilePath -> IO a
binaryFromFile path = do
bs <- BS.readFile path
pure (B.decode (BSL.fromStrict bs))

59
Aufgabe_6/code/src/Huffman.hs Executable file
View File

@@ -0,0 +1,59 @@
module Huffman where
--import qualified Data.List as List
import qualified Data.Map.Strict as Map
import Auxiliaries -- defines Bit
type Map = Map.Map
type CodingTable = Map Char [Bit]
-----------------------------------------------------------------------
-- Aufgabe 2
-----------------------------------------------------------------------
data Node = Leaf Char Integer | Inner Node Node Integer
data HTree = Root Node
exercise1TreeValid :: HTree
exercise1TreeValid = Root (Inner (Inner (Leaf 'E' 158) (Inner (Leaf 'N' 97) (Leaf 'I' 82) 179) 337) (Inner (Inner (Leaf 'R' 77) (Leaf 'S' 67) 144) (Inner (Leaf 'T' 64) (Leaf 'A' 61) 125) 269) 606)
exercise1TreeInvalid :: HTree
exercise1TreeInvalid =
Root (Inner (Leaf 'A' 21) (Leaf 'B' 20) 42)
-----------------------------------------------------------------------
-- Aufgabe 3
-----------------------------------------------------------------------
isConsistent :: HTree -> Bool
isConsistent (Root node) =
case node of
Leaf _ _ -> True
Inner left right frequency ->
case left of
Leaf _ leftFrequency ->
case right of
Leaf _ rightFrequency -> frequency == leftFrequency + rightFrequency
Inner _ _ rightFrequency -> frequency == leftFrequency + rightFrequency && isConsistent (Root right)
Inner _ _ leftFrequency ->
case right of
Leaf _ rightFrequency -> frequency == leftFrequency + rightFrequency && isConsistent (Root left)
Inner _ _ rightFrequency -> frequency == leftFrequency + rightFrequency && isConsistent (Root left) && isConsistent (Root right)
-----------------------------------------------------------------------
-- Aufgabe 4
-----------------------------------------------------------------------
toCodingTable :: HTree -> CodingTable
toCodingTable (Root node) =
case node of
Leaf char _ -> singleton char [Zero]
Inner _ _ _ -> fromList toCodingTableList (Root node)
toCodingTableList :: HTree -> [(Char,[Bit])]
toCodingTableList (Root node) =
case node of
Leaf char _ -> [(char,[Zero])]
Inner left right frequency ->
--type Map = Map.Map
--type CodingTable = Map Char [Bit]

3
Aufgabe_6/code/stack.yaml Executable file
View File

@@ -0,0 +1,3 @@
resolver: lts-21.14
packages:
- .

View File

@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages: []
snapshots:
- completed:
sha256: 60e54c1ba3c1e7163acf6dafa9d56b2d3b23f88a31ad53a1c9d888f32561f8da
size: 639819
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/14.yaml
original: lts-21.14

48
Aufgabe_6/code/test/Tests.hs Executable file
View File

@@ -0,0 +1,48 @@
module Main where
import Huffman
import Test.HUnit
test_isConsistent :: IO ()
test_isConsistent = do
assertEqual "test1_Valid_tree" True (isConsistent exercise1TreeValid)
assertEqual "test2_Invalid_tree" False (isConsistent exercise1TreeInvalid)
test_toCodingTable :: IO ()
test_toCodingTable = pure ()
test_encode :: IO ()
test_encode = pure ()
test_decode :: IO ()
test_decode = pure ()
test_buildHTree :: IO ()
test_buildHTree = pure ()
test_toDecodeTree :: IO ()
test_toDecodeTree = pure ()
test_toFromWord8 :: IO ()
test_toFromWord8 = pure ()
test_encodeDecodeFile :: IO ()
test_encodeDecodeFile = pure ()
allTests :: Test
allTests =
TestList
[ mkTest "toCodingTable" test_toCodingTable
, mkTest "encode" test_encode
, mkTest "isConsistent" test_isConsistent
, mkTest "decode" test_decode
, mkTest "buildHTree" test_buildHTree
, mkTest "toDecodeTree" test_toDecodeTree
, mkTest "toFromWord8" test_toFromWord8
, mkTest "encodeDecodeFile" test_encodeDecodeFile
]
where
mkTest label ass = TestLabel label (TestCase ass)
main :: IO ()
main = runTestTTAndExit allTests

BIN
Aufgabe_6/huffman.pdf Executable file

Binary file not shown.