[1 of 1] Compiling Main ( /in/foo.hs, /tmp/Main.o )
/in/foo.hs:1:19: error:
* Couldn't match expected type `Int -> [a0]'
with actual type `[a1]'
* The function `solve' is applied to one argument,
but its type `[a1]' has none
In the first argument of `(!!)', namely `solve p'
In the expression: solve p !! (n - p)
/in/foo.hs:1:35: error:
* Couldn't match type `[b0]' with `Int'
Expected type: String -> Int
Actual type: String -> [b0]
* In the second argument of `(.)', namely `map read . words'
In the second argument of `(.)', namely
`(\ n p -> solve p !! (n - p)) . map read . words'
In the first argument of `(=<<)', namely
`print . (\ n p -> solve p !! (n - p)) . map read . words'
/in/foo.hs:2:9: error:
* Couldn't match expected type `[a]'
with actual type `Integer -> [Integer]'
* In an equation for `main':
main
= print . (\ n p -> solve p !! (n - p)) . map read . words
=<< getLine
where
solve y = (y * 2) : zipWith (+) (tail solve x y) [y .. ]
* Relevant bindings include solve :: [a] (bound at /in/foo.hs:2:9)
/in/foo.hs:2:34: error:
* Couldn't match expected type `t0 -> Integer -> [Integer]'
with actual type `[a]'
* The function `tail' is applied to three arguments,
but its type `[a] -> [a]' has only one
In the second argument of `zipWith', namely `(tail solve x y)'
In the second argument of `(:)', namely
`zipWith (+) (tail solve x y) [y .. ]'
* Relevant bindings include solve :: [a] (bound at /in/foo.hs:2:9)
/in/foo.hs:2:45: error: Variable not in scope: x