module IO.Show
(
showFunction
)
where
import Data.List (intercalate)
showFunction :: (Show a, Show b) =>
(a -> b) -> [a] -> String
showFunction :: forall a b. (Show a, Show b) => (a -> b) -> [a] -> String
showFunction a -> b
f [a]
xs = String
"(\\x -> case x of " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate String
";" [a -> String
forall a. Show a => a -> String
show a
x String -> String -> String
forall a. [a] -> [a] -> [a]
++String
" -> " String -> String -> String
forall a. [a] -> [a] -> [a]
++ b -> String
forall a. Show a => a -> String
show (a -> b
f a
x) | a
x <- [a]
xs] String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
")"