[Haskell-beginners] Using "cabal test" and getting "cabal: Prelude.read: no parse"

Erik Price erikprice at gmail.com
Mon May 26 21:20:47 UTC 2014


It's possible that you're calling the

    read :: Read a => String -> a

function somewhere with a parameter that the function doesn't know how to
parse. I ran into this just today when I called

    read "a string" :: String

when what I needed to call was

    read "\"a string\"" :: String

e

On Monday, May 26, 2014, Boris <Boris.Daix at gmail.com> wrote:

> Hello,
>
> Last time I got such an error, it was because I was using 'read' for a
> type I had defined myself, deriving Read, but on something that was not
> reelated to the type.  For instance:
>
> data Foo = Foo deriving (Read, Show)
>
> x :: Foo
> x = read "Bar"
>
> Do you use read somwhere?
>
> HTH
>
> Daniel King <daniel.zidan.king at gmail.com <javascript:;>> writes:
>
> > Hi all,
> >
> > I created a cabal project with the attached cabal file. I run:
> >
> >   cabal configure --enable-tests
> >   cabal build
> >   cabal test
> >
> > and then I get the error:
> >
> >   cabal: Prelude.read: no parse
> >
> > I'm not sure how to debug this any further. If I execute:
> >
> >   ./dist/build/scientific-pl-testsStub/scientific-pl-testsStub
> >
> > with any input I've tried (numbers, array notation, string notation,
> > etc.) and I get that same error.
> >
> > I can post the whole project if that is helpful.
> >
> > Thanks for the debugging tips!
> >
> > The full log is:
> >
> > danking at spock # cabal configure --enable-tests
> > Resolving dependencies...
> > Configuring scientific-pl-0.1.0.0...
> > danking at spock # cabal build
> > Building scientific-pl-0.1.0.0...
> > Preprocessing test suite 'scientific-pl-tests' for
> scientific-pl-0.1.0.0...
> > [1 of 3] Compiling SPLData          ( SPLData.hs, dist/build/SPLData.o )
> > [2 of 3] Compiling SPLEval          ( SPLEval.hs, dist/build/SPLEval.o )
> > [3 of 3] Compiling Tests            ( tests/Tests.hs, dist/build/Tests.o
> )
> > In-place registering scientific-pl-tests-0.1.0.0...
> > [1 of 1] Compiling Main             (
> >
> dist/build/scientific-pl-testsStub/scientific-pl-testsStub-tmp/scientific-pl-testsStub.hs,
> > dist/build/scientific-pl-testsStub/scientific-pl-testsStub-tmp/Main.o
> > )
> > Linking dist/build/scientific-pl-testsStub/scientific-pl-testsStub ...
> > Preprocessing executable 'scientific-pl' for scientific-pl-0.1.0.0...
> > [1 of 3] Compiling SPLData          ( SPLData.hs,
> > dist/build/scientific-pl/scientific-pl-tmp/SPLData.o )
> > [2 of 3] Compiling SPLEval          ( SPLEval.hs,
> > dist/build/scientific-pl/scientific-pl-tmp/SPLEval.o )
> > [3 of 3] Compiling Main             ( Main.hs,
> > dist/build/scientific-pl/scientific-pl-tmp/Main.o )
> > Linking dist/build/scientific-pl/scientific-pl ...
> > danking at spock # cabal test
> > Running 1 test suites...
> > Test suite scientific-pl-tests: RUNNING...
> > cabal: Prelude.read: no parse
> > 1 danking at spock #
>
> --
> Boris Daix
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org <javascript:;>
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140526/4d3bc9d5/attachment.html>


More information about the Beginners mailing list