-
-
Save mtsmfm/8277968 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
| <interactive>:72:1: | |
| No instance for (RealFrac a0) arising from a use of `split' | |
| The type variable `a0' is ambiguous | |
| Possible fix: add a type signature that fixes these type variable(s) | |
| Note: there are several potential instances: | |
| instance RealFrac Double -- Defined in `GHC.Float' | |
| instance RealFrac Float -- Defined in `GHC.Float' | |
| instance Integral a => RealFrac (GHC.Real.Ratio a) | |
| -- Defined in `GHC.Real' | |
| In the expression: split 10 10 | |
| In an equation for `it': it = split 10 10 | |
| <interactive>:72:7: | |
| No instance for (Num a0) arising from the literal `10' | |
| The type variable `a0' is ambiguous | |
| Possible fix: add a type signature that fixes these type variable(s) | |
| Note: there are several potential instances: | |
| instance Num Double -- Defined in `GHC.Float' | |
| instance Num Float -- Defined in `GHC.Float' | |
| instance Integral a => Num (GHC.Real.Ratio a) | |
| -- Defined in `GHC.Real' | |
| ...plus three others | |
| In the first argument of `split', namely `10' | |
| In the expression: split 10 10 | |
| In an equation for `it': it = split 10 10 |
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
| split x n = val : [other] | |
| where d = floor $ logBase n x | |
| digit = n ^ d | |
| val = floor $ x / digit | |
| other = x - val * digit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment