PureScript does not create "trace" and "show"

So the following work

 main = do
    trace $ show $ 5

But it is not

 main = do
    (trace . show) 5

in psci type of route

 forall r. Prim.String -> Control.Monad.Eff.Eff (trace :: Debug.Trace.Trace | r) Prelude.Unit

and type of show

 forall a. (Prelude.Show a) => a -> Prim.String

since the return value is show Prim.String, and the first entry into the trace Prim.String, they must be compositional. This is once again evidenced by the trace $ showtransfer of type checking. But instead, I get this error:

Error at  line 1, column 10: 
Error in declaration it
Cannot unify Prim.Object with Prim.Function Prim.String.

What am I missing here? My mental model right now is that which is tracevery similar to putStrLnin Haskell, and that can definitely be compiled with show. (putStrLn . show) 5works.

Expected type of compiled trace and display result:

 forall a r. (Prelude.Show a) => a -> Control.Monad.Eff.Eff (trace :: Debug.Trace.Trace | r) Prelude.Unit
+4
source share
1

. , PureScript,

main = show $ { test : "Hello, string property" } . test

<<<, , Control.Arrow (Haskell).

+5

All Articles