File: Simple.hs

package info (click to toggle)
haskell-yaml 0.11.11.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 272 kB
  • sloc: haskell: 2,371; makefile: 15
file content (14 lines) | stat: -rw-r--r-- 398 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE OverloadedStrings #-}

module Simple where

import qualified Data.Yaml as Y

main :: IO ()
main = do
  res <- Y.decodeThrow "[1,2,3]"
  print (res :: [Integer])

-- You can go one step further and decode into a custom type by implementing
-- 'FromJSON' for that type. This is also appropriate where extra
-- normalization, formatting or manipulation of the YAML is required on decode.