[Haskell-cafe] Simple "Maybe" question

Jim Lewis jimlewis at miclog.com
Tue Jan 27 06:20:42 EST 2004

I'm new to Haskell and can't find an example to solve a trivial problem.

I have code like this:
findBlank :: [] -> Int
findBlank str =3D findIndex (=3D=3D' ') str

But interpreter complains elsewhere of mismatch of Int with Maybe Int. I wa=
nt to handle the maybe only here and nowhere else.

This just makes matters worse:
findBlank str =3D Just findIndex (=3D=3D' ') str


Powered by the E-mail PIM - Info Select - www.miclog.com

More information about the Haskell-Cafe mailing list