File: Internal.hsc

package info (click to toggle)
haskell-text-icu 0.6.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 284 kB
  • ctags: 82
  • sloc: haskell: 794; ansic: 535; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE CPP, DeriveDataTypeable, ForeignFunctionInterface #-}
-- |
-- Module      : Data.Text.ICU.Normalize.Internal
-- Copyright   : (c) 2010 Bryan O'Sullivan
--
-- License     : BSD-style
-- Maintainer  : bos@serpentine.com
-- Stability   : experimental
-- Portability : GHC

module Data.Text.ICU.Normalize.Internal
    (
      UNormalizationCheckResult
    , toNCR
    ) where

#include <unicode/unorm.h>

import Foreign.C.Types (CInt)

type UNormalizationCheckResult = CInt

toNCR :: UNormalizationCheckResult -> Maybe Bool
toNCR (#const UNORM_NO)    = Just False
toNCR (#const UNORM_MAYBE) = Nothing
toNCR (#const UNORM_YES)   = Just True
toNCR _                    = error "toNormalizationCheckResult"