Ticket #4236 (closed bug: fixed)
arrow bug
| Reported by: | igloo | Owned by: | SamAnklesaria |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.1 |
| Component: | Compiler | Version: | 6.12.3 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Initially reported here: http://www.haskell.org/pipermail/glasgow-haskell-users/2010-July/019035.html
This program:
{-# LANGUAGE Arrows #-}
module Main where
import Control.Arrow
foo :: (b -> String) -> ((((b, Int), Float), Double) -> String) -> (b -> String)
foo f g b = f b ++ " " ++ g (((b, 8), 1.0), 6.0)
bar :: (t -> String) -> ((t, Double, Float, Int) -> String) -> t -> String
bar f g = proc x -> do
(f -< x) `foo` \n m k -> g -< (x,n,m,k)
main = do
putStrLn $ foo show show 17
putStrLn $ bar show show 17
putStrLn $ foo show show 42
putStrLn $ bar show show 42
produces the wrong output:
17 (((17,8),1.0),6.0) 17 (17,4.0e-323,1.0,4618441417868443648) 42 (((42,8),1.0),6.0) 42 (42,4.0e-323,1.0,4618441417868443648)
Note that, e.g.,
*Main GHC.Exts GHC.Prim> D# (unsafeCoerce# 4618441417868443648#) 6.0
-dcore-lint failes with multiple errors.
Change History
Note: See
TracTickets for help on using
tickets.
