Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
3430737f
Commit
3430737f
authored
Sep 08, 2006
by
simonpj
Browse files
Fix another use of result type signatures (this one was easy)
parent
d039b7eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/programs/thurston-modular-arith/Main.hs
View file @
3430737f
...
...
@@ -43,12 +43,11 @@ data Mod s a = Mod {value::a} deriving (Eq, Show)
data
Modulus
a
=
forall
s
.
TypeVal
a
s
=>
Modulus
(
a
->
Mod
s
a
)
(
Mod
s
a
->
a
)
mkModulus
::
(
ValToType
a
,
Integral
a
)
=>
a
->
Modulus
a
mkModulus
x
=
case
valToType
x
of
{
Wrapper
y
->
case
y
of
{(
_
::
t
)
->
Modulus
normalize
(
value
::
Mod
t
a
->
a
)}}
mkModulus
x
=
case
valToType
x
of
{
Wrapper
(
y
::
t
)
->
Modulus
normalize
(
value
::
Mod
t
a
->
a
)}
normalize
::
(
TypeVal
a
s
,
Integral
a
)
=>
a
->
Mod
s
a
normalize
x
::
(
Mod
s
a
)
=
(
Mod
(
x
`
mod
`
typeToVal
(
undefined
::
s
)))
normalize
::
forall
a
s
.
(
TypeVal
a
s
,
Integral
a
)
=>
a
->
Mod
s
a
normalize
x
=
(
Mod
(
x
`
mod
`
typeToVal
(
undefined
::
s
)))
inModulus
::
Modulus
a
->
(
forall
s
.
TypeVal
a
s
=>
Mod
s
a
->
Mod
s
a
)
->
a
->
a
...
...
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