How do I write the function 'twice' in Haskell?
- by kunjaan
I want to write 'twice' function that takes a function and an argument and applies the function twice. However the function that it receives should work on union types.
eg.
    f a -> b 
    f b -> c
Output
   twice f a
 c
   f a
   b
   f b 
   c
   f c
   error