Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell Questions

Name: Anonymous 2008-12-03 12:06

Sup dudes, a couple of Haskell questions:

- what is the meaning of "deriving Eq", in the end of a data type definition?

- is there any native Haskell function that giving String A, String B and Int C, to check if A is only made of B and only C times. "Ron" "RonRon" 2 -> True
I could swear I saw something like that in a substring shit

Name: Anonymous 2008-12-04 19:59

>>15
>>16
>>17
>>18

14 here...
What the OP dude was talking about is this:

- he has to make a function that receives a String A, a String B, and an Int C.

test :: String -> String -> Int -> Bool
           A        B        C
- String B will be taken from a [String] available inside the program, say ZS (for instance made of [Z1,Z2,Z3,Z4,B,Z6,blabla]). I don't know how he is going to get this, but it's probably related with a data type he must do... I guess?

- on String A, OP must test if inside this String you can _only_ find the given String B, and not the other 'Z' friends AND if that is true, then B appears exactly C times, if not... False.

examples, with a fixed B of "lol", a fixed C is 2 and a fixed Z with ["lol","wut"]:
A: "lolomgguyslol" is True
A: "lollol" is True
A: "lolol" is False
A: "wutlollol" False

Row Row, Fight The Peyton.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List