This commit is contained in:
WickedJack99
2024-01-21 10:22:06 +01:00
parent 234dce215c
commit f82a356d1b
46 changed files with 565 additions and 92 deletions

View File

@@ -42,12 +42,12 @@ getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir ::
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"
bindir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/bin"
libdir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/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"
dynlibdir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7"
datadir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/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)

View File

@@ -173,10 +173,10 @@
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_PACKAGE_KEY
#define CURRENT_PACKAGE_KEY "huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
#define CURRENT_PACKAGE_KEY "huffman-0.1-FYSjga9JLF2kZjOZ6zeLt"
#endif /* CURRENT_packageKey */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-5hb8DvQH04kAhx22YvzXdK"
#define CURRENT_COMPONENT_ID "huffman-0.1-FYSjga9JLF2kZjOZ6zeLt"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1"

View File

@@ -42,12 +42,12 @@ getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir ::
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"
bindir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/bin"
libdir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7/huffman-0.1-23WUwl30C5UEHpdRSzT9lV-huffman-exe"
dynlibdir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7"
datadir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/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)

View File

@@ -143,7 +143,7 @@
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-7oGsPwnMV4MIdxe92R26Zp-huffman-exe"
#define CURRENT_COMPONENT_ID "huffman-0.1-23WUwl30C5UEHpdRSzT9lV-huffman-exe"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1"

View File

@@ -42,12 +42,12 @@ getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir ::
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"
bindir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/bin"
libdir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/lib/x86_64-linux-ghc-9.4.7"
datadir = "/home/student/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/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/Repositories/Anwendungsentwicklung_Haskell/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)

View File

@@ -10,19 +10,19 @@ 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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build
data-dir:
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/.
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.
hs-libraries: HShuffman-0.1-FYSjga9JLF2kZjOZ6zeLt
depends:
@@ -30,7 +30,7 @@ depends:
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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/doc/html/huffman

View File

@@ -1,14 +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
? /home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/huffman-exe/autogen/Paths_huffman.hs
: hash: c3b102e039993d93c4c1b5265e5c083b7d1f80bd31c97863951db401397044ae
? /home/student/Repositories/Anwendungsentwicklung_Haskell/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:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/exe/Main.hs:
hash: bc321c5e6dea106198eca53ccb8e31b17746ac198c7de206483c2989e73b1fd0
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/huffman.cabal:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/huffman.cabal:
hash: 0f828acaf94c12587e96d013bb3f48a4c4abac1e2efe6cce31dbffe48864d1f2
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/package.yaml:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/package.yaml:
hash: e9fcddf7857388c0e51188152e25a1d446e2e46628ed45552bdc3b635472171c
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -1,16 +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
? /home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/autogen/Paths_huffman.hs
: hash: 874bd9884d9b692ac0e06224523211af59c32e03667af528723b7a592c4c4815
? /home/student/Repositories/Anwendungsentwicklung_Haskell/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:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/huffman.cabal:
hash: 0f828acaf94c12587e96d013bb3f48a4c4abac1e2efe6cce31dbffe48864d1f2
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/package.yaml:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/package.yaml:
hash: e9fcddf7857388c0e51188152e25a1d446e2e46628ed45552bdc3b635472171c
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/src/Auxiliaries.hs:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/src/Auxiliaries.hs:
hash: 5a404af397ad51d6d268ac0a318157dd9511d113c3fbfce35cc238d42974425f
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/src/Huffman.hs:
hash: 73ec1a50a698556eb56e225b69c8712a3cd2fd1406496741e1c60b1b9b85b185
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/src/Huffman.hs:
hash: b652f09badf6a87f7650257d2ef94ccb2ed44fef14b63061f89723fccd1efa94
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -1,14 +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
? /home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/dist/x86_64-linux/Cabal-3.8.1.0/build/unit-tests/autogen/Paths_huffman.hs
: hash: de939c724220351db2e4fd252c261d62f8a9ba7b31514d9026d2a141a40d27d7
? /home/student/Repositories/Anwendungsentwicklung_Haskell/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:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/huffman.cabal:
hash: 0f828acaf94c12587e96d013bb3f48a4c4abac1e2efe6cce31dbffe48864d1f2
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/package.yaml:
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/package.yaml:
hash: e9fcddf7857388c0e51188152e25a1d446e2e46628ed45552bdc3b635472171c
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/test/Tests.hs:
hash: 0189e9ebf9498389b73efcb50cf30fc46f21889d0185d806168aff69fa099fe1
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/test/Tests.hs:
hash: 4e0f91ba3a1c9bf5828a2e8c1324aaf73675144b8f6e87fe3a447c1c66404f95
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -1 +1 @@
/home/student/Documents/Anwendungsentwicklung/Aufgabe_6/code/
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/

View File

@@ -1 +1 @@
success
unknown

View File

