News for hackers. Stuff that matters.
Re:Mastering Time-to-Market with Haskell by pka on Tuesday November 22, 2016 @10:31AM (#13014742)
I.e. look at how PureScript does it [0]. Haskell could do the same.

[0] https://pursuit.purescript.org/packages/purescript-arrays/3....

Re:Mastering Time-to-Market with Haskell by jstimpfle on Tuesday November 22, 2016 @11:09AM (#13015013)
Sure, I can use a Maybe variant, but the consequence would be that I wrap the whole program in a layer of maybes for cases that I "know" shouldn't happen but happened -- because I do make mistakes.

Or in other words, an "AssertionMonad". No thanks, I'm perfectly fine with assertion errors (i.e. "Index out of bounds"). I just need help with finding my own errors. Stacktraces are a good thing.

Re:Mastering Time-to-Market with Haskell by pka on Tuesday November 22, 2016 @11:34AM (#13015224)
I agree, stack traces are a good thing.

For the time being, make a helper function:

ixWithString :: String -> Int -> Array a -> a

check the bounds inside and error out with a custom message when the index is outside the array bounds.