I am a newby to Haskell and I am trying to create a function that takes a triple and returns an array of triples, like so:
tripleVariations 1 (0,0,0)
=> [(1,0,0), (0,1,0), (0,0,1)]
I understand how to match to a specific value in the triple with pattern matching and I even created a custom function that maps a function over a triple, but I don't understand how to replace one value of the triple, add that to the array and then continue to the next value in the triple. I find that I tend to try and solve these problems too much according to imperative paradigm, which is exactly what I'm trying to avoid. Any help is welcome, thanks!