New Posts  All Forums:Forum Nav:

Help with Haskell

post #1 of 4
Thread Starter 
Hello,

I'm not sure if anyone here knows Haskell however I'm learning it now and have come across a problem I can't get my head around.

I'll try to explain it as best as I can.

Essentially I have two lists of tuples which are as follows: [(String,Integer)] and [(Float,Integer)] - (each list has several tuples)

What I need to do is: For every integer that has a float in the second list check if it's integer matches the integer in the first list and if it does return the string, although this function needs to return a list of strings, i.e. [String] with all the results.

I have already defined a function which returns a list of Integers from the second list (for the comparison on the integers in the first list).

This should be solvable using "high-order functions" of which I've spent a considerably amount of time playing with map and filter but haven't found a solution!

Thanks
    
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E8400 @ 3GHz Asus P5N73-AM 1GB XFX HD 5830 4GB Corsair DDR2 800MHz 
Hard DriveOptical DriveOSMonitor
Western Digital 7200RPM 500GB LiteOn 16x DVD±RW Windows 7 Professional 64-Bit 22" Samsung P2350 
KeyboardPowerCaseMouse
Logitech Media 600 Arctic Power 700W Antec Mini P180 Logitech RX1000 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E8400 @ 3GHz Asus P5N73-AM 1GB XFX HD 5830 4GB Corsair DDR2 800MHz 
Hard DriveOptical DriveOSMonitor
Western Digital 7200RPM 500GB LiteOn 16x DVD±RW Windows 7 Professional 64-Bit 22" Samsung P2350 
KeyboardPowerCaseMouse
Logitech Media 600 Arctic Power 700W Antec Mini P180 Logitech RX1000 
  hide details  
Reply
post #2 of 4
Hi there!

Well, I am sorry I won't be any help at all with Haskell since I have never had any experience with it.

The general algorithm of the program should be simple though. It's just that I haven't dealt with functional programming languages. If you want me to, I can have a go at it with Java.

Anyway...bump for you.
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #3 of 4
Thread Starter 
Thanks for your reply, indeed it should be relatively simple yet I've managed to waste so much time trying to figure it out! I do Java myself so I don't need a Java translation, thanks for the offer though smile.gif
    
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E8400 @ 3GHz Asus P5N73-AM 1GB XFX HD 5830 4GB Corsair DDR2 800MHz 
Hard DriveOptical DriveOSMonitor
Western Digital 7200RPM 500GB LiteOn 16x DVD±RW Windows 7 Professional 64-Bit 22" Samsung P2350 
KeyboardPowerCaseMouse
Logitech Media 600 Arctic Power 700W Antec Mini P180 Logitech RX1000 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E8400 @ 3GHz Asus P5N73-AM 1GB XFX HD 5830 4GB Corsair DDR2 800MHz 
Hard DriveOptical DriveOSMonitor
Western Digital 7200RPM 500GB LiteOn 16x DVD±RW Windows 7 Professional 64-Bit 22" Samsung P2350 
KeyboardPowerCaseMouse
Logitech Media 600 Arctic Power 700W Antec Mini P180 Logitech RX1000 
  hide details  
Reply
post #4 of 4
Thread Starter 
Figured it out now smile.gif
    
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E8400 @ 3GHz Asus P5N73-AM 1GB XFX HD 5830 4GB Corsair DDR2 800MHz 
Hard DriveOptical DriveOSMonitor
Western Digital 7200RPM 500GB LiteOn 16x DVD±RW Windows 7 Professional 64-Bit 22" Samsung P2350 
KeyboardPowerCaseMouse
Logitech Media 600 Arctic Power 700W Antec Mini P180 Logitech RX1000 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E8400 @ 3GHz Asus P5N73-AM 1GB XFX HD 5830 4GB Corsair DDR2 800MHz 
Hard DriveOptical DriveOSMonitor
Western Digital 7200RPM 500GB LiteOn 16x DVD±RW Windows 7 Professional 64-Bit 22" Samsung P2350 
KeyboardPowerCaseMouse
Logitech Media 600 Arctic Power 700W Antec Mini P180 Logitech RX1000 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming