Skip to content

Instantly share code, notes, and snippets.

@mtsmfm
Created January 6, 2014 03:53
Show Gist options
  • Select an option

  • Save mtsmfm/8277968 to your computer and use it in GitHub Desktop.

Select an option

Save mtsmfm/8277968 to your computer and use it in GitHub Desktop.
<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
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