Long story short, see the gist. The exercise is to make GHC accept the function deasils
.
The expression I refer to in the title is deasilsB . deasilsA
.
GHC can type it:
% ghci-9.2.2 Squeeze.hs
GHCi, version 9.2.2: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/kindaro/code/dotfiles/ghci.conf
[1 of 1] Compiling Main ( Squeeze.hs, interpreted )
Ok, one module loaded.
λ :type deasilsB . deasilsA
deasilsB . deasilsA
:: …
GHC cannot assign it to a name:
λ f = deasilsB . deasilsA
<interactive>:2:1: error: …
Evidence that the computation is correct:
λ deasilsB (deasilsA (['a', 'b'], True) :: Squeezed '[[ ]] (Char, Bool))
[('a',True),('b',True)]
What is going on? How can I have my deasils
?
This is a continuation of my previous work on iterated currying and mapping.