This is close, but string is not an object in Haskell.
You have to Map aFunction over aString
Take a look at signature for 'map'.
map :: (a -> b) -> [a] -> [b]
-------- Original Message --------
Subject: Re: [Haskell-beginners] where do i get wrong
From: Roelof Wobben <r.wobben@home.nl>
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org>
Date: 02.03.2014 20:50
Correect, I forget to use map
But also x = map "aBCde".islower does not work.
I think I have to find out how I can ghci in fpcomplete or use another IDE which supports it.
Roelof
Ryan Stradling schreef op 2-3-2014 20:44:
isLower takes a character. You need to look at operating on the string with higher order functions which will call isLower on each character.
On Mar 2, 2014 2:25 PM, "Roelof Wobben" <r.wobben@home.nl> wrote:
Found this one:
This is partly working:
import Data.Char
x = "aBCde".isLower
-- Note that comments are preceded by two hyphens
{- or enclosed
in curly brace/hypens pairs. -}
main = print x
But now I see this error:
Main.hs@3:5-3:12Couldn't match expected type `b0 -> c0' with actual type `[Char]' In the first argument of `(.)', namely `"aBCde"' In the expression: "aBCde" . isLower In an equation for `x': x = "aBCde" . isLower In an equation for `x': x = "aBCde" . isLower
Roelof
Roelof Wobben schreef op 2-3-2014 20:10:
Thanks,
isLower is in base package.
The tutorial has not spoken about importing modules.
I use the IDE of fpcomplete.
Roelof
Bob Ippolito schreef op 2-3-2014 20:02:
isLower is not in the Prelude (the automatically imported module built-in functions). Here's the list of all functions in Prelude:
isLower is in another module. You can figure that out by searching for "isLower" on Hoogle:
You can even find it by searching for it by type, which is useful if you don't remember the precise name. Try searching for "Char -> Bool".
In other words, you'll need to import isLower from somewhere before you can use it.
On Sun, Mar 2, 2014 at 10:45 AM, Roelof Wobben <r.wobben@home.nl> wrote:
Hello,
I try to selfstudy haskell by following the yet another haskell tutorial.
Now I have the exercise where I have a string and have to convert it into a list of Booleans based on lower cats letter using map.
So i tried this
x = "aBCde".islower:[]
But I see this error : Not in Scope: 'isLower'.
Where do I make my error.
Do not give the answer otherwise I do not learn anything from it.
Roelof
---
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus-bescherming actief is.
http://www.avast.com
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
![]()
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus actief is.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
![]()
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus actief is.
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
![]()
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus actief is.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
![]() |
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus actief is. |