As a learning exercise, I'm trying to define a newtype to serve as a holder of functions that can convert Show-able values to Effects, i.e.:
newtype ShEff a = ShEff (forall eff. Show a => a -> Eff eff Unit)
However, this:
f :: forall a. ShEff a
f = ShEff logShow
fails to compile with this error:
Could not match type
( console :: CONSOLE
| t2
)
with type
eff1
while trying to match type Eff
( console :: CONSOLE
| t2
)
with type Eff eff1
while checking that expression logShow
has type t0 -> Eff eff1 Unit
in value declaration f
Can you point me in the right direction?