I want to crate a tuple, that holds an arrow and a string that describes the arrow. If i do so with functions (instead of arrows), the following works like expected:
funTimes10 = (*10)
describe10 = "times 10"
tuple10 :: (Num b) => ((b -> b), String)
tuple10 = (,) funTimes10 describe10
I can access the function with fst
, and with snd
i get the description string of the function.
However, if i exchange the function with an arrow, like in the following:
aTuple10 :: (Arrow a, Num b) => (a b b, String)
aTuple10 = (,) (arr funTimes10) describe10
fst
still works and returns my arrow, but- i don't get any description string with
snd
.
I only got this error-message:
Ambiguous type variable `a0' in the constraint:
(Arrow a0) arising from a use of `aTuple10'
Probable fix: add a type signature that fixes these type variable(s)
In the first argument of `snd', namely `aTuple10'
In the expression: (snd aTuple10)
In an equation for `it': it = (snd aTuple10)
Why do i get this error, and what should i do, to avoid it?