[Haskell-beginners] searching for an element from a list of tuples
anvikakumar93 at gmail.com
Mon May 9 12:02:49 UTC 2016
Let me review and get back. Thank you.
STONY BROOK UNIVERSITY
On Mon, May 9, 2016 at 6:25 PM, Sumit Sahrawat, Maths & Computing, IIT
(BHU) <sumit.sahrawat.apm13 at iitbhu.ac.in> wrote:
> Try pattern matching on the list head and tail as in (x:xs). Take a look
> at the source code for filter , which can be put to use here.
> On 09-May-2016 9:41 am, "Anvika Kumar" <anvikakumar93 at gmail.com> wrote:
>> I have a tuple with three values and i want to remove the tuple which
>> contains a particular name.
>> So d = (name, month, date)
>> i take a user input of name and then search the list which has tuples of
>> the above declared type. Which ever tuple has the name it should be deleted
>> from the list.
>> d is the tuple.
>> db should be a list of tuples.
>> remove :: (Eq) => IO String -> d
>> print "Enter the name to be removed”
>> a <- getLine
>> remove x  = 
>> print “Record not found”
>> remove x db =
>> if x ==
>> Please let me know!
>> Thanks a lot
>> Beginners mailing list
>> Beginners at haskell.org
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners