Idris2/tests/idris2/interpolation003/Test.idr
André Videla 274954998b
Implement generic interpolation (#1967)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-10-13 17:26:54 +01:00

16 lines
278 B
Idris

import Data.String
Interpolation Bool where
interpolate True = "TT"
interpolate False = "FF"
Interpolation Nat where
interpolate Z = "0"
interpolate (S n) = "S \{n}"
Interpolation Integer where
interpolate = show
test : String
test = "\{2}\{True}: \{True}\{True}"