packages feed

tilia-0.2.0.0: corpora/vendored/cpp/comment/comment-in-a-branch-the-conditional-above-settles.hs

{-# LANGUAGE CPP #-}

module Emacs.Module.Text where

extract :: Env -> Value -> IO Text
extract env x = withString env x $ \size bytes ->
#ifdef ASSERTIONS
    do
      -- Leave the terminating NUL out.
      checked <- validate bytes
      decode checked (size - 1)
#endif
#ifndef ASSERTIONS
    case freeze bytes of
      frozen ->
        -- Leave the terminating NUL out.
        pure (decode frozen (size - 1))
#endif