Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 713 Bytes

README.md

File metadata and controls

31 lines (26 loc) · 713 Bytes

Ouroboros

An OCaml -> Haskell -> OCaml Ouroboros Quine

Usage

$ ocaml ouroboros.ml > ouroboros.hs
$ ghc ouroboros.hs
$ ./ouroboros > ouroboros_again.ml
$ diff ouruboros.ml ouroboros_again.ml
$ echo $?
0

This is an OCaml program that outputs a Haskell program which outputs the original Ocaml program.

Hints

Here are some hints if you'd like to try this yourself, but are getting stuck. There are other ways to do this without using these hints though.

Hint 1 (Ocaml)
  Printf.printf "%S" "hello \"world\""
Hint 2 (Haskell)
  putStrLn $ show "hello \"world\""