Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 635
    • Merge requests 635
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4236

arrow bug

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.

Trac metadata
Trac field Value
Version 6.12.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking