Hi Tim,
I have a small remark. You can use maybe from Data.Maybe: b -> (a -> b) -> Maybe a -> b
to create your maybe plus function:
maybePlus x y = maybe 0 id $ liftM2 (+) x y
Hey there all,
I've just completed my first functional haskell project - a simple utility for steganography - hiding messages within the least significant bit of another sort of data file.
Therefore, I was wondering if any of you had any pointers about how I could refactor or otherwise improve my code? Any input would be greatly appreciated - whether howling great errors or smaller points of "good haskell style". In particular, I'd be really interested in whether my type declarations are correct - for instance, whether I have been to specific or not specific enough in specifying the types of my functions (Integral vs Int, etc).
In addition, I keep feeling that my Steganograph 'smells like' a monad and/or functor , as it 'wraps around' a message - however, I'm having trouble defining quite how I could achieve construct a monadic type representing a steganograph. Is my hunch incorrect, or is there a way of doing this that I haven't yet discovered?
The sources is here: http://gist.github.com/473862
Cheers,
Tim
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners