Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Will Hawkins
GHC
Commits
86e1db7d
Commit
86e1db7d
authored
7 years ago
by
Richard Eisenberg
Committed by
Ben Gamari
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Test
#13938
, with expect_broken
test case: dependent/should_compile/T13938
parent
fa626f3b
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testsuite/tests/dependent/should_compile/T13938.hs
+80
-0
80 additions, 0 deletions
testsuite/tests/dependent/should_compile/T13938.hs
testsuite/tests/dependent/should_compile/all.T
+1
-0
1 addition, 0 deletions
testsuite/tests/dependent/should_compile/all.T
with
81 additions
and
0 deletions
testsuite/tests/dependent/should_compile/T13938.hs
0 → 100644
+
80
−
0
View file @
86e1db7d
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module
T13938
where
import
Data.Kind
(
Type
)
data
family
Sing
(
a
::
k
)
data
instance
Sing
(
z
::
[
a
])
where
SNil
::
Sing
'
[]
SCons
::
Sing
x
->
Sing
xs
->
Sing
(
x
:
xs
)
data
TyFun
::
Type
->
Type
->
Type
type
a
~>
b
=
TyFun
a
b
->
Type
infixr
0
~>
type
family
Apply
(
f
::
k1
~>
k2
)
(
x
::
k1
)
::
k2
type
a
@@
b
=
Apply
a
b
infixl
9
@@
data
FunArrow
=
(
:->
)
-- ^ '(->)'
|
(
:~>
)
-- ^ '(~>)'
class
FunType
(
arr
::
FunArrow
)
where
type
Fun
(
k1
::
Type
)
arr
(
k2
::
Type
)
::
Type
class
FunType
arr
=>
AppType
(
arr
::
FunArrow
)
where
type
App
k1
arr
k2
(
f
::
Fun
k1
arr
k2
)
(
x
::
k1
)
::
k2
type
FunApp
arr
=
(
FunType
arr
,
AppType
arr
)
instance
FunType
(
:->
)
where
type
Fun
k1
(
:->
)
k2
=
k1
->
k2
$
(
return
[]
)
-- This is only necessary for GHC 8.0 -- GHC 8.2 is smarter
instance
AppType
(
:->
)
where
type
App
k1
(
:->
)
k2
(
f
::
k1
->
k2
)
x
=
f
x
instance
FunType
(
:~>
)
where
type
Fun
k1
(
:~>
)
k2
=
k1
~>
k2
$
(
return
[]
)
instance
AppType
(
:~>
)
where
type
App
k1
(
:~>
)
k2
(
f
::
k1
~>
k2
)
x
=
f
@@
x
infixr
0
-?>
type
(
-?>
)
(
k1
::
Type
)
(
k2
::
Type
)
(
arr
::
FunArrow
)
=
Fun
k1
arr
k2
elimList
::
forall
(
a
::
Type
)
(
p
::
[
a
]
->
Type
)
(
l
::
[
a
])
.
Sing
l
->
p
'
[]
->
(
forall
(
x
::
a
)
(
xs
::
[
a
])
.
Sing
x
->
Sing
xs
->
p
xs
->
p
(
x
:
xs
))
->
p
l
elimList
=
elimListPoly
@
(
:->
)
elimListTyFun
::
forall
(
a
::
Type
)
(
p
::
[
a
]
~>
Type
)
(
l
::
[
a
])
.
Sing
l
->
p
@@
'
[]
->
(
forall
(
x
::
a
)
(
xs
::
[
a
])
.
Sing
x
->
Sing
xs
->
p
@@
xs
->
p
@@
(
x
:
xs
))
->
p
@@
l
elimListTyFun
=
elimListPoly
@
(
:~>
)
@
_
@
p
elimListPoly
::
forall
(
arr
::
FunArrow
)
(
a
::
Type
)
(
p
::
([
a
]
-?>
Type
)
arr
)
(
l
::
[
a
])
.
FunApp
arr
=>
Sing
l
->
App
[
a
]
arr
Type
p
'
[]
->
(
forall
(
x
::
a
)
(
xs
::
[
a
])
.
Sing
x
->
Sing
xs
->
App
[
a
]
arr
Type
p
xs
->
App
[
a
]
arr
Type
p
(
x
:
xs
))
->
App
[
a
]
arr
Type
p
l
elimListPoly
SNil
pNil
_
=
pNil
elimListPoly
(
SCons
x
(
xs
::
Sing
xs
))
pNil
pCons
=
pCons
x
xs
(
elimListPoly
@
arr
@
a
@
p
@
xs
xs
pNil
pCons
)
This diff is collapsed.
Click to expand it.
testsuite/tests/dependent/should_compile/all.T
+
1
−
0
View file @
86e1db7d
...
...
@@ -28,3 +28,4 @@ test('T12176', normal, compile, [''])
test
('
T14038
',
expect_broken
(
14038
),
compile
,
[''])
test
('
T12742
',
normal
,
compile
,
[''])
test
('
T13910
',
expect_broken
(
13910
),
compile
,
[''])
test
('
T13938
',
expect_broken
(
13938
),
compile
,
[''])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment