[Haskell-beginners] How to use the yaml package?

Michael Snoyman michael at snoyman.com
Wed Feb 2 21:26:37 CET 2011


Hi Xavier,

I'm the author of both yaml and data-object-yaml. I recommend you
stick with data-object-yaml: yaml is much more low level. I recently
wrote a blog post about data-object-yaml which you will probably find
useful: http://docs.yesodweb.com/blog/data-object-yaml/ .

As for your installation problem: cabal installs libraries by default
in the user folder, whereas Setup.hs checks the global folder by
default. I recommend just using "cabal configure" and skipping the
Setup.hs file.

Good luck!

Michael

On Wed, Feb 2, 2011 at 10:23 PM, Xavier Shay <xavier-list at rhnh.net> wrote:
> Hello,
>
> I want to use YAML in my app
>
> I have run:
> cabal install yaml
>
> I have added it to my build-depends line in my .cabal file:
> Build-Depends:       base,time,yaml
>
> $ runhaskell Setup.lhs configure
> Configuring xtdo-0.1...
> Setup.lhs: At least the following dependencies are missing:
> yaml -any
>
> Oh no! I tried just importing Text.Libyaml in both my app and GHCi but
> neither error gave any clues. I also found references to HsSyck,
> data-object-yaml and YAML::Tiny libraries, but not sure what I should be
> using.
>
> Right now I'm feeling totally lost, not being able to find examples of code
> using yaml, nor documentation for how I would use the libraries to play
> around with it. Also not comfortable I understand the interaction between
> cabal, runhaskell, ghc, and my build file.
>
> Any pointers?
> References to documentation I should have read also appreciated.
>
> Cheers,
> Xavier
>
>
> (I don't know how relevant it is, but here is my minimal project I am trying
> to add it to: https://github.com/xaviershay/xtdo-hs)
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



More information about the Beginners mailing list