Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
curry-packages
base
Commits
c7df02b3
Commit
c7df02b3
authored
Jan 09, 2018
by
Michael Hanus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fromInteger->fromInt, fromRational->fromFloat
parent
d3c7c669
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/Prelude.curry
src/Prelude.curry
+7
-7
No files found.
src/Prelude.curry
View file @
c7df02b3
...
...
@@ -1645,7 +1645,7 @@ class Num a where
abs :: a -> a
signum :: a -> a
fromInt
eger
:: Int -> a
fromInt :: Int -> a
x - y = x + negate y
negate x = 0 - x
...
...
@@ -1664,7 +1664,7 @@ instance Num Int where
| x == 0 = 0
| otherwise = -1
fromInt
eger
x = x
fromInt x = x
instance Num Float where
x + y = x +. y
...
...
@@ -1681,9 +1681,9 @@ instance Num Float where
| x == 0 = 0
| otherwise = -1
fromInt
eger
x = i2f x
fromInt x = i2f x
-- minimal definition: from
Rational
and (recip or (/))
-- minimal definition: from
Float
and (recip or (/))
class Num a => Fractional a where
(/) :: a -> a -> a
...
...
@@ -1692,16 +1692,16 @@ class Num a => Fractional a where
recip x = 1/x
x / y = x * recip y
from
Rational
:: Float -> a -- since we have no type Rational
from
Float
:: Float -> a -- since we have no type Rational
instance Fractional Float where
x / y = x /. y
recip x = 1.0/x
from
Rational
x = x
from
Float
x = x
class (Num a, Ord a) => Real a where
-- to
Rational :: a -> Rational
-- to
Float :: a -> Float
class Real a => Integral a where
div :: a -> a -> a
...
...
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