[Haskell-cafe] propogation of Error
brad clawsie
clawsie at fastmail.fm
Thu Dec 4 23:58:46 EST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hi. i have a partial library for parsing ogg files here:
http://hpaste.org/12705
i have a question about an aspect of the code. in the function
checkHeader
there are a sequence of functions to check various elements in the
header of a ogg file. if i test this function against a file that
*isn't* an ogg file, i.e.
badFile = "/home/user/.bashrc" :: String
main = parseOgg badFile >>= (\x -> print x)
i would expect to get back the Error from the *first* function in the
sequence of functions in checkHeader (oggHeaderError from the oggHeader
function). but instead i always see the Error from the *last* function
in the sequence, OggPacketFlagError from the OggPacketFlag function. why
is this? is there any way i can get the desired behavior...i.e. see the
Error from the first function in the sequence that fails?
thanks
brad
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkk4tQYACgkQxRg3RkRK91PD9gCePloWFIvE9WjcfApxR2RmnHQ0
pUgAn0WAzRQR/y2yE8yeYP1s7eKHyKDh
=EcOM
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe
mailing list