[GHC] #14367: Lazy evaluation can be invalidated
GHC
ghc-devs at haskell.org
Wed Oct 18 15:03:56 UTC 2017
#14367: Lazy evaluation can be invalidated
-------------------------------------+-------------------------------------
Reporter: vanto | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.1
Resolution: invalid | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by int-e):
There is a curiosity here, IMHO:
{{{
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
Prelude> :set -fdefer-typed-holes -Wno-typed-holes
Prelude> :set -fdefer-out-of-scope-variables -Wno-deferred-out-of-scope-
variables
Prelude> let x = [_]; y = [r]
Prelude> (length x, length y)
(1,1)
Prelude> length [_]
<interactive>:4:9: error:
• Found hole: _ :: a0
Where: ‘a0’ is an ambiguous type variable
• In the expression: _
In the first argument of ‘length’, namely ‘[_]’
In the expression: length [_]
• Relevant bindings include it :: Int (bound at <interactive>:4:1)
Prelude> length [r]
1
}}}
Why does the `length [_]` expression produce a compile time error?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14367#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list