on master help sign in
emphasize examples directory, add it to CI
commit49f8f924c9bc4dbb8b2ccb4c10b34a604a25d838 authorChris Allen <cma@bitemyapp.com> dateSun 28 Feb 2016, 23:10 (11 years ago) parentae8263c
5 files changed+17−24
.travis.yml+3−1 Data/Yaml.hs+2−15 examples/config.hs → examples/Config.hs examples/Simple.hs+12 examples/simple.hs−8
.travis.yml+3−1
@@ -28,7 +28,9 @@ before_install:
2828# This line does all of the work: installs GHC if necessary, build the library,
2929# executables, and test suites, and runs the test suites. --no-terminal works
3030# around some quirks in Travis's terminal implementation.
31−script: stack $ARGS --no-terminal --install-ghc test --pedantic
31+script:
32+ - stack $ARGS --no-terminal --install-ghc build yaml:examples --pedantic
33+ - stack $ARGS --no-terminal --install-ghc test --pedantic
3234
3335# Caching so the next build will be fast too.
3436cache:
Data/Yaml.hs+2−15
@@ -18,21 +18,8 @@
1818-- For documentation on the @aeson@ types, functions, classes, and
1919-- operators, please see the @Data.Aeson@ module of the @aeson@ package.
2020--
21−-- == Examples
22−--
23−-- Decode into a data structure by specifying the desired type to the 'decode'
24−-- method.
25−--
26−-- > {-# LANGUAGE OverloadedStrings #-}
27−-- >
28−-- > import qualified Data.Yaml as Y
29−-- >
30−-- > main = do
31−-- > print $ (Y.decode "[1,2,3]" :: Maybe [Integer])
32−--
33−-- You can go one step further and decode into a custom type by implementing
34−-- 'FromJSON' for that type. This is also appropriate where extra
35−-- normalization, formatting or manipulation of the YAML is required on decode.
21+-- Look in the examples directory of the source repository for some initial
22+-- pointers on how to use this library.
3623
3724#if (defined (ghcjs_HOST_OS))
3825module Data.Yaml {-# WARNING "GHCJS is not supported yet (will break at runtime once called)." #-}
examples/config.hs → examples/Config.hsrenamed

The content is the same.

examples/Simple.hsnew file+12
@@ -0,0 +1,12 @@
1+{-# LANGUAGE OverloadedStrings #-}
2+
3+module Simple where
4+
5+import qualified Data.Yaml as Y
6+
7+main = do
8+ print $ (Y.decode "[1,2,3]" :: Maybe [Integer])
9+
10+-- You can go one step further and decode into a custom type by implementing
11+-- 'FromJSON' for that type. This is also appropriate where extra
12+-- normalization, formatting or manipulation of the YAML is required on decode.
examples/simple.hsdeleted−8
@@ -1,8 +0,0 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−
3−module Simple where
4−
5−import qualified Data.Yaml as Y
6−
7−main = do
8− print $ (Y.decode "[1,2,3]" :: Maybe [Integer])