Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
e1674ac4
Commit
e1674ac4
authored
Oct 17, 2007
by
chak@cse.unsw.edu.au.
Browse files
TypeFamilies: should_compile/Simple21
* Code of #1776 from aslatter@gmail.com
parent
927fe3b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/indexed-types/should_compile/Simple21.hs
0 → 100644
View file @
e1674ac4
{-# LANGUAGE TypeFamilies #-}
module
ShouldCompile
where
import
Prelude
hiding
(
foldr
,
foldr1
)
import
Data.Maybe
type
family
Elem
x
class
Foldable
a
where
foldr
::
(
Elem
a
->
b
->
b
)
->
b
->
a
->
b
foldr1
::
(
Elem
a
->
Elem
a
->
Elem
a
)
->
a
->
Elem
a
foldr1
f
xs
=
fromMaybe
(
error
"foldr1: empty structure"
)
(
foldr
mf
Nothing
xs
)
where
mf
x
Nothing
=
Just
x
mf
x
(
Just
y
)
=
Just
(
f
x
y
)
testsuite/tests/ghc-regress/indexed-types/should_compile/all.T
View file @
e1674ac4
...
...
@@ -21,6 +21,7 @@ test('Simple17', expect_fail, compile, [''])
test
('
Simple18
',
normal
,
compile
,
[''])
test
('
Simple19
',
normal
,
compile
,
[''])
test
('
Simple20
',
normal
,
compile
,
[''])
test
('
Simple21
',
normal
,
compile
,
[''])
test
('
Simple22
',
normal
,
compile
,
[''])
test
('
Simple23
',
normal
,
compile
,
[''])
...
...
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