Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ara Adkins
Glasgow Haskell Compiler
Commits
0dd193b7
Commit
0dd193b7
authored
Mar 22, 2004
by
malcolm
Browse files
[project @ 2004-03-22 14:48:56 by malcolm]
For nhc98, at last include the Typeable macros which define the instance decls.
parent
e3670130
Changes
3
Hide whitespace changes
Inline
Side-by-side
libraries/base/Data/Dynamic.hs
View file @
0dd193b7
...
...
@@ -64,10 +64,10 @@ unsafeCoerce = unsafeCoerce#
#
ifdef
__NHC__
import
NonStdUnsafeCoerce
(
unsafeCoerce
)
import
NHC.IOExtras
(
IORef
,
newIORef
,
readIORef
,
writeIORef
,
unsafePerformIO
)
#
else
#
include
"Typeable.h"
#
endif
#
include
"Typeable.h"
-------------------------------------------------------------
--
-- The type Dynamic
...
...
@@ -88,9 +88,7 @@ import NHC.IOExtras (IORef,newIORef,readIORef,writeIORef,unsafePerformIO)
data
Dynamic
=
Dynamic
TypeRep
Obj
#
endif
#
ifndef
__NHC__
INSTANCE_TYPEABLE0
(
Dynamic
,
dynamicTc
,
"Dynamic"
)
#
endif
instance
Show
Dynamic
where
-- the instance just prints the type representation.
...
...
libraries/base/Data/Typeable.hs
View file @
0dd193b7
...
...
@@ -106,10 +106,14 @@ unsafeCoerce = unsafeCoerce#
#
ifdef
__NHC__
import
NonStdUnsafeCoerce
(
unsafeCoerce
)
import
NHC.IOExtras
(
IORef
,
newIORef
,
readIORef
,
writeIORef
,
unsafePerformIO
)
import
IO
(
Handle
)
import
Ratio
(
Ratio
)
import
NHC.FFI
(
Ptr
,
StablePtr
)
#
else
#
include
"Typeable.h"
#
endif
#
include
"Typeable.h"
#
ifndef
__HUGS__
-------------------------------------------------------------
...
...
@@ -444,7 +448,6 @@ gcast2 x = r
--
-------------------------------------------------------------
#
ifndef
__NHC__
INSTANCE_TYPEABLE1
(
[]
,
listTc
,
"[]"
)
INSTANCE_TYPEABLE1
(
Maybe
,
maybeTc
,
"Maybe"
)
INSTANCE_TYPEABLE1
(
Ratio
,
ratioTc
,
"Ratio"
)
...
...
@@ -452,6 +455,7 @@ INSTANCE_TYPEABLE2(Either,eitherTc,"Either")
INSTANCE_TYPEABLE2
((
->
),
funTc
,
"->"
)
INSTANCE_TYPEABLE1
(
IO
,
ioTc
,
"IO"
)
INSTANCE_TYPEABLE0
(
()
,
unitTc
,
"()"
)
#
ifndef
__NHC__
INSTANCE_TYPEABLE2
((,),
pairTc
,
","
)
INSTANCE_TYPEABLE3
((,,),
tup3Tc
,
",,"
)
...
...
@@ -479,10 +483,10 @@ tup7Tc = mkTyCon ",,,,,"
instance
Typeable7
(,,,,,,)
where
typeOf7
tu
=
mkTyConApp
tup7Tc
[]
#
endif
/*
__NHC__
*/
INSTANCE_TYPEABLE1
(
Ptr
,
ptrTc
,
"Foreign.Ptr.Ptr"
)
INSTANCE_TYPEABLE1
(
StablePtr
,
stableptrTc
,
"Foreign.StablePtr.StablePtr"
)
INSTANCE_TYPEABLE1
(
IORef
,
iorefTc
,
"Data.IORef.IORef"
)
#
endif
/*
!
__NHC__
*/
-------------------------------------------------------
--
...
...
@@ -490,7 +494,6 @@ INSTANCE_TYPEABLE1(IORef,iorefTc,"Data.IORef.IORef")
--
-------------------------------------------------------
#
ifndef
__NHC__
INSTANCE_TYPEABLE0
(
Bool
,
boolTc
,
"Bool"
)
INSTANCE_TYPEABLE0
(
Char
,
charTc
,
"Char"
)
INSTANCE_TYPEABLE0
(
Float
,
floatTc
,
"Float"
)
...
...
@@ -512,7 +515,6 @@ INSTANCE_TYPEABLE0(Word64,word64Tc,"Word64")
INSTANCE_TYPEABLE0
(
TyCon
,
tyconTc
,
"TyCon"
)
INSTANCE_TYPEABLE0
(
TypeRep
,
typeRepTc
,
"TypeRep"
)
#
endif
/*
!
__NHC__
*/
#
ifdef
__GLASGOW_HASKELL__
INSTANCE_TYPEABLE0
(
Word
,
wordTc
,
"Word"
)
...
...
libraries/base/Makefile.nhc98
View file @
0dd193b7
THISPKG
=
base
SEARCH
=
-I
$(TOPDIR)
/targets/
$(MACHINE)
SEARCH
=
-I
$(TOPDIR)
/targets/
$(MACHINE)
-Iinclude
EXTRA_H_FLAGS
=
+RTS
-K6M
-RTS
SRCS
=
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment