Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pascal Stücker
pakcs
Commits
8085e3b1
Commit
8085e3b1
authored
Dec 07, 2017
by
Michael Hanus
Browse files
Defaulting for Enum added
parent
4d8fcfe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/c2p.pl
View file @
8085e3b1
...
...
@@ -589,9 +589,11 @@ defaultNumType(Type,Type).
removeDefaultedTypes
(
Type
,
Type
)
:-
var
(
Type
),
!.
removeDefaultedTypes
(
'FuncType'
(
AType
,
RType
),
DType
)
:-
classDict
(
AType
,
TVar
,
ModName
,
DictName
),
ModName
=
"Prelude"
,
member
(
DictName
,[
"Eq"
,
"Ord"
,
"Read"
,
"Show"
]),
nonvar
(
TVar
),
!,
ModName
=
"Prelude"
,
nonvar
(
TVar
),
(
member
(
DictName
,[
"Eq"
,
"Ord"
,
"Read"
,
"Show"
])
;
DictName
=
"Enum"
,
member
(
TVar
,[
'TCons'
(
'Prelude.Int'
,[]),
'TCons'
(
'Prelude.Float'
,[])])
),
!,
removeDefaultedTypes
(
RType
,
DType
).
removeDefaultedTypes
(
'FuncType'
(
AType
,
RType
),
'FuncType'
(
AType
,
DType
))
:-
!,
removeDefaultedTypes
(
RType
,
DType
).
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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