As a simple example I have this.
import Prelude hiding ((.))
import FRP.Netwire
import Control.Wire
f :: Int -> Char -> String
f = replicate
w :: => Wire s e m Int Char
w = mkSF_ fromInt
where
fromInt :: Int -> Char
fromInt 1 = 'a'
fromInt 2 = 'b'
fromInt _ = '_'
w2 :: Wire s e m Int String
w2 = undefined -- This is where I get stuck
And I would like to be able to create a wire from Int's to Strings.
I think it should be easy, but I'm having no luck.
Another option is to use applicative syntax, which is even cleaner, imo
This generalizes to
Note that every
Arrow
gives rise to the above constraint.