
22 Apr
2015
22 Apr
'15
4:23 p.m.
Hello, Well, you CAN use fromJust, but bear in mind that you should only use it if you are absolutely, positively, 100% sure the Maybe value you are calling fromJust on is of the form (Just something), because your program will error out if you call fromJust on a Nothing. Even if you're sure it's not a Nothing, it might be better to use maybe (error "Impossible, because (...)") id instead, so that you at the very least get a meaningful error message in case "impossible" happens ;) Other than that, it's recomennded to either use the maybe function, or pattern matching: case foo of Just x -> ... Nothing -> ... instead. Best regards, Marcin Mrotek