Dan Fornika <dforn...@gmail.com> writes:

> Aha!  I think I've got it! Look at how the 'break' function works

Ah, of course.


> I fixed this by switching line 32  of Phd.hs from:
>
> (comment,sd) = break (==B.pack "BEGIN_DNA") fs
>
> to this:
>
> (comment,bdna:sd) = break (==B.pack "BEGIN_DNA") fs
>
> where "bdna" is just meant to capture that "BEGIN_DNA" bytestring.

Yes.

> When I compile, ghc complains that bdna is defined and not used, but
> that is sort of what I intend for now.  Other than that, it works well
> enough for my purposes.

To supress the warning, use an identifier that starts with an
underscore (or even one that is just an underscore):

   (comment,_:sd) = break (==B.pack "BEGIN_DNA") fs

Another concern is that the pattern match may fail - but in that case
the file is broken.  To get a better error message, perhaps do:

   case break (...) fs of (comment,_:sd) -> ...
                          _ -> error "Parse error: Couldn't find BEGIN_DNA in 
PHD file."

or something like that.

> I know this is a really minor fix, but would you mind taking me through
> the normal process of submitting a patch?

You have the darcs repository?  I.e. you did

    darcs get http://malde.org/~ketil/biohaskell/biolib

If so, do

   cd biolib
   vi Bio/Sequence/Phd.hs  -- I assume you did this?
   make test               -- or at least make sure things work at least
                           -- as well as they used to
   darcs record
   darcs send

I think that should suffice, let me know how it goes!

> Do people normally just suggest things for you to change via
> email, and then you integrate it yourself?

I don't think there are enough users to state what is "normal" or
not. :-) But I do have received some patches (look at "darcs changes"),
and also some feature requests. 

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Biohaskell mailing list
Biohaskell@biohaskell.org
http://malde.org/cgi-bin/mailman/listinfo/biohaskell

Reply via email to