Submission #1799276


Source Code Expand

import Control.Applicative
import Control.Monad

main :: IO ()
main = do
    -- 整数の入力
    n <- readLn
    -- スペース区切り整数の入力
    l <- sequence $ replicate n readLn
    -- 出力
    putStrLn . show $ minimum l

Submission Info

Submission Time
Task A - おいしいたこ焼きの作り方
User sifi_border
Language Haskell (GHC 7.10.3)
Score 0
Code Size 252 Byte
Status CE

Compile Error

Main.hs:9:33:
    No instance for (Read r0) arising from a use of ‘readLn’
    The type variable ‘r0’ is ambiguous
    Note: there are several potential instances:
      instance Read a => Read (Const a b)
        -- Defined in ‘Control.Applicative’
      instance Read a => Read (ZipList a)
        -- Defined in ‘Control.Applicative’
      instance (Read a, Read b) => Read (Either a b)
        -- Defined in ‘Data.Either’
      ...plus 29 others
    In the second argument of ‘replicate’, namely ‘readLn’
    In the second argument of ‘($)’, namely ‘replicate n readLn’
    In a stmt of a 'do' block: l <- sequence $ replicate n readLn

Main.hs:11:16:
    No instance for (Show r0) arising from a use of ‘show’
    The type variable ‘r0’ is ambiguous
    Relevant bindings include l :: [r0] (bound at Main.hs:9:5)
    Note: there are several potential instances:
      instance Show a => Show (Const a b)
        -- Defined in ‘Control.Applicative’
      instance Show a => Show (ZipList a)
        -- Defined in ‘Contro...