on 06f73cc help sign in
14 lines 398 B history raw
1{-# LANGUAGE OverloadedStrings #-}
3module Simple where
5import qualified Data.Yaml as Y
7main :: IO ()
8main = do
9 res <- Y.decodeThrow "[1,2,3]"
10 print (res :: [Integer])
12-- You can go one step further and decode into a custom type by implementing
13-- 'FromJSON' for that type. This is also appropriate where extra
14-- normalization, formatting or manipulation of the YAML is required on decode.