@@ -0,0 +1,173 @@
/* 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 */
#undef CURRENT_PACKAGE_KEY
#undef CURRENT_COMPONENT_ID

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-FYSjga9JLF2kZjOZ6zeLt"
#endif /* CURRENT_packageKey */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "huffman-0.1-FYSjga9JLF2kZjOZ6zeLt"
#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

@@ -5,24 +5,24 @@ id: huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
key: huffman-0.1-FYSjga9JLF2kZjOZ6zeLt
license: BSD-3-Clause
synopsis: huffman
abi: 5af1db6672629be997b9440d7ecf09b9
abi: d3dea09c9f2ebe1c8650b290404d897c
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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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:
@@ -30,7 +30,7 @@ depends:
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
/home/student/Repositories/Anwendungsentwicklung_Haskell/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
/home/student/Repositories/Anwendungsentwicklung_Haskell/Aufgabe_6/code/.stack-work/install/x86_64-linux/c95135353db856bc6efc9bd10e84b1a5a9a219f3607bca4f1889717059c848cc/9.4.7/doc/huffman-0.1

BIN
Aufgabe_6/code/Aaron.comp Normal file

Binary file not shown.

6
Aufgabe_6/code/Aaron.txt Normal file
View File

@@ -0,0 +1,6 @@
Aaron Adrian
Aaron Adrian
Aaron Adrian
Aaron Adrian
Aaron Adrian
Aaron Adrian

View File

View File

