Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Haskell: After zipping the lists together I\'m trying to access the int that is

ID: 3765548 • Letter: H

Question

Haskell:

After zipping the lists together I'm trying to access the int that is associated with the char value. So if I say position 'X' it should return 33. the problem with the code below is that it returns [33] which is a list of the int I want. Any help would be greatly appreciated. Remember I want the return to be of type Int and not of type [Int].

Example:

Main> position 'X'

[33]

position x = [i | (x',i) <- createKey, x==x']

createKey :: [(Char, Int)]

createKey = zip (['0'..'9']++['A'..'Z']) ([0..35])

Explanation / Answer

#include using namespace std; int main() { int a = 50; // initialize integer variable a cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote