
22 Apr
2011
22 Apr
'11
3:31 p.m.
On 22 April 2011 21:26, Henning Thielemann
In idiomatic Haskell you would write
case userList of Nothing -> Nothing Just plainUserList = let user = findUser "bob" plainUserList ...
since (userList /= Nothing) requires an Eq instance without need and it requires fromJust. Or was there an educational purpose to write it with (/= Nothing) ?
Educational; it was just to make it look like and have similar meaning (as I perceived it) to the Fantom code. (I'd never write code like this; I use case analysis and avoid if.)