Submission #1520538


Source Code Expand

main = putStrLn =<< p . and . zipWith s <$> getLine <*> getLine
 
s :: Char -> Char -> Bool
s x y
  | x == y = True
  | x == '@' && y `elem` "atcoder" = True
  | y == '@' && x `elem` "atcoder" = True
  | otherwise = False
 
p :: Bool -> String
p True = "You can win"
p False = "You will lose"

Submission Info

Submission Time
Task B - AtCoderトランプ
User Gash788
Language Haskell (GHC 7.10.3)
Score 0
Code Size 303 Byte
Status CE

Compile Error

Main.hs:1:21:
    Couldn't match type ‘[Char]’ with ‘String -> String’
    Expected type: Bool -> String -> String
      Actual type: Bool -> String
    In the first argument of ‘(.)’, namely ‘p’
    In the first argument of ‘(<$>)’, namely ‘p . and . zipWith s’

Main.hs:1:31:
    Couldn't match type ‘[Bool]’ with ‘Bool’
    Expected type: [Char] -> [Char] -> Bool
      Actual type: [Char] -> [Char] -> [Bool]
    In the second argument of ‘(.)’, namely ‘zipWith s’
    In the second argument of ‘(.)’, namely ‘and . zipWith s’