Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Using "cabal test" and getting "cabal: Prelude.read: no
      parse" (Brent Yorgey)
   2. Re:  apply a function to all params of another    function
      (Julian Birch)
   3. Re:  Using "cabal test" and getting "cabal: Prelude.read: no
      parse" (Daniel King)
   4. Re:  Using "cabal test" and getting "cabal: Prelude.read: no
      parse" (Brent Yorgey)


----------------------------------------------------------------------

Message: 1
Date: Tue, 27 May 2014 13:45:52 -0400
From: Brent Yorgey <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Using "cabal test" and getting
        "cabal: Prelude.read: no parse"
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

This seems related, though I don't think it's your problem exactly:

  https://github.com/haskell/cabal/issues/1366

Apparently a "read: no parse" error can be generated when cabal fails
to read a log file for some reason.  Can you tell us precisely what
versions of cabal and ghc you are using (i.e. the output of ghc
--version and cabal --version)?

-Brent

On Mon, May 26, 2014 at 11:12:00PM -0400, Daniel King wrote:
> I don't call the `read' function in my source code anywhere. I do
> derive `read' instances in my data definitions, but otherwise grep
> finds no occurrences.
> 
> I'm fairly certain this is a bug in the testing framework, but I don't
> know how to debug it further. The cabal compilation process seems to
> produce a file at
> "dist/build/MY_PACKAGE_NAME-testsStub/MY_PACKAGE_NAME-testsStub-tmp/MY_PACKAGE_NAME-testsStub.hs".
> This file contains:
> 
>     module Main ( main ) where
>     import Distribution.Simple.Test ( stubMain )
>     import Tests ( tests )
>     main :: IO ()
>     main = stubMain tests
> 
> In the parent directory there is an executable,
> "dist/build/MY_PACKAGE_NAME-testsStub/MY_PACKAGE_NAME-testsStub" which
> appears to be the file which cabal executes when I call "cabal test".
> I'm not sure how this executable is created but I suspect it comes
> from the file I quoted above.
> 
> I'm beginning to suspect that the testing framework is not playing
> well with something.
> 
> This is my test file: http://lpaste.net/104680
> 
> I'm using the detailed-0.9 "type" of test module, because the
> detailed-1.0 "type" isn't present on my system. Is this the problem?
> They seem to reference detailed-1.0 in this user guide I found for
> Cabal: http://www.haskell.org/cabal/release/rc/doc/users-guide/#test-suites
> . Though now, seeing the URL, it seems that the user guide might be
> for a release candidate version of cabal? I found that page through
> googling how to set up a test suite in Cabal.
> 
> Can someone point me at a different guide or tutorial? I tried this
> (http://www.haskell.org/cabal/users-guide/) guide as well, but it
> doesn't give any examples and barely references test suites at all.
> 
> On Mon, May 26, 2014 at 5:20 PM, Erik Price <[email protected]> wrote:
> > 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 <[email protected]> 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 <[email protected]> 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@spock # cabal configure --enable-tests
> >> > Resolving dependencies...
> >> > Configuring scientific-pl-0.1.0.0...
> >> > danking@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@spock # cabal test
> >> > Running 1 test suites...
> >> > Test suite scientific-pl-tests: RUNNING...
> >> > cabal: Prelude.read: no parse
> >> > 1 danking@spock #
> >>
> >> --
> >> Boris Daix
> >> _______________________________________________
> >> Beginners mailing list
> >> [email protected]
> >> http://www.haskell.org/mailman/listinfo/beginners
> >
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> 
> 
> 
> -- 
> Dan King
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners


------------------------------

Message: 2
Date: Tue, 27 May 2014 19:39:46 +0100
From: Julian Birch <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] apply a function to all params of
        another function
Message-ID:
        <CAB0TuzBzAJouKSwKyYOZC6BgrQaU5JXh+h-rPT7Cqs9=dud...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Just a thought, you might want to use functions like (a,a,a)->a instead.

J

On Monday, May 26, 2014, Brent Yorgey <[email protected]> wrote:

> On Mon, May 26, 2014 at 04:46:29PM +0200, Kees Bleijenberg wrote:
> > In have a lot of functions in a program with params that are alle Int's.
> > f :: Int -> Int -> Int
> > g :: Int -> Int -> Int
> > h :: Int -> Int -> Int -> Int
> > ...
> > and convertParam :: Int -> Int -- say (+1)
> > I want to call functions like f, g and h, but apply convertParam to all
> > params first.
> > f2 a b c = f (convertParam a) (convertParam b) (convertParam c)
> >
> > I tried:
> > run1p f  conv = \a  -> f (conv a)                     -- for functions
> with one
> > param
> > run2p f  conv = \a b ->  f (conv a) (conv b)  -- for functions with two
> > params
> > .
> > Can you do this in a more generalized way (using currying?)
> > Any ideas?
>
> class Convertible t where
>   convert :: t -> t
>
> instance Convertible Int where
>   ...
>
> instance Convertible t => Convertible (Int -> t) where
>   ...
>
> I'll let you fill in the ... ! =) Note this only works well because
> the base case is Int.  You could also add some extra base cases for
> other concrete return types.  However, it is quite difficult to give a
> Convertible instance which applies to "all types which are not
> functions", so this will only work if you are willing to make one
> instance for each concrete result type your functions use.
>
> -Brent
> _______________________________________________
> Beginners mailing list
> [email protected] <javascript:;>
> http://www.haskell.org/mailman/listinfo/beginners
>


-- 
Sent from an iPhone, please excuse brevity and typos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140527/a46c458e/attachment-0001.html>

------------------------------

Message: 3
Date: Tue, 27 May 2014 14:47:51 -0400
From: Daniel King <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Using "cabal test" and getting
        "cabal: Prelude.read: no parse"
Message-ID:
        <CAOShcWrhsOc9DMcLqrrRYGUTYLq5BR7inpOoO2Vc_UyG=mw...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Tue, May 27, 2014 at 1:45 PM, Brent Yorgey <[email protected]> wrote:
> This seems related, though I don't think it's your problem exactly:
>
>   https://github.com/haskell/cabal/issues/1366

I saw that, realized I didn't change directory at all and wasn't
really sure how to proceed. It did help me narrow done the cause to
something directly in the test suite though.

> Apparently a "read: no parse" error can be generated when cabal fails
> to read a log file for some reason.  Can you tell us precisely what
> versions of cabal and ghc you are using (i.e. the output of ghc
> --version and cabal --version)?

Sure thing:

    1 danking@spock # cabal --version
    cabal-install version 1.20.0.2
    using version 1.20.0.0 of the Cabal library

    danking@spock # ghc --version
    The Glorious Glasgow Haskell Compilation System, version 7.6.3

Upon seeing this version information, I tried changing my build-depends to
depend on Cabal 1.20 or greater, but I still get the error.

--
Dan King


------------------------------

Message: 4
Date: Tue, 27 May 2014 15:29:15 -0400
From: Brent Yorgey <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Using "cabal test" and getting
        "cabal: Prelude.read: no parse"
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Tue, May 27, 2014 at 02:47:51PM -0400, Daniel King wrote:
> On Tue, May 27, 2014 at 1:45 PM, Brent Yorgey <[email protected]> wrote:
> > This seems related, though I don't think it's your problem exactly:
> >
> >   https://github.com/haskell/cabal/issues/1366
> 
> I saw that, realized I didn't change directory at all and wasn't
> really sure how to proceed. It did help me narrow done the cause to
> something directly in the test suite though.
> 
> > Apparently a "read: no parse" error can be generated when cabal fails
> > to read a log file for some reason.  Can you tell us precisely what
> > versions of cabal and ghc you are using (i.e. the output of ghc
> > --version and cabal --version)?
> 
> Sure thing:
> 
>     1 danking@spock # cabal --version
>     cabal-install version 1.20.0.2
>     using version 1.20.0.0 of the Cabal library
> 
>     danking@spock # ghc --version
>     The Glorious Glasgow Haskell Compilation System, version 7.6.3
> 
> Upon seeing this version information, I tried changing my build-depends to
> depend on Cabal 1.20 or greater, but I still get the error.

Hmm, I'm not sure then.  The people who know the most about the
internals of Cabal likely do not read this list; you may have better
luck asking on stackoverflow.com and/or in the #hackage channel on
Freenode IRC.

-Brent


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 71, Issue 34
*****************************************

Reply via email to