blob: 69c27d01ea08289b3952bb39b7beb1fcba841233 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-- !!! Testing Show on Maybes and Eithers
module Main(main) where
x :: Maybe ()
x = Nothing
main :: IO ()
main = do
print x
print (Just ())
print ((Just (Just ())) :: Maybe (Maybe ()))
print (Just x)
print ((Left 'a') :: Either Char Int)
print ((Right 'b') :: Either Int Char)
print ((Right x) :: Either Int (Maybe ()))
print ((Right (Just 'c')) :: Either Int (Maybe Char))
print ((Right (Right 'd')) :: Either Int (Either Char Char))
print ((Right (Left 'e')) :: Either Int (Either Char Int))
print ((Left 'f') :: Either Char Int)
print ((Left x) :: Either (Maybe ()) Char)
print ((Left (Just 'g')) :: Either (Maybe Char) ())
print ((Left (Right 'h')) :: Either (Either Int Char) Char)
print ((Left (Right 'i')) :: Either (Either Int Char) ())
|