<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
W dniu 02.03.2014 22:44, Roelof Wobben pisze:<br>
</div>
<blockquote cite="mid:5313A62E.7060101@home.nl" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hello, <br>
<br>
I now have to use foldr to find the max value in a list. <br>
<br>
So I do this: <br>
<br>
import Data.Char<br>
<br>
x = foldr max [5,10,2,8.1]<br>
-- Note that comments are preceded by two hyphens<br>
{- or enclosed<br>
in curly brace/hypens pairs. -}<br>
main = print x<br>
<br>
But now I see this error message: <br>
<title>Active code from: 1: Haskell Basics</title>
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/combined/mU19TgtT.css"
rel="stylesheet">
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/combined/Wr4atfQw.css"
rel="stylesheet">
<style>.stdout{font-family:'ubuntu mono', 'consolas', 'monaco', monospace;font-size:14px;white-space:pre-wrap;min-height:2em}.stdout .user-input:before{content:"> "}.stdout .user-input,.stdout .stdin{color:#444;font-weight:bold;display:block}.stdout .user-input-error{color:#FF2525}.stdout .stdin{font-family:inherit;font-size:inherit;height:2em;border:0px solid #fff;outline:none;width:100%;background-color:rgba(0,0,0,0.03);border-radius:0.5em}.stdout .stdinform{display:none;margin:0;padding:0;width:100%}#desk-support-box.fpco{height:610px}</style>
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/css/favicon-ide.ico?etag=sxaRfGE2"
rel="icon" type="image/png">
<link href="https://fonts.googleapis.com/css?family=Ubuntu"
rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Ubuntu+Mono&subset=latin,greek,latin-ext"
rel="stylesheet" type="text/css">
<link href="https://www.fpcomplete.com/static/css/ide.css"
rel="stylesheet" type="text/css">
<link
href="https://desk-customers.s3.amazonaws.com/shared/email_widget.css"
rel="stylesheet" media="screen">
<!--[if IE]>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<div id="prompt"></div>
<script>
window.attachEvent("onload", function() {
CFInstall.check({
mode: "inline", // the default
node: "prompt"
});
});
</script>
<![endif]--><br>
main.hs@7:8-7:13<br>
No instance for (Show ([[t0]] -> [t0])) arising from a use
of `print' Possible fix: add an instance declaration for (Show
([[t0]] -> [t0])) In the expression: print x In an equation for
`main': main = print x<br>
<br>
<title>Active code from: 1: Haskell Basics</title>
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/combined/mU19TgtT.css"
rel="stylesheet">
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/combined/Wr4atfQw.css"
rel="stylesheet">
<style>.stdout{font-family:'ubuntu mono', 'consolas', 'monaco', monospace;font-size:14px;white-space:pre-wrap;min-height:2em}.stdout .user-input:before{content:"> "}.stdout .user-input,.stdout .stdin{color:#444;font-weight:bold;display:block}.stdout .user-input-error{color:#FF2525}.stdout .stdin{font-family:inherit;font-size:inherit;height:2em;border:0px solid #fff;outline:none;width:100%;background-color:rgba(0,0,0,0.03);border-radius:0.5em}.stdout .stdinform{display:none;margin:0;padding:0;width:100%}#desk-support-box.fpco{height:610px}</style>
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/css/favicon-ide.ico?etag=sxaRfGE2"
rel="icon" type="image/png">
<link href="https://fonts.googleapis.com/css?family=Ubuntu"
rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Ubuntu+Mono&subset=latin,greek,latin-ext"
rel="stylesheet" type="text/css">
<link href="https://www.fpcomplete.com/static/css/ide.css"
rel="stylesheet" type="text/css">
<link
href="https://desk-customers.s3.amazonaws.com/shared/email_widget.css"
rel="stylesheet" media="screen">
<!--[if IE]>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<div id="prompt"></div>
<script>
window.attachEvent("onload", function() {
CFInstall.check({
mode: "inline", // the default
node: "prompt"
});
});
</script>
<![endif]-->
<title>Active code from: 1: Haskell Basics</title>
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/combined/mU19TgtT.css"
rel="stylesheet">
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/combined/Wr4atfQw.css"
rel="stylesheet">
<style>.stdout{font-family:'ubuntu mono', 'consolas', 'monaco', monospace;font-size:14px;white-space:pre-wrap;min-height:2em}.stdout .user-input:before{content:"> "}.stdout .user-input,.stdout .stdin{color:#444;font-weight:bold;display:block}.stdout .user-input-error{color:#FF2525}.stdout .stdin{font-family:inherit;font-size:inherit;height:2em;border:0px solid #fff;outline:none;width:100%;background-color:rgba(0,0,0,0.03);border-radius:0.5em}.stdout .stdinform{display:none;margin:0;padding:0;width:100%}#desk-support-box.fpco{height:610px}</style>
<link
href="https://s3.amazonaws.com/production-20131217-2207-staticbucket-lnf49w8li1j8/css/favicon-ide.ico?etag=sxaRfGE2"
rel="icon" type="image/png">
<link href="https://fonts.googleapis.com/css?family=Ubuntu"
rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Ubuntu+Mono&subset=latin,greek,latin-ext"
rel="stylesheet" type="text/css">
<link href="https://www.fpcomplete.com/static/css/ide.css"
rel="stylesheet" type="text/css">
<link
href="https://desk-customers.s3.amazonaws.com/shared/email_widget.css"
rel="stylesheet" media="screen">
<!--[if IE]>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<div id="prompt"></div>
<script>
window.attachEvent("onload", function() {
CFInstall.check({
mode: "inline", // the default
node: "prompt"
});
});
</script>
<![endif]--><br>
</blockquote>
<br>
Please look at foldr type and documentation. There is one argument
missing in your code.<br>
<br>
Regards,<br>
Emanuel<br>
<br>
</body>
</html>