{-# LINE 1 "lib/CPython/Constants.chs" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module CPython.Constants
( none
, true
, false
, isNone
, isTrue
, isFalse
) where
import CPython.Internal
none :: IO ((SomeObject))
none =
none'_ >>= \res ->
peekObject res >>= \res' ->
return (res')
{-# LINE 33 "lib/CPython/Constants.chs" #-}
true :: IO ((SomeObject))
true =
true'_ >>= \res ->
peekObject res >>= \res' ->
return (res')
{-# LINE 37 "lib/CPython/Constants.chs" #-}
false :: IO ((SomeObject))
false =
false'_ >>= \res ->
peekObject res >>= \res' ->
return (res')
{-# LINE 41 "lib/CPython/Constants.chs" #-}
rawNone :: (Ptr ())
rawNone =
let {res = rawNone'_} in
let {res' = id res} in
(res')
{-# LINE 44 "lib/CPython/Constants.chs" #-}
rawTrue :: (Ptr ())
rawTrue =
let {res = rawTrue'_} in
let {res' = id res} in
(res')
{-# LINE 47 "lib/CPython/Constants.chs" #-}
rawFalse :: (Ptr ())
rawFalse =
let {res = rawFalse'_} in
let {res' = id res} in
(res')
{-# LINE 50 "lib/CPython/Constants.chs" #-}
isNone :: SomeObject -> IO Bool
isNone obj = withObject obj $ \ptr -> return $ ptr == rawNone
isTrue :: SomeObject -> IO Bool
isTrue obj = withObject obj $ \ptr -> return $ ptr == rawTrue
isFalse :: SomeObject -> IO Bool
isFalse obj = withObject obj $ \ptr -> return $ ptr == rawFalse
foreign import ccall unsafe "CPython/Constants.chs.h hscpython_Py_None"
none'_ :: (IO (Ptr ()))
foreign import ccall unsafe "CPython/Constants.chs.h hscpython_Py_True"
true'_ :: (IO (Ptr ()))
foreign import ccall unsafe "CPython/Constants.chs.h hscpython_Py_False"
false'_ :: (IO (Ptr ()))
foreign import ccall unsafe "CPython/Constants.chs.h hscpython_Py_None"
rawNone'_ :: (Ptr ())
foreign import ccall unsafe "CPython/Constants.chs.h hscpython_Py_True"
rawTrue'_ :: (Ptr ())
foreign import ccall unsafe "CPython/Constants.chs.h hscpython_Py_False"
rawFalse'_ :: (Ptr ())