Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
216bfb01
Commit
216bfb01
authored
Jul 26, 1996
by
partain
Browse files
[project @ 1996-07-26 20:58:52 by partain]
Final changes for 2.01
parent
5eb1c77c
Changes
91
Hide whitespace changes
Inline
Side-by-side
ghc/CONTRIB/haskell-modes/simonm/real/haskell.el
View file @
216bfb01
...
...
@@ -55,8 +55,8 @@
(
modify-syntax-entry
?\f
"> b"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\n
"> b"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\"
"\""
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\'
"
_
"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?_
"
_
"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\'
"
w
"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?_
"
w
"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\\
"."
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\(
"()"
haskell-mode-syntax-table
)
(
modify-syntax-entry
?\)
")("
haskell-mode-syntax-table
)
...
...
@@ -81,8 +81,6 @@
(
setq
comment-column
40
)
(
make-local-variable
'comment-indent-function
)
(
setq
comment-indent-function
'haskell-comment-indent
)
;(make-local-variable 'font-lock-keywords)
;(setq font-lock-keywords haskell-literate-font-lock-keywords)
)
(
defun
haskell-mode
()
...
...
@@ -106,6 +104,8 @@ M-TAB toggles the state of the bird track on the current-line.
Entry to this mode calls haskell-mode-hook and haskell-literate-mode-hook."
(
interactive
)
(
haskell-vars
)
(
make-local-variable
'font-lock-keywords
)
(
setq
font-lock-keywords
haskell-literate-font-lock-keywords
)
(
setq
major-mode
'haskell-literate-mode
)
(
setq
mode-name
"Literate Haskell"
)
(
use-local-map
haskell-literate-mode-map
)
...
...
@@ -190,12 +190,13 @@ Entry to this mode calls haskell-mode-hook and haskell-literate-mode-hook."
(
list
'
(
"^[^>\n].*$"
.
font-lock-comment-face
)
(
concat
"\\b\\("
(
mapconcat
'identity
'
(
"case"
"class"
"data"
"default"
"deriving"
"else"
"hiding"
"if"
"import"
"in"
"infix"
"infixl"
"infixr"
"instance"
"interface"
"let"
"module"
"of"
"renaming"
"then"
"to"
"type"
"where"
)
"\\|"
)
"\\)\\b"
)
(
mapconcat
'identity
'
(
"case"
"class"
"data"
"default"
"deriving"
"else"
"hiding"
"if"
"import"
"in"
"infix"
"infixl"
"infixr"
"instance"
"interface"
"let"
"module"
"of"
"renaming"
"then"
"to"
"type"
"where"
)
"\\|"
)
"\\)\\b"
)
; '("(\\|)\\|\\[\\|\\]\\|,\\|[\\\\!$#^%&*@~?=-+<>.:]+" . font-lock-function-name-face)
))
ghc/compiler/deSugar/Match.lhs
View file @
216bfb01
...
...
@@ -25,11 +25,12 @@ import DsUtils
import MatchCon ( matchConFamily )
import MatchLit ( matchLiterals )
import FieldLabel (
all
FieldLabel
Tags, fieldLabelTag
)
import Id ( idType, mkTupleCon,
import FieldLabel ( FieldLabel
{- Eq instance -}
)
import Id ( idType, mkTupleCon,
dataConFieldLabels,
dataConArgTys, recordSelectorFieldLabel,
GenId{-instance-}
)
import Name ( Name {--O only-} )
import PprStyle ( PprStyle(..) )
import PprType ( GenType{-instance-}, GenTyVar{-ditto-} )
import PrelVals ( pAT_ERROR_ID )
...
...
@@ -337,12 +338,12 @@ tidy1 v (RecPat con_id pat_ty rpats) match_result
-- Boring stuff to find the arg-tys of the constructor
(_, inst_tys, _) = {-trace "Match.getAppDataTyConExpandingDicts" $-} getAppDataTyConExpandingDicts pat_ty
con_arg_tys' = dataConArgTys con_id inst_tys
tagged_arg_tys = con_arg_tys' `zip`
all
FieldLabel
Tags
tagged_arg_tys = con_arg_tys' `zip`
(dataCon
FieldLabel
s con_id)
-- mk_pat picks a WildPat of the appropriate type for absent fields,
-- and the specified pattern for present fields
mk_pat (arg_ty,
tag
) = case [pat | (sel_id,pat,_) <- rpats,
fieldLabelTag (
recordSelectorFieldLabel sel_id
)
==
tag
mk_pat (arg_ty,
lbl
) = case [pat | (sel_id,pat,_) <- rpats,
recordSelectorFieldLabel sel_id ==
lbl
] of
(pat:pats) -> ASSERT( null pats )
pat
...
...
ghc/compiler/tests/Jmakefile
View file @
216bfb01
...
...
@@ -7,5 +7,4 @@ SUBDIRS = reader \
deSugar \
printing \
ccall \
deriving \
bugs
deriving
ghc/compiler/tests/ccall/cc001.hs
View file @
216bfb01
...
...
@@ -2,7 +2,7 @@
module
Test
where
import
PreludeGla
IO
import
PreludeGla
ST
-- simple functions
...
...
ghc/compiler/tests/ccall/cc002.hs
View file @
216bfb01
...
...
@@ -2,20 +2,20 @@
module
Test
where
import
PreludeGla
IO
import
PreludeGla
ST
-- Test returning results
a
::
PrimIO
_MallocPtr
a
::
PrimIO
ForeignObj
a
=
_ccall_
a
b
::
PrimIO
_
StablePtr
b
::
PrimIO
StablePtr
b
=
_ccall_
b
-- Test taking arguments
c
::
_MallocPtr
->
PrimIO
Int
c
::
ForeignObj
->
PrimIO
Int
c
x
=
_ccall_
c
x
d
::
_
StablePtr
->
PrimIO
Int
d
::
StablePtr
->
PrimIO
Int
d
x
=
_ccall_
d
x
ghc/compiler/tests/ccall/cc003.hs
View file @
216bfb01
--!!!
cc003
-- ccall with unresolved polymorphism (should fail)
module
Test
where
import
PreludeGla
IO
import
PreludeGla
ST
fubar
::
PrimIO
Int
fubar
=
ccall
f
`
seqPrimIO
`
ccall
b
...
...
ghc/compiler/tests/ccall/cc004.hs
View file @
216bfb01
--!!!
cc004
-- ccall with synonyms, polymorphic type variables and user type variables.
module
Test
where
import
PreludeGla
IO
import
PreludeGla
ST
-- Since I messed up the handling of polymorphism originally, I'll
-- explicitly test code with UserSysTyVar (ie an explicit polymorphic
...
...
ghc/compiler/tests/deSugar/ds024.hs
View file @
216bfb01
...
...
@@ -3,6 +3,9 @@
-- do all the right types get stuck on all the
-- Nils and Conses?
module
ShouldSucceed
where
f
x
=
[
[]
,
[]
]
g
x
=
(
[]
,
[]
,
[]
)
ghc/compiler/tests/deSugar/ds026.hs
View file @
216bfb01
--!!!
ds026
-- classes -- incl. polymorphic method
module
ShouldSucceed
where
class
Foo
a
where
op
::
a
->
a
...
...
ghc/compiler/tests/deSugar/ds028.hs
View file @
216bfb01
--!!!
ds028
:
failable
pats
in
top
row
module
ShouldSucceed
where
-- when the first row of pats doesn't have convenient
-- variables to grab...
...
...
ghc/compiler/tests/deSugar/ds031.hs
View file @
216bfb01
module
ShouldSucceed
where
foldPair
::
(
a
->
a
->
a
,
b
->
b
->
b
)
->
(
a
,
b
)
->
[(
a
,
b
)]
->
(
a
,
b
)
foldPair
fg
ab
[]
=
ab
foldPair
fg
@
(
f
,
g
)
ab
((
a
,
b
)
:
abs
)
=
(
f
a
u
,
g
b
v
)
...
...
ghc/compiler/tests/deSugar/ds032.hs
View file @
216bfb01
--!!!
recursive
funs
tangled
in
an
AbsBind
module
ShouldSucceed
where
flatten
::
Int
-- Indentation
->
Bool
-- True => just had a newline
->
Float
-- Current seq to flatten
...
...
ghc/compiler/tests/deSugar/ds037.hs
View file @
216bfb01
--!!!
AbsBinds
with
tyvars
,
no
dictvars
,
but
some
dict
binds
--
module
ShouldSucceed
where
f
x
y
=
(
fst
(
g
y
x
),
x
+
(
1
::
Int
))
g
x
y
=
(
fst
(
f
x
y
),
y
+
(
1
::
Int
))
ghc/compiler/tests/deSugar/ds039.hs
View file @
216bfb01
--!!!
make
sure
correct
type
applications
get
put
in
--!!!
when
(
:
)
is
saturated
.
module
ShouldSucceed
where
f
=
(
:
)
ghc/compiler/tests/deriving/drv001.hs
View file @
216bfb01
--!!!
canonical
weird
example
for
"deriving"
module
ShouldSucceed
where
data
X
a
b
=
C1
(
T
a
)
|
C2
(
Y
b
)
|
C3
(
X
b
a
)
deriving
Text
deriving
(
Read
,
Show
)
data
Y
b
=
D1
|
D2
(
X
Int
b
)
deriving
Text
deriving
(
Read
,
Show
)
data
T
a
=
E1
instance
Eq
a
=>
Text
(
T
a
)
where
instance
Eq
a
=>
Show
(
T
a
)
where
showsPrec
=
error
"show"
instance
Eq
a
=>
Read
(
T
a
)
where
readsPrec
=
error
"read"
ghc/compiler/tests/deriving/drv002.hs
View file @
216bfb01
module
ShouldSucceed
where
data
Z
a
b
=
C1
(
T
a
)
|
C2
(
Z
[
a
]
[
b
])
deriving
Text
deriving
(
Show
,
Read
)
data
T
a
=
E1
instance
Eq
a
=>
Text
(
T
a
)
where
instance
Eq
a
=>
Show
(
T
a
)
where
showsPrec
=
error
"show"
instance
Eq
a
=>
Read
(
T
a
)
where
readsPrec
=
error
"read"
ghc/compiler/tests/deriving/drv003.hs
View file @
216bfb01
--!!!
This
is
the
example
given
in
TcDeriv
--
module
ShouldSucceed
where
data
T
a
b
=
C1
(
Foo
a
)
(
Bar
b
)
|
C2
Int
(
T
b
a
)
...
...
ghc/compiler/tests/deriving/drv004.hs
View file @
216bfb01
--!!!
simple
example
of
deriving
Ord
(
and
,
implicitly
,
Eq
)
--
module
ShouldSucceed
where
data
Foo
a
b
=
C1
a
Int
|
C2
b
Double
...
...
ghc/compiler/tests/deriving/drv005.hs
View file @
216bfb01
--!!!
simple
example
of
deriving
Enum
--
module
ShouldSucceed
where
data
Foo
=
Foo1
|
Foo2
|
Foo3
|
Foo4
|
Foo5
|
Foo6
|
Foo7
|
Foo8
deriving
Enum
ghc/compiler/tests/deriving/drv006.hs
View file @
216bfb01
--!!!
simple
examples
of
deriving
Ix
--
module
ShouldSucceed
where
import
Ix
data
Foo
=
Foo1
|
Foo2
|
Foo3
|
Foo4
|
Foo5
|
Foo6
|
Foo7
|
Foo8
deriving
Ix
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
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