Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- import Data.Fixed
- trip j 1 = if sqrt(j^2 + 1) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- trip 1 k = if sqrt(1 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- trip j k = if sqrt(j^2 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else (trip j-1 k) + (trip j k-1)
- main = trip 1000 1000
- [1 of 1] Compiling Main ( 0009.hs, 0009.o )
- 0009.hs:5:56: error:
- • Couldn't match type ‘(a -> a -> a) -> t -> a2’ with ‘[Char]’
- Expected type: String
- Actual type: (a -> a -> a) -> t -> a2
- • Probable cause: ‘j’ is applied to too few arguments
- In the first argument of ‘putStrLn’, namely ‘j’
- In the first argument of ‘(*)’, namely ‘putStrLn j’
- In the first argument of ‘(*)’, namely ‘putStrLn j * k’
- • Relevant bindings include
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:5:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 5 | trip j 1 = if sqrt(j^2 + 1) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^
- 0009.hs:5:60: error: Variable not in scope: k :: IO ()
- |
- 5 | trip j 1 = if sqrt(j^2 + 1) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^
- 0009.hs:5:64: error:
- • Couldn't match expected type ‘IO ()’
- with actual type ‘(a -> a -> a) -> t -> a2’
- • Probable cause: ‘sqrt’ is applied to too few arguments
- In the second argument of ‘(*)’, namely ‘sqrt (j ^ 2 + k ^ 2)’
- In the expression: putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- In the expression:
- if sqrt (j ^ 2 + 1) mod' 1 == 0 then
- putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- else
- 1
- • Relevant bindings include
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:5:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 5 | trip j 1 = if sqrt(j^2 + 1) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^^^^^^^^^^^^^^^
- 0009.hs:5:75: error:
- Variable not in scope: k :: (a -> a -> a) -> t -> a2
- |
- 5 | trip j 1 = if sqrt(j^2 + 1) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^
- 0009.hs:6:56: error: Variable not in scope: j :: String
- |
- 6 | trip 1 k = if sqrt(1 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^
- 0009.hs:6:60: error:
- • Couldn't match expected type ‘IO ()’
- with actual type ‘(a -> a -> a) -> t -> a2’
- • Probable cause: ‘k’ is applied to too few arguments
- In the second argument of ‘(*)’, namely ‘k’
- In the first argument of ‘(*)’, namely ‘putStrLn j * k’
- In the expression: putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:6:8)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 6 | trip 1 k = if sqrt(1 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^
- 0009.hs:6:64: error:
- • Couldn't match expected type ‘IO ()’
- with actual type ‘(a -> a -> a) -> t -> a2’
- • Probable cause: ‘sqrt’ is applied to too few arguments
- In the second argument of ‘(*)’, namely ‘sqrt (j ^ 2 + k ^ 2)’
- In the expression: putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- In the expression:
- if sqrt (1 + k ^ 2) mod' 1 == 0 then
- putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- else
- 1
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:6:8)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 6 | trip 1 k = if sqrt(1 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^^^^^^^^^^^^^^^
- 0009.hs:6:69: error:
- Variable not in scope: j :: (a -> a -> a) -> t -> a2
- |
- 6 | trip 1 k = if sqrt(1 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else 1
- | ^
- 0009.hs:8:58: error:
- • Couldn't match type ‘(a -> a -> a) -> t -> a2’ with ‘[Char]’
- Expected type: String
- Actual type: (a -> a -> a) -> t -> a2
- • Probable cause: ‘j’ is applied to too few arguments
- In the first argument of ‘putStrLn’, namely ‘j’
- In the first argument of ‘(*)’, namely ‘putStrLn j’
- In the first argument of ‘(*)’, namely ‘putStrLn j * k’
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:8)
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 8 | trip j k = if sqrt(j^2 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else (trip j-1 k) + (trip j k-1)
- | ^
- 0009.hs:8:62: error:
- • Couldn't match expected type ‘IO ()’
- with actual type ‘(a -> a -> a) -> t -> a2’
- • Probable cause: ‘k’ is applied to too few arguments
- In the second argument of ‘(*)’, namely ‘k’
- In the first argument of ‘(*)’, namely ‘putStrLn j * k’
- In the expression: putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:8)
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 8 | trip j k = if sqrt(j^2 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else (trip j-1 k) + (trip j k-1)
- | ^
- 0009.hs:8:66: error:
- • Couldn't match expected type ‘IO ()’
- with actual type ‘(a -> a -> a) -> t -> a2’
- • Probable cause: ‘sqrt’ is applied to too few arguments
- In the second argument of ‘(*)’, namely ‘sqrt (j ^ 2 + k ^ 2)’
- In the expression: putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- In the expression:
- if sqrt (j ^ 2 + k ^ 2) mod' 1 == 0 then
- putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- else
- (trip j - 1 k) + (trip j k - 1)
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:8)
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 8 | trip j k = if sqrt(j^2 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else (trip j-1 k) + (trip j k-1)
- | ^^^^^^^^^^^^^^^
- 0009.hs:8:87: error:
- • Couldn't match expected type ‘IO ()’
- with actual type ‘((a -> a -> a) -> t -> a2) -> IO ()’
- • Probable cause: ‘(+)’ is applied to too few arguments
- In the expression: (trip j - 1 k) + (trip j k - 1)
- In the expression:
- if sqrt (j ^ 2 + k ^ 2) mod' 1 == 0 then
- putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- else
- (trip j - 1 k) + (trip j k - 1)
- In an equation for ‘trip’:
- trip j k
- = if sqrt (j ^ 2 + k ^ 2) mod' 1 == 0 then
- putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- else
- (trip j - 1 k) + (trip j k - 1)
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:8)
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 8 | trip j k = if sqrt(j^2 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else (trip j-1 k) + (trip j k-1)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 0009.hs:8:103: error:
- • Couldn't match expected type ‘((a -> a -> a) -> t -> a2)
- -> IO ()’
- with actual type ‘IO ()’
- • Possible cause: ‘(-)’ is applied to too many arguments
- In the second argument of ‘(+)’, namely ‘(trip j k - 1)’
- In the expression: (trip j - 1 k) + (trip j k - 1)
- In the expression:
- if sqrt (j ^ 2 + k ^ 2) mod' 1 == 0 then
- putStrLn j * k * sqrt (j ^ 2 + k ^ 2)
- else
- (trip j - 1 k) + (trip j k - 1)
- • Relevant bindings include
- k :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:8)
- j :: (a -> a -> a) -> t -> a2 (bound at 0009.hs:8:6)
- trip :: ((a -> a -> a) -> t -> a2)
- -> ((a -> a -> a) -> t -> a2) -> IO ()
- (bound at 0009.hs:5:1)
- |
- 8 | trip j k = if sqrt(j^2 + k^2) mod' 1 == 0 then putStrLn j * k * sqrt(j^2 + k^2) else (trip j-1 k) + (trip j k-1)
- | ^^^^^^^^^^
- 0009.hs:10:13: error:
- • No instance for (Num ((a0 -> a0 -> a0) -> t0 -> a1))
- arising from the literal ‘1000’
- (maybe you haven't applied a function to enough arguments?)
- • In the first argument of ‘trip’, namely ‘1000’
- In the expression: trip 1000 1000
- In an equation for ‘main’: main = trip 1000 1000
- |
- 10 | main = trip 1000 1000
Add Comment
Please, Sign In to add comment