
On Thu, Aug 05, 2010 at 06:20:06PM -0500, aditya siram wrote:
Normally yes, but here we are guaranteed to get a 'Just ...' value because of the 'isNothing' guard. -deech
You are correct, but that's not the point. Every time you use fromJust (or head, or unsafePerformIO...) you shift the burden of proving that it is safe from the compiler onto yourself. It's like going to a fancy restaurant and insisting on going into the kitchen and cooking your own meal. -Brent
On Thu, Aug 5, 2010 at 5:47 PM, Brent Yorgey
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@haskell.org http://www.haskell.org/mailman/listinfo/beginners