MK
Read хочется?Size: a a a
MK
Read хочется?ПК
MK
AV
AV
AV
AV
let f = (\s -> asum [Left <$> readMaybe s, Right <$> readMaybe s]) :: String -> (Maybe (Either () Int))
Prelude Text.Read Data.Foldable> f "()"
Just (Left ())
Prelude Text.Read Data.Foldable> f "1"
Just (Right 1)
Prelude Text.Read Data.Foldable> f "yo"
NothingAV
AV
ПК
let f = (\s -> asum [Left <$> readMaybe s, Right <$> readMaybe s]) :: String -> (Maybe (Either () Int))
Prelude Text.Read Data.Foldable> f "()"
Just (Left ())
Prelude Text.Read Data.Foldable> f "1"
Just (Right 1)
Prelude Text.Read Data.Foldable> f "yo"
NothingПК
Prelude> a = read "4"?
Prelude> a :: Char
*** Exception: Prelude.read: no parse
ПК
AV
AT
AV
AT
AV
AV
AV
AV