@@ -1,13 +1,14 @@
module Huffman where
--import qualified Data.List as List
import qualified Data.Map.Strict as Map
import Auxiliaries ( Bit (..) )
import Auxiliaries ( Bit (..), FileContent (FileContent, fc_codingTable, fc_content), Bitlist (Bitlist), binaryToFile, binaryFromFile)
import Data.Maybe (fromMaybe)
import Data.Char (toUpper)
import Data.List (sort)
import qualified Data.IntMap.Strict as IntMap
import System.IO
import Data.List (maximumBy, minimumBy)
import Text.Printf (printf)
type IntMap = IntMap.IntMap
type Map = Map.Map
type CodingTable = Map Char [Bit]
@@ -17,7 +18,7 @@ type CodingTable = Map Char [Bit]
-----------------------------------------------------------------------
data Node = Leaf Char Int | Inner Node Node Int deriving (Show)
newtype HTree = Root Node
newtype HTree = Root Node deriving (Show)
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)
@@ -159,6 +160,9 @@ instance Ord Node where
(Inner _ _ frequency1) <= (Leaf _ frequency2) = frequency1 <= frequency2
(Inner _ _ frequency1) <= (Inner _ _ frequency2) = frequency1 <= frequency2
instance Eq HTree where
(Root node1) == (Root node2) = node1 == node2
buildHTree :: String -> HTree
buildHTree input =
let charFrequencyMap = combineFrequencies (addOccurences input)
@@ -188,32 +192,44 @@ toHTree map lastTree =
case IntMap.minView map of
Just (minimums, newMap) ->
case minimums of
[] -> error "Impossible case"
[] -> toHTree newMap lastTree
[x] ->
let Root xRoot = x
in case xRoot of
Leaf _ xFrequency ->
if lastTreeRootFrequency < xFrequency
then toHTree newMap (Root (Inner lastTreeRoot xRoot (lastTreeRootFrequency + xFrequency)))
else toHTree newMap (Root (Inner xRoot lastTreeRoot (lastTreeRootFrequency + xFrequency)))
if lastTreeRootFrequency == 0
then toHTree newMap x
else if lastTreeRootFrequency < xFrequency
then toHTree newMap (Root (Inner lastTreeRoot xRoot (lastTreeRootFrequency + xFrequency)))
else toHTree newMap (Root (Inner xRoot lastTreeRoot (lastTreeRootFrequency + xFrequency)))
Inner _ _ xFrequency ->
if lastTreeRootFrequency < xFrequency
then toHTree newMap (Root (Inner lastTreeRoot xRoot (lastTreeRootFrequency + xFrequency)))
else toHTree newMap (Root (Inner xRoot lastTreeRoot (lastTreeRootFrequency + xFrequency)))
if lastTreeRootFrequency == 0
then toHTree newMap x
else if lastTreeRootFrequency < xFrequency
then toHTree newMap (Root (Inner lastTreeRoot xRoot (lastTreeRootFrequency + xFrequency)))
else toHTree newMap (Root (Inner xRoot lastTreeRoot (lastTreeRootFrequency + xFrequency)))
(x:y:rest) ->
let Root xRoot = x
Root yRoot = y
in case xRoot of
Leaf _ xFrequency ->
if lastTreeRootFrequency < xFrequency
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner lastTreeRoot (Inner xRoot yRoot (xFrequency * 2)) (lastTreeRootFrequency + (xFrequency * 2))))
else toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner (Inner xRoot yRoot (xFrequency * 2)) lastTreeRoot (lastTreeRootFrequency + (xFrequency * 2))))
if lastTreeRootFrequency == 0
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner xRoot yRoot (xFrequency * 2)))
else if lastTreeRootFrequency < xFrequency
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner lastTreeRoot (Inner xRoot yRoot (xFrequency * 2)) (lastTreeRootFrequency + (xFrequency * 2))))
else toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner (Inner xRoot yRoot (xFrequency * 2)) lastTreeRoot (lastTreeRootFrequency + (xFrequency * 2))))
Inner _ _ xFrequency ->
if lastTreeRootFrequency == 0
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner xRoot yRoot (xFrequency * 2)))
else if lastTreeRootFrequency < xFrequency
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner lastTreeRoot (Inner xRoot yRoot (xFrequency * 2)) (lastTreeRootFrequency + (xFrequency * 2))))
else toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner (Inner xRoot yRoot (xFrequency * 2)) lastTreeRoot (lastTreeRootFrequency + (xFrequency * 2))))
_ -> lastTree
Inner _ _ lastTreeRootFrequency ->
case IntMap.minView map of
Just (minimums, newMap) ->
case minimums of
[] -> error "Impossible case"
[] -> toHTree newMap lastTree
[x] ->
let Root xRoot = x
in case xRoot of
@@ -233,19 +249,104 @@ toHTree map lastTree =
if lastTreeRootFrequency < xFrequency
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner lastTreeRoot (Inner xRoot yRoot (xFrequency * 2)) (lastTreeRootFrequency + (xFrequency * 2))))
else toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner (Inner xRoot yRoot (xFrequency * 2)) lastTreeRoot (lastTreeRootFrequency + (xFrequency * 2))))
Inner _ _ xFrequency ->
if lastTreeRootFrequency < xFrequency
then toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner lastTreeRoot (Inner xRoot yRoot (xFrequency * 2)) (lastTreeRootFrequency + (xFrequency * 2))))
else toHTree (IntMap.insert xFrequency rest newMap) (Root (Inner (Inner xRoot yRoot (xFrequency * 2)) lastTreeRoot (lastTreeRootFrequency + (xFrequency * 2))))
_ -> lastTree
--[(0,'i'),(3,'j'),(0,'f')]
--minView 0 -> [(0,'i'),(0,'f')]
--minView
--kleinster
--minView :: IntMap a -> Maybe (a, IntMap a)
--O(log n). Retrieves the minimal key of the map, and the map stripped of that element, or Nothing if passed an empty map.
-----------------------------------------------------------------------
-- Aufgabe 7 Test
-----------------------------------------------------------------------
nodeList :: [Node]
nodeList = [Leaf 'R' 4, Leaf 'A' 3, Leaf 'I' 2, Leaf 'N' 1]
treeAaron :: HTree
treeAaron = Root (Inner (Leaf 'A' 1) (Inner (Inner (Leaf 'n' 1) (Leaf 'a' 1) 2) (Inner (Leaf 'r' 1) (Leaf 'o' 1) 2) 4) 5)
treeMISSISSIPPI :: HTree
treeMISSISSIPPI = Root (Inner (Inner (Leaf 'M' 1) (Leaf 'P' 2) 3) (Inner (Leaf 'S' 4) (Leaf 'I' 4) 8) 11)
treeAAABC :: HTree
treeAAABC = Root (Inner (Inner (Leaf 'C' 1) (Leaf 'B' 1) 2) (Leaf 'A' 3) 5)
-----------------------------------------------------------------------
-- Aufgabe 8
-----------------------------------------------------------------------
--type CodingTable = Map Char [Bit]
type Depth = Int
toDecodeTree :: CodingTable -> HTree
toDecodeTree table =
let listWithDepth = (codingListToCodingListWithDepth (codingTableToList table))
listWithDepthInverted = invertDepths listWithDepth (getMinimumDepth listWithDepth) (getMaximumDepth listWithDepth)
in buildHTree (depthListToString listWithDepthInverted)
depthListToString :: [(Char, Depth)] -> String
depthListToString list =
case list of
[] -> ""
((char, depth):rest) -> (replicate depth char) ++ depthListToString rest
invertDepths :: [(Char, Depth)] -> Depth -> Depth -> [(Char, Depth)]
invertDepths list minDepth maxDepth = map (\(char, depth) -> (char, (minDepth + maxDepth - depth))) list
codingTableToList :: CodingTable -> [(Char, [Bit])]
codingTableToList table = Map.toList table
codingListToCodingListWithDepth :: [(Char, [Bit])] -> [(Char, Depth)]
codingListToCodingListWithDepth tableList =
map (\(char, bitList) -> (char, length bitList)) tableList
getMaximumDepth :: [(Char, Depth)] -> Depth
getMaximumDepth = (\(_, d) -> d) . maximumBy compareByDepth
getMinimumDepth :: [(Char, Depth)] -> Depth
getMinimumDepth = (\(_, d) -> d) . minimumBy compareByDepth
compareByDepth :: (Char, Depth) -> (Char, Depth) -> Ordering
compareByDepth (_, depth1) (_, depth2)
| depth1 < depth2 = LT
| depth1 > depth2 = GT
| otherwise = EQ
-----------------------------------------------------------------------
-- Aufgabe 8 Test
-----------------------------------------------------------------------
testCodingTable :: CodingTable
testCodingTable = Map.fromList [('E', [Zero,Zero]), ('N', [Zero,One,Zero]), ('I', [Zero,One,One]), ('R', [One,Zero,Zero]), ('S', [One,Zero,One]), ('T', [One,One,Zero]), ('A', [One,One,One])]
testCodingTableHTree :: HTree
testCodingTableHTree = Root (Inner (Leaf 'E' 3) (Inner (Inner (Leaf 'I' 2) (Leaf 'A' 2) 4) (Inner (Inner (Leaf 'R' 2) (Leaf 'N' 2) 4) (Inner (Leaf 'T' 2) (Leaf 'S' 2) 4) 8) 12) 15)
-----------------------------------------------------------------------
-- Aufgabe 9
-----------------------------------------------------------------------
encodeFile :: FilePath -> FilePath -> IO ()
encodeFile input output =
withFile input ReadMode $ \handle -> do
inputContent <- hGetContents handle
let htree = buildHTree inputContent
codingTable = toCodingTable htree
encodedContent = encode codingTable inputContent
fileContent = FileContent {fc_codingTable = (map (\(char, bitList) -> (char, Bitlist bitList)) (Map.toList codingTable)), fc_content = (Bitlist encodedContent)}
in do
printf ("\n" ++ show htree ++ "\n")
--printf (show codingTable ++ "\n")
--printf (show encodedContent ++ "\n")
binaryToFile output fileContent
decodeFile :: FilePath -> FilePath -> IO ()
decodeFile input output = do
fileContent <- binaryFromFile input
let codingTable = fc_codingTable fileContent
encodedContent = fc_content fileContent
decodeTree = toDecodeTree (Map.fromList (map (\(char, Bitlist bitList) -> (char, bitList)) codingTable))
decodedString = decode decodeTree (bitlistToList encodedContent)
in do
printf ("\n" ++ show decodeTree)
withFile output WriteMode (\handle -> do hPutStr handle decodedString)
bitlistToList :: Bitlist -> [Bit]
bitlistToList (Bitlist bits) = bits

