{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
import Dhall
data Example = Example { foo :: Natural, bar :: Vector Double }
deriving (Generic, Show)
instance Interpret Example
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
x <- input auto "./example.dhall"
print (x :: Example)
在上面的例子中,我怎样才能把 an 编码Example
成一个 dhall 值,所以本质上是一个 type 的函数Example -> String
?似乎在黑线鳕中找不到任何关于打印/编码的参考。