[Haskell-beginners] mayBe stuck

aditya siram aditya.siram at gmail.com
Thu Aug 5 19:20:06 EDT 2010


Normally yes, but here we are guaranteed to get a 'Just ...' value because
of the 'isNothing' guard.
-deech

On Thu, Aug 5, 2010 at 5:47 PM, Brent Yorgey <byorgey at seas.upenn.edu> wrote:

> On Thu, Aug 05, 2010 at 05:42:40PM -0500, aditya siram wrote:
> >
> > brS :: Maybe Int -> String -> String
> > brS i ss
> >    | isNothing i   = ss
> >    | otherwise     = (take (fromJust i) ss) ++ (brS newIndex newStr)
> >                        where
> >                            newIndex    = findIndex eqD newStr
> >                            newStr      = drop ((fromJust i) +1) ss
>
> /me makes deech write on the blackboard 100 times, "I will not use
> fromJust"
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100805/de6df37c/attachment.html


More information about the Beginners mailing list