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
Glasgow Haskell Compiler
GHC
Commits
665bf580
Commit
665bf580
authored
Apr 16, 2013
by
Simon Peyton Jones
Browse files
Test Trac
#7837
parent
0e489e57
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/indexed-types/should_compile/T7837.hs
0 → 100644
View file @
665bf580
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
module
T7837
where
type
family
Scalar
a
class
Fractional
(
Scalar
a
)
=>
Norm
a
where
norm
::
a
->
Scalar
a
type
instance
Scalar
Double
=
Double
instance
Norm
Double
where
norm
=
abs
normalize
::
(
Norm
a
,
a
~
Scalar
a
)
=>
a
->
a
normalize
x
=
x
/
norm
x
{-# NOINLINE normalize #-}
normalize_Double
::
Double
->
Double
normalize_Double
=
signum
{-# NOINLINE normalize_Double #-}
-- This rule should fire in 'foo'
{-# RULES "normalize/Double" normalize = normalize_Double #-}
foo
::
Double
foo
=
normalize
(
4
::
Double
)
testsuite/tests/indexed-types/should_compile/T7837.stderr
0 → 100644
View file @
665bf580
Rule fired: Class op abs
Rule fired: Class op signum
Rule fired: normalize/Double
testsuite/tests/indexed-types/should_compile/all.T
View file @
665bf580
...
...
@@ -209,4 +209,5 @@ test('T7489', normal, compile, [''])
test
('
T7585
',
normal
,
compile
,
[''])
test
('
T7282
',
normal
,
compile
,
[''])
test
('
T7804
',
normal
,
compile
,
[''])
test
('
T7837
',
normal
,
compile
,
['
-O -ddump-rule-firings
'])
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