Getting the index (x,y) of a char in a "2D" list in Haskell
Disclaimer: I'm rusty with Haskell, there may be a cleaner way to do this.

Code review: your code looks fine to my eyes, it's just that circuitFind is overly complex, as you suspected. Also note that findIndex (==t) can be written as elemIndex t (source).


  "Let us see whether we could, by chance, conceive some other general
  problem that contains the original problem and is easier to solve." –
  Leibnitz.


We start by solving the more general problem of finding all indices of t in c.

Let's look at the skeleton of our solution.

[ (x,y) | ??? ]


We can get y using zip [0..] as you have done.

[ (x,y) | (y,line) &lt;- zip [0..] c, ??? ]


Now we can find x using elemIndices.

[ (x,y) | (y,line) &lt;- zip [0..] c, x &lt;- elemIndices t line ]


Thanks to lazy evaluation, and Data.Maybe, we get our solution

circuitFind :: Circuit -&gt; Tile -&gt; Maybe Position
circuitFind c t = listToMaybe [ (x,y) | (y,line) &lt;- zip [0..] c, x &lt;- elemIndices t line ]