[Haskell-cafe] Using HList Records

Rahul Kapoor rk at trie.org
Wed Aug 8 17:23:59 EDT 2007


Using The Darcs version of HList (http://darcs.haskell.org/HList/), I
can do simple things with (H)lists just fine, so

--angus =  Key 42
--     .*. Name "Angus"
--     .*. Cow
--     .*. Price 75.5
--     .*. HNil

--main = putStrLn (show angus)

works, On the other hand examples from the HList paper for extensible
records like

--key   = firstLabel FootNMouth "key"
--name  = nextLabel  key        "name"
--breed = nextLabel  name       "breed"
--price = nextLabel  breed      "price"

do not compile with errors

--Main.hs:15:8-17: Not in scope: `firstLabel'
--Main.hs:16:8-16: Not in scope: `nextLabel'

A quick show "ghc-pkg describe HList" shows that

--exposed-modules: HList
--hidden-modules: Label4 CommonMain Variant GhcSyntax GhcRecord
--                Record HZip TIC TIP HTypeIndexed HOccurs HArray GhcExperiments
--                HListPrelude TypeEqBoolGeneric TypeEqGeneric1 TypeCastGeneric1
--                FakePrelude

So the question is do I need to play around with the cabal file to
expose the right stuff? Or has the syntax changed?

I get errors running "./setup haddock" (configure, build, install, are
fine).  Are the HList api docs available anywhere online?

Rahul


More information about the Haskell-Cafe mailing list