#5087: No instance for (Functor ((->) b0)) arising from a use of `<$>'
-----------------------+----------------------------------------------------
Reporter: pSub | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 7.0.2 | Keywords:
Testcase: | Blockedby:
Os: Linux | Blocking:
Architecture: x86 | Failure: GHC rejects valid program
-----------------------+----------------------------------------------------
I'm pretty new to Haskell so sorry if there is already a bug report for
this or if it isn't a bug of ghc at all (e.g. some packaging problem).
I read learnyouahaskell.com and want to play with the Applicative Instance
of (->) r. But when I enter
import Control.Applicative
(+) <$> (+3) <*> (*100) $ 5
in ghci I get the following error:
<interactive>:1:5:
No instance for (Functor ((->) b0))
arising from a use of `<$>'
Possible fix: add an instance declaration for (Functor ((->) b0))
In the first argument of `(<*>)', namely `(+) <$> (+ 3)'
In the expression: (+) <$> (+ 3) <*> (* 100)
In the expression: (+) <$> (+ 3) <*> (* 100) $ 5
This Problem does not occur when executing this small testprogramm with
"ghc --make" or "runhaskell":
import Control.Applicative
main = print $ (+) <$> (+3) <*> (*100) $ 5
So it seems ghci releated. I downgraded to 6.12.3 where the problem
doesn't occur. I'm using Archlinux.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5087>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs