Created
December 12, 2015 16:48
-
-
Save ahalbert/e52965052c3b35187b9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| showUnitString :: Unit -> String | |
| showUnitString Unit m u | |
| | (null posUnits) && (null negUnits) = ms | |
| | null posUnits = ms ++ " 1/" ++ (showall negUnits) | |
| | null negUnits = ms ++ (showall posUnits) | |
| | otherwise = ms ++ (showall negUnits) ++ "/" ++ (showall negUnits) | |
| where negUnits = Map.map (abs) (Map.filter (\ x -> x < 0.0) u) | |
| posUnits = Map.filter (\ x -> x > 0.0) u | |
| ms = show m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment