I have to implement an example function with following signature:
[[([Char], a, b)]] -> (a -> b -> Char) -> ([Char], b -> a -> Char)
So I attempt this way:
funcD [[([' '],x,y)]] uFunc0D = ([' '], uFunc1D)
where
uFunc0D x y = ' '
uFunc1D y x = ' '
but, whe I invoke the type of it with
:t funcD
it returns
funcD :: [[([Char], t1, t2)]] -> t -> ([Char], t3 -> t4 -> Char)
Few questions:
- Why does it return
t
for the 2nd argument rather than(a -> b -> Char)
? - I passed
' '
for Char and it works, however I want to pass an empty char-arg like''
, but it doesn't work. - Why do I get t3 and t4 rather than t1 and t2 in the result signature?
Thanks in advance
Edit: My next try:
funcD1 [[([' '],x,y)]] (uFunc0D x y = ' ' where _ = x y) = ([' '], uFunc1D)
where
uFunc1D y x = ' '