on master help sign in
emphasize examples directory, add it to CI
49f8f92Chris Allen
.travis.yml+3−1
@@ -28,7 +28,9 @@ before_install:
28# This line does all of the work: installs GHC if necessary, build the library,
28# This line does all of the work: installs GHC if necessary, build the library,
29# executables, and test suites, and runs the test suites. --no-terminal works
29# executables, and test suites, and runs the test suites. --no-terminal works
30# around some quirks in Travis's terminal implementation.
30# around some quirks in Travis's terminal implementation.
31+script:
32+ - stack $ARGS --no-terminal --install-ghc build yaml:examples --pedantic
31−script: stack $ARGS --no-terminal --install-ghc test --pedantic
33+ - stack $ARGS --no-terminal --install-ghc test --pedantic
32
34
33# Caching so the next build will be fast too.
35# Caching so the next build will be fast too.
34cache:
36cache:
Data/Yaml.hs+2−15
@@ -18,21 +18,8 @@
18-- For documentation on the @aeson@ types, functions, classes, and
18-- For documentation on the @aeson@ types, functions, classes, and
19-- operators, please see the @Data.Aeson@ module of the @aeson@ package.
19-- operators, please see the @Data.Aeson@ module of the @aeson@ package.
20--
20--
21−-- == Examples
21+-- Look in the examples directory of the source repository for some initial
22−--
22+-- pointers on how to use this library.
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.
36
23
37#if (defined (ghcjs_HOST_OS))
24#if (defined (ghcjs_HOST_OS))
38module Data.Yaml {-# WARNING "GHCJS is not supported yet (will break at runtime once called)." #-}
25module 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])