Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
2cb98454
Commit
2cb98454
authored
26 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-05-11 11:21:02 by simonm]
add isFloatTy and isDoubleTy
parent
c9898dcb
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/prelude/TysWiredIn.lhs
+15
-0
15 additions, 0 deletions
ghc/compiler/prelude/TysWiredIn.lhs
with
15 additions
and
0 deletions
ghc/compiler/prelude/TysWiredIn.lhs
+
15
−
0
View file @
2cb98454
...
...
@@ -22,10 +22,12 @@ module TysWiredIn (
consDataCon,
doubleDataCon,
doubleTy,
isDoubleTy,
doubleTyCon,
falseDataCon,
floatDataCon,
floatTy,
isFloatTy,
floatTyCon,
getStatePairingConInfo,
...
...
@@ -252,11 +254,24 @@ floatTy = mkTyConTy floatTyCon
floatTyCon = pcNonRecDataTyCon floatTyConKey pREL_BASE SLIT("Float") [] [floatDataCon]
floatDataCon = pcDataCon floatDataConKey pREL_BASE SLIT("F#") [] [] [floatPrimTy] floatTyCon
isFloatTy :: GenType flexi -> Bool
isFloatTy ty
= case (splitAlgTyConApp_maybe ty) of
Just (tycon, [], _) -> uniqueOf tycon == floatTyConKey
_ -> False
\end{code}
\begin{code}
doubleTy = mkTyConTy doubleTyCon
isDoubleTy :: GenType flexi -> Bool
isDoubleTy ty
= case (splitAlgTyConApp_maybe ty) of
Just (tycon, [], _) -> uniqueOf tycon == doubleTyConKey
_ -> False
doubleTyCon = pcNonRecDataTyCon doubleTyConKey pREL_BASE SLIT("Double") [] [doubleDataCon]
doubleDataCon = pcDataCon doubleDataConKey pREL_BASE SLIT("D#") [] [] [doublePrimTy] doubleTyCon
\end{code}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment