[Haskell-beginners] Fwd: My first functioning haskell project - a
steganography utility
edgar klerks
edgar.klerks at gmail.com
Tue Jul 13 10:31:10 EDT 2010
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
That is somewhat cleaner.
Greets,
Edgar
On Tue, Jul 13, 2010 at 3:37 PM, Tim Cowlishaw <tim at timcowlishaw.co.uk>wrote:
>
> 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 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/20100713/7704ae46/attachment.html
More information about the Beginners
mailing list