1
0
forked from GitHub/gf-core
Files
gf-core/src/runtime/haskell-bind
Thomas Hallgren 820d2d503f Fixes for GHC 8.4.1 compatibility
* In GHC 8.4.1, the operator <> has become a method of the Semigroup class
  and is exported from the Prelude. This is unfortunate, since <> is also
  exported from the standard library module Text.PrettyPrint, so in any
  module that defines a pretty printer, there is likely to be an ambiguity.

  This affects ~18 modules in GF. Solution:

    import Prelude hiding (<>)

  This works also in older versions of GHC, since GHC does't complain if
  you hide something that doesn't exists.

* In GHC 8.4.1, Semigroup has become a superclass of Monoid. This means
  that anywhere you define an instance of the Monoid class you also have to
  define an instance in the Semigroup class.

  This affects Data.Binary.Builder in GF. Solution: conditionally define
  a Semigroup instance if compiling with base>=4.11 (ghc>=8.4.1)
2018-04-18 19:18:10 +02:00
..
2018-04-09 12:14:32 -03:00
2018-04-18 19:18:10 +02:00
2014-02-09 20:56:01 +00:00
2017-04-12 11:55:27 +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)