View File

@@ -20,10 +20,10 @@ test_toCodingTable = do
test_encode :: IO ()
test_encode = do
assertEqual "test encode Ente" enteEncoded (encode codingTableForTesting "Ente")
assertEqual "test encode Eren" erenEncoded (encode codingTableForTesting "Eren")
assertEqual "test encode Start" startEncoded (encode codingTableForTesting "Start")
assertEqual "test encode Rain" rainEncoded (encode codingTableForTesting "Rain")
assertEqual "test encode ENTE" enteEncoded (encode codingTableForTesting "ENTE")
assertEqual "test encode ENTE" erenEncoded (encode codingTableForTesting "EREN")
assertEqual "test encode START" startEncoded (encode codingTableForTesting "START")
assertEqual "test encode RAIN" rainEncoded (encode codingTableForTesting "RAIN")
test_decode :: IO ()
test_decode = do
@@ -34,16 +34,23 @@ test_decode = do
test_buildHTree :: IO ()
test_buildHTree = do
assertEqual "test buildHTree" nodeList (buildHTree "nIiaAaRrRr")
assertEqual "test buildHTree" treeMISSISSIPPI (buildHTree "MISSISSIPPI")
assertEqual "test buildHTree" treeAaron (buildHTree "Aaron")
assertEqual "test buildHTree" treeAAABC (buildHTree "AAABC")
assertEqual "test buildHTree" (Root (Leaf 'A' 0)) (buildHTree "")
assertEqual "test buildHTree" (Root (Leaf 'A' 1)) (buildHTree "A")
test_toDecodeTree :: IO ()
test_toDecodeTree = pure ()
test_toDecodeTree = do
assertEqual "test toDecodeTree" testCodingTableHTree (toDecodeTree testCodingTable)
test_toFromWord8 :: IO ()
test_toFromWord8 = pure ()
test_encodeDecodeFile :: IO ()
test_encodeDecodeFile = pure ()
test_encodeDecodeFile = do
_ <- encodeFile "Aaron.txt" "Aaron.comp"
decodeFile "Aaron.comp" "Aaron2.txt"
allTests :: Test
allTests =