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