1
0
forked from GitHub/gf-core
Files
gf-core/src/runtime/haskell-bind
hallgren d2217c0715 PGF2: export BindType(..) and two new functions: showType & categories
showType :: Type -> String
categories :: PGF -> [Cat]

But both are implemented as quick hacks: categories is implemented by listing
all functions and taking the target categories from their types. showType uses
ppType copied & modified from PGF.Type, and needs a ppExpr, which is currently
implemented by wrapping showExpr...

TODO: need something correpsonding to PGF.categoryContext.
2015-08-20 15:55:24 +00:00
..
2014-02-09 20:56:01 +00:00

This is a binding to the new GF runtime in C.

The files are:

PGF2.hsc         -- a user API similar to Python and Java APIs
PGF2/FFI.hs      -- an internal module with FFI definitions for 
                 -- the relevant C functions

HOW TO COMPILE:

cabal install

HOW TO USE:

- Import PGF to the Haskell program that you're writing. 
  The Cabal infrastructure will make sure to tell the compiler
  where to find the relevant modules. Example:

  module Main where

  import PGF2
  import qualified Data.Map as Map

  main = do
    pgf <- readPGF "Foo.pgf"
    let Just english = Map.lookup "FooEng" (languages pgf)