-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anastasios Valtinos
committed
Oct 27, 2022
1 parent
5e00bab
commit 7d76fe3
Showing
56 changed files
with
635 additions
and
8 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Haskell Excercises & Code/Alejandro - Book of Monads/practice.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module WithCounting where | ||
|
||
data WithCounter a = Int -> (a, Int) deriving (Eq, Show) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+26.4 KB
...- Testing/dist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/build/Addition.hi
Binary file not shown.
Binary file added
BIN
+48 KB
... - Testing/dist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/build/Addition.o
Binary file not shown.
74 changes: 74 additions & 0 deletions
74
...-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/build/autogen/Paths_addition.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE NoRebindableSyntax #-} | ||
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-} | ||
{-# OPTIONS_GHC -w #-} | ||
module Paths_addition ( | ||
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,0,0] [] | ||
|
||
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 = "C:\\Users\\Administrator\\AppData\\Roaming\\cabal\\bin" | ||
libdir = "C:\\Users\\Administrator\\AppData\\Roaming\\cabal\\x86_64-windows-ghc-9.2.1\\addition-0.1.0.0-inplace" | ||
dynlibdir = "C:\\Users\\Administrator\\AppData\\Roaming\\cabal\\x86_64-windows-ghc-9.2.1" | ||
datadir = "C:\\Users\\Administrator\\AppData\\Roaming\\cabal\\x86_64-windows-ghc-9.2.1\\addition-0.1.0.0" | ||
libexecdir = "C:\\Users\\Administrator\\AppData\\Roaming\\cabal\\addition-0.1.0.0-inplace\\x86_64-windows-ghc-9.2.1\\addition-0.1.0.0" | ||
sysconfdir = "C:\\Users\\Administrator\\AppData\\Roaming\\cabal\\etc" | ||
|
||
getBinDir = catchIO (getEnv "addition_bindir") (\_ -> return bindir) | ||
getLibDir = catchIO (getEnv "addition_libdir") (\_ -> return libdir) | ||
getDynLibDir = catchIO (getEnv "addition_dynlibdir") (\_ -> return dynlibdir) | ||
getDataDir = catchIO (getEnv "addition_datadir") (\_ -> return datadir) | ||
getLibexecDir = catchIO (getEnv "addition_libexecdir") (\_ -> return libexecdir) | ||
getSysconfDir = catchIO (getEnv "addition_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 == '/' || c == '\\' |
133 changes: 133 additions & 0 deletions
133
...ist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/build/autogen/cabal_macros.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/* DO NOT EDIT: This file is automatically generated by Cabal */ | ||
|
||
/* package addition-0.1.0.0 */ | ||
#ifndef VERSION_addition | ||
#define VERSION_addition "0.1.0.0" | ||
#endif /* VERSION_addition */ | ||
#ifndef MIN_VERSION_addition | ||
#define MIN_VERSION_addition(major1,major2,minor) (\ | ||
(major1) < 0 || \ | ||
(major1) == 0 && (major2) < 1 || \ | ||
(major1) == 0 && (major2) == 1 && (minor) <= 0) | ||
#endif /* MIN_VERSION_addition */ | ||
/* package QuickCheck-2.14.2 */ | ||
#ifndef VERSION_QuickCheck | ||
#define VERSION_QuickCheck "2.14.2" | ||
#endif /* VERSION_QuickCheck */ | ||
#ifndef MIN_VERSION_QuickCheck | ||
#define MIN_VERSION_QuickCheck(major1,major2,minor) (\ | ||
(major1) < 2 || \ | ||
(major1) == 2 && (major2) < 14 || \ | ||
(major1) == 2 && (major2) == 14 && (minor) <= 2) | ||
#endif /* MIN_VERSION_QuickCheck */ | ||
/* package base-4.16.0.0 */ | ||
#ifndef VERSION_base | ||
#define VERSION_base "4.16.0.0" | ||
#endif /* VERSION_base */ | ||
#ifndef MIN_VERSION_base | ||
#define MIN_VERSION_base(major1,major2,minor) (\ | ||
(major1) < 4 || \ | ||
(major1) == 4 && (major2) < 16 || \ | ||
(major1) == 4 && (major2) == 16 && (minor) <= 0) | ||
#endif /* MIN_VERSION_base */ | ||
/* package hspec-2.10.6 */ | ||
#ifndef VERSION_hspec | ||
#define VERSION_hspec "2.10.6" | ||
#endif /* VERSION_hspec */ | ||
#ifndef MIN_VERSION_hspec | ||
#define MIN_VERSION_hspec(major1,major2,minor) (\ | ||
(major1) < 2 || \ | ||
(major1) == 2 && (major2) < 10 || \ | ||
(major1) == 2 && (major2) == 10 && (minor) <= 6) | ||
#endif /* MIN_VERSION_hspec */ | ||
|
||
/* tool gcc-10.2.0 */ | ||
#ifndef TOOL_VERSION_gcc | ||
#define TOOL_VERSION_gcc "10.2.0" | ||
#endif /* TOOL_VERSION_gcc */ | ||
#ifndef MIN_TOOL_VERSION_gcc | ||
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\ | ||
(major1) < 10 || \ | ||
(major1) == 10 && (major2) < 2 || \ | ||
(major1) == 10 && (major2) == 2 && (minor) <= 0) | ||
#endif /* MIN_TOOL_VERSION_gcc */ | ||
/* tool ghc-9.2.1 */ | ||
#ifndef TOOL_VERSION_ghc | ||
#define TOOL_VERSION_ghc "9.2.1" | ||
#endif /* TOOL_VERSION_ghc */ | ||
#ifndef MIN_TOOL_VERSION_ghc | ||
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\ | ||
(major1) < 9 || \ | ||
(major1) == 9 && (major2) < 2 || \ | ||
(major1) == 9 && (major2) == 2 && (minor) <= 1) | ||
#endif /* MIN_TOOL_VERSION_ghc */ | ||
/* tool ghc-pkg-9.2.1 */ | ||
#ifndef TOOL_VERSION_ghc_pkg | ||
#define TOOL_VERSION_ghc_pkg "9.2.1" | ||
#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) < 2 || \ | ||
(major1) == 9 && (major2) == 2 && (minor) <= 1) | ||
#endif /* MIN_TOOL_VERSION_ghc_pkg */ | ||
/* tool haddock-2.26.0 */ | ||
#ifndef TOOL_VERSION_haddock | ||
#define TOOL_VERSION_haddock "2.26.0" | ||
#endif /* TOOL_VERSION_haddock */ | ||
#ifndef MIN_TOOL_VERSION_haddock | ||
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\ | ||
(major1) < 2 || \ | ||
(major1) == 2 && (major2) < 26 || \ | ||
(major1) == 2 && (major2) == 26 && (minor) <= 0) | ||
#endif /* MIN_TOOL_VERSION_haddock */ | ||
/* 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 runghc-9.2.1 */ | ||
#ifndef TOOL_VERSION_runghc | ||
#define TOOL_VERSION_runghc "9.2.1" | ||
#endif /* TOOL_VERSION_runghc */ | ||
#ifndef MIN_TOOL_VERSION_runghc | ||
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\ | ||
(major1) < 9 || \ | ||
(major1) == 9 && (major2) < 2 || \ | ||
(major1) == 9 && (major2) == 2 && (minor) <= 1) | ||
#endif /* MIN_TOOL_VERSION_runghc */ | ||
/* tool strip-2.34 */ | ||
#ifndef TOOL_VERSION_strip | ||
#define TOOL_VERSION_strip "2.34" | ||
#endif /* TOOL_VERSION_strip */ | ||
#ifndef MIN_TOOL_VERSION_strip | ||
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\ | ||
(major1) < 2 || \ | ||
(major1) == 2 && (major2) < 34 || \ | ||
(major1) == 2 && (major2) == 34 && (minor) <= 0) | ||
#endif /* MIN_TOOL_VERSION_strip */ | ||
|
||
#ifndef CURRENT_PACKAGE_KEY | ||
#define CURRENT_PACKAGE_KEY "addition-0.1.0.0-inplace" | ||
#endif /* CURRENT_packageKey */ | ||
#ifndef CURRENT_COMPONENT_ID | ||
#define CURRENT_COMPONENT_ID "addition-0.1.0.0-inplace" | ||
#endif /* CURRENT_COMPONENT_ID */ | ||
#ifndef CURRENT_PACKAGE_VERSION | ||
#define CURRENT_PACKAGE_VERSION "0.1.0.0" | ||
#endif /* CURRENT_PACKAGE_VERSION */ |
Binary file added
BIN
+60.4 KB
...yle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/build/libHSaddition-0.1.0.0-inplace.a
Binary file not shown.
Binary file added
BIN
+509 Bytes
...ter14 - Testing/dist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/cache/build
Binary file not shown.
Binary file added
BIN
+4.82 KB
...er14 - Testing/dist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/cache/config
Binary file not shown.
Binary file added
BIN
+1.76 KB
... Testing/dist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/cache/registration
Binary file not shown.
Binary file added
BIN
+40 Bytes
...wstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/package.conf.inplace/package.cache
Binary file not shown.
Empty file.
Binary file added
BIN
+293 KB
...er14 - Testing/dist-newstyle/build/x86_64-windows/ghc-9.2.1/addition-0.1.0.0/setup-config
Binary file not shown.
Binary file added
BIN
+24.2 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/compiler
Binary file not shown.
Binary file added
BIN
+3.63 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/config
Binary file not shown.
Binary file added
BIN
+326 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/elaborated-plan
Binary file not shown.
Binary file added
BIN
+626 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/improved-plan
Binary file not shown.
1 change: 1 addition & 0 deletions
1
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/plan.json
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+270 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/solver-plan
Binary file not shown.
Binary file added
BIN
+11.7 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/source-hashes
Binary file not shown.
Binary file added
BIN
+1.72 KB
Haskell Excercises & Code/Chapter14 - Testing/dist-newstyle/cache/up-to-date
Binary file not shown.
34 changes: 34 additions & 0 deletions
34
... Code/Chapter14 - Testing/dist-newstyle/packagedb/ghc-9.2.1/addition-0.1.0.0-inplace.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: addition | ||
version: 0.1.0.0 | ||
visibility: public | ||
id: addition-0.1.0.0-inplace | ||
key: addition-0.1.0.0-inplace | ||
maintainer: sky@isfalling.org | ||
author: Chicken Little | ||
category: Text | ||
abi: inplace | ||
exposed: True | ||
exposed-modules: Addition | ||
import-dirs: | ||
"C:\\Users\\Administrator\\Desktop\\Haskell first Principles\\haskell-deepidive\\Haskell Excercises & Code\\Chapter14 - Testing\\dist-newstyle\\build\\x86_64-windows\\ghc-9.2.1\\addition-0.1.0.0\\build" | ||
|
||
library-dirs: | ||
"C:\\Users\\Administrator\\Desktop\\Haskell first Principles\\haskell-deepidive\\Haskell Excercises & Code\\Chapter14 - Testing\\dist-newstyle\\build\\x86_64-windows\\ghc-9.2.1\\addition-0.1.0.0\\build" | ||
|
||
dynamic-library-dirs: | ||
"C:\\Users\\Administrator\\Desktop\\Haskell first Principles\\haskell-deepidive\\Haskell Excercises & Code\\Chapter14 - Testing\\dist-newstyle\\build\\x86_64-windows\\ghc-9.2.1\\addition-0.1.0.0\\build" | ||
|
||
data-dir: | ||
"C:\\Users\\Administrator\\Desktop\\Haskell first Principles\\haskell-deepidive\\Haskell Excercises & Code\\Chapter14 - Testing\\." | ||
|
||
hs-libraries: HSaddition-0.1.0.0-inplace | ||
include-dirs: C:\tools\msys64\mingw64\include | ||
depends: | ||
QuickCheck-2.14.2-a86079fca27e4995eff71586bc69486728d69c5d | ||
base-4.16.0.0 hspec-2.10.6-4755191b26c19bdcaf316d380b729c36bd3ac94c | ||
|
||
haddock-interfaces: | ||
"C:\\Users\\Administrator\\Desktop\\Haskell first Principles\\haskell-deepidive\\Haskell Excercises & Code\\Chapter14 - Testing\\dist-newstyle\\build\\x86_64-windows\\ghc-9.2.1\\addition-0.1.0.0\\doc\\html\\addition\\addition.haddock" | ||
|
||
haddock-html: | ||
"C:\\Users\\Administrator\\Desktop\\Haskell first Principles\\haskell-deepidive\\Haskell Excercises & Code\\Chapter14 - Testing\\dist-newstyle\\build\\x86_64-windows\\ghc-9.2.1\\addition-0.1.0.0\\doc\\html\\addition" |
Binary file added
BIN
+3.31 KB
...ell Excercises & Code/Chapter14 - Testing/dist-newstyle/packagedb/ghc-9.2.1/package.cache
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Haskell Excercises & Code/Chapter22 - Reader/mondayMorning.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module ReaderTest where | ||
|
||
-- Calls func2 if even length, func3 and func4 if odd | ||
func1 :: String -> (Int, String) | ||
func1 input = if length input `mod` 2 == 0 | ||
then func2 (0, input) | ||
else (i1 + i2, str1 ++ str2) | ||
where | ||
(i1, str1) = func3 (0, tail input) | ||
(i2, str2) = func4 (0, take 1 input) | ||
|
||
-- Calls func4 on truncated version | ||
func2 :: (Int, String) -> (Int, String) | ||
func2 (prev, input) = if (length input) > 10 | ||
then func4 (prev + 1, take 9 input) | ||
else (10, input) | ||
|
||
-- Calls func2 on expanded version if a multiple of 3 | ||
func3 :: (Int, String) -> (Int, String) | ||
func3 (prev, input) = if (length input) `mod` 3 == 0 | ||
then (prev + f2resI + 3, f2resStr) | ||
else (prev + 1, tail input) | ||
where | ||
(f2resI, f2resStr) = func2 (prev, input ++ "ab") | ||
|
||
func4 :: (Int, String) -> (Int, String) | ||
func4 (prev, input) = if (length input) < 10 | ||
then (prev + length input, input ++ input) | ||
else (prev + 5, take 5 input) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Haskell Excercises & Code/Chapter25 - Composing Types/taskEmurgo.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module TestIng where | ||
|
||
-- /* | ||
|
||
-- I = 1 | ||
-- V = 5 | ||
-- X = 10 | ||
-- L = 50 | ||
-- C = 100 | ||
-- D = 500 | ||
-- M = 1000 | ||
|
||
-- */ | ||
|
||
desiredList = [(1,'I'),(5,'V'),(10,'X'),(50,'L'),(100,'C'), (500,'D'),(1000,'M')] | ||
indexing = [1,5,10,50,100,500,1000] | ||
|
||
|
||
devisionIndex x = [ x / i | i <- reverse indexing] | ||
|
||
|
||
-- General case | ||
-- Always larger to smaller - left to right | ||
-- 66 == LXVI | ||
|
||
-- Special cases: | ||
-- 4 = IV | 9 = IX | ||
-- 40 = XL | 90 = XC | ||
-- 400 = CD | 900 = CM | ||
|
||
-- Initial test examples | ||
-- 3 = III | ||
-- 4 = IV | ||
-- 9 = IX | ||
-- 58 = LVIII | ||
-- 1994 = MCMXCIV | ||
-- 3000 = MMM | ||
|
||
isBigGang :: Int -> IO () -- (Bool, String) | ||
isBigGang x = print $ (x > 9, "Compared gang size to 9.") |
Oops, something went wrong.