diff options
Diffstat (limited to 'src/Chelleport/Utils.hs')
| -rw-r--r-- | src/Chelleport/Utils.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Chelleport/Utils.hs b/src/Chelleport/Utils.hs index 5977039..0e7dabc 100644 --- a/src/Chelleport/Utils.hs +++ b/src/Chelleport/Utils.hs @@ -2,10 +2,12 @@ module Chelleport.Utils where import Data.List (nub) import Foreign.C (CInt) -import Unsafe.Coerce (unsafeCoerce) intToCInt :: Int -> CInt -intToCInt = unsafeCoerce +intToCInt = fromIntegral + +cIntToInt :: CInt -> Int +cIntToInt = fromIntegral findWithIndex :: (x -> Maybe r) -> Int -> [x] -> Maybe (Int, r) findWithIndex _predicate _index [] = Nothing |
