# How to implement a transcript program in Haskell?

**URL:** <https://discourse.haskell.org/t/how-to-implement-a-transcript-program-in-haskell/8080>\
**Category:** Uncategorized\
**Created:** [November 10, 2023, 8:08pm UTC](https://discourse.haskell.org/t/how-to-implement-a-transcript-program-in-haskell/8080 "2023-11-10T20:08:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tomjaguarpaw](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomjaguarpaw/32/1230_2.png) [@tomjaguarpaw](https://discourse.haskell.org/u/tomjaguarpaw)\
**Post date:** [November 10, 2023, 8:33pm UTC](https://discourse.haskell.org/t/how-to-implement-a-transcript-program-in-haskell/8080/2 "2023-11-10T20:33:08Z")

</div>

So you want to intercept writes to stdout, and to be able to write to stdin? Maybe there’s a way of doing that but it would probably be easier if you wrote the program to take two higher order arguments, say

```haskell
myMain :: IO String -> (String -> IO ()) -> IO ()
myMain readIt writeIt = ...

```

---

_[View the full topic](https://discourse.haskell.org/t/how-to-implement-a-transcript-program-in-haskell/8080)._
