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 coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.