GHC Trac Home
GHC Home
Joining In
Working on GHC
Mailing Lists & IRC
GHC Contributors
Documentation
Status Reports
Repositories
Building Guide
Commentary
Debugging
View Tickets
All Bugs
All Tasks
All Feature Req's
All Proposals
My Tickets
Tickets I Created
By Milestone
By OS
By Architecture
Patches for review
Create Ticket
New Bug
New Task
New Feature Req
Wiki
Title Index
Recent Changes
Wiki Notes
Search:
Login
Help/Guide
About Trac
Register
Forgot your password?
Preferences
Wiki
Timeline
Roadmap
View Tickets
Dashboard
Blog
Context Navigation
Back to Ticket #6000
Ticket #6000
: fibs.hs
File fibs.hs,
204 bytes
(added by guest,
14 months
ago)
Haskell implementation
Line
1
{-# LANGUAGE BangPatterns #-}
2
3
fib
::
Int
->
Integer
4
fib
0
=
0
5
fib
1
=
1
6
fib
n
=
fib'
0
1
2
where
7
fib'
_
y n'
|
n'
>
n
=
y
8
fib'
!
x
!
y
!
n'
=
fib' y
(
x
+
y
)
(
n'
+
1
)
9
10
main
=
fib
1000000
`
seq
`
return
()
Download in other formats:
Original Format