Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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


Today's Topics:

   1. Re:  cabal install errors & issues (Andres L?h)
   2.  99problems: different response from ghci <-->    runhaskell /
      ghc (GiGi)
   3. Re:  99problems: different response from ghci <--> runhaskell
      / ghc (Andres L?h)


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

Message: 1
Date: Fri, 17 Aug 2012 10:16:34 +0200
From: Andres L?h <andres.l...@googlemail.com>
Subject: Re: [Haskell-beginners] cabal install errors & issues
To: Antoine Latter <aslat...@gmail.com>
Cc: Gregory Guthrie <guth...@mum.edu>,  "beginners@haskell.org"
        <beginners@haskell.org>
Message-ID:
        <caljd_v5edgzm-3xf43p7rwdko5u_aj8cpmgnuxc_kby7v4d...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi.

Sorry for singling out this one message of the thread to reply to a
bunch of messages.

> Can you try upgrading "cabal-install" to see if the new solver handles
> it better? I think the new version works with what is in the platform.
> If you also get errors there might be ways to make it go ...

I just tried installing cabal-dev on a clean platform, and I can
confirm it doesn't work:

$ cabal install --dry-run cabal-dev
Resolving dependencies...
In order, the following would be installed:
tar-0.3.2.0 (new package)
transformers-0.2.2.0 (new version)
mtl-2.0.1.0 (new version)
parsec-3.1.3 (new version)
network-2.3.1.0 (new version)
HTTP-4000.2.3 (reinstall) changes: mtl-2.1.1 -> 2.0.1.0, network-2.3.0.13 ->
2.3.1.0, parsec-3.1.2 -> 3.1.3
cabal-dev-0.9.1 (new package)
Warning: The following packages are likely to be broken by the reinstalls:
haskell-platform-2012.2.0.0
Use --force-reinstalls if you want to install anyway.

Investigating the dependencies, it seems cabal-dev depends on
transformers < 0.3, which in turn leads to an older mtl being picked,
and all the other problems.

I've only just come to this thread. There are a couple of things that
are strange. The original poster shows logs where base version changes
are listed. That's really puzzling to me. GHC usually has one version
of base installed, and that can't be changed. So why are there
several? Also, there are multiple versions of the Haskell Platform
being listed as possibly being broken. How can multiple versions of
the platform be installed at once? So something to me looks to be
strange with that installation.

There also seems to be a misconception that "switching to cabal-dev"
means no longer using cabal-install. I just want to clarify that this
isn't the case. The use of cabal-dev offers additional sandboxing
functionality and wraps cabal-install, but you're still using it.

The next release of cabal-install (don't know when that'll happen
though, unfortunately) will most likely have sandboxing functionality
built-in.

Cheers,
  Andres



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

Message: 2
Date: Fri, 17 Aug 2012 10:53:19 +0200
From: GiGi <looee...@gmail.com>
Subject: [Haskell-beginners] 99problems: different response from ghci
        <-->    runhaskell / ghc
To: beginners@haskell.org
Message-ID:
        <CAEp_LLwrn8njTCjOnATp8vGOOOMcw-f=wno_971alqfjwjx...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi all,
trying to solve the problem 6  "reverse a list"
I'm getting a different behaviour from ghci / runhaskell.

main = do
  putStrLn $ concat (map show (myReverse [1,2,3]))
  -- putStrLn $ concat (map show (myReverse []))

myReverse :: [a] -> [a]
myReverse [] = []
myReverse (x:xs) = go [] (x:xs)
    where go :: [a] -> [a] -> [a]
          go curr (x:xs) | null xs  =  [x] ++ curr
          go curr (x:xs)  =  go ([x] ++ curr) xs


the second putStrLn (once uncommented) gives this error in the
runhaskell/ghc:
         Ambiguous type variable `a0' in the constraint:
      (Show a0) arising from a use of `show'
    Probable fix: add a type signature that fixes these type variable(s)
    In the first argument of `map', namely `show'

_but_   if I load the same source into ghci I can successfully enter&run
the command:

Prelude> :reload
[1 of 1] Compiling Main             ( 05.hs, interpreted )
Ok, modules loaded: Main.
*Main> putStrLn $ concat (map show (myReverse []))

*Main>


Then if I "help" the type inference changing the myReverse type declaration
to:

myReverse :: [Int] -> [Int]


everything works well

So, my question is:  _where_ is the difference between ghci / runhaskell?

thx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120817/9a35fbe3/attachment-0001.htm>

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

Message: 3
Date: Fri, 17 Aug 2012 11:35:54 +0200
From: Andres L?h <and...@well-typed.com>
Subject: Re: [Haskell-beginners] 99problems: different response from
        ghci <--> runhaskell / ghc
To: GiGi <looee...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CALjd_v4q+PVJ2BEX2GS1=05exhnpfqzvv4ca4trwv5wof36...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi.

> So, my question is:  _where_ is the difference between ghci / runhaskell?

See here:

http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html#extended-default-rules

Cheers,
  Andres

-- 
Andres L?h, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com



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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 50, Issue 20
*****************************************

Reply via email to