1-- | 2-- Module : Data.Text.Internal.Encoding.Utf32 3-- Copyright : (c) 2008, 2009 Tom Harper, 4-- (c) 2009, 2010 Bryan O'Sullivan, 5-- (c) 2009 Duncan Coutts 6-- 7-- License : BSD-style 8-- Maintainer : bos@serpentine.com 9-- Stability : experimental 10-- Portability : portable 11-- 12-- /Warning/: this is an internal module, and does not have a stable 13-- API or name. Functions in this module may not check or enforce 14-- preconditions expected by public modules. Use at your own risk! 15-- 16-- Basic UTF-32 validation. 17module Data.Text.Internal.Encoding.Utf32 18 ( 19 validate 20 ) where 21 22import Data.Word (Word32) 23 24validate :: Word32 -> Bool 25validate x1 = x1 < 0xD800 || (x1 > 0xDFFF && x1 <= 0x10FFFF) 26{-# INLINE validate #-} 27