#8588: ForeignImport coercion evaluated before typechecking
----------------------------------+----------------------------
Reporter: zcourts | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Keywords: | Operating System: Windows
Architecture: x86_64 (amd64) | Type of failure: Other
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
----------------------------------+----------------------------
I'm fairly new to Haskell by all accounts this could have been caused by
me doing something silly. Following the real world haskell book's
directions on the FFI resulted in:
"Multiple markers at this line: - buildwrapper.exe: panic! (the
'impossible' happened) (GHC version 7.6.3 for i386-unknown-mingw32):
ForeignImport coercion evaluated before typechecking Please report this as
a GHC bug: http://www.haskell.org/ghc/reportabug - 16 changed lines"
I went to the Haskell Wiki to try an example from there to see if the RWH
e.g. was just out dated. All examples I've come across causes this error
inc. those at
http://www.haskell.org/haskellwiki/FFI_complete_examples#Calling_standard_l…
and reading https://www.haskell.org/ghc/docs/7.6.3/users_guide.pdf FFI
section didn't help.
The current failing code is
{{{
{-# LANGUAGE ForeignFunctionInterface #-}
module Events.CEvent where
import Prelude hiding (sin)
import Foreign.C -- get the C types
import Foreign.Ptr (Ptr,nullPtr)
-- pure function
foreign import ccall "sin" c_sin :: CDouble -> CDouble
sin :: Double -> Double
sin d = realToFrac (c_sin (realToFrac d))
-- impure function
foreign import ccall "time" c_time :: Ptr a -> IO CTime
getTime :: IO CTime
getTime = c_time nullPtr
}}}
I've also tried this which causes the same error
{{{
{-# LANGUAGE ForeignFunctionInterface #-}
module Events.Event2 where
import Foreign
import Foreign.C.Types
foreign import ccall "math.h sin"
c_sin :: CDouble -> CDouble
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8588>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#8587: Add operator <%>, or similar, as <%> = flip fmap
-------------------------------------------+-------------------------------
Reporter: bunimo | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: Prelude | Version: 7.6.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Easy (less than 1 hour) | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
-------------------------------------------+-------------------------------
Often, piping results through one function after another provides a good
conceptual flow to the code. But when the functions are a mixture of
monadic and pure, it can seem more convoluted than it actually is. For
example, compare:
{{{
do
a <- monadicResult
let b = pureFunction2 . pureFunction 1 <$> a
c <- monadicFunction1 b >>= monadicFunction2
}}}
to
{{{
c <- monadicFunction2 =<<
monadicFunction1 =<<
pureFunction2 <$>
pureFunction1 <$>
monadicResult
}}}
But this reading from bottom-to-up seems backwards, especially considering
monadic code is more traditionally top-to-bottom, left-to-right.
I'd like to propose adding a new operator
{{{
infixl 1 <%>
(<%>) :: Functor f => f a -> (a -> b) -> f b
(<%>) = flip fmap
}}}
so that the following can be written. It is obvious what the intent of the
code is. There are no unnecessary temporary variables. It conforms to
typical monadic code direction. It is visually pleasing.
{{{
c <- monadicResult <%>
pureFunction1 <%>
pureFunction2 >>=
monadicFunction1 >>=
monadicFunction2
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8587>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#8220: Macros / functions for source location
------------------------------------+-------------------------------------
Reporter: wojteknar | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
In GNAT (Ada compiler) there is a special package with functions
(evaluated at compile time) that return source location and enclosing
entity name. This is very useful for logging and debugging. I'd love to
have something similar in GHC.
http://www.radford.edu/~nokie/classes/320/std_lib_html/gnat-
source_info.html
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8220>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#5144: Pattern synonyms
-------------------------------------------+-------------------------------
Reporter: simonpj | Owner: cactus
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version:
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: 8581, 8582, 8583, 8584 | Blocked By:
| Related Tickets:
-------------------------------------------+-------------------------------
Comment (by cactus):
I've added separate tickets to the features from the PatternSynonyms page
that are not going to be implemented in the initial version (which is now
code-complete and just needs some docs and some comments here and there).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5144#comment:39>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler