Add remaining haskell book exercises

This commit is contained in:
2025-12-11 10:28:11 +01:00
parent 3624c712d7
commit 98329e0a3d
221 changed files with 8033 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
import Data.Monoid
import Exercises
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
main :: IO ()
main = do
quickBatch $ functor $ Pair ('a', 'b', 'c') ('d', 'e', 'f')
quickBatch $ applicative $ Pair ('a', 'b', 'c') ('d', 'e', 'f')
quickBatch $ functor $ Two ('a', 'b', 'c') (1 :: Integer, 2 :: Integer, 3 :: Integer)
quickBatch $ applicative $ Two (Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Sum (1 :: Integer), Sum (2 :: Integer), Sum (3 :: Integer))
quickBatch $ applicative $ Three (Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Sum (1 :: Integer), Sum (2 :: Integer), Sum (3 :: Integer))
(Sum (4 :: Integer), Sum (5 :: Integer), Sum (6 :: Integer))
quickBatch $ applicative $ Three' (Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Sum (1 :: Integer), Sum (2 :: Integer), Sum (3 :: Integer))
(Sum (4 :: Integer), Sum (5 :: Integer), Sum (6 :: Integer))
quickBatch $ applicative $ Four (Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Sum (1 :: Integer), Sum (2 :: Integer), Sum (3 :: Integer))
(Sum (4 :: Integer), Sum (5 :: Integer), Sum (6 :: Integer))
quickBatch $ applicative $ Four (Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Product (1 :: Integer), Product (2 :: Integer), Product (3 :: Integer))
(Sum (4 :: Integer), Sum (5 :: Integer), Sum (6 :: Integer))