aboutsummaryrefslogtreecommitdiff
path: root/Haskell-book/18/Instance/test/Spec.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-12-11 10:28:11 +0100
committerEugen Wissner <belka@caraus.de>2025-12-11 10:28:11 +0100
commit98329e0a3dd4f78b5d815ac3896272ec70904901 (patch)
tree80f9c56cfe2ac20232358f236d32e84bd683be1b /Haskell-book/18/Instance/test/Spec.hs
parent3624c712d72d246f21d4e710cec7c11e052e0326 (diff)
downloadbook-exercises-98329e0a3dd4f78b5d815ac3896272ec70904901.tar.gz
Add remaining haskell book exercises
Diffstat (limited to 'Haskell-book/18/Instance/test/Spec.hs')
-rw-r--r--Haskell-book/18/Instance/test/Spec.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Haskell-book/18/Instance/test/Spec.hs b/Haskell-book/18/Instance/test/Spec.hs
new file mode 100644
index 0000000..ea250fc
--- /dev/null
+++ b/Haskell-book/18/Instance/test/Spec.hs
@@ -0,0 +1,29 @@
+import Sum
+import Nope
+import qualified PhhhbbtttEither as Phhhbbttt
+import Identity
+import List
+import Test.QuickCheck.Checkers
+import Test.QuickCheck.Classes
+
+main :: IO ()
+main = do
+ quickBatch $ functor $ (First (1, 2, 3) :: Sum (Int, Int, Int) (Int, Int, Int))
+ quickBatch $ applicative $ (First (1, 2, 3) :: Sum (Int, Int, Int) (Int, Int, Int))
+ quickBatch $ monad $ (First (1, 2, 3) :: Sum (Int, Int, Int) (Int, Int, Int))
+
+ quickBatch $ functor $ (NopeDotJpg :: Nope (Int, Int, Int))
+ quickBatch $ applicative $ (NopeDotJpg :: Nope (Int, Int, Int))
+ quickBatch $ monad $ (NopeDotJpg :: Nope (Int, Int, Int))
+
+ quickBatch $ functor $ (Phhhbbttt.Left (1, 2, 3) :: Phhhbbttt.PhhhbbtttEither (Int, Int, Int) (Int, Int, Int))
+ quickBatch $ applicative $ (Phhhbbttt.Left (1, 2, 3) :: Phhhbbttt.PhhhbbtttEither (Int, Int, Int) (Int, Int, Int))
+ quickBatch $ monad $ (Phhhbbttt.Left (1, 2, 3) :: Phhhbbttt.PhhhbbtttEither (Int, Int, Int) (Int, Int, Int))
+
+ quickBatch $ functor $ (Identity (1, 2, 3) :: Identity (Int, Int, Int))
+ quickBatch $ applicative $ (Identity (1, 2, 3) :: Identity (Int, Int, Int))
+ quickBatch $ monad $ (Identity (1, 2, 3) :: Identity (Int, Int, Int))
+
+ quickBatch $ functor (Cons (1 :: Integer, 2 :: Integer, 3 :: Integer) Nil)
+ quickBatch $ applicative (Cons (1 :: Integer, 2 :: Integer, 3 :: Integer) Nil)
+ quickBatch $ monad (Cons (1 :: Integer, 2 :: Integer, 3 :: Integer) Nil)