packages feed

base 4.6.0.1 → 4.7.0.0

raw patch · 220 files changed

+32232/−30440 lines, 220 filesdep ~ghc-primdep ~integer-gmpdep ~integer-simplenew-uploaderPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ghc-prim, integer-gmp, integer-simple, rts

API changes (from Hackage documentation)

- Control.Concurrent: forkIOUnmasked :: IO () -> IO ThreadId
- Control.Concurrent: mergeIO :: [a] -> [a] -> IO [a]
- Control.Concurrent: nmergeIO :: [[a]] -> IO [a]
- Control.Concurrent.Chan: instance Typeable1 Chan
- Control.Concurrent.QSem: instance Eq QSem
- Control.Concurrent.QSem: instance Typeable QSem
- Control.Concurrent.QSemN: instance Eq QSemN
- Control.Concurrent.SampleVar: data SampleVar a
- Control.Concurrent.SampleVar: emptySampleVar :: SampleVar a -> IO ()
- Control.Concurrent.SampleVar: instance Eq (SampleVar a)
- Control.Concurrent.SampleVar: instance Typeable1 SampleVar
- Control.Concurrent.SampleVar: isEmptySampleVar :: SampleVar a -> IO Bool
- Control.Concurrent.SampleVar: newEmptySampleVar :: IO (SampleVar a)
- Control.Concurrent.SampleVar: newSampleVar :: a -> IO (SampleVar a)
- Control.Concurrent.SampleVar: readSampleVar :: SampleVar a -> IO a
- Control.Concurrent.SampleVar: writeSampleVar :: SampleVar a -> a -> IO ()
- Control.Exception: block :: IO a -> IO a
- Control.Exception: blocked :: IO Bool
- Control.Exception: data ErrorCall
- Control.Exception: unblock :: IO a -> IO a
- Control.Exception.Base: block :: IO a -> IO a
- Control.Exception.Base: blocked :: IO Bool
- Control.Exception.Base: data ErrorCall
- Control.Exception.Base: unblock :: IO a -> IO a
- Control.Monad.ST: unsafeIOToST :: IO a -> ST s a
- Control.Monad.ST: unsafeInterleaveST :: ST s a -> ST s a
- Control.Monad.ST: unsafeSTToIO :: ST s a -> IO a
- Control.Monad.ST.Lazy: unsafeIOToST :: IO a -> ST s a
- Control.Monad.ST.Lazy: unsafeInterleaveST :: ST s a -> ST s a
- Data.Complex: instance Typeable1 Complex
- Data.Data: instance (Typeable a, Data b, Ix a) => Data (Array a b)
- Data.Data: instance Typeable a => Data (ForeignPtr a)
- Data.Data: instance Typeable a => Data (Ptr a)
- Data.Data: mkFloatConstr :: DataType -> Double -> Constr
- Data.Data: mkIntConstr :: DataType -> Integer -> Constr
- Data.Data: mkNorepType :: String -> DataType
- Data.Data: mkStringConstr :: DataType -> String -> Constr
- Data.Data: mkStringType :: String -> DataType
- Data.Either: instance Typeable2 Either
- Data.Fixed: data Fixed a
- Data.Fixed: instance Typeable1 Fixed
- Data.HashTable: data HashTable key val
- Data.HashTable: delete :: HashTable key val -> key -> IO ()
- Data.HashTable: fromList :: Eq key => (key -> Int32) -> [(key, val)] -> IO (HashTable key val)
- Data.HashTable: hashInt :: Int -> Int32
- Data.HashTable: hashString :: String -> Int32
- Data.HashTable: insert :: HashTable key val -> key -> val -> IO ()
- Data.HashTable: instance Eq HashData
- Data.HashTable: instance Eq Inserts
- Data.HashTable: instance Show HashData
- Data.HashTable: longestChain :: HashTable key val -> IO [(key, val)]
- Data.HashTable: lookup :: HashTable key val -> key -> IO (Maybe val)
- Data.HashTable: new :: (key -> key -> Bool) -> (key -> Int32) -> IO (HashTable key val)
- Data.HashTable: newHint :: (key -> key -> Bool) -> (key -> Int32) -> Int -> IO (HashTable key val)
- Data.HashTable: prime :: Int32
- Data.HashTable: toList :: HashTable key val -> IO [(key, val)]
- Data.HashTable: update :: HashTable key val -> key -> val -> IO Bool
- Data.Typeable: class Typeable1 t
- Data.Typeable: class Typeable2 t
- Data.Typeable: class Typeable3 t
- Data.Typeable: class Typeable4 t
- Data.Typeable: class Typeable5 t
- Data.Typeable: class Typeable6 t
- Data.Typeable: class Typeable7 t
- Data.Typeable: data TypeRepKey
- Data.Typeable: instance [overlap ok] Eq TypeRepKey
- Data.Typeable: instance [overlap ok] Ord TypeRepKey
- Data.Typeable: mkTyCon :: String -> TyCon
- Data.Typeable: typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep
- Data.Typeable: typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep
- Data.Typeable: typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep
- Data.Typeable: typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep
- Data.Typeable: typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep
- Data.Typeable: typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep
- Data.Typeable: typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep
- Data.Typeable: typeRepKey :: TypeRep -> IO TypeRepKey
- Data.Typeable.Internal: class Typeable1 t
- Data.Typeable.Internal: class Typeable2 t
- Data.Typeable.Internal: class Typeable3 t
- Data.Typeable.Internal: class Typeable4 t
- Data.Typeable.Internal: class Typeable5 t
- Data.Typeable.Internal: class Typeable6 t
- Data.Typeable.Internal: class Typeable7 t
- Data.Typeable.Internal: instance [overlap ok] (Typeable1 s, Typeable a) => Typeable (s a)
- Data.Typeable.Internal: instance [overlap ok] (Typeable2 s, Typeable a) => Typeable1 (s a)
- Data.Typeable.Internal: instance [overlap ok] (Typeable3 s, Typeable a) => Typeable2 (s a)
- Data.Typeable.Internal: instance [overlap ok] (Typeable4 s, Typeable a) => Typeable3 (s a)
- Data.Typeable.Internal: instance [overlap ok] (Typeable5 s, Typeable a) => Typeable4 (s a)
- Data.Typeable.Internal: instance [overlap ok] (Typeable6 s, Typeable a) => Typeable5 (s a)
- Data.Typeable.Internal: instance [overlap ok] (Typeable7 s, Typeable a) => Typeable6 (s a)
- Data.Typeable.Internal: instance [overlap ok] Typeable Int16
- Data.Typeable.Internal: instance [overlap ok] Typeable Int32
- Data.Typeable.Internal: instance [overlap ok] Typeable Int64
- Data.Typeable.Internal: instance [overlap ok] Typeable Int8
- Data.Typeable.Internal: instance [overlap ok] Typeable1 FunPtr
- Data.Typeable.Internal: instance [overlap ok] Typeable1 IO
- Data.Typeable.Internal: instance [overlap ok] Typeable1 IORef
- Data.Typeable.Internal: instance [overlap ok] Typeable1 MVar
- Data.Typeable.Internal: instance [overlap ok] Typeable1 Maybe
- Data.Typeable.Internal: instance [overlap ok] Typeable1 Ptr
- Data.Typeable.Internal: instance [overlap ok] Typeable1 Ratio
- Data.Typeable.Internal: instance [overlap ok] Typeable1 StablePtr
- Data.Typeable.Internal: instance [overlap ok] Typeable1 []
- Data.Typeable.Internal: instance [overlap ok] Typeable2 (,)
- Data.Typeable.Internal: instance [overlap ok] Typeable2 (->)
- Data.Typeable.Internal: instance [overlap ok] Typeable2 Array
- Data.Typeable.Internal: instance [overlap ok] Typeable2 IOArray
- Data.Typeable.Internal: instance [overlap ok] Typeable2 ST
- Data.Typeable.Internal: instance [overlap ok] Typeable2 STRef
- Data.Typeable.Internal: instance [overlap ok] Typeable3 (,,)
- Data.Typeable.Internal: instance [overlap ok] Typeable3 STArray
- Data.Typeable.Internal: instance [overlap ok] Typeable4 (,,,)
- Data.Typeable.Internal: instance [overlap ok] Typeable5 (,,,,)
- Data.Typeable.Internal: instance [overlap ok] Typeable6 (,,,,,)
- Data.Typeable.Internal: instance [overlap ok] Typeable7 (,,,,,,)
- Data.Typeable.Internal: typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep
- Data.Typeable.Internal: typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep
- Data.Typeable.Internal: typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep
- Data.Typeable.Internal: typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep
- Data.Typeable.Internal: typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep
- Data.Typeable.Internal: typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep
- Data.Typeable.Internal: typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep
- Foreign: unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a
- Foreign: unsafePerformIO :: IO a -> a
- Foreign.Marshal: unsafeLocalState :: IO a -> a
- GHC.Conc: forkIOUnmasked :: IO () -> IO ThreadId
- GHC.Conc: forkOnIO :: Int -> IO () -> IO ThreadId
- GHC.Conc: forkOnIOUnmasked :: Int -> IO () -> IO ThreadId
- GHC.Conc.Sync: forkIOUnmasked :: IO () -> IO ThreadId
- GHC.Conc.Sync: forkOnIO :: Int -> IO () -> IO ThreadId
- GHC.Conc.Sync: forkOnIOUnmasked :: Int -> IO () -> IO ThreadId
- GHC.Conc.Sync: instance Typeable1 STM
- GHC.Conc.Sync: instance Typeable1 TVar
- GHC.Constants: aP_STACK_SPLIM :: Int
- GHC.Constants: bITMAP_BITS_SHIFT :: Int
- GHC.Constants: bLOCKS_PER_MBLOCK :: Int
- GHC.Constants: bLOCK_SIZE :: Int
- GHC.Constants: bLOCK_SIZE_W :: Int
- GHC.Constants: cINT_SIZE :: Int
- GHC.Constants: cLONG_LONG_SIZE :: Int
- GHC.Constants: cLONG_SIZE :: Int
- GHC.Constants: dOUBLE_SIZE :: Int
- GHC.Constants: iNT64_SIZE :: Int
- GHC.Constants: mAX_CHARLIKE :: Int
- GHC.Constants: mAX_CONTEXT_REDUCTION_DEPTH :: Int
- GHC.Constants: mAX_Double_REG :: Int
- GHC.Constants: mAX_Float_REG :: Int
- GHC.Constants: mAX_INTLIKE :: Int
- GHC.Constants: mAX_Long_REG :: Int
- GHC.Constants: mAX_PTR_TAG :: Int
- GHC.Constants: mAX_Real_Double_REG :: Int
- GHC.Constants: mAX_Real_Float_REG :: Int
- GHC.Constants: mAX_Real_Long_REG :: Int
- GHC.Constants: mAX_Real_Vanilla_REG :: Int
- GHC.Constants: mAX_SPEC_AP_SIZE :: Int
- GHC.Constants: mAX_SPEC_CONSTR_SIZE :: Int
- GHC.Constants: mAX_SPEC_FUN_SIZE :: Int
- GHC.Constants: mAX_SPEC_SELECTEE_SIZE :: Int
- GHC.Constants: mAX_SPEC_THUNK_SIZE :: Int
- GHC.Constants: mAX_TUPLE_SIZE :: Int
- GHC.Constants: mAX_Vanilla_REG :: Int
- GHC.Constants: mIN_CHARLIKE :: Int
- GHC.Constants: mIN_INTLIKE :: Int
- GHC.Constants: mIN_PAYLOAD_SIZE :: Int
- GHC.Constants: mUT_ARR_PTRS_CARD_BITS :: Int
- GHC.Constants: oFFSET_Capability_context_switch :: Int
- GHC.Constants: oFFSET_Capability_interrupt :: Int
- GHC.Constants: oFFSET_Capability_lock :: Int
- GHC.Constants: oFFSET_Capability_mut_lists :: Int
- GHC.Constants: oFFSET_Capability_no :: Int
- GHC.Constants: oFFSET_Capability_r :: Int
- GHC.Constants: oFFSET_Capability_sparks :: Int
- GHC.Constants: oFFSET_CostCentreStack_ccsID :: Int
- GHC.Constants: oFFSET_CostCentreStack_mem_alloc :: Int
- GHC.Constants: oFFSET_CostCentreStack_prevStack :: Int
- GHC.Constants: oFFSET_CostCentreStack_scc_count :: Int
- GHC.Constants: oFFSET_CostCentre_ccID :: Int
- GHC.Constants: oFFSET_CostCentre_link :: Int
- GHC.Constants: oFFSET_MessageBlackHole_bh :: Int
- GHC.Constants: oFFSET_MessageBlackHole_link :: Int
- GHC.Constants: oFFSET_MessageBlackHole_tso :: Int
- GHC.Constants: oFFSET_RtsFlags_DebugFlags_apply :: Int
- GHC.Constants: oFFSET_RtsFlags_DebugFlags_sanity :: Int
- GHC.Constants: oFFSET_RtsFlags_DebugFlags_weak :: Int
- GHC.Constants: oFFSET_RtsFlags_GcFlags_initialStkSize :: Int
- GHC.Constants: oFFSET_RtsFlags_MiscFlags_tickInterval :: Int
- GHC.Constants: oFFSET_RtsFlags_ProfFlags_showCCSOnException :: Int
- GHC.Constants: oFFSET_StgAP_STACK_fun :: Int
- GHC.Constants: oFFSET_StgAP_STACK_payload :: Int
- GHC.Constants: oFFSET_StgAP_STACK_size :: Int
- GHC.Constants: oFFSET_StgAP_fun :: Int
- GHC.Constants: oFFSET_StgAP_n_args :: Int
- GHC.Constants: oFFSET_StgAP_payload :: Int
- GHC.Constants: oFFSET_StgArrWords_bytes :: Int
- GHC.Constants: oFFSET_StgArrWords_payload :: Int
- GHC.Constants: oFFSET_StgAtomicInvariant_code :: Int
- GHC.Constants: oFFSET_StgAtomicallyFrame_code :: Int
- GHC.Constants: oFFSET_StgAtomicallyFrame_next_invariant_to_check :: Int
- GHC.Constants: oFFSET_StgAtomicallyFrame_result :: Int
- GHC.Constants: oFFSET_StgBCO_arity :: Int
- GHC.Constants: oFFSET_StgBCO_bitmap :: Int
- GHC.Constants: oFFSET_StgBCO_instrs :: Int
- GHC.Constants: oFFSET_StgBCO_literals :: Int
- GHC.Constants: oFFSET_StgBCO_ptrs :: Int
- GHC.Constants: oFFSET_StgBCO_size :: Int
- GHC.Constants: oFFSET_StgBlockingQueue_bh :: Int
- GHC.Constants: oFFSET_StgBlockingQueue_link :: Int
- GHC.Constants: oFFSET_StgBlockingQueue_owner :: Int
- GHC.Constants: oFFSET_StgBlockingQueue_queue :: Int
- GHC.Constants: oFFSET_StgCatchFrame_exceptions_blocked :: Int
- GHC.Constants: oFFSET_StgCatchFrame_handler :: Int
- GHC.Constants: oFFSET_StgCatchRetryFrame_alt_code :: Int
- GHC.Constants: oFFSET_StgCatchRetryFrame_first_code :: Int
- GHC.Constants: oFFSET_StgCatchRetryFrame_running_alt_code :: Int
- GHC.Constants: oFFSET_StgCatchSTMFrame_code :: Int
- GHC.Constants: oFFSET_StgCatchSTMFrame_handler :: Int
- GHC.Constants: oFFSET_StgClosure_payload :: Int
- GHC.Constants: oFFSET_StgDeadWeak_link :: Int
- GHC.Constants: oFFSET_StgEntCounter_allocs :: Int
- GHC.Constants: oFFSET_StgEntCounter_entry_count :: Int
- GHC.Constants: oFFSET_StgEntCounter_link :: Int
- GHC.Constants: oFFSET_StgEntCounter_registeredp :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraFwd_arity :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraFwd_bitmap :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraFwd_fun_type :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraFwd_slow_apply :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraRev_arity :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraRev_bitmap :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraRev_fun_type :: Int
- GHC.Constants: oFFSET_StgFunInfoExtraRev_slow_apply_offset :: Int
- GHC.Constants: oFFSET_StgHeader_ccs :: Int
- GHC.Constants: oFFSET_StgHeader_info :: Int
- GHC.Constants: oFFSET_StgHeader_ldvw :: Int
- GHC.Constants: oFFSET_StgInd_indirectee :: Int
- GHC.Constants: oFFSET_StgInvariantCheckQueue_invariant :: Int
- GHC.Constants: oFFSET_StgInvariantCheckQueue_my_execution :: Int
- GHC.Constants: oFFSET_StgInvariantCheckQueue_next_queue_entry :: Int
- GHC.Constants: oFFSET_StgLargeBitmap_bitmap :: Int
- GHC.Constants: oFFSET_StgLargeBitmap_size :: Int
- GHC.Constants: oFFSET_StgMVarTSOQueue_link :: Int
- GHC.Constants: oFFSET_StgMVarTSOQueue_tso :: Int
- GHC.Constants: oFFSET_StgMVar_head :: Int
- GHC.Constants: oFFSET_StgMVar_tail :: Int
- GHC.Constants: oFFSET_StgMVar_value :: Int
- GHC.Constants: oFFSET_StgMutArrPtrs_ptrs :: Int
- GHC.Constants: oFFSET_StgMutArrPtrs_size :: Int
- GHC.Constants: oFFSET_StgMutVar_var :: Int
- GHC.Constants: oFFSET_StgPAP_arity :: Int
- GHC.Constants: oFFSET_StgPAP_fun :: Int
- GHC.Constants: oFFSET_StgPAP_n_args :: Int
- GHC.Constants: oFFSET_StgPAP_payload :: Int
- GHC.Constants: oFFSET_StgRegTable_rCCCS :: Int
- GHC.Constants: oFFSET_StgRegTable_rCurrentNursery :: Int
- GHC.Constants: oFFSET_StgRegTable_rCurrentTSO :: Int
- GHC.Constants: oFFSET_StgRegTable_rD1 :: Int
- GHC.Constants: oFFSET_StgRegTable_rD2 :: Int
- GHC.Constants: oFFSET_StgRegTable_rF1 :: Int
- GHC.Constants: oFFSET_StgRegTable_rF2 :: Int
- GHC.Constants: oFFSET_StgRegTable_rF3 :: Int
- GHC.Constants: oFFSET_StgRegTable_rF4 :: Int
- GHC.Constants: oFFSET_StgRegTable_rHp :: Int
- GHC.Constants: oFFSET_StgRegTable_rHpAlloc :: Int
- GHC.Constants: oFFSET_StgRegTable_rHpLim :: Int
- GHC.Constants: oFFSET_StgRegTable_rL1 :: Int
- GHC.Constants: oFFSET_StgRegTable_rNursery :: Int
- GHC.Constants: oFFSET_StgRegTable_rR1 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR10 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR2 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR3 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR4 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR5 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR6 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR7 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR8 :: Int
- GHC.Constants: oFFSET_StgRegTable_rR9 :: Int
- GHC.Constants: oFFSET_StgRegTable_rRet :: Int
- GHC.Constants: oFFSET_StgRegTable_rSp :: Int
- GHC.Constants: oFFSET_StgRegTable_rSpLim :: Int
- GHC.Constants: oFFSET_StgStableName_sn :: Int
- GHC.Constants: oFFSET_StgStack_dirty :: Int
- GHC.Constants: oFFSET_StgStack_sp :: Int
- GHC.Constants: oFFSET_StgStack_stack :: Int
- GHC.Constants: oFFSET_StgStack_stack_size :: Int
- GHC.Constants: oFFSET_StgTRecHeader_enclosing_trec :: Int
- GHC.Constants: oFFSET_StgTSO__link :: Int
- GHC.Constants: oFFSET_StgTSO_block_info :: Int
- GHC.Constants: oFFSET_StgTSO_blocked_exceptions :: Int
- GHC.Constants: oFFSET_StgTSO_bq :: Int
- GHC.Constants: oFFSET_StgTSO_cap :: Int
- GHC.Constants: oFFSET_StgTSO_cccs :: Int
- GHC.Constants: oFFSET_StgTSO_dirty :: Int
- GHC.Constants: oFFSET_StgTSO_flags :: Int
- GHC.Constants: oFFSET_StgTSO_global_link :: Int
- GHC.Constants: oFFSET_StgTSO_id :: Int
- GHC.Constants: oFFSET_StgTSO_saved_errno :: Int
- GHC.Constants: oFFSET_StgTSO_stackobj :: Int
- GHC.Constants: oFFSET_StgTSO_trec :: Int
- GHC.Constants: oFFSET_StgTSO_what_next :: Int
- GHC.Constants: oFFSET_StgTSO_why_blocked :: Int
- GHC.Constants: oFFSET_StgTVarWatchQueue_closure :: Int
- GHC.Constants: oFFSET_StgTVarWatchQueue_next_queue_entry :: Int
- GHC.Constants: oFFSET_StgTVarWatchQueue_prev_queue_entry :: Int
- GHC.Constants: oFFSET_StgTVar_current_value :: Int
- GHC.Constants: oFFSET_StgUpdateFrame_updatee :: Int
- GHC.Constants: oFFSET_StgWeak_cfinalizer :: Int
- GHC.Constants: oFFSET_StgWeak_finalizer :: Int
- GHC.Constants: oFFSET_StgWeak_key :: Int
- GHC.Constants: oFFSET_StgWeak_link :: Int
- GHC.Constants: oFFSET_StgWeak_value :: Int
- GHC.Constants: oFFSET_bdescr_blocks :: Int
- GHC.Constants: oFFSET_bdescr_free :: Int
- GHC.Constants: oFFSET_bdescr_gen_no :: Int
- GHC.Constants: oFFSET_bdescr_link :: Int
- GHC.Constants: oFFSET_bdescr_start :: Int
- GHC.Constants: oFFSET_generation_n_new_large_words :: Int
- GHC.Constants: oFFSET_snEntry_addr :: Int
- GHC.Constants: oFFSET_snEntry_sn_obj :: Int
- GHC.Constants: oFFSET_stgEagerBlackholeInfo :: Int
- GHC.Constants: oFFSET_stgGCEnter1 :: Int
- GHC.Constants: oFFSET_stgGCFun :: Int
- GHC.Constants: pROF_HDR_SIZE :: Int
- GHC.Constants: rESERVED_C_STACK_BYTES :: Int
- GHC.Constants: rESERVED_STACK_WORDS :: Int
- GHC.Constants: sIZEOF_CostCentreStack :: Int
- GHC.Constants: sIZEOF_MessageBlackHole_NoHdr :: Int
- GHC.Constants: sIZEOF_StgAP_NoHdr :: Int
- GHC.Constants: sIZEOF_StgAP_NoThunkHdr :: Int
- GHC.Constants: sIZEOF_StgAP_STACK_NoHdr :: Int
- GHC.Constants: sIZEOF_StgAP_STACK_NoThunkHdr :: Int
- GHC.Constants: sIZEOF_StgArrWords_NoHdr :: Int
- GHC.Constants: sIZEOF_StgAtomicallyFrame_NoHdr :: Int
- GHC.Constants: sIZEOF_StgBCO_NoHdr :: Int
- GHC.Constants: sIZEOF_StgBlockingQueue_NoHdr :: Int
- GHC.Constants: sIZEOF_StgCatchFrame_NoHdr :: Int
- GHC.Constants: sIZEOF_StgCatchRetryFrame_NoHdr :: Int
- GHC.Constants: sIZEOF_StgCatchSTMFrame_NoHdr :: Int
- GHC.Constants: sIZEOF_StgDeadWeak_NoHdr :: Int
- GHC.Constants: sIZEOF_StgFunInfoExtraFwd :: Int
- GHC.Constants: sIZEOF_StgFunInfoExtraRev :: Int
- GHC.Constants: sIZEOF_StgMVarTSOQueue_NoHdr :: Int
- GHC.Constants: sIZEOF_StgMVar_NoHdr :: Int
- GHC.Constants: sIZEOF_StgMutArrPtrs_NoHdr :: Int
- GHC.Constants: sIZEOF_StgMutVar_NoHdr :: Int
- GHC.Constants: sIZEOF_StgPAP_NoHdr :: Int
- GHC.Constants: sIZEOF_StgSMPThunkHeader :: Int
- GHC.Constants: sIZEOF_StgSelector_NoHdr :: Int
- GHC.Constants: sIZEOF_StgSelector_NoThunkHdr :: Int
- GHC.Constants: sIZEOF_StgStableName_NoHdr :: Int
- GHC.Constants: sIZEOF_StgStopFrame_NoHdr :: Int
- GHC.Constants: sIZEOF_StgTSOProfInfo :: Int
- GHC.Constants: sIZEOF_StgUpdateFrame_NoHdr :: Int
- GHC.Constants: sIZEOF_StgWeak_NoHdr :: Int
- GHC.Constants: sIZEOF_generation :: Int
- GHC.Constants: sIZEOF_snEntry :: Int
- GHC.Constants: sTD_HDR_SIZE :: Int
- GHC.Constants: tAG_BITS :: Int
- GHC.Constants: tAG_MASK :: Int
- GHC.Constants: tARGET_MAX_CHAR :: Int
- GHC.Constants: tARGET_MAX_INT :: Integer
- GHC.Constants: tARGET_MAX_WORD :: Integer
- GHC.Constants: tARGET_MIN_INT :: Integer
- GHC.Constants: type TargetInt = Int64
- GHC.Constants: type TargetWord = Word64
- GHC.Constants: wORD64_SIZE :: Int
- GHC.Constants: wORD_SIZE :: Int
- GHC.Constants: wORD_SIZE_IN_BITS :: Int
- GHC.Desugar: (>>>) :: Arrow arr => forall a b c. arr a b -> arr b c -> arr a c
- GHC.Desugar: AnnotationWrapper :: a -> AnnotationWrapper
- GHC.Desugar: data AnnotationWrapper
- GHC.Desugar: toAnnotationWrapper :: Data a => a -> AnnotationWrapper
- GHC.Event: loop :: EventManager -> IO ()
- GHC.Event: shutdown :: EventManager -> IO ()
- GHC.Event: step :: EventManager -> TimeoutQueue -> IO (Bool, TimeoutQueue)
- GHC.IO.Encoding.Iconv: iconvEncoding :: String -> IO TextEncoding
- GHC.IO.Encoding.Iconv: localeEncodingName :: String
- GHC.IO.Encoding.Iconv: mkIconvEncoding :: CodingFailureMode -> String -> IO TextEncoding
- GHC.TypeLits: IsEven :: !(Sing (n + 1)) -> IsEven ((2 * n) + 2)
- GHC.TypeLits: IsEvenZero :: IsEven 0
- GHC.TypeLits: IsOdd :: !(Sing n) -> IsEven ((2 * n) + 1)
- GHC.TypeLits: IsSucc :: !(Sing n) -> IsZero (n + 1)
- GHC.TypeLits: IsZero :: IsZero 0
- GHC.TypeLits: class (<=) (m :: Nat) (n :: Nat)
- GHC.TypeLits: class kparam ~ Kind => SingE (kparam :: k) rep | kparam -> rep
- GHC.TypeLits: class SingI a
- GHC.TypeLits: class (SingI a, SingE (Kind :: k) rep) => SingRep (a :: k) rep | a -> rep
- GHC.TypeLits: data IsEven :: Nat -> *
- GHC.TypeLits: data IsZero :: Nat -> *
- GHC.TypeLits: fromSing :: SingE kparam rep => Sing (a :: k) -> rep
- GHC.TypeLits: instance (SingE k (Kind k) rep, Show rep) => Show (Sing k a)
- GHC.TypeLits: instance (SingI k a, SingE k (Kind k) rep) => SingRep k a rep
- GHC.TypeLits: instance (SingRep k a rep, Read rep, Eq rep) => Read (Sing k a)
- GHC.TypeLits: instance Show (IsEven n)
- GHC.TypeLits: instance Show (IsZero n)
- GHC.TypeLits: instance SingE Nat (Kind Nat) Integer
- GHC.TypeLits: instance SingE Symbol (Kind Symbol) String
- GHC.TypeLits: isEven :: Sing n -> IsEven n
- GHC.TypeLits: isZero :: Sing n -> IsZero n
- GHC.TypeLits: sing :: SingI a => Sing a
- GHC.TypeLits: singThat :: SingRep a rep => (rep -> Bool) -> Maybe (Sing a)
- GHC.TypeLits: type Kind = Any
- GHC.TypeLits: unsafeSingNat :: Integer -> Sing (n :: Nat)
- GHC.TypeLits: unsafeSingSymbol :: String -> Sing (n :: Symbol)
- GHC.TypeLits: withSing :: SingI a => (Sing a -> b) -> b
- System.Mem.StableName: instance Typeable1 StableName
- Text.Printf: instance [safe] HPrintfType (IO a)
- Text.Printf: instance [safe] PrintfType (IO a)
+ Control.Applicative: instance Applicative Proxy
+ Control.Applicative: instance Constructor C1_0Const
+ Control.Applicative: instance Constructor C1_0WrappedArrow
+ Control.Applicative: instance Constructor C1_0WrappedMonad
+ Control.Applicative: instance Constructor C1_0ZipList
+ Control.Applicative: instance Datatype D1Const
+ Control.Applicative: instance Datatype D1WrappedArrow
+ Control.Applicative: instance Datatype D1WrappedMonad
+ Control.Applicative: instance Datatype D1ZipList
+ Control.Applicative: instance Eq a => Eq (ZipList a)
+ Control.Applicative: instance Generic (Const a b)
+ Control.Applicative: instance Generic (WrappedArrow a b c)
+ Control.Applicative: instance Generic (WrappedMonad m a)
+ Control.Applicative: instance Generic (ZipList a)
+ Control.Applicative: instance Generic1 (Const a)
+ Control.Applicative: instance Generic1 (WrappedArrow a b)
+ Control.Applicative: instance Generic1 (WrappedMonad m)
+ Control.Applicative: instance Generic1 ZipList
+ Control.Applicative: instance Monad m => Monad (WrappedMonad m)
+ Control.Applicative: instance Monoid a => Monoid (Const a b)
+ Control.Applicative: instance Ord a => Ord (ZipList a)
+ Control.Applicative: instance Read a => Read (ZipList a)
+ Control.Applicative: instance Selector S1_0_0Const
+ Control.Applicative: instance Selector S1_0_0WrappedArrow
+ Control.Applicative: instance Selector S1_0_0WrappedMonad
+ Control.Applicative: instance Selector S1_0_0ZipList
+ Control.Applicative: instance Show a => Show (ZipList a)
+ Control.Applicative: instance Typeable Alternative
+ Control.Applicative: instance Typeable Applicative
+ Control.Category: instance Category (:~:)
+ Control.Category: instance Category Coercion
+ Control.Concurrent: threadWaitReadSTM :: Fd -> IO (STM (), IO ())
+ Control.Concurrent: threadWaitWriteSTM :: Fd -> IO (STM (), IO ())
+ Control.Concurrent.Chan: instance Typeable Chan
+ Control.Concurrent.MVar: tryReadMVar :: MVar a -> IO (Maybe a)
+ Control.Concurrent.MVar: withMVarMasked :: MVar a -> (a -> IO b) -> IO b
+ Control.Exception: SomeAsyncException :: e -> SomeAsyncException
+ Control.Exception: asyncExceptionFromException :: Exception e => SomeException -> Maybe e
+ Control.Exception: asyncExceptionToException :: Exception e => e -> SomeException
+ Control.Exception: data SomeAsyncException
+ Control.Exception: newtype ErrorCall
+ Control.Exception.Base: SomeAsyncException :: e -> SomeAsyncException
+ Control.Exception.Base: asyncExceptionFromException :: Exception e => SomeException -> Maybe e
+ Control.Exception.Base: asyncExceptionToException :: Exception e => e -> SomeException
+ Control.Exception.Base: data SomeAsyncException
+ Control.Exception.Base: newtype ErrorCall
+ Data.Bits: bitSizeMaybe :: Bits a => a -> Maybe Int
+ Data.Bits: class Bits b => FiniteBits b
+ Data.Bits: finiteBitSize :: FiniteBits b => b -> Int
+ Data.Bits: instance Bits Bool
+ Data.Bits: instance FiniteBits Bool
+ Data.Bits: instance FiniteBits Int
+ Data.Bits: instance FiniteBits Word
+ Data.Bits: zeroBits :: Bits a => a
+ Data.Bool: bool :: a -> a -> Bool -> a
+ Data.Coerce: class Coercible (a :: k) (b :: k)
+ Data.Coerce: coerce :: Coercible k a b => a -> b
+ Data.Complex: instance Typeable Complex
+ Data.Data: instance (Coercible a b, Data a, Data b) => Data (Coercion a b)
+ Data.Data: instance (Data a, Typeable a) => Data (ForeignPtr a)
+ Data.Data: instance (Data a, Typeable a) => Data (Ptr a)
+ Data.Data: instance (Typeable a, Data a, Data b, Ix a) => Data (Array a b)
+ Data.Data: instance (a ~ b, Data a) => Data (a :~: b)
+ Data.Data: instance Data Version
+ Data.Data: instance Data t => Data (Proxy t)
+ Data.Either: instance Typeable Either
+ Data.Either: isLeft :: Either a b -> Bool
+ Data.Either: isRight :: Either a b -> Bool
+ Data.Fixed: MkFixed :: Integer -> Fixed a
+ Data.Fixed: instance Typeable Fixed
+ Data.Fixed: newtype Fixed a
+ Data.Foldable: instance Foldable ((,) a)
+ Data.Foldable: instance Foldable (Const m)
+ Data.Foldable: instance Foldable (Either a)
+ Data.Foldable: instance Foldable Proxy
+ Data.Functor: ($>) :: Functor f => f a -> b -> f b
+ Data.Functor: void :: Functor f => f a -> f ()
+ Data.Monoid: instance Constructor C1_0All
+ Data.Monoid: instance Constructor C1_0Any
+ Data.Monoid: instance Constructor C1_0Dual
+ Data.Monoid: instance Constructor C1_0Endo
+ Data.Monoid: instance Constructor C1_0First
+ Data.Monoid: instance Constructor C1_0Last
+ Data.Monoid: instance Constructor C1_0Product
+ Data.Monoid: instance Constructor C1_0Sum
+ Data.Monoid: instance Datatype D1All
+ Data.Monoid: instance Datatype D1Any
+ Data.Monoid: instance Datatype D1Dual
+ Data.Monoid: instance Datatype D1Endo
+ Data.Monoid: instance Datatype D1First
+ Data.Monoid: instance Datatype D1Last
+ Data.Monoid: instance Datatype D1Product
+ Data.Monoid: instance Datatype D1Sum
+ Data.Monoid: instance Generic (Dual a)
+ Data.Monoid: instance Generic (Endo a)
+ Data.Monoid: instance Generic (First a)
+ Data.Monoid: instance Generic (Last a)
+ Data.Monoid: instance Generic (Product a)
+ Data.Monoid: instance Generic (Sum a)
+ Data.Monoid: instance Generic All
+ Data.Monoid: instance Generic Any
+ Data.Monoid: instance Generic1 Dual
+ Data.Monoid: instance Generic1 First
+ Data.Monoid: instance Generic1 Last
+ Data.Monoid: instance Generic1 Product
+ Data.Monoid: instance Generic1 Sum
+ Data.Monoid: instance Monoid (Proxy s)
+ Data.Monoid: instance Num a => Num (Product a)
+ Data.Monoid: instance Num a => Num (Sum a)
+ Data.Monoid: instance Selector S1_0_0All
+ Data.Monoid: instance Selector S1_0_0Any
+ Data.Monoid: instance Selector S1_0_0Dual
+ Data.Monoid: instance Selector S1_0_0Endo
+ Data.Monoid: instance Selector S1_0_0First
+ Data.Monoid: instance Selector S1_0_0Last
+ Data.Monoid: instance Selector S1_0_0Product
+ Data.Monoid: instance Selector S1_0_0Sum
+ Data.Monoid: instance Typeable Monoid
+ Data.OldTypeable: cast :: (Typeable a, Typeable b) => a -> Maybe b
+ Data.OldTypeable: class Typeable a
+ Data.OldTypeable: class Typeable1 t
+ Data.OldTypeable: class Typeable2 t
+ Data.OldTypeable: class Typeable3 t
+ Data.OldTypeable: class Typeable4 t
+ Data.OldTypeable: class Typeable5 t
+ Data.OldTypeable: class Typeable6 t
+ Data.OldTypeable: class Typeable7 t
+ Data.OldTypeable: data TyCon
+ Data.OldTypeable: data TypeRep
+ Data.OldTypeable: data TypeRepKey
+ Data.OldTypeable: funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
+ Data.OldTypeable: gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)
+ Data.OldTypeable: gcast1 :: (Typeable1 t, Typeable1 t') => c (t a) -> Maybe (c (t' a))
+ Data.OldTypeable: gcast2 :: (Typeable2 t, Typeable2 t') => c (t a b) -> Maybe (c (t' a b))
+ Data.OldTypeable: instance [overlap ok] Eq TypeRepKey
+ Data.OldTypeable: instance [overlap ok] Ord TypeRepKey
+ Data.OldTypeable: mkAppTy :: TypeRep -> TypeRep -> TypeRep
+ Data.OldTypeable: mkFunTy :: TypeRep -> TypeRep -> TypeRep
+ Data.OldTypeable: mkTyCon :: String -> TyCon
+ Data.OldTypeable: mkTyCon3 :: String -> String -> String -> TyCon
+ Data.OldTypeable: mkTyConApp :: TyCon -> [TypeRep] -> TypeRep
+ Data.OldTypeable: showsTypeRep :: TypeRep -> ShowS
+ Data.OldTypeable: splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
+ Data.OldTypeable: tyConModule :: TyCon -> String
+ Data.OldTypeable: tyConName :: TyCon -> String
+ Data.OldTypeable: tyConPackage :: TyCon -> String
+ Data.OldTypeable: tyConString :: TyCon -> String
+ Data.OldTypeable: typeOf :: Typeable a => a -> TypeRep
+ Data.OldTypeable: typeOf1 :: Typeable1 t => t a -> TypeRep
+ Data.OldTypeable: typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep
+ Data.OldTypeable: typeOf2 :: Typeable2 t => t a b -> TypeRep
+ Data.OldTypeable: typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep
+ Data.OldTypeable: typeOf3 :: Typeable3 t => t a b c -> TypeRep
+ Data.OldTypeable: typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep
+ Data.OldTypeable: typeOf4 :: Typeable4 t => t a b c d -> TypeRep
+ Data.OldTypeable: typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep
+ Data.OldTypeable: typeOf5 :: Typeable5 t => t a b c d e -> TypeRep
+ Data.OldTypeable: typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep
+ Data.OldTypeable: typeOf6 :: Typeable6 t => t a b c d e f -> TypeRep
+ Data.OldTypeable: typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep
+ Data.OldTypeable: typeOf7 :: Typeable7 t => t a b c d e f g -> TypeRep
+ Data.OldTypeable: typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep
+ Data.OldTypeable: typeRepArgs :: TypeRep -> [TypeRep]
+ Data.OldTypeable: typeRepKey :: TypeRep -> IO TypeRepKey
+ Data.OldTypeable: typeRepTyCon :: TypeRep -> TyCon
+ Data.OldTypeable.Internal: TyCon :: {-# UNPACK #-} !Fingerprint -> String -> String -> String -> TyCon
+ Data.OldTypeable.Internal: TypeRep :: {-# UNPACK #-} !Fingerprint -> TyCon -> [TypeRep] -> TypeRep
+ Data.OldTypeable.Internal: class Typeable a
+ Data.OldTypeable.Internal: class Typeable1 t
+ Data.OldTypeable.Internal: class Typeable2 t
+ Data.OldTypeable.Internal: class Typeable3 t
+ Data.OldTypeable.Internal: class Typeable4 t
+ Data.OldTypeable.Internal: class Typeable5 t
+ Data.OldTypeable.Internal: class Typeable6 t
+ Data.OldTypeable.Internal: class Typeable7 t
+ Data.OldTypeable.Internal: data TyCon
+ Data.OldTypeable.Internal: data TypeRep
+ Data.OldTypeable.Internal: funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
+ Data.OldTypeable.Internal: funTc :: TyCon
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable1 s, Typeable a) => Typeable (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable2 s, Typeable a) => Typeable1 (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable3 s, Typeable a) => Typeable2 (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable4 s, Typeable a) => Typeable3 (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable5 s, Typeable a) => Typeable4 (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable6 s, Typeable a) => Typeable5 (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] (Typeable7 s, Typeable a) => Typeable6 (s a)
+ Data.OldTypeable.Internal: instance [overlap ok] Eq TyCon
+ Data.OldTypeable.Internal: instance [overlap ok] Eq TypeRep
+ Data.OldTypeable.Internal: instance [overlap ok] Ord TyCon
+ Data.OldTypeable.Internal: instance [overlap ok] Ord TypeRep
+ Data.OldTypeable.Internal: instance [overlap ok] Show TyCon
+ Data.OldTypeable.Internal: instance [overlap ok] Show TypeRep
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable ()
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Bool
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Char
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Double
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Float
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Int
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Int16
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Int32
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Int64
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Int8
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Integer
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Ordering
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable RealWorld
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable TyCon
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable TypeRep
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Word
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Word16
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Word32
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Word64
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable Word8
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 FunPtr
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 IO
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 IORef
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 MVar
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 Maybe
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 Ptr
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 Ratio
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 StablePtr
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable1 []
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable2 (,)
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable2 (->)
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable2 Array
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable2 IOArray
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable2 ST
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable2 STRef
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable3 (,,)
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable3 STArray
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable4 (,,,)
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable5 (,,,,)
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable6 (,,,,,)
+ Data.OldTypeable.Internal: instance [overlap ok] Typeable7 (,,,,,,)
+ Data.OldTypeable.Internal: listTc :: TyCon
+ Data.OldTypeable.Internal: mkAppTy :: TypeRep -> TypeRep -> TypeRep
+ Data.OldTypeable.Internal: mkFunTy :: TypeRep -> TypeRep -> TypeRep
+ Data.OldTypeable.Internal: mkTyCon :: Word# -> Word# -> String -> String -> String -> TyCon
+ Data.OldTypeable.Internal: mkTyCon3 :: String -> String -> String -> TyCon
+ Data.OldTypeable.Internal: mkTyConApp :: TyCon -> [TypeRep] -> TypeRep
+ Data.OldTypeable.Internal: showsTypeRep :: TypeRep -> ShowS
+ Data.OldTypeable.Internal: splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
+ Data.OldTypeable.Internal: tyConHash :: TyCon -> {-# UNPACK #-} !Fingerprint
+ Data.OldTypeable.Internal: tyConModule :: TyCon -> String
+ Data.OldTypeable.Internal: tyConName :: TyCon -> String
+ Data.OldTypeable.Internal: tyConPackage :: TyCon -> String
+ Data.OldTypeable.Internal: tyConString :: TyCon -> String
+ Data.OldTypeable.Internal: typeOf :: Typeable a => a -> TypeRep
+ Data.OldTypeable.Internal: typeOf1 :: Typeable1 t => t a -> TypeRep
+ Data.OldTypeable.Internal: typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep
+ Data.OldTypeable.Internal: typeOf2 :: Typeable2 t => t a b -> TypeRep
+ Data.OldTypeable.Internal: typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep
+ Data.OldTypeable.Internal: typeOf3 :: Typeable3 t => t a b c -> TypeRep
+ Data.OldTypeable.Internal: typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep
+ Data.OldTypeable.Internal: typeOf4 :: Typeable4 t => t a b c d -> TypeRep
+ Data.OldTypeable.Internal: typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep
+ Data.OldTypeable.Internal: typeOf5 :: Typeable5 t => t a b c d e -> TypeRep
+ Data.OldTypeable.Internal: typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep
+ Data.OldTypeable.Internal: typeOf6 :: Typeable6 t => t a b c d e f -> TypeRep
+ Data.OldTypeable.Internal: typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep
+ Data.OldTypeable.Internal: typeOf7 :: Typeable7 t => t a b c d e f g -> TypeRep
+ Data.OldTypeable.Internal: typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep
+ Data.OldTypeable.Internal: typeRepArgs :: TypeRep -> [TypeRep]
+ Data.OldTypeable.Internal: typeRepTyCon :: TypeRep -> TyCon
+ Data.Ord: instance Read a => Read (Down a)
+ Data.Ord: instance Show a => Show (Down a)
+ Data.Proxy: KProxy :: KProxy
+ Data.Proxy: Proxy :: Proxy t
+ Data.Proxy: asProxyTypeOf :: a -> Proxy a -> a
+ Data.Proxy: data KProxy (t :: *)
+ Data.Proxy: data Proxy t
+ Data.Proxy: instance Bounded (Proxy s)
+ Data.Proxy: instance Enum (Proxy s)
+ Data.Proxy: instance Eq (Proxy s)
+ Data.Proxy: instance Functor Proxy
+ Data.Proxy: instance Ix (Proxy s)
+ Data.Proxy: instance Monad Proxy
+ Data.Proxy: instance Ord (Proxy s)
+ Data.Proxy: instance Read (Proxy s)
+ Data.Proxy: instance Show (Proxy s)
+ Data.Traversable: instance Traversable ((,) a)
+ Data.Traversable: instance Traversable (Const m)
+ Data.Traversable: instance Traversable (Either a)
+ Data.Traversable: instance Traversable Proxy
+ Data.Type.Coercion: Coercion :: Coercion a b
+ Data.Type.Coercion: class TestCoercion f
+ Data.Type.Coercion: coerceWith :: Coercion a b -> a -> b
+ Data.Type.Coercion: data Coercion a b
+ Data.Type.Coercion: instance Coercible a b => Bounded (Coercion a b)
+ Data.Type.Coercion: instance Coercible a b => Enum (Coercion a b)
+ Data.Type.Coercion: instance Coercible a b => Read (Coercion a b)
+ Data.Type.Coercion: instance Eq (Coercion a b)
+ Data.Type.Coercion: instance Ord (Coercion a b)
+ Data.Type.Coercion: instance Show (Coercion a b)
+ Data.Type.Coercion: instance TestCoercion ((:~:) a)
+ Data.Type.Coercion: instance TestCoercion (Coercion a)
+ Data.Type.Coercion: repr :: (a :~: b) -> Coercion a b
+ Data.Type.Coercion: sym :: Coercion a b -> Coercion b a
+ Data.Type.Coercion: testCoercion :: TestCoercion f => f a -> f b -> Maybe (Coercion a b)
+ Data.Type.Coercion: trans :: Coercion a b -> Coercion b c -> Coercion a c
+ Data.Type.Equality: Refl :: a :~: a
+ Data.Type.Equality: apply :: (f :~: g) -> (a :~: b) -> (f a :~: g b)
+ Data.Type.Equality: castWith :: (a :~: b) -> a -> b
+ Data.Type.Equality: class TestEquality f
+ Data.Type.Equality: data (:~:) a b
+ Data.Type.Equality: gcastWith :: (a :~: b) -> (a ~ b => r) -> r
+ Data.Type.Equality: inner :: (f a :~: g b) -> (a :~: b)
+ Data.Type.Equality: instance Eq (a :~: b)
+ Data.Type.Equality: instance Ord (a :~: b)
+ Data.Type.Equality: instance Show (a :~: b)
+ Data.Type.Equality: instance TestEquality ((:~:) a)
+ Data.Type.Equality: instance a ~ b => Bounded (a :~: b)
+ Data.Type.Equality: instance a ~ b => Enum (a :~: b)
+ Data.Type.Equality: instance a ~ b => Read (a :~: b)
+ Data.Type.Equality: outer :: (f a :~: g b) -> (f :~: g)
+ Data.Type.Equality: sym :: (a :~: b) -> (b :~: a)
+ Data.Type.Equality: testEquality :: TestEquality f => f a -> f b -> Maybe (a :~: b)
+ Data.Type.Equality: trans :: (a :~: b) -> (b :~: c) -> (a :~: c)
+ Data.Typeable: Proxy :: Proxy t
+ Data.Typeable: Refl :: a :~: a
+ Data.Typeable: data (:~:) a b
+ Data.Typeable: data Proxy t
+ Data.Typeable: eqT :: (Typeable a, Typeable b) => Maybe (a :~: b)
+ Data.Typeable: type Typeable1 (a :: * -> *) = Typeable a
+ Data.Typeable: type Typeable2 (a :: * -> * -> *) = Typeable a
+ Data.Typeable: type Typeable3 (a :: * -> * -> * -> *) = Typeable a
+ Data.Typeable: type Typeable4 (a :: * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable: type Typeable5 (a :: * -> * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable: type Typeable6 (a :: * -> * -> * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable: type Typeable7 (a :: * -> * -> * -> * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable: typeRep :: Typeable a => proxy a -> TypeRep
+ Data.Typeable.Internal: Proxy :: Proxy t
+ Data.Typeable.Internal: data Proxy t
+ Data.Typeable.Internal: instance [overlap ok] (Typeable s, Typeable a) => Typeable (s a)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (,)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (,,)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (,,,)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (,,,,)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (,,,,,)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (,,,,,,)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (->)
+ Data.Typeable.Internal: instance [overlap ok] Typeable (:~:)
+ Data.Typeable.Internal: instance [overlap ok] Typeable Array
+ Data.Typeable.Internal: instance [overlap ok] Typeable Coercion
+ Data.Typeable.Internal: instance [overlap ok] Typeable FunPtr
+ Data.Typeable.Internal: instance [overlap ok] Typeable IO
+ Data.Typeable.Internal: instance [overlap ok] Typeable Maybe
+ Data.Typeable.Internal: instance [overlap ok] Typeable Proxy
+ Data.Typeable.Internal: instance [overlap ok] Typeable Ptr
+ Data.Typeable.Internal: instance [overlap ok] Typeable Ratio
+ Data.Typeable.Internal: instance [overlap ok] Typeable ST
+ Data.Typeable.Internal: instance [overlap ok] Typeable STArray
+ Data.Typeable.Internal: instance [overlap ok] Typeable STRef
+ Data.Typeable.Internal: instance [overlap ok] Typeable []
+ Data.Typeable.Internal: type Typeable1 (a :: * -> *) = Typeable a
+ Data.Typeable.Internal: type Typeable2 (a :: * -> * -> *) = Typeable a
+ Data.Typeable.Internal: type Typeable3 (a :: * -> * -> * -> *) = Typeable a
+ Data.Typeable.Internal: type Typeable4 (a :: * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable.Internal: type Typeable5 (a :: * -> * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable.Internal: type Typeable6 (a :: * -> * -> * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable.Internal: type Typeable7 (a :: * -> * -> * -> * -> * -> * -> * -> *) = Typeable a
+ Data.Typeable.Internal: typeRep :: Typeable a => proxy a -> TypeRep
+ Data.Typeable.Internal: typeRep# :: Typeable a => Proxy# a -> TypeRep
+ Data.Word: byteSwap16 :: Word16 -> Word16
+ Data.Word: byteSwap32 :: Word32 -> Word32
+ Data.Word: byteSwap64 :: Word64 -> Word64
+ Debug.Trace: traceId :: String -> String
+ Debug.Trace: traceM :: Monad m => String -> m ()
+ Debug.Trace: traceMarker :: String -> a -> a
+ Debug.Trace: traceMarkerIO :: String -> IO ()
+ Debug.Trace: traceShowId :: Show a => a -> a
+ Debug.Trace: traceShowM :: (Show a, Monad m) => a -> m ()
+ Foreign.C.Error: eNOTSUP :: Errno
+ Foreign.C.Types: instance FiniteBits CChar
+ Foreign.C.Types: instance FiniteBits CInt
+ Foreign.C.Types: instance FiniteBits CIntMax
+ Foreign.C.Types: instance FiniteBits CIntPtr
+ Foreign.C.Types: instance FiniteBits CLLong
+ Foreign.C.Types: instance FiniteBits CLong
+ Foreign.C.Types: instance FiniteBits CPtrdiff
+ Foreign.C.Types: instance FiniteBits CSChar
+ Foreign.C.Types: instance FiniteBits CShort
+ Foreign.C.Types: instance FiniteBits CSigAtomic
+ Foreign.C.Types: instance FiniteBits CSize
+ Foreign.C.Types: instance FiniteBits CUChar
+ Foreign.C.Types: instance FiniteBits CUInt
+ Foreign.C.Types: instance FiniteBits CUIntMax
+ Foreign.C.Types: instance FiniteBits CUIntPtr
+ Foreign.C.Types: instance FiniteBits CULLong
+ Foreign.C.Types: instance FiniteBits CULong
+ Foreign.C.Types: instance FiniteBits CUShort
+ Foreign.C.Types: instance FiniteBits CWchar
+ Foreign.Ptr: instance FiniteBits IntPtr
+ Foreign.Ptr: instance FiniteBits WordPtr
+ GHC.Conc: ioManagerCapabilitiesChanged :: IO ()
+ GHC.Conc: threadWaitReadSTM :: Fd -> IO (STM (), IO ())
+ GHC.Conc: threadWaitWriteSTM :: Fd -> IO (STM (), IO ())
+ GHC.Conc.IO: ioManagerCapabilitiesChanged :: IO ()
+ GHC.Conc.IO: threadWaitReadSTM :: Fd -> IO (STM (), IO ())
+ GHC.Conc.IO: threadWaitWriteSTM :: Fd -> IO (STM (), IO ())
+ GHC.Conc.Sync: instance Typeable STM
+ GHC.Conc.Sync: instance Typeable TVar
+ GHC.Event: getSystemTimerManager :: IO TimerManager
+ GHC.Exts: class Coercible (a :: k) (b :: k)
+ GHC.Exts: class IsList l where type family Item l fromListN _ = fromList
+ GHC.Exts: coerce :: Coercible k a b => a -> b
+ GHC.Exts: fromList :: IsList l => [Item l] -> l
+ GHC.Exts: fromListN :: IsList l => Int -> [Item l] -> l
+ GHC.Exts: instance IsList [a]
+ GHC.Exts: isTrue# :: Int# -> Bool
+ GHC.Exts: toList :: IsList l => l -> [Item l]
+ GHC.Fingerprint: getFileHash :: FilePath -> IO Fingerprint
+ GHC.Fingerprint.Type: instance Show Fingerprint
+ GHC.Generics: instance (Eq (f p), Eq (g p)) => Eq ((:*:) f g p)
+ GHC.Generics: instance (Eq (f p), Eq (g p)) => Eq ((:+:) f g p)
+ GHC.Generics: instance (Ord (f p), Ord (g p)) => Ord ((:*:) f g p)
+ GHC.Generics: instance (Ord (f p), Ord (g p)) => Ord ((:+:) f g p)
+ GHC.Generics: instance (Read (f p), Read (g p)) => Read ((:*:) f g p)
+ GHC.Generics: instance (Read (f p), Read (g p)) => Read ((:+:) f g p)
+ GHC.Generics: instance (Show (f p), Show (g p)) => Show ((:*:) f g p)
+ GHC.Generics: instance (Show (f p), Show (g p)) => Show ((:+:) f g p)
+ GHC.Generics: instance Constructor C1_0:*:
+ GHC.Generics: instance Constructor C1_0:+:
+ GHC.Generics: instance Constructor C1_0:.:
+ GHC.Generics: instance Constructor C1_0Arity
+ GHC.Generics: instance Constructor C1_0Associativity
+ GHC.Generics: instance Constructor C1_0Fixity
+ GHC.Generics: instance Constructor C1_0K1
+ GHC.Generics: instance Constructor C1_0M1
+ GHC.Generics: instance Constructor C1_0Par1
+ GHC.Generics: instance Constructor C1_0Proxy
+ GHC.Generics: instance Constructor C1_0Rec1
+ GHC.Generics: instance Constructor C1_0U1
+ GHC.Generics: instance Constructor C1_1:+:
+ GHC.Generics: instance Constructor C1_1Arity
+ GHC.Generics: instance Constructor C1_1Associativity
+ GHC.Generics: instance Constructor C1_1Fixity
+ GHC.Generics: instance Constructor C1_2Associativity
+ GHC.Generics: instance Datatype D1:*:
+ GHC.Generics: instance Datatype D1:+:
+ GHC.Generics: instance Datatype D1:.:
+ GHC.Generics: instance Datatype D1Arity
+ GHC.Generics: instance Datatype D1Associativity
+ GHC.Generics: instance Datatype D1Fixity
+ GHC.Generics: instance Datatype D1K1
+ GHC.Generics: instance Datatype D1M1
+ GHC.Generics: instance Datatype D1Par1
+ GHC.Generics: instance Datatype D1Proxy
+ GHC.Generics: instance Datatype D1Rec1
+ GHC.Generics: instance Datatype D1U1
+ GHC.Generics: instance Eq (U1 p)
+ GHC.Generics: instance Eq (f (g p)) => Eq ((:.:) f g p)
+ GHC.Generics: instance Eq (f p) => Eq (M1 i c f p)
+ GHC.Generics: instance Eq (f p) => Eq (Rec1 f p)
+ GHC.Generics: instance Eq c => Eq (K1 i c p)
+ GHC.Generics: instance Eq p => Eq (Par1 p)
+ GHC.Generics: instance Generic ((:*:) f g p)
+ GHC.Generics: instance Generic ((:+:) f g p)
+ GHC.Generics: instance Generic ((:.:) f g p)
+ GHC.Generics: instance Generic (K1 i c p)
+ GHC.Generics: instance Generic (M1 i c f p)
+ GHC.Generics: instance Generic (Par1 p)
+ GHC.Generics: instance Generic (Proxy t)
+ GHC.Generics: instance Generic (Rec1 f p)
+ GHC.Generics: instance Generic (U1 p)
+ GHC.Generics: instance Generic Arity
+ GHC.Generics: instance Generic Associativity
+ GHC.Generics: instance Generic Fixity
+ GHC.Generics: instance Ord (U1 p)
+ GHC.Generics: instance Ord (f (g p)) => Ord ((:.:) f g p)
+ GHC.Generics: instance Ord (f p) => Ord (M1 i c f p)
+ GHC.Generics: instance Ord (f p) => Ord (Rec1 f p)
+ GHC.Generics: instance Ord c => Ord (K1 i c p)
+ GHC.Generics: instance Ord p => Ord (Par1 p)
+ GHC.Generics: instance Read (U1 p)
+ GHC.Generics: instance Read (f (g p)) => Read ((:.:) f g p)
+ GHC.Generics: instance Read (f p) => Read (M1 i c f p)
+ GHC.Generics: instance Read (f p) => Read (Rec1 f p)
+ GHC.Generics: instance Read c => Read (K1 i c p)
+ GHC.Generics: instance Read p => Read (Par1 p)
+ GHC.Generics: instance Selector S1_0_0:.:
+ GHC.Generics: instance Selector S1_0_0K1
+ GHC.Generics: instance Selector S1_0_0M1
+ GHC.Generics: instance Selector S1_0_0Par1
+ GHC.Generics: instance Selector S1_0_0Rec1
+ GHC.Generics: instance Show (U1 p)
+ GHC.Generics: instance Show (f (g p)) => Show ((:.:) f g p)
+ GHC.Generics: instance Show (f p) => Show (M1 i c f p)
+ GHC.Generics: instance Show (f p) => Show (Rec1 f p)
+ GHC.Generics: instance Show c => Show (K1 i c p)
+ GHC.Generics: instance Show p => Show (Par1 p)
+ GHC.Generics: isNewtype :: Datatype d => t d (f :: * -> *) a -> Bool
+ GHC.IO.Encoding.Types: type CodeBuffer from to = Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)
+ GHC.Profiling: startProfTimer :: IO ()
+ GHC.Profiling: stopProfTimer :: IO ()
+ GHC.Stack: errorWithStackTrace :: String -> a
+ GHC.TypeLits: SomeNat :: (Proxy n) -> SomeNat
+ GHC.TypeLits: SomeSymbol :: (Proxy n) -> SomeSymbol
+ GHC.TypeLits: class KnownNat (n :: Nat)
+ GHC.TypeLits: class KnownSymbol (n :: Symbol)
+ GHC.TypeLits: data SomeNat
+ GHC.TypeLits: data SomeSymbol
+ GHC.TypeLits: instance Eq SomeNat
+ GHC.TypeLits: instance Eq SomeSymbol
+ GHC.TypeLits: instance Ord SomeNat
+ GHC.TypeLits: instance Ord SomeSymbol
+ GHC.TypeLits: instance Read SomeNat
+ GHC.TypeLits: instance Read SomeSymbol
+ GHC.TypeLits: instance Show SomeNat
+ GHC.TypeLits: instance Show SomeSymbol
+ GHC.TypeLits: natVal :: KnownNat n => proxy n -> Integer
+ GHC.TypeLits: sameNat :: (KnownNat a, KnownNat b) => Proxy a -> Proxy b -> Maybe (a :~: b)
+ GHC.TypeLits: sameSymbol :: (KnownSymbol a, KnownSymbol b) => Proxy a -> Proxy b -> Maybe (a :~: b)
+ GHC.TypeLits: someNatVal :: Integer -> Maybe SomeNat
+ GHC.TypeLits: someSymbolVal :: String -> SomeSymbol
+ GHC.TypeLits: symbolVal :: KnownSymbol n => proxy n -> String
+ GHC.TypeLits: type (<=) x y = (x <=? y) ~ True
+ Numeric: showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
+ Numeric: showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
+ System.Console.GetOpt: instance [safe] Functor ArgDescr
+ System.Console.GetOpt: instance [safe] Functor ArgOrder
+ System.Console.GetOpt: instance [safe] Functor OptDescr
+ System.Environment: setEnv :: String -> String -> IO ()
+ System.Environment: unsetEnv :: String -> IO ()
+ System.Mem: performMajorGC :: IO ()
+ System.Mem: performMinorGC :: IO ()
+ System.Mem.StableName: eqStableName :: StableName a -> StableName b -> Bool
+ System.Mem.StableName: instance Typeable StableName
+ System.Posix.Types: instance FiniteBits CDev
+ System.Posix.Types: instance FiniteBits CGid
+ System.Posix.Types: instance FiniteBits CIno
+ System.Posix.Types: instance FiniteBits CMode
+ System.Posix.Types: instance FiniteBits CNlink
+ System.Posix.Types: instance FiniteBits COff
+ System.Posix.Types: instance FiniteBits CPid
+ System.Posix.Types: instance FiniteBits CRLim
+ System.Posix.Types: instance FiniteBits CSsize
+ System.Posix.Types: instance FiniteBits CTcflag
+ System.Posix.Types: instance FiniteBits CUid
+ System.Posix.Types: instance FiniteBits Fd
+ Text.Printf: FieldFormat :: Maybe Int -> Maybe Int -> Maybe FormatAdjustment -> Maybe FormatSign -> Bool -> String -> Char -> FieldFormat
+ Text.Printf: FormatParse :: String -> Char -> String -> FormatParse
+ Text.Printf: LeftAdjust :: FormatAdjustment
+ Text.Printf: SignPlus :: FormatSign
+ Text.Printf: SignSpace :: FormatSign
+ Text.Printf: ZeroPad :: FormatAdjustment
+ Text.Printf: data FieldFormat
+ Text.Printf: data FormatAdjustment
+ Text.Printf: data FormatParse
+ Text.Printf: data FormatSign
+ Text.Printf: errorBadArgument :: a
+ Text.Printf: errorBadFormat :: Char -> a
+ Text.Printf: errorMissingArgument :: a
+ Text.Printf: errorShortFormat :: a
+ Text.Printf: fmtAdjust :: FieldFormat -> Maybe FormatAdjustment
+ Text.Printf: fmtAlternate :: FieldFormat -> Bool
+ Text.Printf: fmtChar :: FieldFormat -> Char
+ Text.Printf: fmtModifiers :: FieldFormat -> String
+ Text.Printf: fmtPrecision :: FieldFormat -> Maybe Int
+ Text.Printf: fmtSign :: FieldFormat -> Maybe FormatSign
+ Text.Printf: fmtWidth :: FieldFormat -> Maybe Int
+ Text.Printf: formatArg :: PrintfArg a => a -> FieldFormatter
+ Text.Printf: formatChar :: Char -> FieldFormatter
+ Text.Printf: formatInt :: (Integral a, Bounded a) => a -> FieldFormatter
+ Text.Printf: formatInteger :: Integer -> FieldFormatter
+ Text.Printf: formatRealFloat :: RealFloat a => a -> FieldFormatter
+ Text.Printf: formatString :: IsChar a => [a] -> FieldFormatter
+ Text.Printf: fpChar :: FormatParse -> Char
+ Text.Printf: fpModifiers :: FormatParse -> String
+ Text.Printf: fpRest :: FormatParse -> String
+ Text.Printf: fromChar :: IsChar c => Char -> c
+ Text.Printf: instance [safe] a ~ () => HPrintfType (IO a)
+ Text.Printf: instance [safe] a ~ () => PrintfType (IO a)
+ Text.Printf: parseFormat :: PrintfArg a => a -> ModifierParser
+ Text.Printf: perror :: String -> a
+ Text.Printf: toChar :: IsChar c => c -> Char
+ Text.Printf: type FieldFormatter = FieldFormat -> ShowS
+ Text.Printf: type ModifierParser = String -> FormatParse
+ Text.Printf: vFmt :: Char -> FieldFormat -> FieldFormat
+ Text.Read.Lex: data Number
+ Text.Read.Lex: expect :: Lexeme -> ReadP ()
+ Text.Read.Lex: numberToFixed :: Integer -> Number -> Maybe (Integer, Integer)
- Control.Applicative: class Functor f => Applicative f where *> = liftA2 (const id) <* = liftA2 const
+ Control.Applicative: class Functor f => Applicative f where (*>) = liftA2 (const id) (<*) = liftA2 const
- Control.Monad: class Functor f where <$ = fmap . const
+ Control.Monad: class Functor f where (<$) = fmap . const
- Control.Monad.Instances: class Functor f where <$ = fmap . const
+ Control.Monad.Instances: class Functor f where (<$) = fmap . const
- Data.Bits: class Eq a => Bits a where x shift i | i < 0 = x `shiftR` (- i) | i > 0 = x `shiftL` i | otherwise = x x rotate i | i < 0 = x `rotateR` (- i) | i > 0 = x `rotateL` i | otherwise = x x setBit i = x .|. bit i x clearBit i = x .&. complement (bit i) x complementBit i = x `xor` bit i x shiftL i = x `shift` i x unsafeShiftL i = x `shiftL` i x shiftR i = x `shift` (- i) x unsafeShiftR i = x `shiftR` i x rotateL i = x `rotate` i x rotateR i = x `rotate` (- i)
+ Data.Bits: class Eq a => Bits a where x `shift` i | i < 0 = x `shiftR` (- i) | i > 0 = x `shiftL` i | otherwise = x x `rotate` i | i < 0 = x `rotateR` (- i) | i > 0 = x `rotateL` i | otherwise = x zeroBits = clearBit (bit 0) 0 x `setBit` i = x .|. bit i x `clearBit` i = x .&. complement (bit i) x `complementBit` i = x `xor` bit i x `shiftL` i = x `shift` i x `unsafeShiftL` i = x `shiftL` i x `shiftR` i = x `shift` (- i) x `unsafeShiftR` i = x `shiftR` i x `rotateL` i = x `rotate` i x `rotateR` i = x `rotate` (- i)
- Data.Data: dataCast1 :: (Data a, Typeable1 t) => (forall d. Data d => c (t d)) -> Maybe (c a)
+ Data.Data: dataCast1 :: (Data a, Typeable t) => (forall d. Data d => c (t d)) -> Maybe (c a)
- Data.Data: dataCast2 :: (Data a, Typeable2 t) => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a)
+ Data.Data: dataCast2 :: (Data a, Typeable t) => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a)
- Data.Foldable: foldl :: Foldable t => (a -> b -> a) -> a -> t b -> a
+ Data.Foldable: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Data.Foldable: foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a
+ Data.Foldable: foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Data.Foldable: foldlM :: (Foldable t, Monad m) => (a -> b -> m a) -> a -> t b -> m a
+ Data.Foldable: foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- Data.Functor: class Functor f where <$ = fmap . const
+ Data.Functor: class Functor f where (<$) = fmap . const
- Data.List: foldl :: (a -> b -> a) -> a -> [b] -> a
+ Data.List: foldl :: (b -> a -> b) -> b -> [a] -> b
- Data.List: foldl' :: (a -> b -> a) -> a -> [b] -> a
+ Data.List: foldl' :: (b -> a -> b) -> b -> [a] -> b
- Data.List: genericIndex :: Integral a => [b] -> a -> b
+ Data.List: genericIndex :: Integral i => [a] -> i -> a
- Data.List: genericLength :: Num i => [b] -> i
+ Data.List: genericLength :: Num i => [a] -> i
- Data.List: genericSplitAt :: Integral i => i -> [b] -> ([b], [b])
+ Data.List: genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
- Data.List: scanl :: (a -> b -> a) -> a -> [b] -> [a]
+ Data.List: scanl :: (b -> a -> b) -> b -> [a] -> [b]
- Data.Typeable: gcast1 :: (Typeable1 t, Typeable1 t') => c (t a) -> Maybe (c (t' a))
+ Data.Typeable: gcast1 :: (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a))
- Data.Typeable: gcast2 :: (Typeable2 t, Typeable2 t') => c (t a b) -> Maybe (c (t' a b))
+ Data.Typeable: gcast2 :: (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b))
- Data.Typeable: typeOf1 :: Typeable1 t => t a -> TypeRep
+ Data.Typeable: typeOf1 :: Typeable t => t a -> TypeRep
- Data.Typeable: typeOf2 :: Typeable2 t => t a b -> TypeRep
+ Data.Typeable: typeOf2 :: Typeable t => t a b -> TypeRep
- Data.Typeable: typeOf3 :: Typeable3 t => t a b c -> TypeRep
+ Data.Typeable: typeOf3 :: Typeable t => t a b c -> TypeRep
- Data.Typeable: typeOf4 :: Typeable4 t => t a b c d -> TypeRep
+ Data.Typeable: typeOf4 :: Typeable t => t a b c d -> TypeRep
- Data.Typeable: typeOf5 :: Typeable5 t => t a b c d e -> TypeRep
+ Data.Typeable: typeOf5 :: Typeable t => t a b c d e -> TypeRep
- Data.Typeable: typeOf6 :: Typeable6 t => t a b c d e f -> TypeRep
+ Data.Typeable: typeOf6 :: Typeable t => t a b c d e f -> TypeRep
- Data.Typeable: typeOf7 :: Typeable7 t => t a b c d e f g -> TypeRep
+ Data.Typeable: typeOf7 :: Typeable t => t a b c d e f g -> TypeRep
- Data.Typeable.Internal: typeOf1 :: Typeable1 t => t a -> TypeRep
+ Data.Typeable.Internal: typeOf1 :: Typeable t => t a -> TypeRep
- Data.Typeable.Internal: typeOf2 :: Typeable2 t => t a b -> TypeRep
+ Data.Typeable.Internal: typeOf2 :: Typeable t => t a b -> TypeRep
- Data.Typeable.Internal: typeOf3 :: Typeable3 t => t a b c -> TypeRep
+ Data.Typeable.Internal: typeOf3 :: Typeable t => t a b c -> TypeRep
- Data.Typeable.Internal: typeOf4 :: Typeable4 t => t a b c d -> TypeRep
+ Data.Typeable.Internal: typeOf4 :: Typeable t => t a b c d -> TypeRep
- Data.Typeable.Internal: typeOf5 :: Typeable5 t => t a b c d e -> TypeRep
+ Data.Typeable.Internal: typeOf5 :: Typeable t => t a b c d e -> TypeRep
- Data.Typeable.Internal: typeOf6 :: Typeable6 t => t a b c d e f -> TypeRep
+ Data.Typeable.Internal: typeOf6 :: Typeable t => t a b c d e f -> TypeRep
- Data.Typeable.Internal: typeOf7 :: Typeable7 t => t a b c d e f g -> TypeRep
+ Data.Typeable.Internal: typeOf7 :: Typeable t => t a b c d e f g -> TypeRep
- GHC.Event: new :: IO EventManager
+ GHC.Event: new :: Bool -> IO EventManager
- GHC.Event: registerTimeout :: EventManager -> Int -> TimeoutCallback -> IO TimeoutKey
+ GHC.Event: registerTimeout :: TimerManager -> Int -> TimeoutCallback -> IO TimeoutKey
- GHC.Event: unregisterTimeout :: EventManager -> TimeoutKey -> IO ()
+ GHC.Event: unregisterTimeout :: TimerManager -> TimeoutKey -> IO ()
- GHC.Event: updateTimeout :: EventManager -> TimeoutKey -> Int -> IO ()
+ GHC.Event: updateTimeout :: TimerManager -> TimeoutKey -> Int -> IO ()
- GHC.Generics: (:*:) :: f p -> g p -> :*: f g p
+ GHC.Generics: (:*:) :: f p -> g p -> (:*:) f g p
- GHC.Generics: Comp1 :: f (g p) -> :.: f g p
+ GHC.Generics: Comp1 :: f (g p) -> (:.:) f g p
- GHC.Generics: L1 :: (f p) -> :+: f g p
+ GHC.Generics: L1 :: (f p) -> (:+:) f g p
- GHC.Generics: R1 :: (g p) -> :+: f g p
+ GHC.Generics: R1 :: (g p) -> (:+:) f g p
- GHC.Generics: class Datatype d
+ GHC.Generics: class Datatype d where isNewtype _ = False
- GHC.Generics: unComp1 :: :.: f g p -> f (g p)
+ GHC.Generics: unComp1 :: (:.:) f g p -> f (g p)
- GHC.IO.Encoding: BufferCodec :: (Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)) -> (Buffer from -> Buffer to -> IO (Buffer from, Buffer to)) -> IO () -> IO state -> (state -> IO ()) -> BufferCodec from to state
+ GHC.IO.Encoding: BufferCodec :: CodeBuffer from to -> (Buffer from -> Buffer to -> IO (Buffer from, Buffer to)) -> IO () -> IO state -> (state -> IO ()) -> BufferCodec from to state
- GHC.IO.Encoding: encode :: BufferCodec from to state -> Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)
+ GHC.IO.Encoding: encode :: BufferCodec from to state -> CodeBuffer from to
- GHC.IO.Encoding.Types: BufferCodec :: (Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)) -> (Buffer from -> Buffer to -> IO (Buffer from, Buffer to)) -> IO () -> IO state -> (state -> IO ()) -> BufferCodec from to state
+ GHC.IO.Encoding.Types: BufferCodec :: CodeBuffer from to -> (Buffer from -> Buffer to -> IO (Buffer from, Buffer to)) -> IO () -> IO state -> (state -> IO ()) -> BufferCodec from to state
- GHC.IO.Encoding.Types: encode :: BufferCodec from to state -> Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)
+ GHC.IO.Encoding.Types: encode :: BufferCodec from to state -> CodeBuffer from to
- GHC.IO.Encoding.Types: type DecodeBuffer = Buffer Word8 -> Buffer Char -> IO (CodingProgress, Buffer Word8, Buffer Char)
+ GHC.IO.Encoding.Types: type DecodeBuffer = CodeBuffer Word8 Char
- GHC.IO.Encoding.Types: type EncodeBuffer = Buffer Char -> Buffer Word8 -> IO (CodingProgress, Buffer Char, Buffer Word8)
+ GHC.IO.Encoding.Types: type EncodeBuffer = CodeBuffer Char Word8
- Prelude: class Functor f where <$ = fmap . const
+ Prelude: class Functor f where (<$) = fmap . const
- Prelude: class (Real a, Enum a) => Integral a where n quot d = q where (q, _) = quotRem n d n rem d = r where (_, r) = quotRem n d n div d = q where (q, _) = divMod n d n mod d = r where (_, r) = divMod n d divMod n d = if signum r == negate (signum d) then (q - 1, r + d) else qr where qr@(q, r) = quotRem n d
+ Prelude: class (Real a, Enum a) => Integral a where n `quot` d = q where (q, _) = quotRem n d n `rem` d = r where (_, r) = quotRem n d n `div` d = q where (q, _) = divMod n d n `mod` d = r where (_, r) = divMod n d divMod n d = if signum r == negate (signum d) then (q - 1, r + d) else qr where qr@(q, r) = quotRem n d
- Prelude: foldl :: (a -> b -> a) -> a -> [b] -> a
+ Prelude: foldl :: (b -> a -> b) -> b -> [a] -> b
- Prelude: scanl :: (a -> b -> a) -> a -> [b] -> [a]
+ Prelude: scanl :: (b -> a -> b) -> b -> [a] -> [b]
- Text.Printf: class PrintfArg a
+ Text.Printf: class PrintfArg a where parseFormat _ (c : cs) = FormatParse "" c cs parseFormat _ "" = errorShortFormat

Files

Control/Applicative.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}+{-# LANGUAGE AutoDeriveTypeable #-}+{-# LANGUAGE DeriveGeneric #-}  ----------------------------------------------------------------------------- -- |@@ -28,9 +29,9 @@ -- it admits more sharing than the monadic interface.  The names here are -- mostly based on parsing work by Doaitse Swierstra. ----- For more details, see /Applicative Programming with Effects/,--- by Conor McBride and Ross Paterson, online at--- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.+-- For more details, see+-- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html Applicative Programming with Effects>,+-- by Conor McBride and Ross Paterson.  module Control.Applicative (     -- * Applicative functors@@ -50,26 +51,17 @@ import Control.Category import Control.Arrow import Control.Monad (liftM, ap, MonadPlus(..))-#ifndef __NHC__ import Control.Monad.ST.Safe (ST) import qualified Control.Monad.ST.Lazy.Safe as Lazy (ST)-#endif import Data.Functor ((<$>), (<$)) import Data.Monoid (Monoid(..))--import Text.ParserCombinators.ReadP-#ifndef __NHC__-  (ReadP)-#else-  (ReadPN)-#define ReadP (ReadPN b)-#endif+import Data.Proxy +import Text.ParserCombinators.ReadP (ReadP) import Text.ParserCombinators.ReadPrec (ReadPrec) -#ifdef __GLASGOW_HASKELL__ import GHC.Conc (STM, retry, orElse)-#endif+import GHC.Generics  infixl 3 <|> infixl 4 <*>, <*, *>, <**>@@ -84,34 +76,39 @@ -- functions satisfying the following laws: -- -- [/identity/]+-- --      @'pure' 'id' '<*>' v = v@ -- -- [/composition/]+-- --      @'pure' (.) '<*>' u '<*>' v '<*>' w = u '<*>' (v '<*>' w)@ -- -- [/homomorphism/]+-- --      @'pure' f '<*>' 'pure' x = 'pure' (f x)@ -- -- [/interchange/]+-- --      @u '<*>' 'pure' y = 'pure' ('$' y) '<*>' u@ -- -- The other methods have the following default definitions, which may -- be overridden with equivalent specialized implementations: ----- @---      u '*>' v = 'pure' ('const' 'id') '<*>' u '<*>' v---      u '<*' v = 'pure' 'const' '<*>' u '<*>' v--- @+--   * @u '*>' v = 'pure' ('const' 'id') '<*>' u '<*>' v@ --+--   * @u '<*' v = 'pure' 'const' '<*>' u '<*>' v@+-- -- As a consequence of these laws, the 'Functor' instance for @f@ will satisfy ----- @---      'fmap' f x = 'pure' f '<*>' x--- @+--   * @'fmap' f x = 'pure' f '<*>' x@ ----- If @f@ is also a 'Monad', it should satisfy @'pure' = 'return'@ and--- @('<*>') = 'ap'@ (which implies that 'pure' and '<*>' satisfy the--- applicative functor laws).+-- If @f@ is also a 'Monad', it should satisfy+--+--   * @'pure' = 'return'@+--+--   * @('<*>') = 'ap'@+--+-- (which implies that 'pure' and '<*>' satisfy the applicative functor laws).  class Functor f => Applicative f where     -- | Lift a value.@@ -181,7 +178,6 @@     pure = return     (<*>) = ap -#ifndef __NHC__ instance Applicative (ST s) where     pure = return     (<*>) = ap@@ -189,9 +185,7 @@ instance Applicative (Lazy.ST s) where     pure = return     (<*>) = ap-#endif -#ifdef __GLASGOW_HASKELL__ instance Applicative STM where     pure = return     (<*>) = ap@@ -199,7 +193,6 @@ instance Alternative STM where     empty = retry     (<|>) = orElse-#endif  instance Applicative ((->) a) where     pure = const@@ -241,15 +234,22 @@ -- new instances  newtype Const a b = Const { getConst :: a }+                  deriving (Generic, Generic1)  instance Functor (Const m) where     fmap _ (Const v) = Const v +-- Added in base-4.7.0.0+instance Monoid a => Monoid (Const a b) where+    mempty = Const mempty+    mappend (Const a) (Const b) = Const (mappend a b)+ instance Monoid m => Applicative (Const m) where     pure _ = Const mempty     Const f <*> Const v = Const (f `mappend` v)  newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a }+                         deriving (Generic, Generic1)  instance Monad m => Functor (WrappedMonad m) where     fmap f (WrapMonad v) = WrapMonad (liftM f v)@@ -258,11 +258,17 @@     pure = WrapMonad . return     WrapMonad f <*> WrapMonad v = WrapMonad (f `ap` v) +-- Added in base-4.7.0.0 (GHC Trac #8218)+instance Monad m => Monad (WrappedMonad m) where+    return = WrapMonad . return+    a >>= f = WrapMonad (unwrapMonad a >>= unwrapMonad . f)+ instance MonadPlus m => Alternative (WrappedMonad m) where     empty = WrapMonad mzero     WrapMonad u <|> WrapMonad v = WrapMonad (u `mplus` v)  newtype WrappedArrow a b c = WrapArrow { unwrapArrow :: a b c }+                           deriving (Generic, Generic1)  instance Arrow a => Functor (WrappedArrow a b) where     fmap f (WrapArrow a) = WrapArrow (a >>> arr f)@@ -280,6 +286,7 @@ -- @f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsn = 'ZipList' (zipWithn f xs1 ... xsn)@ -- newtype ZipList a = ZipList { getZipList :: [a] }+                  deriving (Show, Eq, Ord, Read, Generic, Generic1)  instance Functor ZipList where     fmap f (ZipList xs) = ZipList (map f xs)@@ -287,6 +294,12 @@ instance Applicative ZipList where     pure x = ZipList (repeat x)     ZipList fs <*> ZipList xs = ZipList (zipWith id fs xs)++instance Applicative Proxy where+    pure _ = Proxy+    {-# INLINE pure #-}+    _ <*> _ = Proxy+    {-# INLINE (<*>) #-}  -- extra functions 
Control/Arrow.hs view
@@ -10,11 +10,15 @@ -- Portability :  portable -- -- Basic arrow definitions, based on+-- --  * /Generalising Monads to Arrows/, by John Hughes, --    /Science of Computer Programming/ 37, pp67-111, May 2000.+-- -- plus a couple of definitions ('returnA' and 'loop') from+-- --  * /A New Notation for Arrows/, by Ross Paterson, in /ICFP 2001/, --    Firenze, Italy, pp229-240.+-- -- These papers and more information on arrows can be found at -- <http://www.haskell.org/arrows/>. @@ -186,6 +190,7 @@  -- | Choice, for arrows that support it.  This class underlies the -- @if@ and @case@ constructs in arrow notation.+-- -- Minimal complete definition: 'left', satisfying the laws -- --  * @'left' ('arr' f) = 'arr' ('left' f)@
Control/Category.hs view
@@ -1,6 +1,10 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-} +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706+{-# LANGUAGE PolyKinds, GADTs #-}+#endif+ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Category@@ -16,6 +20,9 @@ module Control.Category where  import qualified Prelude+import Data.Type.Coercion+import Data.Type.Equality+import GHC.Prim (coerce)  infixr 9 . infixr 1 >>>, <<<@@ -41,6 +48,14 @@ instance Category (->) where     id = Prelude.id     (.) = (Prelude..)++instance Category (:~:) where+  id          = Refl+  Refl . Refl = Refl++instance Category Coercion where+  id = Coercion+  (.) Coercion = coerce  -- | Right-to-left composition (<<<) :: Category cat => cat b c -> cat a b -> cat a c
Control/Concurrent.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP-           , ForeignFunctionInterface            , MagicHash            , UnboxedTuples            , ScopedTypeVariables@@ -15,7 +14,7 @@ -- Module      :  Control.Concurrent -- Copyright   :  (c) The University of Glasgow 2001 -- License     :  BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer  :  libraries@haskell.org -- Stability   :  experimental -- Portability :  non-portable (concurrency)@@ -33,17 +32,13 @@         -- * Basic concurrency operations          ThreadId,-#ifdef __GLASGOW_HASKELL__         myThreadId,-#endif          forkIO,-#ifdef __GLASGOW_HASKELL__         forkFinally,         forkIOWithUnmask,         killThread,         throwTo,-#endif          -- ** Threads with affinity         forkOn,@@ -54,19 +49,19 @@          -- * Scheduling -        -- $conc_scheduling     -        yield,                  -- :: IO ()+        -- $conc_scheduling+        yield,          -- ** Blocking          -- $blocking -#ifdef __GLASGOW_HASKELL__         -- ** Waiting-        threadDelay,            -- :: Int -> IO ()-        threadWaitRead,         -- :: Int -> IO ()-        threadWaitWrite,        -- :: Int -> IO ()-#endif+        threadDelay,+        threadWaitRead,+        threadWaitWrite,+        threadWaitReadSTM,+        threadWaitWriteSTM,          -- * Communication abstractions @@ -74,16 +69,7 @@         module Control.Concurrent.Chan,         module Control.Concurrent.QSem,         module Control.Concurrent.QSemN,-        module Control.Concurrent.SampleVar, -        -- * Merging of streams-#ifndef __HUGS__-        mergeIO,                -- :: [a]   -> [a] -> IO [a]-        nmergeIO,               -- :: [[a]] -> IO [a]-#endif-        -- $merge--#ifdef __GLASGOW_HASKELL__         -- * Bound Threads         -- $boundthreads         rtsSupportsBoundThreads,@@ -91,7 +77,6 @@         isCurrentThreadBound,         runInBoundThread,         runInUnboundThread,-#endif          -- * Weak references to ThreadIds         mkWeakThreadId,@@ -113,18 +98,19 @@          -- $preemption -        -- * Deprecated functions-        forkIOUnmasked+        -- ** Deadlock +        -- $deadlock+     ) where  import Prelude  import Control.Exception.Base as Exception -#ifdef __GLASGOW_HASKELL__ import GHC.Exception-import GHC.Conc hiding (threadWaitRead, threadWaitWrite)+import GHC.Conc hiding (threadWaitRead, threadWaitWrite,+                        threadWaitReadSTM, threadWaitWriteSTM) import qualified GHC.Conc import GHC.IO           ( IO(..), unsafeInterleaveIO, unsafeUnmask ) import GHC.IORef        ( newIORef, readIORef, writeIORef )@@ -133,28 +119,19 @@ import System.Posix.Types ( Fd ) import Foreign.StablePtr import Foreign.C.Types-import Control.Monad    ( when )+import Control.Monad  #ifdef mingw32_HOST_OS import Foreign.C import System.IO-#endif-#endif--#ifdef __HUGS__-import Hugs.ConcBase+import Data.Maybe (Maybe(..)) #endif  import Control.Concurrent.MVar import Control.Concurrent.Chan import Control.Concurrent.QSem import Control.Concurrent.QSemN-import Control.Concurrent.SampleVar -#ifdef __HUGS__-type ThreadId = ()-#endif- {- $conc_intro  The concurrency extension for Haskell is described in the paper@@ -193,7 +170,7 @@     will print either @aaaaaaaaaaaaaa...@ or @bbbbbbbbbbbb...@,     instead of some random interleaving of @a@s and @b@s.  In     practice, cooperative multitasking is sufficient for writing-    simple graphical user interfaces.  +    simple graphical user interfaces. -}  {- $blocking@@ -205,8 +182,6 @@ not.  With the @-threaded@ option, only foreign calls with the @unsafe@ attribute will block all other threads. -Using Hugs, all I\/O operations and foreign calls will block all other-Haskell threads. -}  -- | fork a thread and call the supplied function when the thread is about@@ -220,91 +195,12 @@ -- This function is useful for informing the parent when a child -- terminates, for example. --+-- /Since: 4.6.0.0/ forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId forkFinally action and_then =   mask $ \restore ->     forkIO $ try (restore action) >>= and_then --- -------------------------------------------------------------------------------- Merging streams--#ifndef __HUGS__-max_buff_size :: Int-max_buff_size = 1--{-# DEPRECATED mergeIO "Control.Concurrent.mergeIO will be removed in GHC 7.8. Please use an alternative, e.g. the SafeSemaphore package, instead." #-}-{-# DEPRECATED nmergeIO "Control.Concurrent.nmergeIO will be removed in GHC 7.8. Please use an alternative, e.g. the SafeSemaphore package, instead." #-}-mergeIO :: [a] -> [a] -> IO [a]-nmergeIO :: [[a]] -> IO [a]---- $merge--- The 'mergeIO' and 'nmergeIO' functions fork one thread for each--- input list that concurrently evaluates that list; the results are--- merged into a single output list.  ------ Note: Hugs does not provide these functions, since they require--- preemptive multitasking.--mergeIO ls rs- = newEmptyMVar                >>= \ tail_node ->-   newMVar tail_node           >>= \ tail_list ->-   newQSem max_buff_size       >>= \ e ->-   newMVar 2                   >>= \ branches_running ->-   let-    buff = (tail_list,e)-   in-    forkIO (suckIO branches_running buff ls) >>-    forkIO (suckIO branches_running buff rs) >>-    takeMVar tail_node  >>= \ val ->-    signalQSem e        >>-    return val--type Buffer a- = (MVar (MVar [a]), QSem)--suckIO :: MVar Int -> Buffer a -> [a] -> IO ()--suckIO branches_running buff@(tail_list,e) vs- = case vs of-        [] -> takeMVar branches_running >>= \ val ->-              if val == 1 then-                 takeMVar tail_list     >>= \ node ->-                 putMVar node []        >>-                 putMVar tail_list node-              else-                 putMVar branches_running (val-1)-        (x:xs) ->-                waitQSem e                       >>-                takeMVar tail_list               >>= \ node ->-                newEmptyMVar                     >>= \ next_node ->-                unsafeInterleaveIO (-                        takeMVar next_node  >>= \ y ->-                        signalQSem e        >>-                        return y)                >>= \ next_node_val ->-                putMVar node (x:next_node_val)   >>-                putMVar tail_list next_node      >>-                suckIO branches_running buff xs--nmergeIO lss- = let-    len = length lss-   in-    newEmptyMVar          >>= \ tail_node ->-    newMVar tail_node     >>= \ tail_list ->-    newQSem max_buff_size >>= \ e ->-    newMVar len           >>= \ branches_running ->-    let-     buff = (tail_list,e)-    in-    mapIO (\ x -> forkIO (suckIO branches_running buff x)) lss >>-    takeMVar tail_node  >>= \ val ->-    signalQSem e        >>-    return val-  where-    mapIO f xs = sequence (map f xs)-#endif /* __HUGS__ */--#ifdef __GLASGOW_HASKELL__ -- --------------------------------------------------------------------------- -- Bound Threads @@ -332,7 +228,7 @@ run in a bound thread.  Why do we need this? Because if a foreign library is called from a thread-created using 'forkIO', it won't have access to any /thread-local state/ - +created using 'forkIO', it won't have access to any /thread-local state/ - state variables that have specific values for each OS thread (see POSIX's @pthread_key_create@ or Win32's @TlsAlloc@). Therefore, some libraries (OpenGL, for example) will not work from a thread created using@@ -362,7 +258,7 @@ foreign import ccall rtsSupportsBoundThreads :: Bool  -{- | +{- | Like 'forkIO', this sparks off a new thread to run the 'IO' computation passed as the first argument, and returns the 'ThreadId' of the newly created thread.@@ -430,10 +326,10 @@ isCurrentThreadBound :: IO Bool isCurrentThreadBound = IO $ \ s# ->     case isCurrentThreadBound# s# of-        (# s2#, flg #) -> (# s2#, not (flg ==# 0#) #)+        (# s2#, flg #) -> (# s2#, isTrue# (flg /=# 0#) #)  -{- | +{- | Run the 'IO' computation passed as the first argument. If the calling thread is not /bound/, a bound thread is created temporarily. @runInBoundThread@ doesn't finish until the 'IO' computation finishes.@@ -458,7 +354,7 @@                   unsafeResult     | otherwise = failNonThreaded -{- | +{- | Run the 'IO' computation passed as the first argument. If the calling thread is /bound/, an unbound thread is created temporarily using 'forkIO'. @runInBoundThread@ doesn't finish until the 'IO' computation finishes.@@ -489,9 +385,7 @@  unsafeResult :: Either SomeException a -> IO a unsafeResult = either Exception.throwIO return-#endif /* __GLASGOW_HASKELL__ */ -#ifdef __GLASGOW_HASKELL__ -- --------------------------------------------------------------------------- -- threadWaitRead/threadWaitWrite @@ -536,7 +430,55 @@   = GHC.Conc.threadWaitWrite fd #endif +-- | Returns an STM action that can be used to wait for data+-- to read from a file descriptor. The second returned value+-- is an IO action that can be used to deregister interest+-- in the file descriptor.+--+-- /Since: 4.7.0.0/+threadWaitReadSTM :: Fd -> IO (STM (), IO ())+threadWaitReadSTM fd #ifdef mingw32_HOST_OS+  | threaded = do v <- newTVarIO Nothing+                  mask_ $ void $ forkIO $ do result <- try (waitFd fd 0)+                                             atomically (writeTVar v $ Just result)+                  let waitAction = do result <- readTVar v+                                      case result of+                                        Nothing         -> retry+                                        Just (Right ()) -> return ()+                                        Just (Left e)   -> throwSTM (e :: IOException)+                  let killAction = return ()+                  return (waitAction, killAction)+  | otherwise = error "threadWaitReadSTM requires -threaded on Windows"+#else+  = GHC.Conc.threadWaitReadSTM fd+#endif++-- | Returns an STM action that can be used to wait until data+-- can be written to a file descriptor. The second returned value+-- is an IO action that can be used to deregister interest+-- in the file descriptor.+--+-- /Since: 4.7.0.0/+threadWaitWriteSTM :: Fd -> IO (STM (), IO ())+threadWaitWriteSTM fd+#ifdef mingw32_HOST_OS+  | threaded = do v <- newTVarIO Nothing+                  mask_ $ void $ forkIO $ do result <- try (waitFd fd 1)+                                             atomically (writeTVar v $ Just result)+                  let waitAction = do result <- readTVar v+                                      case result of+                                        Nothing         -> retry+                                        Just (Right ()) -> return ()+                                        Just (Left e)   -> throwSTM (e :: IOException)+                  let killAction = return ()+                  return (waitAction, killAction)+  | otherwise = error "threadWaitWriteSTM requires -threaded on Windows"+#else+  = GHC.Conc.threadWaitWriteSTM fd+#endif++#ifdef mingw32_HOST_OS foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool  withThread :: IO a -> IO a@@ -635,7 +577,7 @@  >    children :: MVar [MVar ()] >    children = unsafePerformIO (newMVar [])->    +> >    waitForChildren :: IO () >    waitForChildren = do >      cs <- takeMVar children@@ -694,4 +636,30 @@       lock is woken up, but haven't found it to be useful for anything       other than this example :-) -}-#endif /* __GLASGOW_HASKELL__ */++{- $deadlock++GHC attempts to detect when threads are deadlocked using the garbage+collector.  A thread that is not reachable (cannot be found by+following pointers from live objects) must be deadlocked, and in this+case the thread is sent an exception.  The exception is either+'BlockedIndefinitelyOnMVar', 'BlockedIndefinitelyOnSTM',+'NonTermination', or 'Deadlock', depending on the way in which the+thread is deadlocked.++Note that this feature is intended for debugging, and should not be+relied on for the correct operation of your program.  There is no+guarantee that the garbage collector will be accurate enough to detect+your deadlock, and no guarantee that the garbage collector will run in+a timely enough manner.  Basically, the same caveats as for finalizers+apply to deadlock detection.++There is a subtle interaction between deadlock detection and+finalizers (as created by 'Foreign.Concurrent.newForeignPtr' or the+functions in "System.Mem.Weak"): if a thread is blocked waiting for a+finalizer to run, then the thread will be considered deadlocked and+sent an exception.  So preferably don't do this, but if you have no+alternative then it is possible to prevent the thread from being+considered deadlocked by making a 'StablePtr' pointing to it.  Don't+forget to release the 'StablePtr' later with 'freeStablePtr'.+-}
Control/Concurrent/Chan.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -24,16 +22,16 @@         Chan,                   -- abstract            -- * Operations-        newChan,                -- :: IO (Chan a)-        writeChan,              -- :: Chan a -> a -> IO ()-        readChan,               -- :: Chan a -> IO a-        dupChan,                -- :: Chan a -> IO (Chan a)-        unGetChan,              -- :: Chan a -> a -> IO ()-        isEmptyChan,            -- :: Chan a -> IO Bool+        newChan,+        writeChan,+        readChan,+        dupChan,+        unGetChan,+        isEmptyChan,            -- * Stream interface-        getChanContents,        -- :: Chan a -> IO [a]-        writeList2Chan,         -- :: Chan a -> [a] -> IO ()+        getChanContents,+        writeList2Chan,    ) where  import Prelude@@ -43,8 +41,6 @@ import Control.Exception (mask_) import Data.Typeable -#include "Typeable.h"- #define _UPK_(x) {-# UNPACK #-} !(x)  -- A channel is represented by two @MVar@s keeping track of the two ends@@ -55,9 +51,7 @@ data Chan a  = Chan _UPK_(MVar (Stream a))         _UPK_(MVar (Stream a)) -- Invariant: the Stream a is always an empty MVar-   deriving Eq--INSTANCE_TYPEABLE1(Chan,chanTc,"Chan")+   deriving (Eq,Typeable)  type Stream a = MVar (ChItem a) @@ -142,7 +136,7 @@    modifyMVar_ readVar $ \read_end -> do      putMVar new_read_end (ChItem val read_end)      return new_read_end-{-# DEPRECATED unGetChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See http://hackage.haskell.org/trac/ghc/ticket/4154 for details" #-}+{-# DEPRECATED unGetChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See <http://ghc.haskell.org/trac/ghc/ticket/4154> for details" #-} -- deprecated in 7.0  -- |Returns 'True' if the supplied 'Chan' is empty. isEmptyChan :: Chan a -> IO Bool@@ -151,7 +145,7 @@      w <- readMVar writeVar      let eq = r == w      eq `seq` return eq-{-# DEPRECATED isEmptyChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See http://hackage.haskell.org/trac/ghc/ticket/4154 for details" #-}+{-# DEPRECATED isEmptyChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See <http://ghc.haskell.org/trac/ghc/ticket/4154> for details" #-} -- deprecated in 7.0  -- Operators for interfacing with functional streams. 
Control/Concurrent/MVar.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, UnboxedTuples, MagicHash #-}+{-# LANGUAGE NoImplicitPrelude, UnboxedTuples, MagicHash #-}  ----------------------------------------------------------------------------- -- |@@ -17,18 +17,22 @@ -- 'takeMVar' which empties an 'MVar' if it is full and blocks -- otherwise.  They can be used in multiple different ways: -----  1. As synchronized mutable variables,---  2. As channels, with 'takeMVar' and 'putMVar' as receive and send, and---  3. As a binary semaphore @'MVar' ()@, with 'takeMVar' and 'putMVar' as---     wait and signal.+--   1. As synchronized mutable variables, ----- They were introduced in the paper "Concurrent Haskell" by Simon--- Peyton Jones, Andrew Gordon and Sigbjorn Finne, though some details--- of their implementation have since then changed (in particular, a--- put on a full MVar used to error, but now merely blocks.)+--   2. As channels, with 'takeMVar' and 'putMVar' as receive and send, and ----- * Applicability+--   3. As a binary semaphore @'MVar' ()@, with 'takeMVar' and 'putMVar' as+--      wait and signal. --+-- They were introduced in the paper+-- <http://research.microsoft.com/~simonpj/papers/concurrent-haskell.ps.gz "Concurrent Haskell">+-- by Simon Peyton Jones, Andrew Gordon and Sigbjorn Finne, though+-- some details of their implementation have since then changed (in+-- particular, a put on a full 'MVar' used to error, but now merely+-- blocks.)+--+-- === Applicability+-- -- 'MVar's offer more flexibility than 'IORef's, but less flexibility -- than 'STM'.  They are appropriate for building synchronization -- primitives and performing simple interthread communication; however@@ -45,7 +49,7 @@ -- perform a 'takeMVar' before a 'putMVar' as well;  otherwise, they may -- block. ----- * Fairness+-- === Fairness -- -- No thread can be blocked indefinitely on an 'MVar' unless another -- thread holds that 'MVar' indefinitely.  One usual implementation of@@ -53,7 +57,7 @@ -- served in a first-in-first-out fashion, but this is not guaranteed -- in the semantics. ----- * Gotchas+-- === Gotchas -- -- Like many other Haskell data structures, 'MVar's are lazy.  This -- means that if you place an expensive unevaluated thunk inside an@@ -62,14 +66,14 @@ -- in an 'MVar' to the appropriate normal form, or utilize a strict -- MVar provided by the strict-concurrency package. ----- * Ordering+-- === Ordering -- -- 'MVar' operations are always observed to take place in the order -- they are written in the program, regardless of the memory model of -- the underlying machine.  This is in contrast to 'IORef' operations -- which may appear out-of-order to another thread in some cases. ----- * Example+-- === Example -- -- Consider the following concurrent data structure, a skip channel. -- This is a channel for an intermittent source of high bandwidth@@ -135,52 +139,27 @@         , tryPutMVar         , isEmptyMVar         , withMVar+        , withMVarMasked         , modifyMVar_         , modifyMVar         , modifyMVarMasked_         , modifyMVarMasked-#ifndef __HUGS__+        , tryReadMVar         , mkWeakMVar-        , addMVarFinalizer -- :: MVar a -> IO () -> IO ()-#endif+        , addMVarFinalizer     ) where -#ifdef __HUGS__-import Hugs.ConcBase ( MVar, newEmptyMVar, newMVar, takeMVar, putMVar,-                  tryTakeMVar, tryPutMVar, isEmptyMVar,-                )-#endif--#ifdef __GLASGOW_HASKELL__ import GHC.MVar ( MVar(..), newEmptyMVar, newMVar, takeMVar, putMVar,-                  tryTakeMVar, tryPutMVar, isEmptyMVar+                  tryTakeMVar, tryPutMVar, isEmptyMVar, readMVar,+                  tryReadMVar                 ) import qualified GHC.MVar import GHC.Weak-#endif--#ifdef __GLASGOW_HASKELL__ import GHC.Base-#else-import Prelude-#endif  import Control.Exception.Base  {-|-  This is a combination of 'takeMVar' and 'putMVar'; ie. it takes the value-  from the 'MVar', puts it back, and also returns it.  This function-  is atomic only if there are no other producers (i.e. threads calling-  'putMVar') for this 'MVar'.--}-readMVar :: MVar a -> IO a-readMVar m =-  mask_ $ do-    a <- takeMVar m-    putMVar m a-    return a--{-|   Take a value from an 'MVar', put a new value into the 'MVar' and   return the value taken. This function is atomic only if there are   no other producers for this 'MVar'.@@ -211,6 +190,21 @@     return b  {-|+  Like 'withMVar', but the @IO@ action in the second argument is executed+  with asynchronous exceptions masked.++  /Since: 4.7.0.0/+-}+{-# INLINE withMVarMasked #-}+withMVarMasked :: MVar a -> (a -> IO b) -> IO b+withMVarMasked m io =+  mask_ $ do+    a <- takeMVar m+    b <- io a `onException` putMVar m a+    putMVar m a+    return b++{-|   An exception-safe wrapper for modifying the contents of an 'MVar'.   Like 'withMVar', 'modifyMVar' will replace the original contents of   the 'MVar' if an exception is raised during the operation.  This@@ -234,13 +228,15 @@ modifyMVar m io =   mask $ \restore -> do     a      <- takeMVar m-    (a',b) <- restore (io a) `onException` putMVar m a+    (a',b) <- restore (io a >>= evaluate) `onException` putMVar m a     putMVar m a'     return b  {-|   Like 'modifyMVar_', but the @IO@ action in the second argument is executed with   asynchronous exceptions masked.++  /Since: 4.6.0.0/ -} {-# INLINE modifyMVarMasked_ #-} modifyMVarMasked_ :: MVar a -> (a -> IO a) -> IO ()@@ -253,22 +249,26 @@ {-|   Like 'modifyMVar', but the @IO@ action in the second argument is executed with   asynchronous exceptions masked.++  /Since: 4.6.0.0/ -} {-# INLINE modifyMVarMasked #-} modifyMVarMasked :: MVar a -> (a -> IO (a,b)) -> IO b modifyMVarMasked m io =   mask_ $ do     a      <- takeMVar m-    (a',b) <- io a `onException` putMVar m a+    (a',b) <- (io a >>= evaluate) `onException` putMVar m a     putMVar m a'     return b -{-# DEPRECATED addMVarFinalizer "use mkWeakMVar instead" #-}+{-# DEPRECATED addMVarFinalizer "use 'mkWeakMVar' instead" #-} -- deprecated in 7.6 addMVarFinalizer :: MVar a -> IO () -> IO () addMVarFinalizer = GHC.MVar.addMVarFinalizer  -- | Make a 'Weak' pointer to an 'MVar', using the second argument as -- a finalizer to run when 'MVar' is garbage-collected+--+-- /Since: 4.6.0.0/ mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a)) mkWeakMVar m@(MVar m#) f = IO $ \s ->   case mkWeak# m# m f s of (# s1, w #) -> (# s1, Weak w #)
Control/Concurrent/QSem.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__-{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif+{-# LANGUAGE DeriveDataTypeable, BangPatterns #-}+{-# OPTIONS_GHC -funbox-strict-fields #-}  ----------------------------------------------------------------------------- -- |@@ -19,7 +17,6 @@ -----------------------------------------------------------------------------  module Control.Concurrent.QSem-        {-# DEPRECATED "Control.Concurrent.QSem will be removed in GHC 7.8. Please use an alternative, e.g. the SafeSemaphore package, instead." #-}         ( -- * Simple Quantity Semaphores           QSem,         -- abstract           newQSem,      -- :: Int  -> IO QSem@@ -27,64 +24,107 @@           signalQSem    -- :: QSem -> IO ()         ) where -import Prelude-import Control.Concurrent.MVar-import Control.Exception ( mask_ )-import Data.Typeable--#include "Typeable.h"---- General semaphores are also implemented readily in terms of shared--- @MVar@s, only have to catch the case when the semaphore is tried--- waited on when it is empty (==0). Implement this in the same way as--- shared variables are implemented - maintaining a list of @MVar@s--- representing threads currently waiting. The counter is a shared--- variable, ensuring the mutual exclusion on its access.+import Control.Concurrent.MVar ( MVar, newEmptyMVar, takeMVar, tryTakeMVar+                          , putMVar, newMVar, tryPutMVar)+import Control.Exception+import Data.Maybe --- |A 'QSem' is a simple quantity semaphore, in which the available--- \"quantity\" is always dealt with in units of one.-newtype QSem = QSem (MVar (Int, [MVar ()])) deriving Eq+-- | 'QSem' is a quantity semaphore in which the resource is aqcuired+-- and released in units of one. It provides guaranteed FIFO ordering+-- for satisfying blocked `waitQSem` calls.+--+-- The pattern+--+-- >   bracket_ waitQSem signalQSem (...)+--+-- is safe; it never loses a unit of the resource.+--+data QSem = QSem !(MVar (Int, [MVar ()], [MVar ()])) -INSTANCE_TYPEABLE0(QSem,qSemTc,"QSem")+-- The semaphore state (i, xs, ys):+--+--   i is the current resource value+--+--   (xs,ys) is the queue of blocked threads, where the queue is+--           given by xs ++ reverse ys.  We can enqueue new blocked threads+--           by consing onto ys, and dequeue by removing from the head of xs.+--+-- A blocked thread is represented by an empty (MVar ()).  To unblock+-- the thread, we put () into the MVar.+--+-- A thread can dequeue itself by also putting () into the MVar, which+-- it must do if it receives an exception while blocked in waitQSem.+-- This means that when unblocking a thread in signalQSem we must+-- first check whether the MVar is already full; the MVar lock on the+-- semaphore itself resolves race conditions between signalQSem and a+-- thread attempting to dequeue itself.  -- |Build a new 'QSem' with a supplied initial quantity. --  The initial quantity must be at least 0. newQSem :: Int -> IO QSem-newQSem initial =-    if initial < 0-    then fail "newQSem: Initial quantity must be non-negative"-    else do sem <- newMVar (initial, [])-            return (QSem sem)+newQSem initial+  | initial < 0 = fail "newQSem: Initial quantity must be non-negative"+  | otherwise   = do+      sem <- newMVar (initial, [], [])+      return (QSem sem)  -- |Wait for a unit to become available waitQSem :: QSem -> IO ()-waitQSem (QSem sem) = mask_ $ do-   (avail,blocked) <- takeMVar sem  -- gain ex. access-   if avail > 0 then-     let avail' = avail-1-     in avail' `seq` putMVar sem (avail',[])-    else do-     b <- newEmptyMVar-      {--        Stuff the reader at the back of the queue,-        so as to preserve waiting order. A signalling-        process then only have to pick the MVar at the-        front of the blocked list.--        The version of waitQSem given in the paper could-        lead to starvation.-      -}-     putMVar sem (0, blocked++[b])-     takeMVar b+waitQSem (QSem m) =+  mask_ $ do+    (i,b1,b2) <- takeMVar m+    if i == 0+       then do+         b <- newEmptyMVar+         putMVar m (i, b1, b:b2)+         wait b+       else do+         let !z = i-1+         putMVar m (z, b1, b2)+         return ()+  where+    wait b = takeMVar b `onException` do+                (uninterruptibleMask_ $ do -- Note [signal uninterruptible]+                   (i,b1,b2) <- takeMVar m+                   r <- tryTakeMVar b+                   r' <- if isJust r+                            then signal (i,b1,b2)+                            else do putMVar b (); return (i,b1,b2)+                   putMVar m r')  -- |Signal that a unit of the 'QSem' is available signalQSem :: QSem -> IO ()-signalQSem (QSem sem) = mask_ $ do-   (avail,blocked) <- takeMVar sem-   case blocked of-     [] -> let avail' = avail+1-           in avail' `seq` putMVar sem (avail',blocked)+signalQSem (QSem m) =+  uninterruptibleMask_ $ do -- Note [signal uninterruptible]+    r <- takeMVar m+    r' <- signal r+    putMVar m r' -     (b:blocked') -> do-           putMVar sem (0,blocked')-           putMVar b ()+-- Note [signal uninterruptible]+--+--   If we have+--+--      bracket waitQSem signalQSem (...)+--+--   and an exception arrives at the signalQSem, then we must not lose+--   the resource.  The signalQSem is masked by bracket, but taking+--   the MVar might block, and so it would be interruptible.  Hence we+--   need an uninterruptibleMask here.+--+--   This isn't ideal: during high contention, some threads won't be+--   interruptible.  The QSemSTM implementation has better behaviour+--   here, but it performs much worse than this one in some+--   benchmarks.++signal :: (Int,[MVar ()],[MVar ()]) -> IO (Int,[MVar ()],[MVar ()])+signal (i,a1,a2) =+ if i == 0+   then loop a1 a2+   else let !z = i+1 in return (z, a1, a2)+ where+   loop [] [] = return (1, [], [])+   loop [] b2 = loop (reverse b2) []+   loop (b:bs) b2 = do+     r <- tryPutMVar b ()+     if r then return (0, bs, b2)+          else loop bs b2
Control/Concurrent/QSemN.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__-{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif+{-# LANGUAGE DeriveDataTypeable, BangPatterns #-}+{-# OPTIONS_GHC -funbox-strict-fields #-}  ----------------------------------------------------------------------------- -- |@@ -20,7 +18,6 @@ -----------------------------------------------------------------------------  module Control.Concurrent.QSemN-        {-# DEPRECATED "Control.Concurrent.QSemN will be removed in GHC 7.8. Please use an alternative, e.g. the SafeSemaphore package, instead." #-}         (  -- * General Quantity Semaphores           QSemN,        -- abstract           newQSemN,     -- :: Int   -> IO QSemN@@ -28,55 +25,100 @@           signalQSemN   -- :: QSemN -> Int -> IO ()       ) where -import Prelude--import Control.Concurrent.MVar-import Control.Exception ( mask_ )+import Control.Concurrent.MVar ( MVar, newEmptyMVar, takeMVar, tryTakeMVar+                          , putMVar, newMVar+                          , tryPutMVar, isEmptyMVar) import Data.Typeable--#include "Typeable.h"+import Control.Exception+import Data.Maybe --- |A 'QSemN' is a quantity semaphore, in which the available--- \"quantity\" may be signalled or waited for in arbitrary amounts.-newtype QSemN = QSemN (MVar (Int,[(Int,MVar ())])) deriving Eq+-- | 'QSemN' is a quantity semaphore in which the resource is aqcuired+-- and released in units of one. It provides guaranteed FIFO ordering+-- for satisfying blocked `waitQSemN` calls.+--+-- The pattern+--+-- >   bracket_ (waitQSemN n) (signalQSemN n) (...)+--+-- is safe; it never loses any of the resource.+--+data QSemN = QSemN !(MVar (Int, [(Int, MVar ())], [(Int, MVar ())]))+  deriving Typeable -INSTANCE_TYPEABLE0(QSemN,qSemNTc,"QSemN")+-- The semaphore state (i, xs, ys):+--+--   i is the current resource value+--+--   (xs,ys) is the queue of blocked threads, where the queue is+--           given by xs ++ reverse ys.  We can enqueue new blocked threads+--           by consing onto ys, and dequeue by removing from the head of xs.+--+-- A blocked thread is represented by an empty (MVar ()).  To unblock+-- the thread, we put () into the MVar.+--+-- A thread can dequeue itself by also putting () into the MVar, which+-- it must do if it receives an exception while blocked in waitQSemN.+-- This means that when unblocking a thread in signalQSemN we must+-- first check whether the MVar is already full; the MVar lock on the+-- semaphore itself resolves race conditions between signalQSemN and a+-- thread attempting to dequeue itself.  -- |Build a new 'QSemN' with a supplied initial quantity. --  The initial quantity must be at least 0. newQSemN :: Int -> IO QSemN-newQSemN initial =-    if initial < 0-    then fail "newQSemN: Initial quantity must be non-negative"-    else do sem <- newMVar (initial, [])-            return (QSemN sem)+newQSemN initial+  | initial < 0 = fail "newQSemN: Initial quantity must be non-negative"+  | otherwise   = do+      sem <- newMVar (initial, [], [])+      return (QSemN sem)  -- |Wait for the specified quantity to become available waitQSemN :: QSemN -> Int -> IO ()-waitQSemN (QSemN sem) sz = mask_ $ do-  (avail,blocked) <- takeMVar sem   -- gain ex. access-  let remaining = avail - sz-  if remaining >= 0 then-       -- discharging 'sz' still leaves the semaphore-       -- in an 'unblocked' state.-     putMVar sem (remaining,blocked)-   else do-     b <- newEmptyMVar-     putMVar sem (avail, blocked++[(sz,b)])-     takeMVar b+waitQSemN (QSemN m) sz =+  mask_ $ do+    (i,b1,b2) <- takeMVar m+    let z = i-sz+    if z < 0+       then do+         b <- newEmptyMVar+         putMVar m (i, b1, (sz,b):b2)+         wait b+       else do+         putMVar m (z, b1, b2)+         return ()+  where+    wait b = do+        takeMVar b `onException`+                (uninterruptibleMask_ $ do -- Note [signal uninterruptible]+                   (i,b1,b2) <- takeMVar m+                   r <- tryTakeMVar b+                   r' <- if isJust r+                            then signal sz (i,b1,b2)+                            else do putMVar b (); return (i,b1,b2)+                   putMVar m r')  -- |Signal that a given quantity is now available from the 'QSemN'.-signalQSemN :: QSemN -> Int  -> IO ()-signalQSemN (QSemN sem) n = mask_ $ do-   (avail,blocked)   <- takeMVar sem-   (avail',blocked') <- free (avail+n) blocked-   avail' `seq` putMVar sem (avail',blocked')+signalQSemN :: QSemN -> Int -> IO ()+signalQSemN (QSemN m) sz = uninterruptibleMask_ $ do+  r <- takeMVar m+  r' <- signal sz r+  putMVar m r'++signal :: Int+       -> (Int,[(Int,MVar ())],[(Int,MVar ())])+       -> IO (Int,[(Int,MVar ())],[(Int,MVar ())])++signal sz0 (i,a1,a2) = loop (sz0 + i) a1 a2  where-   free avail []    = return (avail,[])-   free avail ((req,b):blocked)-     | avail >= req = do-        putMVar b ()-        free (avail-req) blocked-     | otherwise    = do-        (avail',blocked') <- free avail blocked-        return (avail',(req,b):blocked')+   loop 0  bs b2 = return (0,  bs, b2)+   loop sz [] [] = return (sz, [], [])+   loop sz [] b2 = loop sz (reverse b2) []+   loop sz ((j,b):bs) b2+     | j > sz = do+       r <- isEmptyMVar b+       if r then return (sz, (j,b):bs, b2)+            else loop sz bs b2+     | otherwise = do+       r <- tryPutMVar b ()+       if r then loop (sz-j) bs b2+            else loop sz bs b2
− Control/Concurrent/SampleVar.hs
@@ -1,137 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__-{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif---------------------------------------------------------------------------------- |--- Module      :  Control.Concurrent.SampleVar--- Copyright   :  (c) The University of Glasgow 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)--- --- Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  non-portable (concurrency)------ Sample variables-----------------------------------------------------------------------------------module Control.Concurrent.SampleVar-        {-# DEPRECATED "Control.Concurrent.SampleVar will be removed in GHC 7.8. Please use an alternative, e.g. the SafeSemaphore package, instead." #-}-       (-         -- * Sample Variables-         SampleVar,         -- :: type _ =- -         newEmptySampleVar, -- :: IO (SampleVar a)-         newSampleVar,      -- :: a -> IO (SampleVar a)-         emptySampleVar,    -- :: SampleVar a -> IO ()-         readSampleVar,     -- :: SampleVar a -> IO a-         writeSampleVar,    -- :: SampleVar a -> a -> IO ()-         isEmptySampleVar,  -- :: SampleVar a -> IO Bool--       ) where--import Prelude--import Control.Concurrent.MVar--import Control.Exception ( mask_ )--import Data.Functor ( (<$>) )--import Data.Typeable--#include "Typeable.h"---- |--- Sample variables are slightly different from a normal 'MVar':--- ---  * Reading an empty 'SampleVar' causes the reader to block.---    (same as 'takeMVar' on empty 'MVar')--- ---  * Reading a filled 'SampleVar' empties it and returns value.---    (same as 'takeMVar')--- ---  * Writing to an empty 'SampleVar' fills it with a value, and---    potentially, wakes up a blocked reader (same as for 'putMVar' on---    empty 'MVar').------  * Writing to a filled 'SampleVar' overwrites the current value.---    (different from 'putMVar' on full 'MVar'.)--newtype SampleVar a = SampleVar ( MVar ( Int    -- 1  == full-                                                -- 0  == empty-                                                -- <0 no of readers blocked-                                       , MVar a-                                       )-                                )-    deriving (Eq)--INSTANCE_TYPEABLE1(SampleVar,sampleVarTc,"SampleVar")---- |Build a new, empty, 'SampleVar'-newEmptySampleVar :: IO (SampleVar a)-newEmptySampleVar = do-   v <- newEmptyMVar-   SampleVar <$> newMVar (0,v)---- |Build a 'SampleVar' with an initial value.-newSampleVar :: a -> IO (SampleVar a)-newSampleVar a = do-   v <- newMVar a-   SampleVar <$> newMVar (1,v)---- |If the SampleVar is full, leave it empty.  Otherwise, do nothing.-emptySampleVar :: SampleVar a -> IO ()-emptySampleVar (SampleVar v) = mask_ $ do-   s@(readers, var) <- takeMVar v-   if readers > 0 then do-     _ <- takeMVar var-     putMVar v (0,var)-    else-     putMVar v s---- |Wait for a value to become available, then take it and return.-readSampleVar :: SampleVar a -> IO a-readSampleVar (SampleVar svar) = mask_ $ do------ filled => make empty and grab sample--- not filled => try to grab value, empty when read val.----   (readers,val) <- takeMVar svar-   let readers' = readers-1-   readers' `seq` putMVar svar (readers',val)-   takeMVar val---- |Write a value into the 'SampleVar', overwriting any previous value that--- was there.-writeSampleVar :: SampleVar a -> a -> IO ()-writeSampleVar (SampleVar svar) v = mask_ $ do------ filled => overwrite--- not filled => fill, write val----   s@(readers,val) <- takeMVar svar-   case readers of-     1 ->-       swapMVar val v >>-       putMVar svar s-     _ ->-       putMVar val v >>-       let readers' = min 1 (readers+1)-       in readers' `seq` putMVar svar (readers', val)---- | Returns 'True' if the 'SampleVar' is currently empty.------ Note that this function is only useful if you know that no other--- threads can be modifying the state of the 'SampleVar', because--- otherwise the state of the 'SampleVar' may have changed by the time--- you see the result of 'isEmptySampleVar'.----isEmptySampleVar :: SampleVar a -> IO Bool-isEmptySampleVar (SampleVar svar) = do-   (readers, _) <- readMVar svar-   return (readers <= 0)-
Control/Exception.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, ExistentialQuantification #-}+{-# LANGUAGE NoImplicitPrelude, ExistentialQuantification #-}  ----------------------------------------------------------------------------- -- |@@ -34,26 +34,18 @@ module Control.Exception (          -- * The Exception type-#ifdef __HUGS__-        SomeException,-#else         SomeException(..),-#endif         Exception(..),          -- class         IOException,            -- instance Eq, Ord, Show, Typeable, Exception         ArithException(..),     -- instance Eq, Ord, Show, Typeable, Exception         ArrayException(..),     -- instance Eq, Ord, Show, Typeable, Exception         AssertionFailed(..),+        SomeAsyncException(..),         AsyncException(..),     -- instance Eq, Ord, Show, Typeable, Exception+        asyncExceptionToException, asyncExceptionFromException, -#if __GLASGOW_HASKELL__ || __HUGS__         NonTermination(..),         NestedAtomically(..),-#endif-#ifdef __NHC__-        System.ExitCode(), -- instance Exception-#endif-         BlockedIndefinitelyOnMVar(..),         BlockedIndefinitelyOnSTM(..),         Deadlock(..),@@ -68,9 +60,7 @@         throw,         throwIO,         ioError,-#ifdef __GLASGOW_HASKELL__         throwTo,-#endif          -- * Catching Exceptions @@ -109,21 +99,13 @@         -- asynchronous exceptions during a critical region.          mask,-#ifndef __NHC__         mask_,         uninterruptibleMask,         uninterruptibleMask_,         MaskingState(..),         getMaskingState,         allowInterrupt,-#endif -        -- ** (deprecated) Asynchronous exception control--        block,-        unblock,-        blocked,-         -- *** Applying @mask@ to an exception handler          -- $block_handler@@ -149,18 +131,10 @@  import Control.Exception.Base -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IO (unsafeUnmask) import Data.Maybe-#else-import Prelude hiding (catch)-#endif -#ifdef __NHC__-import System (ExitCode())-#endif- -- | You need this when using 'catches'. data Handler a = forall e . Exception e => Handler (e -> IO a) @@ -244,6 +218,8 @@ -- -- When called outside 'mask', or inside 'uninterruptibleMask', this -- function has no effect.+--+-- /Since: 4.4.0.0/ allowInterrupt :: IO () allowInterrupt = unsafeUnmask $ return () @@ -353,12 +329,19 @@ The following operations are guaranteed not to be interruptible:   * operations on 'IORef' from "Data.IORef"+  * STM transactions that do not use 'retry'+  * everything from the @Foreign@ modules- * everything from @Control.Exception@++ * everything from @Control.Exception@ except for 'throwTo'+  * @tryTakeMVar@, @tryPutMVar@, @isEmptyMVar@+  * @takeMVar@ if the @MVar@ is definitely full, and conversely @putMVar@ if the @MVar@ is definitely empty+  * @newEmptyMVar@, @newMVar@+  * @forkIO@, @forkIOUnmasked@, @myThreadId@  -}
Control/Exception/Base.hs view
@@ -1,11 +1,7 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}-#ifdef __GLASGOW_HASKELL__+{-# LANGUAGE NoImplicitPrelude, MagicHash #-} {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif -#include "Typeable.h"- ----------------------------------------------------------------------------- -- | -- Module      :  Control.Exception.Base@@ -23,23 +19,16 @@ module Control.Exception.Base (          -- * The Exception type-#ifdef __HUGS__-        SomeException,-#else         SomeException(..),-#endif         Exception(..),         IOException,         ArithException(..),         ArrayException(..),         AssertionFailed(..),-        AsyncException(..),--#if __GLASGOW_HASKELL__ || __HUGS__+        SomeAsyncException(..), AsyncException(..),+        asyncExceptionToException, asyncExceptionFromException,         NonTermination(..),         NestedAtomically(..),-#endif-         BlockedIndefinitelyOnMVar(..),         BlockedIndefinitelyOnSTM(..),         Deadlock(..),@@ -54,9 +43,7 @@         throwIO,         throw,         ioError,-#ifdef __GLASGOW_HASKELL__         throwTo,-#endif          -- * Catching Exceptions @@ -83,20 +70,12 @@          -- ** Asynchronous exception control         mask,-#ifndef __NHC__         mask_,         uninterruptibleMask,         uninterruptibleMask_,         MaskingState(..),         getMaskingState,-#endif -        -- ** (deprecated) Asynchronous exception control--        block,-        unblock,-        blocked,-         -- * Assertions          assert,@@ -109,16 +88,13 @@          finally, -#ifdef __GLASGOW_HASKELL__         -- * Calls for GHC runtime         recSelError, recConError, irrefutPatError, runtimeError,         nonExhaustiveGuardsError, patError, noMethodBindingError,         absentError,         nonTermination, nestedAtomically,-#endif   ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IO hiding (bracket,finally,onException) import GHC.IO.Exception@@ -126,223 +102,11 @@ import GHC.Show -- import GHC.Exception hiding ( Exception ) import GHC.Conc.Sync-#endif -#ifdef __HUGS__-import Prelude hiding (catch)-import Hugs.Prelude (ExitCode(..))-import Hugs.IOExts (unsafePerformIO)-import Hugs.Exception (SomeException(DynamicException, IOException,-                                     ArithException, ArrayException, ExitException),-                       evaluate, IOException, ArithException, ArrayException)-import qualified Hugs.Exception-#endif- import Data.Dynamic import Data.Either import Data.Maybe -#ifdef __NHC__-import qualified IO as H'98 (catch)-import IO              (bracket,ioError)-import DIOError         -- defn of IOError type-import System          (ExitCode())-import System.IO.Unsafe (unsafePerformIO)-import Unsafe.Coerce    (unsafeCoerce)---- minimum needed for nhc98 to pretend it has Exceptions--{--data Exception   = IOException    IOException-                 | ArithException ArithException-                 | ArrayException ArrayException-                 | AsyncException AsyncException-                 | ExitException  ExitCode-                 deriving Show--}-class ({-Typeable e,-} Show e) => Exception e where-    toException   :: e -> SomeException-    fromException :: SomeException -> Maybe e--data SomeException = forall e . Exception e => SomeException e--INSTANCE_TYPEABLE0(SomeException,someExceptionTc,"SomeException")--instance Show SomeException where-    showsPrec p (SomeException e) = showsPrec p e-instance Exception SomeException where-    toException se = se-    fromException = Just--type IOException = IOError-instance Exception IOError where-    toException                     = SomeException-    fromException (SomeException e) = Just (unsafeCoerce e)--instance Exception ExitCode where-    toException                     = SomeException-    fromException (SomeException e) = Just (unsafeCoerce e)--data ArithException-data ArrayException-data AsyncException-data AssertionFailed-data PatternMatchFail-data NoMethodError-data Deadlock-data BlockedIndefinitelyOnMVar-data BlockedIndefinitelyOnSTM-data ErrorCall-data RecConError-data RecSelError-data RecUpdError-instance Show ArithException-instance Show ArrayException-instance Show AsyncException-instance Show AssertionFailed-instance Show PatternMatchFail-instance Show NoMethodError-instance Show Deadlock-instance Show BlockedIndefinitelyOnMVar-instance Show BlockedIndefinitelyOnSTM-instance Show ErrorCall-instance Show RecConError-instance Show RecSelError-instance Show RecUpdError--catch   :: Exception e-        => IO a         -- ^ The computation to run-        -> (e -> IO a)  -- ^ Handler to invoke if an exception is raised-        -> IO a-catch io h = H'98.catch  io  (h . fromJust . fromException . toException)--throwIO  :: Exception e => e -> IO a-throwIO   = ioError . fromJust . fromException . toException--throw    :: Exception e => e -> a-throw     = unsafePerformIO . throwIO--evaluate :: a -> IO a-evaluate x = x `seq` return x--assert :: Bool -> a -> a-assert True  x = x-assert False _ = throw (toException (UserError "" "Assertion failed"))--mask   :: ((IO a-> IO a) -> IO a) -> IO a-mask action = action restore-    where restore act = act--#endif--#ifdef __HUGS__-class (Typeable e, Show e) => Exception e where-    toException   :: e -> SomeException-    fromException :: SomeException -> Maybe e--    toException e = DynamicException (toDyn e) (flip showsPrec e)-    fromException (DynamicException dyn _) = fromDynamic dyn-    fromException _ = Nothing--INSTANCE_TYPEABLE0(SomeException,someExceptionTc,"SomeException")-INSTANCE_TYPEABLE0(IOException,iOExceptionTc,"IOException")-INSTANCE_TYPEABLE0(ArithException,arithExceptionTc,"ArithException")-INSTANCE_TYPEABLE0(ArrayException,arrayExceptionTc,"ArrayException")-INSTANCE_TYPEABLE0(ExitCode,exitCodeTc,"ExitCode")-INSTANCE_TYPEABLE0(ErrorCall,errorCallTc,"ErrorCall")-INSTANCE_TYPEABLE0(AssertionFailed,assertionFailedTc,"AssertionFailed")-INSTANCE_TYPEABLE0(AsyncException,asyncExceptionTc,"AsyncException")-INSTANCE_TYPEABLE0(BlockedIndefinitelyOnMVar,blockedIndefinitelyOnMVarTc,"BlockedIndefinitelyOnMVar")-INSTANCE_TYPEABLE0(BlockedIndefinitelyOnSTM,blockedIndefinitelyOnSTM,"BlockedIndefinitelyOnSTM")-INSTANCE_TYPEABLE0(Deadlock,deadlockTc,"Deadlock")--instance Exception SomeException where-    toException se = se-    fromException = Just--instance Exception IOException where-    toException = IOException-    fromException (IOException e) = Just e-    fromException _ = Nothing--instance Exception ArrayException where-    toException = ArrayException-    fromException (ArrayException e) = Just e-    fromException _ = Nothing--instance Exception ArithException where-    toException = ArithException-    fromException (ArithException e) = Just e-    fromException _ = Nothing--instance Exception ExitCode where-    toException = ExitException-    fromException (ExitException e) = Just e-    fromException _ = Nothing--data ErrorCall = ErrorCall String--instance Show ErrorCall where-    showsPrec _ (ErrorCall err) = showString err--instance Exception ErrorCall where-    toException (ErrorCall s) = Hugs.Exception.ErrorCall s-    fromException (Hugs.Exception.ErrorCall s) = Just (ErrorCall s)-    fromException _ = Nothing--data BlockedIndefinitelyOnMVar = BlockedIndefinitelyOnMVar-data BlockedIndefinitelyOnSTM = BlockedIndefinitelyOnSTM-data Deadlock = Deadlock-data AssertionFailed = AssertionFailed String-data AsyncException-  = StackOverflow-  | HeapOverflow-  | ThreadKilled-  | UserInterrupt-  deriving (Eq, Ord)--instance Show BlockedIndefinitelyOnMVar where-    showsPrec _ BlockedIndefinitelyOnMVar = showString "thread blocked indefinitely"--instance Show BlockedIndefinitely where-    showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"--instance Show Deadlock where-    showsPrec _ Deadlock = showString "<<deadlock>>"--instance Show AssertionFailed where-    showsPrec _ (AssertionFailed err) = showString err--instance Show AsyncException where-    showsPrec _ StackOverflow   = showString "stack overflow"-    showsPrec _ HeapOverflow    = showString "heap overflow"-    showsPrec _ ThreadKilled    = showString "thread killed"-    showsPrec _ UserInterrupt   = showString "user interrupt"--instance Exception BlockedOnDeadMVar-instance Exception BlockedIndefinitely-instance Exception Deadlock-instance Exception AssertionFailed-instance Exception AsyncException--throw :: Exception e => e -> a-throw e = Hugs.Exception.throw (toException e)--throwIO :: Exception e => e -> IO a-throwIO e = Hugs.Exception.throwIO (toException e)-#endif--#ifndef __GLASGOW_HASKELL__--- Dummy definitions for implementations lacking asynchonous exceptions--block   :: IO a -> IO a-block    = id-unblock :: IO a -> IO a-unblock  = id-blocked :: IO Bool-blocked  = return False-#endif- ----------------------------------------------------------------------------- -- Catching exceptions @@ -379,20 +143,11 @@ -- might get a the opposite behaviour. This is ok, because 'catch' is an -- 'IO' computation. ---#ifndef __NHC__ catch   :: Exception e         => IO a         -- ^ The computation to run         -> (e -> IO a)  -- ^ Handler to invoke if an exception is raised         -> IO a-#if __GLASGOW_HASKELL__ catch = catchException-#elif __HUGS__-catch m h = Hugs.Exception.catchException m h'-  where h' e = case fromException e of-            Just e' -> h e'-            Nothing -> throwIO e-#endif-#endif  -- | The function 'catchJust' is like 'catch', but it takes an extra -- argument which is an /exception predicate/, a function which@@ -452,11 +207,6 @@ -- up to the next enclosing exception handler. -- -- >  try a = catch (Right `liftM` a) (return . Left)------ Note that "System.IO.Error" also exports a function called--- 'System.IO.Error.try' with a similar type to 'Control.Exception.try',--- except that it catches only the IO and user families of exceptions--- (as required by the Haskell 98 @IO@ module).  try :: Exception e => IO a -> IO (Either e a) try a = catch (a >>= \ v -> return (Right v)) (\e -> return (Left e))@@ -501,7 +251,6 @@ -- -- > withFile name mode = bracket (openFile name mode) hClose ---#ifndef __NHC__ bracket         :: IO a         -- ^ computation to run first (\"acquire resource\")         -> (a -> IO b)  -- ^ computation to run last (\"release resource\")@@ -513,7 +262,6 @@     r <- restore (thing a) `onException` after a     _ <- after a     return r-#endif  -- | A specialised variant of 'bracket' with just a computation to run -- afterward.@@ -545,31 +293,16 @@     a <- before     restore (thing a) `onException` after a -#if !(__GLASGOW_HASKELL__ || __NHC__)-assert :: Bool -> a -> a-assert True x = x-assert False _ = throw (AssertionFailed "")-#endif- ----- -#if __GLASGOW_HASKELL__ || __HUGS__ -- |A pattern match failed. The @String@ gives information about the -- source location of the pattern.-data PatternMatchFail = PatternMatchFail String-INSTANCE_TYPEABLE0(PatternMatchFail,patternMatchFailTc,"PatternMatchFail")+data PatternMatchFail = PatternMatchFail String deriving Typeable  instance Show PatternMatchFail where     showsPrec _ (PatternMatchFail err) = showString err -#ifdef __HUGS__-instance Exception PatternMatchFail where-    toException (PatternMatchFail err) = Hugs.Exception.PatternMatchFail err-    fromException (Hugs.Exception.PatternMatchFail err) = Just (PatternMatchFail err)-    fromException _ = Nothing-#else instance Exception PatternMatchFail-#endif  ----- @@ -578,40 +311,24 @@ -- multiple constructors, where some fields are in one constructor -- but not another. The @String@ gives information about the source -- location of the record selector.-data RecSelError = RecSelError String-INSTANCE_TYPEABLE0(RecSelError,recSelErrorTc,"RecSelError")+data RecSelError = RecSelError String deriving Typeable  instance Show RecSelError where     showsPrec _ (RecSelError err) = showString err -#ifdef __HUGS__-instance Exception RecSelError where-    toException (RecSelError err) = Hugs.Exception.RecSelError err-    fromException (Hugs.Exception.RecSelError err) = Just (RecSelError err)-    fromException _ = Nothing-#else instance Exception RecSelError-#endif  -----  -- |An uninitialised record field was used. The @String@ gives -- information about the source location where the record was -- constructed.-data RecConError = RecConError String-INSTANCE_TYPEABLE0(RecConError,recConErrorTc,"RecConError")+data RecConError = RecConError String deriving Typeable  instance Show RecConError where     showsPrec _ (RecConError err) = showString err -#ifdef __HUGS__-instance Exception RecConError where-    toException (RecConError err) = Hugs.Exception.RecConError err-    fromException (Hugs.Exception.RecConError err) = Just (RecConError err)-    fromException _ = Nothing-#else instance Exception RecConError-#endif  ----- @@ -620,40 +337,24 @@ -- multiple constructors, where some fields are in one constructor -- but not another. The @String@ gives information about the source -- location of the record update.-data RecUpdError = RecUpdError String-INSTANCE_TYPEABLE0(RecUpdError,recUpdErrorTc,"RecUpdError")+data RecUpdError = RecUpdError String deriving Typeable  instance Show RecUpdError where     showsPrec _ (RecUpdError err) = showString err -#ifdef __HUGS__-instance Exception RecUpdError where-    toException (RecUpdError err) = Hugs.Exception.RecUpdError err-    fromException (Hugs.Exception.RecUpdError err) = Just (RecUpdError err)-    fromException _ = Nothing-#else instance Exception RecUpdError-#endif  -----  -- |A class method without a definition (neither a default definition, -- nor a definition in the appropriate instance) was called. The -- @String@ gives information about which method it was.-data NoMethodError = NoMethodError String-INSTANCE_TYPEABLE0(NoMethodError,noMethodErrorTc,"NoMethodError")+data NoMethodError = NoMethodError String deriving Typeable  instance Show NoMethodError where     showsPrec _ (NoMethodError err) = showString err -#ifdef __HUGS__-instance Exception NoMethodError where-    toException (NoMethodError err) = Hugs.Exception.NoMethodError err-    fromException (Hugs.Exception.NoMethodError err) = Just (NoMethodError err)-    fromException _ = Nothing-#else instance Exception NoMethodError-#endif  ----- @@ -661,27 +362,18 @@ -- guaranteed not to terminate. Note that there is no guarantee that -- the runtime system will notice whether any given computation is -- guaranteed to terminate or not.-data NonTermination = NonTermination-INSTANCE_TYPEABLE0(NonTermination,nonTerminationTc,"NonTermination")+data NonTermination = NonTermination deriving Typeable  instance Show NonTermination where     showsPrec _ NonTermination = showString "<<loop>>" -#ifdef __HUGS__-instance Exception NonTermination where-    toException NonTermination = Hugs.Exception.NonTermination-    fromException Hugs.Exception.NonTermination = Just NonTermination-    fromException _ = Nothing-#else instance Exception NonTermination-#endif  -----  -- |Thrown when the program attempts to call @atomically@, from the @stm@ -- package, inside another call to @atomically@.-data NestedAtomically = NestedAtomically-INSTANCE_TYPEABLE0(NestedAtomically,nestedAtomicallyTc,"NestedAtomically")+data NestedAtomically = NestedAtomically deriving Typeable  instance Show NestedAtomically where     showsPrec _ NestedAtomically = showString "Control.Concurrent.STM.atomically was nested"@@ -690,9 +382,6 @@  ----- -#endif /* __GLASGOW_HASKELL__ || __HUGS__ */--#ifdef __GLASGOW_HASKELL__ recSelError, recConError, irrefutPatError, runtimeError,   nonExhaustiveGuardsError, patError, noMethodBindingError,   absentError@@ -716,4 +405,3 @@ -- GHC's RTS calls this nestedAtomically :: SomeException nestedAtomically = toException NestedAtomically-#endif
Control/Monad.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -21,9 +21,9 @@       Functor(fmap)     , Monad((>>=), (>>), return, fail) -    , MonadPlus (   -- class context: Monad-          mzero     -- :: (MonadPlus m) => m a-        , mplus     -- :: (MonadPlus m) => m a -> m a -> m a+    , MonadPlus (+          mzero+        , mplus         )     -- * Functions @@ -32,58 +32,55 @@      -- ** Basic @Monad@ functions -    , mapM          -- :: (Monad m) => (a -> m b) -> [a] -> m [b]-    , mapM_         -- :: (Monad m) => (a -> m b) -> [a] -> m ()-    , forM          -- :: (Monad m) => [a] -> (a -> m b) -> m [b]-    , forM_         -- :: (Monad m) => [a] -> (a -> m b) -> m ()-    , sequence      -- :: (Monad m) => [m a] -> m [a]-    , sequence_     -- :: (Monad m) => [m a] -> m ()-    , (=<<)         -- :: (Monad m) => (a -> m b) -> m a -> m b-    , (>=>)         -- :: (Monad m) => (a -> m b) -> (b -> m c) -> (a -> m c)-    , (<=<)         -- :: (Monad m) => (b -> m c) -> (a -> m b) -> (a -> m c)-    , forever       -- :: (Monad m) => m a -> m b+    , mapM+    , mapM_+    , forM+    , forM_+    , sequence+    , sequence_+    , (=<<)+    , (>=>)+    , (<=<)+    , forever     , void      -- ** Generalisations of list functions -    , join          -- :: (Monad m) => m (m a) -> m a-    , msum          -- :: (MonadPlus m) => [m a] -> m a-    , mfilter       -- :: (MonadPlus m) => (a -> Bool) -> m a -> m a-    , filterM       -- :: (Monad m) => (a -> m Bool) -> [a] -> m [a]-    , mapAndUnzipM  -- :: (Monad m) => (a -> m (b,c)) -> [a] -> m ([b], [c])-    , zipWithM      -- :: (Monad m) => (a -> b -> m c) -> [a] -> [b] -> m [c]-    , zipWithM_     -- :: (Monad m) => (a -> b -> m c) -> [a] -> [b] -> m ()-    , foldM         -- :: (Monad m) => (a -> b -> m a) -> a -> [b] -> m a -    , foldM_        -- :: (Monad m) => (a -> b -> m a) -> a -> [b] -> m ()-    , replicateM    -- :: (Monad m) => Int -> m a -> m [a]-    , replicateM_   -- :: (Monad m) => Int -> m a -> m ()+    , join+    , msum+    , mfilter+    , filterM+    , mapAndUnzipM+    , zipWithM+    , zipWithM_+    , foldM+    , foldM_+    , replicateM+    , replicateM_      -- ** Conditional execution of monadic expressions -    , guard         -- :: (MonadPlus m) => Bool -> m ()-    , when          -- :: (Monad m) => Bool -> m () -> m ()-    , unless        -- :: (Monad m) => Bool -> m () -> m ()+    , guard+    , when+    , unless      -- ** Monadic lifting operators -    , liftM         -- :: (Monad m) => (a -> b) -> (m a -> m b)-    , liftM2        -- :: (Monad m) => (a -> b -> c) -> (m a -> m b -> m c)-    , liftM3        -- :: ...-    , liftM4        -- :: ...-    , liftM5        -- :: ...+    , liftM+    , liftM2+    , liftM3+    , liftM4+    , liftM5 -    , ap            -- :: (Monad m) => m (a -> b) -> m a -> m b+    , ap      ) where  import Data.Maybe -#ifdef __GLASGOW_HASKELL__ import GHC.List import GHC.Base-#endif -#ifdef __GLASGOW_HASKELL__ infixr 1 =<<  -- -----------------------------------------------------------------------------@@ -117,8 +114,6 @@ mapM_           :: Monad m => (a -> m b) -> [a] -> m () {-# INLINE mapM_ #-} mapM_ f as      =  sequence_ (map f as)--#endif  /* __GLASGOW_HASKELL__ */  -- ----------------------------------------------------------------------------- -- The MonadPlus class definition
Control/Monad/Fix.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -19,23 +18,15 @@ -----------------------------------------------------------------------------  module Control.Monad.Fix (-        MonadFix(-           mfix -- :: (a -> m a) -> m a-         ),-        fix     -- :: (a -> a) -> a+        MonadFix(mfix),+        fix   ) where  import Prelude import System.IO import Data.Function (fix)-#ifdef __HUGS__-import Hugs.Prelude (MonadFix(mfix))-#endif-#if defined(__GLASGOW_HASKELL__) import GHC.ST-#endif -#ifndef __HUGS__ -- | Monads having fixed points with a \'knot-tying\' semantics. -- Instances of 'MonadFix' should satisfy the following laws: --@@ -60,7 +51,6 @@         -- output fed back as the input.  Hence @f@ should not be strict,         -- for then @'mfix' f@ would diverge.         mfix :: (a -> m a) -> m a-#endif /* !__HUGS__ */  -- Instances of MonadFix for Prelude monads @@ -85,8 +75,5 @@              where unRight (Right x) = x                    unRight (Left  _) = error "mfix Either: Left" -#if defined(__GLASGOW_HASKELL__) instance MonadFix (ST s) where         mfix = fixST-#endif-
Control/Monad/Instances.hs view
@@ -1,7 +1,4 @@ {-# LANGUAGE Safe #-}-{-# OPTIONS_NHC98 --prelude #-}--- This module deliberately declares orphan instances:-{-# OPTIONS_GHC -fno-warn-orphans #-}  ----------------------------------------------------------------------------- -- |@@ -18,6 +15,7 @@ -- 'Functor' and 'Monad' instances for @(->) r@ and -- 'Functor' instances for @(,) a@ and @'Either' a@. -module Control.Monad.Instances (Functor(..),Monad(..)) where+module Control.Monad.Instances {-# DEPRECATED "This module now contains no instances and will be removed in the future" #-} -- deprecated in 7.8+    (Functor(..),Monad(..)) where  import Prelude
Control/Monad/ST.hs view
@@ -14,40 +14,22 @@ -- described in the PLDI \'94 paper by John Launchbury and Simon Peyton -- Jones /Lazy Functional State Threads/. --+-- References (variables) that can be used within the @ST@ monad are+-- provided by "Data.STRef", and arrays are provided by+-- "Data.Array.ST".+ -----------------------------------------------------------------------------  module Control.Monad.ST (         -- * The 'ST' Monad         ST,             -- abstract, instance of Functor, Monad, Typeable.-        runST,          -- :: (forall s. ST s a) -> a-        fixST,          -- :: (a -> ST s a) -> ST s a+        runST,+        fixST,          -- * Converting 'ST' to 'IO'         RealWorld,              -- abstract-        stToIO,                 -- :: ST RealWorld a -> IO a--        -- * Unsafe Functions-        unsafeInterleaveST,-        unsafeIOToST,-        unsafeSTToIO+        stToIO,     ) where  import Control.Monad.ST.Safe-import qualified Control.Monad.ST.Unsafe as U--{-# DEPRECATED unsafeInterleaveST, unsafeIOToST, unsafeSTToIO-              "Please import from Control.Monad.ST.Unsafe instead; This will be removed in the next release"- #-}--{-# INLINE unsafeInterleaveST #-}-unsafeInterleaveST :: ST s a -> ST s a-unsafeInterleaveST = U.unsafeInterleaveST--{-# INLINE unsafeIOToST #-}-unsafeIOToST :: IO a -> ST s a-unsafeIOToST = U.unsafeIOToST--{-# INLINE unsafeSTToIO #-}-unsafeSTToIO :: ST s a -> IO a-unsafeSTToIO = U.unsafeSTToIO 
Control/Monad/ST/Imp.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -18,54 +17,22 @@ -- ----------------------------------------------------------------------------- --- #hide module Control.Monad.ST.Imp (         -- * The 'ST' Monad         ST,             -- abstract, instance of Functor, Monad, Typeable.-        runST,          -- :: (forall s. ST s a) -> a-        fixST,          -- :: (a -> ST s a) -> ST s a+        runST,+        fixST,          -- * Converting 'ST' to 'IO'         RealWorld,              -- abstract-        stToIO,                 -- :: ST RealWorld a -> IO a+        stToIO,          -- * Unsafe operations-        unsafeInterleaveST,     -- :: ST s a -> ST s a-        unsafeIOToST,           -- :: IO a -> ST s a-        unsafeSTToIO            -- :: ST s a -> IO a+        unsafeInterleaveST,+        unsafeIOToST,+        unsafeSTToIO     ) where -#if !defined(__GLASGOW_HASKELL__)-import Control.Monad.Fix-#endif--#include "Typeable.h"--#if defined(__GLASGOW_HASKELL__) import GHC.ST           ( ST, runST, fixST, unsafeInterleaveST ) import GHC.Base         ( RealWorld ) import GHC.IO           ( stToIO, unsafeIOToST, unsafeSTToIO )-#elif defined(__HUGS__)-import Data.Typeable-import Hugs.ST-import qualified Hugs.LazyST as LazyST-#endif--#if defined(__HUGS__)-INSTANCE_TYPEABLE2(ST,sTTc,"ST")-INSTANCE_TYPEABLE0(RealWorld,realWorldTc,"RealWorld")--fixST :: (a -> ST s a) -> ST s a-fixST f = LazyST.lazyToStrictST (LazyST.fixST (LazyST.strictToLazyST . f))--unsafeInterleaveST :: ST s a -> ST s a-unsafeInterleaveST =-    LazyST.lazyToStrictST . LazyST.unsafeInterleaveST . LazyST.strictToLazyST-#endif--#if !defined(__GLASGOW_HASKELL__)-instance MonadFix (ST s) where-        mfix = fixST-#endif--
Control/Monad/ST/Lazy.hs view
@@ -28,24 +28,7 @@         -- * Converting 'ST' To 'IO'         RealWorld,         stToIO,--        -- * Unsafe Functions-        unsafeInterleaveST,-        unsafeIOToST     ) where  import Control.Monad.ST.Lazy.Safe-import qualified Control.Monad.ST.Lazy.Unsafe as U--{-# DEPRECATED unsafeInterleaveST, unsafeIOToST-              "Please import from Control.Monad.ST.Lazy.Unsafe instead; This will be removed in the next release"- #-}--{-# INLINE unsafeInterleaveST #-}-unsafeInterleaveST :: ST s a -> ST s a-unsafeInterleaveST = U.unsafeInterleaveST--{-# INLINE unsafeIOToST #-}-unsafeIOToST :: IO a -> ST s a-unsafeIOToST = U.unsafeIOToST 
Control/Monad/ST/Lazy/Imp.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, MagicHash, UnboxedTuples, Rank2Types #-}+{-# LANGUAGE MagicHash, UnboxedTuples, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -18,7 +18,6 @@ -- ----------------------------------------------------------------------------- --- #hide module Control.Monad.ST.Lazy.Imp (         -- * The 'ST' monad         ST,@@ -44,16 +43,9 @@ import qualified Control.Monad.ST.Safe as ST import qualified Control.Monad.ST.Unsafe as ST -#ifdef __GLASGOW_HASKELL__ import qualified GHC.ST as GHC.ST import GHC.Base-#endif -#ifdef __HUGS__-import Hugs.LazyST-#endif--#ifdef __GLASGOW_HASKELL__ -- | The lazy state-transformer monad. -- A computation of type @'ST' s a@ transforms an internal state indexed -- by @s@, and returns a value of type @a@.@@ -111,7 +103,6 @@                    (r,s') = m_r s                 in                    (r,s'))-#endif  instance MonadFix (ST s) where         mfix = fixST@@ -119,7 +110,6 @@ -- --------------------------------------------------------------------------- -- Strict <--> Lazy -#ifdef __GLASGOW_HASKELL__ {-| Convert a strict 'ST' computation into a lazy one.  The strict state thread passed to 'strictToLazyST' is not performed until the result of@@ -140,7 +130,6 @@ lazyToStrictST :: ST s a -> ST.ST s a lazyToStrictST (ST m) = GHC.ST.ST $ \s ->         case (m (S# s)) of (a, S# s') -> (# s', a #)-#endif  -- | A monad transformer embedding lazy state transformers in the 'IO' -- monad.  The 'RealWorld' parameter indicates that the internal state@@ -152,10 +141,8 @@ -- --------------------------------------------------------------------------- -- Strict <--> Lazy -#ifdef __GLASGOW_HASKELL__ unsafeInterleaveST :: ST s a -> ST s a unsafeInterleaveST = strictToLazyST . ST.unsafeInterleaveST . lazyToStrictST-#endif  unsafeIOToST :: IO a -> ST s a unsafeIOToST = strictToLazyST . ST.unsafeIOToST
Control/Monad/ST/Safe.hs view
@@ -20,13 +20,13 @@  module Control.Monad.ST.Safe (         -- * The 'ST' Monad-        ST,             -- abstract, instance of Functor, Monad, Typeable.-        runST,          -- :: (forall s. ST s a) -> a-        fixST,          -- :: (a -> ST s a) -> ST s a+        ST,             -- abstract+        runST,+        fixST,          -- * Converting 'ST' to 'IO'         RealWorld,              -- abstract-        stToIO,                 -- :: ST RealWorld a -> IO a+        stToIO,     ) where  import Control.Monad.ST.Imp
Control/Monad/Zip.hs view
@@ -47,6 +47,7 @@     -- munzip is a member of the class because sometimes     -- you can implement it more efficiently than the     -- above default code.  See Trac #4370 comment by giorgidze+    {-# MINIMAL mzip | mzipWith #-}  instance MonadZip [] where     mzip     = zip
Data/Bits.hs view
@@ -6,7 +6,7 @@ -- Module      :  Data.Bits -- Copyright   :  (c) The University of Glasgow 2001 -- License     :  BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer  :  libraries@haskell.org -- Stability   :  experimental -- Portability :  portable@@ -19,56 +19,52 @@ -- ----------------------------------------------------------------------------- -module Data.Bits ( +module Data.Bits (   Bits(-    (.&.), (.|.), xor, -- :: a -> a -> a-    complement,        -- :: a -> a-    shift,             -- :: a -> Int -> a-    rotate,            -- :: a -> Int -> a-    bit,               -- :: Int -> a-    setBit,            -- :: a -> Int -> a-    clearBit,          -- :: a -> Int -> a-    complementBit,     -- :: a -> Int -> a-    testBit,           -- :: a -> Int -> Bool-    bitSize,           -- :: a -> Int-    isSigned,          -- :: a -> Bool-    shiftL, shiftR,    -- :: a -> Int -> a-    unsafeShiftL, unsafeShiftR,  -- :: a -> Int -> a-    rotateL, rotateR,  -- :: a -> Int -> a-    popCount           -- :: a -> Int+    (.&.), (.|.), xor,+    complement,+    shift,+    rotate,+    zeroBits,+    bit,+    setBit,+    clearBit,+    complementBit,+    testBit,+    bitSizeMaybe,+    bitSize,+    isSigned,+    shiftL, shiftR,+    unsafeShiftL, unsafeShiftR,+    rotateL, rotateR,+    popCount   ),+  FiniteBits(finiteBitSize),    bitDefault,   testBitDefault,   popCountDefault-  -- instance Bits Int-  -- instance Bits Integer  ) where  -- Defines the @Bits@ class containing bit-based operations. -- See library document for details on the semantics of the -- individual operations. -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) #include "MachDeps.h"-#endif -#ifdef __GLASGOW_HASKELL__+import Data.Maybe import GHC.Enum import GHC.Num import GHC.Base-#endif -#ifdef __HUGS__-import Hugs.Bits-#endif- infixl 8 `shift`, `rotate`, `shiftL`, `shiftR`, `rotateL`, `rotateR` infixl 7 .&. infixl 6 `xor` infixl 5 .|. -{-| +{-# DEPRECATED bitSize "Use 'bitSizeMaybe' or 'finiteBitSize' instead" #-} -- deprecated in 7.8++{-| The 'Bits' class defines bitwise operations over integral types.  * Bits are numbered from 0 with bit 0 being the least@@ -77,7 +73,7 @@ Minimal complete definition: '.&.', '.|.', 'xor', 'complement', ('shift' or ('shiftL' and 'shiftR')), ('rotate' or ('rotateL' and 'rotateR')), 'bitSize', 'isSigned', 'testBit', 'bit', and 'popCount'.  The latter three can-be implemented using `testBitDefault', 'bitDefault, and 'popCountDefault', if+be implemented using `testBitDefault', 'bitDefault', and 'popCountDefault', if @a@ is also an instance of 'Num'. -} class Eq a => Bits a where@@ -136,7 +132,26 @@                   | i>0  = (x `shift` i) .|. (x `shift` (i-bitSize x))     -} -    -- | @bit i@ is a value with the @i@th bit set and all other bits clear+    -- | 'zeroBits' is the value with all bits unset.+    --+    -- The following laws ought to hold (for all valid bit indices @/n/@):+    --+    --   * @'clearBit' 'zeroBits' /n/ == 'zeroBits'@+    --   * @'setBit'   'zeroBits' /n/ == 'bit' /n/@+    --   * @'testBit'  'zeroBits' /n/ == False@+    --   * @'popCount' 'zeroBits'   == 0@+    --+    -- This method uses @'clearBit' ('bit' 0) 0@ as its default+    -- implementation (which ought to be equivalent to 'zeroBits' for+    -- types which possess a 0th bit).+    --+    -- /Since: 4.7.0.0/+    zeroBits :: a+    zeroBits = clearBit (bit 0) 0++    -- | @bit /i/@ is a value with the @/i/@th bit set and all other bits clear.+    --+    -- See also 'zeroBits'.     bit               :: Int -> a      -- | @x \`setBit\` i@ is the same as @x .|. bit i@@@ -152,6 +167,14 @@     testBit           :: a -> Int -> Bool      {-| Return the number of bits in the type of the argument.  The actual+        value of the argument is ignored.  Returns Nothing+        for types that do not have a fixed bitsize, like 'Integer'.++        /Since: 4.7.0.0/+        -}+    bitSizeMaybe      :: a -> Maybe Int++    {-| Return the number of bits in the type of the argument.  The actual         value of the argument is ignored.  The function 'bitSize' is         undefined for types that do not have a fixed bitsize, like 'Integer'.         -}@@ -182,7 +205,9 @@         result is undefined for negative shift amounts and shift amounts         greater or equal to the 'bitSize'. -        Defaults to 'shiftL' unless defined explicitly by an instance. -}+        Defaults to 'shiftL' unless defined explicitly by an instance.++        /Since: 4.5.0.0/ -}     unsafeShiftL            :: a -> Int -> a     {-# INLINE unsafeShiftL #-}     x `unsafeShiftL` i = x `shiftL` i@@ -209,7 +234,9 @@         i.e. they fill the top bits with 1 if the @x@ is negative         and with 0 otherwise. -        Defaults to 'shiftR' unless defined explicitly by an instance. -}+        Defaults to 'shiftR' unless defined explicitly by an instance.++        /Since: 4.5.0.0/ -}     unsafeShiftR            :: a -> Int -> a     {-# INLINE unsafeShiftR #-}     x `unsafeShiftR` i = x `shiftR` i@@ -235,27 +262,60 @@     x `rotateR` i = x `rotate` (-i)      {-| Return the number of set bits in the argument.  This number is-        known as the population count or the Hamming weight. -}+        known as the population count or the Hamming weight.++        /Since: 4.5.0.0/ -}     popCount          :: a -> Int +    {-# MINIMAL (.&.), (.|.), xor, complement,+                (shift | (shiftL, shiftR)),+                (rotate | (rotateL, rotateR)),+                bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-}++-- |The 'FiniteBits' class denotes types with a finite, fixed number of bits.+--+-- /Since: 4.7.0.0/+class Bits b => FiniteBits b where+    -- | Return the number of bits in the type of the argument.+    -- The actual value of the argument is ignored. Moreover, 'finiteBitSize'+    -- is total, in contrast to the deprecated 'bitSize' function it replaces.+    --+    -- @+    -- 'finiteBitSize' = 'bitSize'+    -- 'bitSizeMaybe' = 'Just' . 'finiteBitSize'+    -- @+    --+    -- /Since: 4.7.0.0/+    finiteBitSize :: b -> Int++-- The defaults below are written with lambdas so that e.g.+--     bit = bitDefault+-- is fully applied, so inlining will happen+ -- | Default implementation for 'bit'. -- -- Note that: @bitDefault i = 1 `shiftL` i@+--+-- /Since: 4.6.0.0/ bitDefault :: (Bits a, Num a) => Int -> a-bitDefault i = 1 `shiftL` i+bitDefault = \i -> 1 `shiftL` i {-# INLINE bitDefault #-}  -- | Default implementation for 'testBit'. -- -- Note that: @testBitDefault x i = (x .&. bit i) /= 0@+--+-- /Since: 4.6.0.0/ testBitDefault ::  (Bits a, Num a) => a -> Int -> Bool-testBitDefault x i = (x .&. bit i) /= 0+testBitDefault = \x i -> (x .&. bit i) /= 0 {-# INLINE testBitDefault #-}  -- | Default implementation for 'popCount'. -- -- This implementation is intentionally naive. Instances are expected to provide -- an optimized implementation for their size.+--+-- /Since: 4.6.0.0/ popCountDefault :: (Bits a, Num a) => a -> Int popCountDefault = go 0  where@@ -263,91 +323,80 @@    go c w = go (c+1) (w .&. (w - 1)) -- clear the least significant {-# INLINABLE popCountDefault #-} ++-- Interpret 'Bool' as 1-bit bit-field; /Since: 4.7.0.0/+instance Bits Bool where+    (.&.) = (&&)++    (.|.) = (||)++    xor = (/=)++    complement = not++    shift x 0 = x+    shift _ _ = False++    rotate x _ = x++    bit 0 = True+    bit _ = False++    testBit x 0 = x+    testBit _ _ = False++    bitSizeMaybe _ = Just 1++    bitSize _ = 1++    isSigned _ = False++    popCount False = 0+    popCount True  = 1++instance FiniteBits Bool where+    finiteBitSize _ = 1++ instance Bits Int where     {-# INLINE shift #-}     {-# INLINE bit #-}     {-# INLINE testBit #-} -#ifdef __GLASGOW_HASKELL__+    zeroBits = 0+     bit     = bitDefault      testBit = testBitDefault -    (I# x#) .&.   (I# y#)  = I# (word2Int# (int2Word# x# `and#` int2Word# y#))--    (I# x#) .|.   (I# y#)  = I# (word2Int# (int2Word# x# `or#`  int2Word# y#))--    (I# x#) `xor` (I# y#)  = I# (word2Int# (int2Word# x# `xor#` int2Word# y#))--    complement (I# x#)     = I# (word2Int# (int2Word# x# `xor#` int2Word# (-1#)))-+    (I# x#) .&.   (I# y#)          = I# (x# `andI#` y#)+    (I# x#) .|.   (I# y#)          = I# (x# `orI#`  y#)+    (I# x#) `xor` (I# y#)          = I# (x# `xorI#` y#)+    complement (I# x#)             = I# (notI# x#)     (I# x#) `shift` (I# i#)-        | i# >=# 0#        = I# (x# `iShiftL#` i#)-        | otherwise        = I# (x# `iShiftRA#` negateInt# i#)-    (I# x#) `shiftL` (I# i#) = I# (x# `iShiftL#` i#)+        | isTrue# (i# >=# 0#)      = I# (x# `iShiftL#` i#)+        | otherwise                = I# (x# `iShiftRA#` negateInt# i#)+    (I# x#) `shiftL` (I# i#)       = I# (x# `iShiftL#` i#)     (I# x#) `unsafeShiftL` (I# i#) = I# (x# `uncheckedIShiftL#` i#)-    (I# x#) `shiftR` (I# i#) = I# (x# `iShiftRA#` i#)+    (I# x#) `shiftR` (I# i#)       = I# (x# `iShiftRA#` i#)     (I# x#) `unsafeShiftR` (I# i#) = I# (x# `uncheckedIShiftRA#` i#)      {-# INLINE rotate #-} 	-- See Note [Constant folding for rotate]     (I# x#) `rotate` (I# i#) =-        I# (word2Int# ((x'# `uncheckedShiftL#` i'#) `or#`-                       (x'# `uncheckedShiftRL#` (wsib -# i'#))))+        I# ((x# `uncheckedIShiftL#` i'#) `orI#` (x# `uncheckedIShiftRL#` (wsib -# i'#)))       where-        !x'# = int2Word# x#-        !i'# = word2Int# (int2Word# i# `and#` int2Word# (wsib -# 1#))+        !i'# = i# `andI#` (wsib -# 1#)         !wsib = WORD_SIZE_IN_BITS#   {- work around preprocessor problem (??) -}-    bitSize  _             = WORD_SIZE_IN_BITS+    bitSizeMaybe i         = Just (finiteBitSize i)+    bitSize i              = finiteBitSize i      popCount (I# x#) = I# (word2Int# (popCnt# (int2Word# x#))) -#else /* !__GLASGOW_HASKELL__ */--    popCount               = popCountDefault--#ifdef __HUGS__-    (.&.)                  = primAndInt-    (.|.)                  = primOrInt-    xor                    = primXorInt-    complement             = primComplementInt-    shift                  = primShiftInt-    bit                    = primBitInt-    testBit                = primTestInt-    bitSize _              = SIZEOF_HSINT*8-#elif defined(__NHC__)-    (.&.)                  = nhc_primIntAnd-    (.|.)                  = nhc_primIntOr-    xor                    = nhc_primIntXor-    complement             = nhc_primIntCompl-    shiftL                 = nhc_primIntLsh-    shiftR                 = nhc_primIntRsh-    bit                    = bitDefault-    testBit                = testBitDefault-    bitSize _              = 32-#endif /* __NHC__ */--    x `rotate`  i-        | i<0 && x<0       = let left = i+bitSize x in-                             ((x `shift` i) .&. complement ((-1) `shift` left))-                             .|. (x `shift` left)-        | i<0              = (x `shift` i) .|. (x `shift` (i+bitSize x))-        | i==0             = x-        | i>0              = (x `shift` i) .|. (x `shift` (i-bitSize x))--#endif /* !__GLASGOW_HASKELL__ */-     isSigned _             = True -#ifdef __NHC__-foreign import ccall nhc_primIntAnd :: Int -> Int -> Int-foreign import ccall nhc_primIntOr  :: Int -> Int -> Int-foreign import ccall nhc_primIntXor :: Int -> Int -> Int-foreign import ccall nhc_primIntLsh :: Int -> Int -> Int-foreign import ccall nhc_primIntRsh :: Int -> Int -> Int-foreign import ccall nhc_primIntCompl :: Int -> Int-#endif /* __NHC__ */+instance FiniteBits Int where+    finiteBitSize _ = WORD_SIZE_IN_BITS -#if defined(__GLASGOW_HASKELL__) instance Bits Word where     {-# INLINE shift #-}     {-# INLINE bit #-}@@ -359,94 +408,47 @@     complement (W# x#)       = W# (x# `xor#` mb#)         where !(W# mb#) = maxBound     (W# x#) `shift` (I# i#)-        | i# >=# 0#          = W# (x# `shiftL#` i#)-        | otherwise          = W# (x# `shiftRL#` negateInt# i#)-    (W# x#) `shiftL` (I# i#) = W# (x# `shiftL#` i#)+        | isTrue# (i# >=# 0#)      = W# (x# `shiftL#` i#)+        | otherwise                = W# (x# `shiftRL#` negateInt# i#)+    (W# x#) `shiftL` (I# i#)       = W# (x# `shiftL#` i#)     (W# x#) `unsafeShiftL` (I# i#) = W# (x# `uncheckedShiftL#` i#)-    (W# x#) `shiftR` (I# i#) = W# (x# `shiftRL#` i#)+    (W# x#) `shiftR` (I# i#)       = W# (x# `shiftRL#` i#)     (W# x#) `unsafeShiftR` (I# i#) = W# (x# `uncheckedShiftRL#` i#)     (W# x#) `rotate` (I# i#)-        | i'# ==# 0# = W# x#+        | isTrue# (i'# ==# 0#) = W# x#         | otherwise  = W# ((x# `uncheckedShiftL#` i'#) `or#` (x# `uncheckedShiftRL#` (wsib -# i'#)))         where-        !i'# = word2Int# (int2Word# i# `and#` int2Word# (wsib -# 1#))+        !i'# = i# `andI#` (wsib -# 1#)         !wsib = WORD_SIZE_IN_BITS#  {- work around preprocessor problem (??) -}-    bitSize  _               = WORD_SIZE_IN_BITS+    bitSizeMaybe i           = Just (finiteBitSize i)+    bitSize i                = finiteBitSize i     isSigned _               = False     popCount (W# x#)         = I# (word2Int# (popCnt# x#))     bit                      = bitDefault     testBit                  = testBitDefault-#endif +instance FiniteBits Word where+    finiteBitSize _ = WORD_SIZE_IN_BITS+ instance Bits Integer where-#if defined(__GLASGOW_HASKELL__)    (.&.) = andInteger    (.|.) = orInteger    xor = xorInteger    complement = complementInteger    shift x i@(I# i#) | i >= 0    = shiftLInteger x i#                      | otherwise = shiftRInteger x (negateInt# i#)-#else-   -- reduce bitwise binary operations to special cases we can handle--   x .&. y   | x<0 && y<0 = complement (complement x `posOr` complement y)-             | otherwise  = x `posAnd` y-   -   x .|. y   | x<0 || y<0 = complement (complement x `posAnd` complement y)-             | otherwise  = x `posOr` y-   -   x `xor` y | x<0 && y<0 = complement x `posXOr` complement y-             | x<0        = complement (complement x `posXOr` y)-             |        y<0 = complement (x `posXOr` complement y)-             | otherwise  = x `posXOr` y--   -- assuming infinite 2's-complement arithmetic-   complement a = -1 - a-   shift x i | i >= 0    = x * 2^i-             | otherwise = x `div` 2^(-i)-#endif+   testBit x (I# i) = testBitInteger x i +   zeroBits   = 0    bit        = bitDefault-   testBit    = testBitDefault    popCount   = popCountDefault     rotate x i = shift x i   -- since an Integer never wraps around +   bitSizeMaybe _ = Nothing    bitSize _  = error "Data.Bits.bitSize(Integer)"    isSigned _ = True -#if !defined(__GLASGOW_HASKELL__)--- Crude implementation of bitwise operations on Integers: convert them--- to finite lists of Ints (least significant first), zip and convert--- back again.---- posAnd requires at least one argument non-negative--- posOr and posXOr require both arguments non-negative--posAnd, posOr, posXOr :: Integer -> Integer -> Integer-posAnd x y   = fromInts $ zipWith (.&.) (toInts x) (toInts y)-posOr x y    = fromInts $ longZipWith (.|.) (toInts x) (toInts y)-posXOr x y   = fromInts $ longZipWith xor (toInts x) (toInts y)--longZipWith :: (a -> a -> a) -> [a] -> [a] -> [a]-longZipWith f xs [] = xs-longZipWith f [] ys = ys-longZipWith f (x:xs) (y:ys) = f x y:longZipWith f xs ys--toInts :: Integer -> [Int]-toInts n-    | n == 0 = []-    | otherwise = mkInt (n `mod` numInts):toInts (n `div` numInts)-  where mkInt n | n > toInteger(maxBound::Int) = fromInteger (n-numInts)-                | otherwise = fromInteger n--fromInts :: [Int] -> Integer-fromInts = foldr catInt 0-    where catInt d n = (if d<0 then n+1 else n)*numInts + toInteger d--numInts = toInteger (maxBound::Int) - toInteger (minBound::Int) + 1-#endif /* !__GLASGOW_HASKELL__ */- {- 	Note [Constant folding for rotate] 	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The INLINE on the Int instance of rotate enables it to be constant@@ -470,5 +472,5 @@            __DEFAULT -> Main.$wfold (+# ww_sOb 56) (+# wild_XM 1);            10000000 -> ww_sOb          }--} +-} 
Data/Bool.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -19,24 +19,20 @@    -- * Booleans    Bool(..),    -- ** Operations -   (&&),        -- :: Bool -> Bool -> Bool-   (||),        -- :: Bool -> Bool -> Bool-   not,         -- :: Bool -> Bool-   otherwise,   -- :: Bool+   (&&),+   (||),+   not,+   otherwise,+   bool,   ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base-#endif -#ifdef __NHC__-import Prelude-import Prelude-  ( Bool(..)-  , (&&)-  , (||)-  , not-  , otherwise-  )-#endif-+-- | Case analysis for the 'Bool' type.+-- @bool a b p@ evaluates to @a@ when @p@ is @False@, and evaluates to @b@+-- when @p@ is @True@.+--+-- /Since: 4.7.0.0/+bool :: a -> a -> Bool -> a+bool f _ False = f+bool _ t True  = t
Data/Char.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -36,23 +36,22 @@     , GeneralCategory(..), generalCategory      -- * Case conversion-    , toUpper, toLower, toTitle  -- :: Char -> Char+    , toUpper, toLower, toTitle      -- * Single digit characters-    , digitToInt        -- :: Char -> Int-    , intToDigit        -- :: Int  -> Char+    , digitToInt+    , intToDigit      -- * Numeric representations-    , ord               -- :: Char -> Int-    , chr               -- :: Int  -> Char+    , ord+    , chr      -- * String representations-    , showLitChar       -- :: Char -> ShowS-    , lexLitChar        -- :: ReadS String-    , readLitChar       -- :: ReadS Char +    , showLitChar+    , lexLitChar+    , readLitChar     ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Arr (Ix) import GHC.Char@@ -62,22 +61,7 @@ import GHC.Unicode import GHC.Num import GHC.Enum-#endif -#ifdef __HUGS__-import Hugs.Prelude (Ix)-import Hugs.Char-#endif--#ifdef __NHC__-import Prelude-import Prelude(Char,String)-import Char-import Ix-import NHC.FFI (CInt)-foreign import ccall unsafe "WCsubst.h u_gencat" wgencat :: CInt -> CInt-#endif- -- | Convert a single digit 'Char' to the corresponding 'Int'.   -- This function fails unless its argument satisfies 'isHexDigit', -- but recognises both upper and lower-case hexadecimal digits@@ -89,12 +73,6 @@  | c >= 'A' && c <= 'F' =  ord c - ord 'A' + 10  | otherwise            =  error ("Char.digitToInt: not a digit " ++ show c) -- sigh -#ifndef __GLASGOW_HASKELL__-isAsciiUpper, isAsciiLower :: Char -> Bool-isAsciiLower c          =  c >= 'a' && c <= 'z'-isAsciiUpper c          =  c >= 'A' && c <= 'Z'-#endif- -- | Unicode General Categories (column 2 of the UnicodeData table) -- in the order they are listed in the Unicode standard. @@ -133,12 +111,7 @@  -- | The Unicode general category of the character. generalCategory :: Char -> GeneralCategory-#if defined(__GLASGOW_HASKELL__) || defined(__NHC__) generalCategory c = toEnum $ fromIntegral $ wgencat $ fromIntegral $ ord c-#endif-#ifdef __HUGS__-generalCategory c = toEnum (primUniGenCat c)-#endif  -- derived character classifiers @@ -202,10 +175,4 @@         LineSeparator           -> True         ParagraphSeparator      -> True         _                       -> False--#ifdef __NHC__--- dummy implementation-toTitle :: Char -> Char-toTitle = toUpper-#endif 
+ Data/Coerce.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE Unsafe #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE StandaloneDeriving #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Coerce+-- Copyright   :  (c) The University of Glasgow 2001+-- License     :  BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  provisional+-- Portability :  portable+--+-- Safe coercions between data types.+--+-- More in-depth information can be found on the+-- <https://ghc.haskell.org/trac/ghc/wiki/Roles Roles wiki page>+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++module Data.Coerce+        ( -- * Safe coercions+          coerce, Coercible,+        ) where+import GHC.Prim (coerce, Coercible)
Data/Complex.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, DeriveDataTypeable #-}-#ifdef __GLASGOW_HASKELL__+{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -23,39 +21,24 @@         -- * Rectangular form           Complex((:+)) -        , realPart      -- :: (RealFloat a) => Complex a -> a-        , imagPart      -- :: (RealFloat a) => Complex a -> a+        , realPart+        , imagPart         -- * Polar form-        , mkPolar       -- :: (RealFloat a) => a -> a -> Complex a-        , cis           -- :: (RealFloat a) => a -> Complex a-        , polar         -- :: (RealFloat a) => Complex a -> (a,a)-        , magnitude     -- :: (RealFloat a) => Complex a -> a-        , phase         -- :: (RealFloat a) => Complex a -> a+        , mkPolar+        , cis+        , polar+        , magnitude+        , phase         -- * Conjugate-        , conjugate     -- :: (RealFloat a) => Complex a -> Complex a--        -- Complex instances:-        ---        --  (RealFloat a) => Eq         (Complex a)-        --  (RealFloat a) => Read       (Complex a)-        --  (RealFloat a) => Show       (Complex a)-        --  (RealFloat a) => Num        (Complex a)-        --  (RealFloat a) => Fractional (Complex a)-        --  (RealFloat a) => Floating   (Complex a)+        , conjugate          )  where  import Prelude  import Data.Typeable-#ifdef __GLASGOW_HASKELL__ import Data.Data (Data)-#endif -#ifdef __HUGS__-import Hugs.Prelude(Num(fromInt), Fractional(fromDouble))-#endif- infix  6  :+  -- -----------------------------------------------------------------------------@@ -69,11 +52,7 @@ data Complex a   = !a :+ !a    -- ^ forms a complex number from its real and imaginary                 -- rectangular components.-# if __GLASGOW_HASKELL__-        deriving (Eq, Show, Read, Data)-# else-        deriving (Eq, Show, Read)-# endif+        deriving (Eq, Show, Read, Data, Typeable)  -- ----------------------------------------------------------------------------- -- Functions over Complex@@ -130,9 +109,6 @@ -- ----------------------------------------------------------------------------- -- Instances of Complex -#include "Typeable.h"-INSTANCE_TYPEABLE1(Complex,complexTc,"Complex")- instance  (RealFloat a) => Num (Complex a)  where     {-# SPECIALISE instance Num (Complex Float) #-}     {-# SPECIALISE instance Num (Complex Double) #-}@@ -144,9 +120,6 @@     signum (0:+0)       =  0     signum z@(x:+y)     =  x/r :+ y/r  where r = magnitude z     fromInteger n       =  fromInteger n :+ 0-#ifdef __HUGS__-    fromInt n           =  fromInt n :+ 0-#endif  instance  (RealFloat a) => Fractional (Complex a)  where     {-# SPECIALISE instance Fractional (Complex Float) #-}@@ -158,9 +131,6 @@                                  d   = x'*x'' + y'*y''      fromRational a      =  fromRational a :+ 0-#ifdef __HUGS__-    fromDouble a        =  fromDouble a :+ 0-#endif  instance  (RealFloat a) => Floating (Complex a) where     {-# SPECIALISE instance Floating (Complex Float) #-}
Data/Data.hs view
@@ -1,5 +1,7 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, Rank2Types, ScopedTypeVariables #-}+{-# LANGUAGE Trustworthy, FlexibleInstances #-}+{-# LANGUAGE RankNTypes, ScopedTypeVariables, PolyKinds #-}+{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable, TypeOperators,+             GADTs #-}  ----------------------------------------------------------------------------- -- |@@ -32,10 +34,10 @@          -- * The Data class for processing constructor applications         Data(-                gfoldl,         -- :: ... -> a -> c a-                gunfold,        -- :: ... -> Constr -> c a-                toConstr,       -- :: a -> Constr-                dataTypeOf,     -- :: a -> DataType+                gfoldl,+                gunfold,+                toConstr,+                dataTypeOf,                 dataCast1,      -- mediate types and unary type constructors                 dataCast2,      -- mediate types and binary type constructors                 -- Generic maps defined in terms of gfoldl @@ -50,59 +52,54 @@             ),          -- * Datatype representations-        DataType,       -- abstract, instance of: Show+        DataType,       -- abstract         -- ** Constructors-        mkDataType,     -- :: String   -> [Constr] -> DataType-        mkIntType,      -- :: String -> DataType-        mkFloatType,    -- :: String -> DataType-        mkStringType,   -- :: String -> DataType-        mkCharType,     -- :: String -> DataType-        mkNoRepType,    -- :: String -> DataType-        mkNorepType,    -- :: String -> DataType+        mkDataType,+        mkIntType,+        mkFloatType,+        mkCharType,+        mkNoRepType,         -- ** Observers-        dataTypeName,   -- :: DataType -> String-        DataRep(..),    -- instance of: Eq, Show-        dataTypeRep,    -- :: DataType -> DataRep+        dataTypeName,+        DataRep(..),+        dataTypeRep,         -- ** Convenience functions-        repConstr,      -- :: DataType -> ConstrRep -> Constr-        isAlgType,      -- :: DataType -> Bool-        dataTypeConstrs,-- :: DataType -> [Constr]-        indexConstr,    -- :: DataType -> ConIndex -> Constr-        maxConstrIndex, -- :: DataType -> ConIndex-        isNorepType,    -- :: DataType -> Bool+        repConstr,+        isAlgType,+        dataTypeConstrs,+        indexConstr,+        maxConstrIndex,+        isNorepType,          -- * Data constructor representations-        Constr,         -- abstract, instance of: Eq, Show+        Constr,         -- abstract         ConIndex,       -- alias for Int, start at 1-        Fixity(..),     -- instance of: Eq, Show+        Fixity(..),         -- ** Constructors-        mkConstr,       -- :: DataType -> String -> Fixity -> Constr-        mkIntConstr,    -- :: DataType -> Integer -> Constr-        mkFloatConstr,  -- :: DataType -> Double -> Constr-        mkIntegralConstr,-- :: (Integral a) => DataType -> a -> Constr-        mkRealConstr,   -- :: (Real a) => DataType -> a -> Constr-        mkStringConstr, -- :: DataType -> String  -> Constr-        mkCharConstr,   -- :: DataType -> Char -> Constr+        mkConstr,+        mkIntegralConstr,+        mkRealConstr,+        mkCharConstr,         -- ** Observers-        constrType,     -- :: Constr   -> DataType-        ConstrRep(..),  -- instance of: Eq, Show-        constrRep,      -- :: Constr   -> ConstrRep-        constrFields,   -- :: Constr   -> [String]-        constrFixity,   -- :: Constr   -> Fixity+        constrType,+        ConstrRep(..),+        constrRep,+        constrFields,+        constrFixity,         -- ** Convenience function: algebraic data types-        constrIndex,    -- :: Constr   -> ConIndex+        constrIndex,         -- ** From strings to constructors and vice versa: all data types-        showConstr,     -- :: Constr   -> String-        readConstr,     -- :: DataType -> String -> Maybe Constr+        showConstr,+        readConstr,          -- * Convenience functions: take type constructors apart-        tyconUQname,    -- :: String -> String-        tyconModule,    -- :: String -> String+        tyconUQname,+        tyconModule,          -- * Generic operations defined in terms of 'gunfold'-        fromConstr,     -- :: Constr -> a-        fromConstrB,    -- :: ... -> Constr -> a-        fromConstrM     -- :: Monad m => ... -> Constr -> m a+        fromConstr,+        fromConstrB,+        fromConstrM    ) where @@ -113,33 +110,24 @@  import Data.Typeable import Data.Maybe+import Data.Version( Version(..) ) import Control.Monad  -- Imports for the instances import Data.Int              -- So we can give Data instance for Int8, ...+import Data.Type.Coercion import Data.Word             -- So we can give Data instance for Word8, ...-#ifdef __GLASGOW_HASKELL__ import GHC.Real( Ratio(..) ) -- So we can give Data instance for Ratio --import GHC.IOBase            -- So we can give Data instance for IO, Handle+import GHC.Prim import GHC.Ptr               -- So we can give Data instance for Ptr import GHC.ForeignPtr        -- So we can give Data instance for ForeignPtr --import GHC.Stable            -- So we can give Data instance for StablePtr --import GHC.ST                -- So we can give Data instance for ST --import GHC.Conc              -- So we can give Data instance for MVar & Co. import GHC.Arr               -- So we can give Data instance for Array-#else-# ifdef __HUGS__-import Hugs.Prelude( Ratio(..) )-# endif-import Foreign.Ptr-import Foreign.ForeignPtr-import Data.Array-#endif -#include "Typeable.h" -- ------------------------------------------------------------------------------ -- --      The Data class@@ -274,7 +262,7 @@   --   -- The default definition is @'const' 'Nothing'@, which is appropriate   -- for non-unary type constructors.-  dataCast1 :: Typeable1 t+  dataCast1 :: Typeable t             => (forall d. Data d => c (t d))             -> Maybe (c a)   dataCast1 _ = Nothing@@ -285,7 +273,7 @@   --   -- The default definition is @'const' 'Nothing'@, which is appropriate   -- for non-binary type constructors.-  dataCast2 :: Typeable2 t+  dataCast2 :: Typeable t             => (forall d e. (Data d, Data e) => c (t d e))             -> Maybe (c a)   dataCast2 _ = Nothing@@ -584,10 +572,10 @@ repConstr dt cr =       case (dataTypeRep dt, cr) of         (AlgRep cs, AlgConstr i)      -> cs !! (i-1)-        (IntRep,    IntConstr i)      -> mkIntConstr dt i+        (IntRep,    IntConstr i)      -> mkIntegralConstr dt i         (FloatRep,  FloatConstr f)    -> mkRealConstr dt f         (CharRep,   CharConstr c)     -> mkCharConstr dt c-        _ -> error "Data.Data.repConstr"+        _ -> error "Data.Data.repConstr: The given ConstrRep does not fit to the given DataType."   @@ -625,7 +613,9 @@ dataTypeConstrs :: DataType -> [Constr] dataTypeConstrs dt = case datarep dt of                         (AlgRep cons) -> cons-                        _ -> error "Data.Data.dataTypeConstrs"+                        _ -> error $ "Data.Data.dataTypeConstrs is not supported for "+                                    ++ dataTypeName dt +++                                    ", as it is not an algebraic data type."   -- | Gets the field labels of a constructor.  The list of labels@@ -698,21 +688,27 @@ indexConstr :: DataType -> ConIndex -> Constr indexConstr dt idx = case datarep dt of                         (AlgRep cs) -> cs !! (idx-1)-                        _           -> error "Data.Data.indexConstr"+                        _           -> error $ "Data.Data.indexConstr is not supported for "+                                               ++ dataTypeName dt +++                                               ", as it is not an algebraic data type."   -- | Gets the index of a constructor (algebraic datatypes only) constrIndex :: Constr -> ConIndex constrIndex con = case constrRep con of                     (AlgConstr idx) -> idx-                    _ -> error "Data.Data.constrIndex"+                    _ -> error $ "Data.Data.constrIndex is not supported for "+                                 ++ dataTypeName (constrType con) +++                                 ", as it is not an algebraic data type."   -- | Gets the maximum constructor index of an algebraic datatype maxConstrIndex :: DataType -> ConIndex maxConstrIndex dt = case dataTypeRep dt of                         AlgRep cs -> length cs-                        _            -> error "Data.Data.maxConstrIndex"+                        _            -> error $ "Data.Data.maxConstrIndex is not supported for "+                                                 ++ dataTypeName dt +++                                                 ", as it is not an algebraic data type."   @@ -733,17 +729,12 @@ mkFloatType = mkPrimType FloatRep  --- | This function is now deprecated. Please use 'mkCharType' instead.-{-# DEPRECATED mkStringType "Use mkCharType instead" #-}-mkStringType :: String -> DataType-mkStringType = mkCharType- -- | Constructs the 'Char' type mkCharType :: String -> DataType mkCharType = mkPrimType CharRep  --- | Helper for 'mkIntType', 'mkFloatType', 'mkStringType'+-- | Helper for 'mkIntType', 'mkFloatType' mkPrimType :: DataRep -> String -> DataType mkPrimType dr str = DataType                         { tycon   = str@@ -761,41 +752,27 @@                         , confixity = error "Data.Data.confixity"                         } --- | This function is now deprecated. Please use 'mkIntegralConstr' instead.-{-# DEPRECATED mkIntConstr "Use mkIntegralConstr instead" #-}-mkIntConstr :: DataType -> Integer -> Constr-mkIntConstr = mkIntegralConstr- mkIntegralConstr :: (Integral a, Show a) => DataType -> a -> Constr mkIntegralConstr dt i = case datarep dt of                   IntRep -> mkPrimCon dt (show i) (IntConstr (toInteger  i))-                  _ -> error "Data.Data.mkIntegralConstr"---- | This function is now deprecated. Please use 'mkRealConstr' instead.-{-# DEPRECATED mkFloatConstr "Use mkRealConstr instead" #-}-mkFloatConstr :: DataType -> Double -> Constr-mkFloatConstr dt = mkRealConstr dt . toRational+                  _ -> error $ "Data.Data.mkIntegralConstr is not supported for "+                               ++ dataTypeName dt +++                               ", as it is not an Integral data type."  mkRealConstr :: (Real a, Show a) => DataType -> a -> Constr mkRealConstr dt f = case datarep dt of                     FloatRep -> mkPrimCon dt (show f) (FloatConstr (toRational f))-                    _ -> error "Data.Data.mkRealConstr"---- | This function is now deprecated. Please use 'mkCharConstr' instead.-{-# DEPRECATED mkStringConstr "Use mkCharConstr instead" #-}-mkStringConstr :: DataType -> String -> Constr-mkStringConstr dt str =-  case datarep dt of-    CharRep -> case str of-      [c] -> mkPrimCon dt (show c) (CharConstr c)-      _ -> error "Data.Data.mkStringConstr: input String must contain a single character"-    _ -> error "Data.Data.mkStringConstr"+                    _ -> error $ "Data.Data.mkRealConstr is not supported for "+                                 ++ dataTypeName dt +++                                 ", as it is not an Real data type."  -- | Makes a constructor for 'Char'. mkCharConstr :: DataType -> Char -> Constr mkCharConstr dt c = case datarep dt of                    CharRep -> mkPrimCon dt (show c) (CharConstr c)-                   _ -> error "Data.Data.mkCharConstr"+                   _ -> error $ "Data.Data.mkCharConstr is not supported for "+                                ++ dataTypeName dt +++                                ", as it is not an Char data type."   ------------------------------------------------------------------------------@@ -805,14 +782,6 @@ ------------------------------------------------------------------------------  --- | Deprecated version (misnamed)-{-# DEPRECATED mkNorepType "Use mkNoRepType instead" #-}-mkNorepType :: String -> DataType-mkNorepType str = DataType-                        { tycon   = str-                        , datarep = NoRep-                        }- -- | Constructs a non-representation for a non-presentable type mkNoRepType :: String -> DataType mkNoRepType str = DataType@@ -880,7 +849,9 @@   gunfold _ z c  = case constrIndex c of                      1 -> z False                      2 -> z True-                     _ -> error "Data.Data.gunfold(Bool)"+                     _ -> error $ "Data.Data.gunfold: Constructor "+                                  ++ show c+                                  ++ " is not of type Bool."   dataTypeOf _ = boolDataType  @@ -893,7 +864,8 @@   toConstr x = mkCharConstr charType x   gunfold _ z c = case constrRep c of                     (CharConstr x) -> z x-                    _ -> error "Data.Data.gunfold(Char)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Char."   dataTypeOf _ = charType  @@ -906,7 +878,8 @@   toConstr = mkRealConstr floatType   gunfold _ z c = case constrRep c of                     (FloatConstr x) -> z (realToFrac x)-                    _ -> error "Data.Data.gunfold(Float)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Float."   dataTypeOf _ = floatType  @@ -919,7 +892,8 @@   toConstr = mkRealConstr doubleType   gunfold _ z c = case constrRep c of                     (FloatConstr x) -> z (realToFrac x)-                    _ -> error "Data.Data.gunfold(Double)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Double."   dataTypeOf _ = doubleType  @@ -929,10 +903,11 @@ intType = mkIntType "Prelude.Int"  instance Data Int where-  toConstr x = mkIntConstr intType (fromIntegral x)+  toConstr x = mkIntegralConstr intType x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Int)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Int."   dataTypeOf _ = intType  @@ -942,10 +917,11 @@ integerType = mkIntType "Prelude.Integer"  instance Data Integer where-  toConstr = mkIntConstr integerType+  toConstr = mkIntegralConstr integerType   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z x-                    _ -> error "Data.Data.gunfold(Integer)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Integer."   dataTypeOf _ = integerType  @@ -955,10 +931,11 @@ int8Type = mkIntType "Data.Int.Int8"  instance Data Int8 where-  toConstr x = mkIntConstr int8Type (fromIntegral x)+  toConstr x = mkIntegralConstr int8Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Int8)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Int8."   dataTypeOf _ = int8Type  @@ -968,10 +945,11 @@ int16Type = mkIntType "Data.Int.Int16"  instance Data Int16 where-  toConstr x = mkIntConstr int16Type (fromIntegral x)+  toConstr x = mkIntegralConstr int16Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Int16)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Int16."   dataTypeOf _ = int16Type  @@ -981,10 +959,11 @@ int32Type = mkIntType "Data.Int.Int32"  instance Data Int32 where-  toConstr x = mkIntConstr int32Type (fromIntegral x)+  toConstr x = mkIntegralConstr int32Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Int32)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Int32."   dataTypeOf _ = int32Type  @@ -994,10 +973,11 @@ int64Type = mkIntType "Data.Int.Int64"  instance Data Int64 where-  toConstr x = mkIntConstr int64Type (fromIntegral x)+  toConstr x = mkIntegralConstr int64Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Int64)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Int64."   dataTypeOf _ = int64Type  @@ -1007,10 +987,11 @@ wordType = mkIntType "Data.Word.Word"  instance Data Word where-  toConstr x = mkIntConstr wordType (fromIntegral x)+  toConstr x = mkIntegralConstr wordType x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Word)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Word"   dataTypeOf _ = wordType  @@ -1020,10 +1001,11 @@ word8Type = mkIntType "Data.Word.Word8"  instance Data Word8 where-  toConstr x = mkIntConstr word8Type (fromIntegral x)+  toConstr x = mkIntegralConstr word8Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Word8)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Word8."   dataTypeOf _ = word8Type  @@ -1033,10 +1015,11 @@ word16Type = mkIntType "Data.Word.Word16"  instance Data Word16 where-  toConstr x = mkIntConstr word16Type (fromIntegral x)+  toConstr x = mkIntegralConstr word16Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Word16)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Word16."   dataTypeOf _ = word16Type  @@ -1046,10 +1029,11 @@ word32Type = mkIntType "Data.Word.Word32"  instance Data Word32 where-  toConstr x = mkIntConstr word32Type (fromIntegral x)+  toConstr x = mkIntegralConstr word32Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Word32)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Word32."   dataTypeOf _ = word32Type  @@ -1059,10 +1043,11 @@ word64Type = mkIntType "Data.Word.Word64"  instance Data Word64 where-  toConstr x = mkIntConstr word64Type (fromIntegral x)+  toConstr x = mkIntegralConstr word64Type x   gunfold _ z c = case constrRep c of                     (IntConstr x) -> z (fromIntegral x)-                    _ -> error "Data.Data.gunfold(Word64)"+                    _ -> error $ "Data.Data.gunfold: Constructor " ++ show c+                                 ++ " is not of type Word64."   dataTypeOf _ = word64Type  @@ -1313,27 +1298,98 @@  ------------------------------------------------------------------------------ -instance Typeable a => Data (Ptr a) where+instance (Data a, Typeable a) => Data (Ptr a) where   toConstr _   = error "Data.Data.toConstr(Ptr)"   gunfold _ _  = error "Data.Data.gunfold(Ptr)"   dataTypeOf _ = mkNoRepType "GHC.Ptr.Ptr"-+  dataCast1 x  = gcast1 x  ------------------------------------------------------------------------------ -instance Typeable a => Data (ForeignPtr a) where+instance (Data a, Typeable a) => Data (ForeignPtr a) where   toConstr _   = error "Data.Data.toConstr(ForeignPtr)"   gunfold _ _  = error "Data.Data.gunfold(ForeignPtr)"   dataTypeOf _ = mkNoRepType "GHC.ForeignPtr.ForeignPtr"-+  dataCast1 x  = gcast1 x  ------------------------------------------------------------------------------ -- The Data instance for Array preserves data abstraction at the cost of  -- inefficiency. We omit reflection services for the sake of data abstraction.-instance (Typeable a, Data b, Ix a) => Data (Array a b)+instance (Typeable a, Data a, Data b, Ix a) => Data (Array a b)  where   gfoldl f z a = z (listArray (bounds a)) `f` (elems a)   toConstr _   = error "Data.Data.toConstr(Array)"   gunfold _ _  = error "Data.Data.gunfold(Array)"   dataTypeOf _ = mkNoRepType "Data.Array.Array"+  dataCast2 x  = gcast2 x +----------------------------------------------------------------------------+-- Data instance for Proxy++proxyConstr :: Constr+proxyConstr = mkConstr proxyDataType "Proxy" [] Prefix++proxyDataType :: DataType+proxyDataType = mkDataType "Data.Proxy.Proxy" [proxyConstr]++instance (Data t) => Data (Proxy t) where+  gfoldl _ z Proxy  = z Proxy+  toConstr Proxy  = proxyConstr+  gunfold _ z c = case constrIndex c of+                    1 -> z Proxy+                    _ -> error "Data.Data.gunfold(Proxy)"+  dataTypeOf _ = proxyDataType+  dataCast1 f  = gcast1 f++-----------------------------------------------------------------------+-- instance for (:~:)++reflConstr :: Constr+reflConstr = mkConstr equalityDataType "Refl" [] Prefix++equalityDataType :: DataType+equalityDataType = mkDataType "Data.Type.Equality.(:~:)" [reflConstr]++instance (a ~ b, Data a) => Data (a :~: b) where+  gfoldl _ z Refl = z Refl+  toConstr Refl   = reflConstr+  gunfold _ z c   = case constrIndex c of+                      1 -> z Refl+                      _ -> error "Data.Data.gunfold(:~:)"+  dataTypeOf _    = equalityDataType+  dataCast2 f     = gcast2 f++-----------------------------------------------------------------------+-- instance for Coercion++coercionConstr :: Constr+coercionConstr = mkConstr equalityDataType "Coercion" [] Prefix++coercionDataType :: DataType+coercionDataType = mkDataType "Data.Type.Coercion.Coercion" [coercionConstr]++instance (Coercible a b, Data a, Data b) => Data (Coercion a b) where+  gfoldl _ z Coercion = z Coercion+  toConstr Coercion = coercionConstr+  gunfold _ z c   = case constrIndex c of+                      1 -> z Coercion+                      _ -> error "Data.Data.gunfold(Coercion)"+  dataTypeOf _    = coercionDataType+  dataCast2 f     = gcast2 f++-----------------------------------------------------------------------+-- instance for Data.Version++versionConstr :: Constr+versionConstr = mkConstr versionDataType "Version" ["versionBranch","versionTags"] Prefix++versionDataType :: DataType+versionDataType = mkDataType "Data.Version.Version" [versionConstr]++instance Data Version where+  gfoldl k z (Version bs ts) = z Version `k` bs `k` ts+  toConstr (Version _ _) = versionConstr+  gunfold k z c = case constrIndex c of+                    1 -> k (k (z Version))+                    _ -> error "Data.Data.gunfold(Version)"+  dataTypeOf _  = versionDataType
Data/Dynamic.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}-#ifdef __GLASGOW_HASKELL__+{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -33,9 +31,9 @@         Dynamic,        -- abstract, instance of: Show, Typeable          -- * Converting to and from @Dynamic@-        toDyn,          -- :: Typeable a => a -> Dynamic-        fromDyn,        -- :: Typeable a => Dynamic -> a -> a-        fromDynamic,    -- :: Typeable a => Dynamic -> Maybe a+        toDyn,+        fromDyn,+        fromDynamic,                  -- * Applying functions of dynamic type         dynApply,@@ -49,25 +47,10 @@ import Data.Maybe import Unsafe.Coerce -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Show import GHC.Exception-#endif -#ifdef __HUGS__-import Hugs.Prelude-import Hugs.IO-import Hugs.IORef-import Hugs.IOExts-#endif--#ifdef __NHC__-import NHC.IOExtras (IORef,newIORef,readIORef,writeIORef,unsafePerformIO)-#endif--#include "Typeable.h"- ------------------------------------------------------------- -- --              The type Dynamic@@ -84,11 +67,8 @@   'Show'ing a value of type 'Dynamic' returns a pretty-printed representation   of the object\'s type; useful for debugging. -}-#ifndef __HUGS__ data Dynamic = Dynamic TypeRep Obj-#endif--INSTANCE_TYPEABLE0(Dynamic,dynamicTc,"Dynamic")+               deriving Typeable  instance Show Dynamic where    -- the instance just prints the type representation.@@ -97,12 +77,9 @@           showsPrec 0 t   .            showString ">>" -#ifdef __GLASGOW_HASKELL__ -- here so that it isn't an orphan: instance Exception Dynamic-#endif -#ifdef __GLASGOW_HASKELL__ type Obj = Any  -- Use GHC's primitive 'Any' type to hold the dynamically typed value.  --@@ -111,9 +88,6 @@  -- when evaluating it, and this will go wrong if the object is really a   -- function.  Using Any forces GHC to use  -- a fallback convention for evaluating it that works for all types.-#elif !defined(__HUGS__)-data Obj = Obj-#endif  -- | Converts an arbitrary value into an object of type 'Dynamic'.   --
Data/Either.hs view
@@ -1,8 +1,7 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}-#ifdef __GLASGOW_HASKELL__+{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif+{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, TypeOperators, UndecidableInstances #-}  ----------------------------------------------------------------------------- -- |@@ -20,23 +19,21 @@  module Data.Either (    Either(..),-   either,           -- :: (a -> c) -> (b -> c) -> Either a b -> c-   lefts,            -- :: [Either a b] -> [a]-   rights,           -- :: [Either a b] -> [b]-   partitionEithers, -- :: [Either a b] -> ([a],[b])+   either,+   lefts,+   rights,+   isLeft,+   isRight,+   partitionEithers,  ) where -#include "Typeable.h"--#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Show import GHC.Read-#endif  import Data.Typeable+import Data.Type.Equality -#ifdef __GLASGOW_HASKELL__ {- -- just for testing import Test.QuickCheck@@ -53,7 +50,7 @@ hold a correct value (mnemonic: \"right\" also means \"correct\"). -} data  Either a b  =  Left a | Right b-  deriving (Eq, Ord, Read, Show)+  deriving (Eq, Ord, Read, Show, Typeable)  instance Functor (Either a) where     fmap _ (Left x) = Left x@@ -70,10 +67,7 @@ either                  :: (a -> c) -> (b -> c) -> Either a b -> c either f _ (Left x)     =  f x either _ g (Right y)    =  g y-#endif  /* __GLASGOW_HASKELL__ */ -INSTANCE_TYPEABLE2(Either,eitherTc,"Either")- -- | Extracts from a list of 'Either' all the 'Left' elements -- All the 'Left' elements are extracted in order. @@ -96,6 +90,27 @@  where   left  a ~(l, r) = (a:l, r)   right a ~(l, r) = (l, a:r)++-- | Return `True` if the given value is a `Left`-value, `False` otherwise.+--+-- /Since: 4.7.0.0/+isLeft :: Either a b -> Bool+isLeft (Left  _) = True+isLeft (Right _) = False++-- | Return `True` if the given value is a `Right`-value, `False` otherwise.+--+-- /Since: 4.7.0.0/+isRight :: Either a b -> Bool+isRight (Left  _) = False+isRight (Right _) = True++-- instance for the == Boolean type-level equality operator+type family EqEither a b where+  EqEither (Left x)  (Left y)  = x == y+  EqEither (Right x) (Right y) = x == y+  EqEither a         b         = False+type instance a == b = EqEither a b  {- {--------------------------------------------------------------------
Data/Eq.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -19,7 +19,4 @@    Eq(..),  ) where -#if __GLASGOW_HASKELL__ import GHC.Base-#endif-
Data/Fixed.hs view
@@ -1,9 +1,7 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}-{-# OPTIONS -Wall -fno-warn-unused-binds #-}-#ifndef __NHC__+{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveDataTypeable #-}-#endif+{-# OPTIONS -Wall -fno-warn-unused-binds #-}  ----------------------------------------------------------------------------- -- |@@ -28,7 +26,7 @@ (     div',mod',divMod', -    Fixed,HasResolution(..),+    Fixed(..), HasResolution(..),     showFixed,     E0,Uni,     E1,Deci,@@ -40,16 +38,13 @@ ) where  import Prelude -- necessary to get dependencies right-import Data.Char-import Data.List-#ifndef __NHC__ import Data.Typeable import Data.Data-#endif+import GHC.Read+import Text.ParserCombinators.ReadPrec+import Text.Read.Lex -#ifndef __NHC__ default () -- avoid any defaulting shenanigans-#endif  -- | generalisation of 'div' to any instance of Real div' :: (Real a,Integral b) => a -> a -> b@@ -66,14 +61,9 @@     f = div' n d  -- | The type parameter should be an instance of 'HasResolution'.-newtype Fixed a = MkFixed Integer-#ifndef __NHC__+newtype Fixed a = MkFixed Integer -- ^ /Since: 4.7.0.0/         deriving (Eq,Ord,Typeable)-#else-        deriving (Eq,Ord)-#endif -#ifndef __NHC__ -- We do this because the automatically derived Data instance requires (Data a) context. -- Our manual instance has the more general (Typeable a) context. tyFixed :: DataType@@ -85,7 +75,6 @@     gunfold k z _ = k (z MkFixed)     dataTypeOf _ = tyFixed     toConstr _ = conMkFixed-#endif  class HasResolution a where     resolution :: p a -> Integer@@ -159,89 +148,65 @@     maxnum = 10 ^ digits     fracNum = div (d * maxnum) res -readsFixed :: (HasResolution a) => ReadS (Fixed a)-readsFixed = readsSigned-    where readsSigned ('-' : xs) = [ (negate x, rest)-                                   | (x, rest) <- readsUnsigned xs ]-          readsSigned xs = readsUnsigned xs-          readsUnsigned xs = case span isDigit xs of-                             ([], _) -> []-                             (is, xs') ->-                                 let i = fromInteger (read is)-                                 in case xs' of-                                    '.' : xs'' ->-                                        case span isDigit xs'' of-                                        ([], _) -> []-                                        (js, xs''') ->-                                            let j = fromInteger (read js)-                                                l = genericLength js :: Integer-                                            in [(i + (j / (10 ^ l)), xs''')]-                                    _ -> [(i, xs')]- instance (HasResolution a) => Show (Fixed a) where     show = showFixed False  instance (HasResolution a) => Read (Fixed a) where-    readsPrec _ = readsFixed+    readPrec     = readNumber convertFixed+    readListPrec = readListPrecDefault+    readList     = readListDefault +convertFixed :: forall a . HasResolution a => Lexeme -> ReadPrec (Fixed a)+convertFixed (Number n)+ | Just (i, f) <- numberToFixed r n =+    return (fromInteger i + (fromInteger f / (10 ^ r)))+    where r = resolution (undefined :: Fixed a)+convertFixed _ = pfail+ data E0 = E0-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E0 where     resolution _ = 1 -- | resolution of 1, this works the same as Integer type Uni = Fixed E0  data E1 = E1-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E1 where     resolution _ = 10 -- | resolution of 10^-1 = .1 type Deci = Fixed E1  data E2 = E2-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E2 where     resolution _ = 100 -- | resolution of 10^-2 = .01, useful for many monetary currencies type Centi = Fixed E2  data E3 = E3-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E3 where     resolution _ = 1000 -- | resolution of 10^-3 = .001 type Milli = Fixed E3  data E6 = E6-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E6 where     resolution _ = 1000000 -- | resolution of 10^-6 = .000001 type Micro = Fixed E6  data E9 = E9-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E9 where     resolution _ = 1000000000 -- | resolution of 10^-9 = .000000001 type Nano = Fixed E9  data E12 = E12-#ifndef __NHC__      deriving (Typeable)-#endif instance HasResolution E12 where     resolution _ = 1000000000000 -- | resolution of 10^-12 = .000000000001
Data/Foldable.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -67,22 +66,10 @@ import Control.Monad (MonadPlus(..)) import Data.Maybe (fromMaybe, listToMaybe) import Data.Monoid--#ifdef __NHC__-import Control.Arrow (ArrowZero(..)) -- work around nhc98 typechecker problem-#endif+import Data.Proxy -#ifdef __GLASGOW_HASKELL__ import GHC.Exts (build)-#endif--#if defined(__GLASGOW_HASKELL__) import GHC.Arr-#elif defined(__HUGS__)-import Hugs.Array-#elif defined(__NHC__)-import Array-#endif  -- | Data structures that can be folded. --@@ -132,14 +119,14 @@     -- | Left-associative fold of a structure.     --     -- @'foldl' f z = 'Prelude.foldl' f z . 'toList'@-    foldl :: (a -> b -> a) -> a -> t b -> a+    foldl :: (b -> a -> b) -> b -> t a -> b     foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z      -- | Left-associative fold of a structure.     -- but with strict application of the operator.     --     -- @'foldl' f z = 'List.foldl'' f z . 'toList'@-    foldl' :: (a -> b -> a) -> a -> t b -> a+    foldl' :: (b -> a -> b) -> b -> t a -> b     foldl' f z0 xs = foldr f' id xs z0       where f' x k z = k $! f z x @@ -164,6 +151,7 @@       where         mf Nothing y = Just y         mf (Just x) y = Just (f x y)+    {-# MINIMAL foldMap | foldr #-}  -- instances for Prelude types @@ -181,12 +169,41 @@     foldr1 = Prelude.foldr1     foldl1 = Prelude.foldl1 +instance Foldable (Either a) where+    foldMap _ (Left _) = mempty+    foldMap f (Right y) = f y++    foldr _ z (Left _) = z+    foldr f z (Right y) = f y z++instance Foldable ((,) a) where+    foldMap f (_, y) = f y++    foldr f z (_, y) = f y z+ instance Ix i => Foldable (Array i) where     foldr f z = Prelude.foldr f z . elems     foldl f z = Prelude.foldl f z . elems     foldr1 f = Prelude.foldr1 f . elems     foldl1 f = Prelude.foldl1 f . elems +instance Foldable Proxy where+    foldMap _ _ = mempty+    {-# INLINE foldMap #-}+    fold _ = mempty+    {-# INLINE fold #-}+    foldr _ z _ = z+    {-# INLINE foldr #-}+    foldl _ z _ = z+    {-# INLINE foldl #-}+    foldl1 _ _ = error "foldl1: Proxy"+    {-# INLINE foldl1 #-}+    foldr1 _ _ = error "foldr1: Proxy"+    {-# INLINE foldr1 #-}++instance Foldable (Const m) where+    foldMap _ _ = mempty+ -- | Monadic fold over the elements of a structure, -- associating to the right, i.e. from right to left. foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b@@ -195,7 +212,7 @@  -- | Monadic fold over the elements of a structure, -- associating to the left, i.e. from left to right.-foldlM :: (Foldable t, Monad m) => (a -> b -> m a) -> a -> t b -> m a+foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b foldlM f z0 xs = foldr f' return xs z0   where f' x k z = f z x >>= k @@ -244,11 +261,7 @@ -- | List of elements of a structure. toList :: Foldable t => t a -> [a] {-# INLINE toList #-}-#ifdef __GLASGOW_HASKELL__ toList t = build (\ c n -> foldr c n t)-#else-toList = foldr (:) []-#endif  -- | The concatenation of all the elements of a container of lists. concat :: Foldable t => t [a] -> [a]
Data/Functor.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -18,19 +17,25 @@     (       Functor(fmap),       (<$),+      ($>),       (<$>),+      void,     ) where -#ifdef __GLASGOW_HASKELL__+import Control.Monad import GHC.Base (Functor(..))-#else-(<$) :: Functor f => a -> f b -> f a-(<$) =  fmap . const-#endif  infixl 4 <$>  -- | An infix synonym for 'fmap'. (<$>) :: Functor f => (a -> b) -> f a -> f b (<$>) = fmap++infixl 4 $>++-- | Flipped version of '<$'.+--+-- /Since: 4.7.0.0/+($>) :: Functor f => f a -> b -> f b+($>) = flip (<$) 
− Data/HashTable.hs
@@ -1,536 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}-{-# OPTIONS_GHC -funbox-strict-fields -fno-warn-name-shadowing #-}---------------------------------------------------------------------------------- |--- Module      :  Data.HashTable--- Copyright   :  (c) The University of Glasgow 2003--- License     :  BSD-style (see the file libraries/base/LICENSE)------ Maintainer  :  libraries@haskell.org--- Stability   :  provisional--- Portability :  portable------ An implementation of extensible hash tables, as described in--- Per-Ake Larson, /Dynamic Hash Tables/, CACM 31(4), April 1988,--- pp. 446--457.  The implementation is also derived from the one--- in GHC's runtime system (@ghc\/rts\/Hash.{c,h}@).-----------------------------------------------------------------------------------module Data.HashTable-      {-# DEPRECATED "Data.HashTable will be removed in GHC 7.8. Please use an alternative, e.g. the hashtables package, instead." #-}-      (-        -- * Basic hash table operations-        HashTable, new, newHint, insert, delete, lookup, update,-        -- * Converting to and from lists-        fromList, toList,-        -- * Hash functions-        -- $hash_functions-        hashInt, hashString,-        prime,-        -- * Diagnostics-        longestChain- ) where---- This module is imported by Data.Dynamic, which is pretty low down in the--- module hierarchy, so don't import "high-level" modules--#ifdef __GLASGOW_HASKELL__-import GHC.Base-#else-import Prelude  hiding  ( lookup )-#endif-import Data.Tuple       ( fst )-import Data.Bits-import Data.Maybe-import Data.List        ( maximumBy, length, concat, foldl', partition )-import Data.Int         ( Int32 )--#if defined(__GLASGOW_HASKELL__)-import GHC.Num-import GHC.Real         ( fromIntegral )-import GHC.Show         ( Show(..) )-import GHC.Int          ( Int64 )--import GHC.IO-import GHC.IOArray-import GHC.IORef-#else-import Data.Char        ( ord )-import Data.IORef       ( IORef, newIORef, readIORef, writeIORef )-import System.IO.Unsafe ( unsafePerformIO )-import Data.Int         ( Int64 )-#  if defined(__HUGS__)-import Hugs.IOArray     ( IOArray, newIOArray,-                          unsafeReadIOArray, unsafeWriteIOArray )-#  elif defined(__NHC__)-import NHC.IOExtras     ( IOArray, newIOArray, readIOArray, writeIOArray )-#  endif-#endif-import Control.Monad    ( mapM, mapM_, sequence_ )----------------------------------------------------------------------------iNSTRUMENTED :: Bool-iNSTRUMENTED = False---------------------------------------------------------------------------readHTArray  :: HTArray a -> Int32 -> IO a-writeMutArray :: MutArray a -> Int32 -> a -> IO ()-newMutArray   :: (Int32, Int32) -> a -> IO (MutArray a)-newMutArray = newIOArray-type MutArray a = IOArray Int32 a-type HTArray a = MutArray a-#if defined(DEBUG) || defined(__NHC__)-readHTArray  = readIOArray-writeMutArray = writeIOArray-#else-readHTArray arr i = unsafeReadIOArray arr (fromIntegral i)-writeMutArray arr i x = unsafeWriteIOArray arr (fromIntegral i) x-#endif--data HashTable key val = HashTable {-                                     cmp     :: !(key -> key -> Bool),-                                     hash_fn :: !(key -> Int32),-                                     tab     :: !(IORef (HT key val))-                                   }--- TODO: the IORef should really be an MVar.--data HT key val-  = HT {-        kcount  :: !Int32,              -- Total number of keys.-        bmask   :: !Int32,-        buckets :: !(HTArray [(key,val)])-       }---- --------------------------------------------------------------- Instrumentation for performance tuning---- This ought to be roundly ignored after optimization when--- iNSTRUMENTED=False.---- STRICT version of modifyIORef!-modifyIORef :: IORef a -> (a -> a) -> IO ()-modifyIORef r f = do-  v <- readIORef r-  let z = f v in z `seq` writeIORef r z--data HashData = HD {-  tables :: !Integer,-  insertions :: !Integer,-  lookups :: !Integer,-  totBuckets :: !Integer,-  maxEntries :: !Int32,-  maxChain :: !Int,-  maxBuckets :: !Int32-} deriving (Eq, Show)--{-# NOINLINE hashData #-}-hashData :: IORef HashData-hashData =  unsafePerformIO (newIORef (HD { tables=0, insertions=0, lookups=0,-                                            totBuckets=0, maxEntries=0,-                                            maxChain=0, maxBuckets=tABLE_MIN } ))--instrument :: (HashData -> HashData) -> IO ()-instrument i | iNSTRUMENTED = modifyIORef hashData i-             | otherwise    = return ()--recordNew :: IO ()-recordNew = instrument rec-  where rec hd@HD{ tables=t, totBuckets=b } =-               hd{ tables=t+1, totBuckets=b+fromIntegral tABLE_MIN }--recordIns :: Int32 -> Int32 -> [a] -> IO ()-recordIns i sz bkt = instrument rec-  where rec hd@HD{ insertions=ins, maxEntries=mx, maxChain=mc } =-               hd{ insertions=ins+fromIntegral i, maxEntries=mx `max` sz,-                   maxChain=mc `max` length bkt }--recordResize :: Int32 -> Int32 -> IO ()-recordResize older newer = instrument rec-  where rec hd@HD{ totBuckets=b, maxBuckets=mx } =-               hd{ totBuckets=b+fromIntegral (newer-older),-                   maxBuckets=mx `max` newer }--recordLookup :: IO ()-recordLookup = instrument lkup-  where lkup hd@HD{ lookups=l } = hd{ lookups=l+1 }---- stats :: IO String--- stats =  fmap show $ readIORef hashData---- ------------------------------------------------------------------------------- Sample hash functions---- $hash_functions------ This implementation of hash tables uses the low-order /n/ bits of the hash--- value for a key, where /n/ varies as the hash table grows.  A good hash--- function therefore will give an even distribution regardless of /n/.------ If your keyspace is integrals such that the low-order bits between--- keys are highly variable, then you could get away with using 'fromIntegral'--- as the hash function.------ We provide some sample hash functions for 'Int' and 'String' below.--golden :: Int32-golden = 1013904242 -- = round ((sqrt 5 - 1) * 2^32) :: Int32--- was -1640531527 = round ((sqrt 5 - 1) * 2^31) :: Int32--- but that has bad mulHi properties (even adding 2^32 to get its inverse)--- Whereas the above works well and contains no hash duplications for--- [-32767..65536]--hashInt32 :: Int32 -> Int32-hashInt32 x = mulHi x golden + x---- | A sample (and useful) hash function for Int and Int32,--- implemented by extracting the uppermost 32 bits of the 64-bit--- result of multiplying by a 33-bit constant.  The constant is from--- Knuth, derived from the golden ratio:------ > golden = round ((sqrt 5 - 1) * 2^32)------ We get good key uniqueness on small inputs--- (a problem with previous versions):---  (length $ group $ sort $ map hashInt [-32767..65536]) == 65536 + 32768----hashInt :: Int -> Int32-hashInt x = hashInt32 (fromIntegral x)---- hi 32 bits of a x-bit * 32 bit -> 64-bit multiply-mulHi :: Int32 -> Int32 -> Int32-mulHi a b = fromIntegral (r `shiftR` 32)-   where r :: Int64-         r = fromIntegral a * fromIntegral b---- | A sample hash function for Strings.  We keep multiplying by the--- golden ratio and adding.  The implementation is:------ > hashString = foldl' f golden--- >   where f m c = fromIntegral (ord c) * magic + hashInt32 m--- >         magic = 0xdeadbeef------ Where hashInt32 works just as hashInt shown above.------ Knuth argues that repeated multiplication by the golden ratio--- will minimize gaps in the hash space, and thus it's a good choice--- for combining together multiple keys to form one.------ Here we know that individual characters c are often small, and this--- produces frequent collisions if we use ord c alone.  A--- particular problem are the shorter low ASCII and ISO-8859-1--- character strings.  We pre-multiply by a magic twiddle factor to--- obtain a good distribution.  In fact, given the following test:------ > testp :: Int32 -> Int--- > testp k = (n - ) . length . group . sort . map hs . take n $ ls--- >   where ls = [] : [c : l | l <- ls, c <- ['\0'..'\xff']]--- >         hs = foldl' f golden--- >         f m c = fromIntegral (ord c) * k + hashInt32 m--- >         n = 100000------ We discover that testp magic = 0.--hashString :: String -> Int32-hashString = foldl' f golden-   where f m c = fromIntegral (ord c) * magic + hashInt32 m-         magic = 0xdeadbeef---- | A prime larger than the maximum hash table size-prime :: Int32-prime = 33554467---- -------------------------------------------------------------------------------- Parameters--tABLE_MAX :: Int32-tABLE_MAX  = 32 * 1024 * 1024   -- Maximum size of hash table-tABLE_MIN :: Int32-tABLE_MIN  = 8--hLOAD :: Int32-hLOAD = 7                       -- Maximum average load of a single hash bucket--hYSTERESIS :: Int32-hYSTERESIS = 64                 -- entries to ignore in load computation--{- Hysteresis favors long association-list-like behavior for small tables. -}---- -------------------------------------------------------------------------------- Creating a new hash table---- | Creates a new hash table.  The following property should hold for the @eq@--- and @hash@ functions passed to 'new':------ >   eq A B  =>  hash A == hash B----new-  :: (key -> key -> Bool)    -- ^ @eq@: An equality comparison on keys-  -> (key -> Int32)          -- ^ @hash@: A hash function on keys-  -> IO (HashTable key val)  -- ^ Returns: an empty hash table--new cmpr hash = do-  recordNew-  -- make a new hash table with a single, empty, segment-  let mask = tABLE_MIN-1-  bkts <- newMutArray (0,mask) []--  let-    kcnt = 0-    ht = HT {  buckets=bkts, kcount=kcnt, bmask=mask }--  table <- newIORef ht-  return (HashTable { tab=table, hash_fn=hash, cmp=cmpr })--{- -   bitTwiddleSameAs takes as arguments positive Int32s less than maxBound/2 and -   returns the smallest power of 2 that is greater than or equal to the -   argument.-   http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2--}-bitTwiddleSameAs :: Int32 -> Int32-bitTwiddleSameAs v0 = -    let v1 = v0-1-        v2 = v1 .|. (v1`shiftR`1)-        v3 = v2 .|. (v2`shiftR`2)-        v4 = v3 .|. (v3`shiftR`4)-        v5 = v4 .|. (v4`shiftR`8)-        v6 = v5 .|. (v5`shiftR`16)-    in v6+1--{--  powerOver takes as arguments Int32s and returns the smallest power of 2 -  that is greater than or equal to the argument if that power of 2 is -  within [tABLE_MIN,tABLE_MAX]--}-powerOver :: Int32 -> Int32-powerOver n = -    if n <= tABLE_MIN-    then tABLE_MIN-    else if n >= tABLE_MAX-         then tABLE_MAX-         else bitTwiddleSameAs n ---- | Creates a new hash table with the given minimum size.-newHint-  :: (key -> key -> Bool)    -- ^ @eq@: An equality comparison on keys-  -> (key -> Int32)          -- ^ @hash@: A hash function on keys-  -> Int                     -- ^ @minSize@: initial table size-  -> IO (HashTable key val)  -- ^ Returns: an empty hash table--newHint cmpr hash minSize = do-  recordNew-  -- make a new hash table with a single, empty, segment-  let mask = powerOver $ fromIntegral minSize-  bkts <- newMutArray (0,mask) []--  let-    kcnt = 0-    ht = HT {  buckets=bkts, kcount=kcnt, bmask=mask }--  table <- newIORef ht-  return (HashTable { tab=table, hash_fn=hash, cmp=cmpr })---- -------------------------------------------------------------------------------- Inserting a key\/value pair into the hash table---- | Inserts a key\/value mapping into the hash table.------ Note that 'insert' doesn't remove the old entry from the table ---- the behaviour is like an association list, where 'lookup' returns--- the most-recently-inserted mapping for a key in the table.  The--- reason for this is to keep 'insert' as efficient as possible.  If--- you need to update a mapping, then we provide 'update'.----insert :: HashTable key val -> key -> val -> IO ()--insert ht key val =-  updatingBucket CanInsert (\bucket -> ((key,val):bucket, 1, ())) ht key----- --------------------------------------------------------------- The core of the implementation is lurking down here, in findBucket,--- updatingBucket, and expandHashTable.--tooBig :: Int32 -> Int32 -> Bool-tooBig k b = k-hYSTERESIS > hLOAD * b---- index of bucket within table.-bucketIndex :: Int32 -> Int32 -> Int32-bucketIndex mask h = h .&. mask---- find the bucket in which the key belongs.--- returns (key equality, bucket index, bucket)------ This rather grab-bag approach gives enough power to do pretty much--- any bucket-finding thing you might want to do.  We rely on inlining--- to throw away the stuff we don't want.  I'm proud to say that this--- plus updatingBucket below reduce most of the other definitions to a--- few lines of code, while actually speeding up the hashtable--- implementation when compared with a version which does everything--- from scratch.-{-# INLINE findBucket #-}-findBucket :: HashTable key val -> key -> IO (HT key val, Int32, [(key,val)])-findBucket HashTable{ tab=ref, hash_fn=hash} key = do-  table@HT{ buckets=bkts, bmask=b } <- readIORef ref-  let indx = bucketIndex b (hash key)-  bucket <- readHTArray bkts indx-  return (table, indx, bucket)--data Inserts = CanInsert-             | Can'tInsert-             deriving (Eq)---- updatingBucket is the real workhorse of all single-element table--- updates.  It takes a hashtable and a key, along with a function--- describing what to do with the bucket in which that key belongs.  A--- flag indicates whether this function may perform table insertions.--- The function returns the new contents of the bucket, the number of--- bucket entries inserted (negative if entries were deleted), and a--- value which becomes the return value for the function as a whole.--- The table sizing is enforced here, calling out to expandSubTable as--- necessary.---- This function is intended to be inlined and specialized for every--- calling context (eg every provided bucketFn).-{-# INLINE updatingBucket #-}--updatingBucket :: Inserts -> ([(key,val)] -> ([(key,val)], Int32, a)) ->-                  HashTable key val -> key ->-                  IO a-updatingBucket canEnlarge bucketFn-               ht@HashTable{ tab=ref, hash_fn=hash } key = do-  (table@HT{ kcount=k, buckets=bkts, bmask=b },-   indx, bckt) <- findBucket ht key-  (bckt', inserts, result) <- return $ bucketFn bckt-  let k' = k + inserts-      table1 = table { kcount=k' }-  writeMutArray bkts indx bckt'-  table2 <- if canEnlarge == CanInsert && inserts > 0 then do-               recordIns inserts k' bckt'-               if tooBig k' b-                  then expandHashTable hash table1-                  else return table1-            else return table1-  writeIORef ref table2-  return result--expandHashTable :: (key -> Int32) -> HT key val -> IO (HT key val)-expandHashTable hash table@HT{ buckets=bkts, bmask=mask } = do-   let-      oldsize = mask + 1-      newmask = mask + mask + 1-   recordResize oldsize (newmask+1)-   ---   if newmask > tABLE_MAX-1-      then return table-      else do-   ---    newbkts <- newMutArray (0,newmask) []--    let-     splitBucket oldindex = do-       bucket <- readHTArray bkts oldindex-       let (oldb,newb) =-              partition ((oldindex==). bucketIndex newmask . hash . fst) bucket-       writeMutArray newbkts oldindex oldb-       writeMutArray newbkts (oldindex + oldsize) newb-    mapM_ splitBucket [0..mask]--    return ( table{ buckets=newbkts, bmask=newmask } )---- -------------------------------------------------------------------------------- Deleting a mapping from the hash table---- Remove a key from a bucket-deleteBucket :: (key -> Bool) -> [(key,val)] -> ([(key, val)], Int32, ())-deleteBucket _   [] = ([],0,())-deleteBucket del (pair@(k,_):bucket) =-  case deleteBucket del bucket of-    (bucket', dels, _) | del k     -> dels' `seq` (bucket', dels', ())-                       | otherwise -> (pair:bucket', dels, ())-      where dels' = dels - 1---- | Remove an entry from the hash table.-delete :: HashTable key val -> key -> IO ()--delete ht@HashTable{ cmp=eq } key =-  updatingBucket Can'tInsert (deleteBucket (eq key)) ht key---- -------------------------------------------------------------------------------- Updating a mapping in the hash table---- | Updates an entry in the hash table, returning 'True' if there was--- already an entry for this key, or 'False' otherwise.  After 'update'--- there will always be exactly one entry for the given key in the table.------ 'insert' is more efficient than 'update' if you don't care about--- multiple entries, or you know for sure that multiple entries can't--- occur.  However, 'update' is more efficient than 'delete' followed--- by 'insert'.-update :: HashTable key val -> key -> val -> IO Bool--update ht@HashTable{ cmp=eq } key val =-  updatingBucket CanInsert-    (\bucket -> let (bucket', dels, _) = deleteBucket (eq key) bucket-                in  ((key,val):bucket', 1+dels, dels/=0))-    ht key---- -------------------------------------------------------------------------------- Looking up an entry in the hash table---- | Looks up the value of a key in the hash table.-lookup :: HashTable key val -> key -> IO (Maybe val)--lookup ht@HashTable{ cmp=eq } key = do-  recordLookup-  (_, _, bucket) <- findBucket ht key-  let firstHit (k,v) r | eq key k  = Just v-                       | otherwise = r-  return (foldr firstHit Nothing bucket)---- -------------------------------------------------------------------------------- Converting to/from lists---- | Convert a list of key\/value pairs into a hash table.  Equality on keys--- is taken from the Eq instance for the key type.----fromList :: (Eq key) => (key -> Int32) -> [(key,val)] -> IO (HashTable key val)-fromList hash list = do-  table <- new (==) hash-  sequence_ [ insert table k v | (k,v) <- list ]-  return table---- | Converts a hash table to a list of key\/value pairs.----toList :: HashTable key val -> IO [(key,val)]-toList = mapReduce id concat--{-# INLINE mapReduce #-}-mapReduce :: ([(key,val)] -> r) -> ([r] -> r) -> HashTable key val -> IO r-mapReduce m r HashTable{ tab=ref } = do-  HT{ buckets=bckts, bmask=b } <- readIORef ref-  fmap r (mapM (fmap m . readHTArray bckts) [0..b])---- -------------------------------------------------------------------------------- Diagnostics---- | This function is useful for determining whether your hash--- function is working well for your data set.  It returns the longest--- chain of key\/value pairs in the hash table for which all the keys--- hash to the same bucket.  If this chain is particularly long (say,--- longer than 14 elements or so), then it might be a good idea to try--- a different hash function.----longestChain :: HashTable key val -> IO [(key,val)]-longestChain = mapReduce id (maximumBy lengthCmp)-  where lengthCmp (_:x)(_:y) = lengthCmp x y-        lengthCmp []   []    = EQ-        lengthCmp []   _     = LT-        lengthCmp _    []    = GT-
Data/IORef.hs view
@@ -19,17 +19,17 @@   (          -- * IORefs         IORef,                -- abstract, instance of: Eq, Typeable-        newIORef,             -- :: a -> IO (IORef a)-        readIORef,            -- :: IORef a -> IO a-        writeIORef,           -- :: IORef a -> a -> IO ()-        modifyIORef,          -- :: IORef a -> (a -> a) -> IO ()-        modifyIORef',         -- :: IORef a -> (a -> a) -> IO ()-        atomicModifyIORef,    -- :: IORef a -> (a -> (a,b)) -> IO b-        atomicModifyIORef',   -- :: IORef a -> (a -> (a,b)) -> IO b+        newIORef,+        readIORef,+        writeIORef,+        modifyIORef,+        modifyIORef',+        atomicModifyIORef,+        atomicModifyIORef',         atomicWriteIORef, -#if !defined(__PARALLEL_HASKELL__) && defined(__GLASGOW_HASKELL__)-        mkWeakIORef,          -- :: IORef a -> IO () -> IO (Weak (IORef a))+#if !defined(__PARALLEL_HASKELL__)+        mkWeakIORef, #endif         -- ** Memory Model @@ -37,11 +37,6 @@          ) where -#ifdef __HUGS__-import Hugs.IORef-#endif--#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.STRef import GHC.IORef hiding (atomicModifyIORef)@@ -49,19 +44,8 @@ #if !defined(__PARALLEL_HASKELL__) import GHC.Weak #endif-#endif /* __GLASGOW_HASKELL__ */ -#ifdef __NHC__-import NHC.IOExtras-    ( IORef-    , newIORef-    , readIORef-    , writeIORef-    , excludeFinalisers-    )-#endif--#if defined(__GLASGOW_HASKELL__) && !defined(__PARALLEL_HASKELL__)+#if !defined(__PARALLEL_HASKELL__) -- |Make a 'Weak' pointer to an 'IORef', using the second argument as a finalizer -- to run when 'IORef' is garbage-collected mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))@@ -86,6 +70,8 @@ modifyIORef ref f = readIORef ref >>= writeIORef ref . f  -- |Strict version of 'modifyIORef'+--+-- /Since: 4.6.0.0/ modifyIORef' :: IORef a -> (a -> a) -> IO () modifyIORef' ref f = do     x <- readIORef ref@@ -112,25 +98,12 @@ -- Use 'atomicModifyIORef'' or 'atomicWriteIORef' to avoid this problem. -- atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b-#if defined(__GLASGOW_HASKELL__) atomicModifyIORef = GHC.IORef.atomicModifyIORef -#elif defined(__HUGS__)-atomicModifyIORef = plainModifyIORef    -- Hugs has no preemption-  where plainModifyIORef r f = do-                a <- readIORef r-                case f a of (a',b) -> writeIORef r a' >> return b-#elif defined(__NHC__)-atomicModifyIORef r f =-  excludeFinalisers $ do-    a <- readIORef r-    let (a',b) = f a-    writeIORef r a'-    return b-#endif- -- | Strict version of 'atomicModifyIORef'.  This forces both the value stored -- in the 'IORef' as well as the value returned.+--+-- /Since: 4.6.0.0/ atomicModifyIORef' :: IORef a -> (a -> (a,b)) -> IO b atomicModifyIORef' ref f = do     b <- atomicModifyIORef ref@@ -140,6 +113,8 @@  -- | Variant of 'writeIORef' with the \"barrier to reordering\" property that -- 'atomicModifyIORef' has.+--+-- /Since: 4.6.0.0/ atomicWriteIORef :: IORef a -> a -> IO () atomicWriteIORef ref a = do     x <- atomicModifyIORef ref (\_ -> (a, ()))@@ -175,7 +150,7 @@   operations cannot cause type-correct code to go wrong.  In   particular, when inspecting the value read from an 'IORef', the   memory writes that created that value must have occurred from the-  point of view of the current therad.+  point of view of the current thread.    'atomicModifyIORef' acts as a barrier to reordering.  Multiple   'atomicModifyIORef' operations occur in strict program order.  An
Data/Int.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -26,21 +26,8 @@         -- $notes         ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base ( Int ) import GHC.Int  ( Int8, Int16, Int32, Int64 )-#endif--#ifdef __HUGS__-import Hugs.Int ( Int8, Int16, Int32, Int64 )-#endif--#ifdef __NHC__-import Prelude-import Prelude (Int)-import NHC.FFI (Int8, Int16, Int32, Int64)-import NHC.SizedTypes (Int8, Int16, Int32, Int64)       -- instances of Bits-#endif  {- $notes 
Data/Ix.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -21,10 +20,10 @@     (     -- * The 'Ix' class         Ix-          ( range       -- :: (Ix a) => (a,a) -> [a]-          , index       -- :: (Ix a) => (a,a) -> a   -> Int-          , inRange     -- :: (Ix a) => (a,a) -> a   -> Bool-          , rangeSize   -- :: (Ix a) => (a,a) -> Int+          ( range+          , index+          , inRange+          , rangeSize           )     -- Ix instances:     --@@ -64,15 +63,4 @@  -- import Prelude -#ifdef __GLASGOW_HASKELL__ import GHC.Arr-#endif--#ifdef __HUGS__-import Hugs.Prelude( Ix(..) )-#endif--#ifdef __NHC__-import Ix (Ix(..))-#endif-
Data/List.hs view
@@ -17,159 +17,154 @@  module Data.List    (-#ifdef __NHC__-     [] (..)-   ,-#endif-    -- * Basic functions -     (++)              -- :: [a] -> [a] -> [a]-   , head              -- :: [a] -> a-   , last              -- :: [a] -> a-   , tail              -- :: [a] -> [a]-   , init              -- :: [a] -> [a]-   , null              -- :: [a] -> Bool-   , length            -- :: [a] -> Int+     (++)+   , head+   , last+   , tail+   , init+   , null+   , length     -- * List transformations-   , map               -- :: (a -> b) -> [a] -> [b]-   , reverse           -- :: [a] -> [a]+   , map+   , reverse -   , intersperse       -- :: a -> [a] -> [a]-   , intercalate       -- :: [a] -> [[a]] -> [a]-   , transpose         -- :: [[a]] -> [[a]]+   , intersperse+   , intercalate+   , transpose    -   , subsequences      -- :: [a] -> [[a]]-   , permutations      -- :: [a] -> [[a]]+   , subsequences+   , permutations     -- * Reducing lists (folds) -   , foldl             -- :: (a -> b -> a) -> a -> [b] -> a-   , foldl'            -- :: (a -> b -> a) -> a -> [b] -> a-   , foldl1            -- :: (a -> a -> a) -> [a] -> a-   , foldl1'           -- :: (a -> a -> a) -> [a] -> a-   , foldr             -- :: (a -> b -> b) -> b -> [a] -> b-   , foldr1            -- :: (a -> a -> a) -> [a] -> a+   , foldl+   , foldl'+   , foldl1+   , foldl1'+   , foldr+   , foldr1     -- ** Special folds -   , concat            -- :: [[a]] -> [a]-   , concatMap         -- :: (a -> [b]) -> [a] -> [b]-   , and               -- :: [Bool] -> Bool-   , or                -- :: [Bool] -> Bool-   , any               -- :: (a -> Bool) -> [a] -> Bool-   , all               -- :: (a -> Bool) -> [a] -> Bool-   , sum               -- :: (Num a) => [a] -> a-   , product           -- :: (Num a) => [a] -> a-   , maximum           -- :: (Ord a) => [a] -> a-   , minimum           -- :: (Ord a) => [a] -> a+   , concat+   , concatMap+   , and+   , or+   , any+   , all+   , sum+   , product+   , maximum+   , minimum     -- * Building lists     -- ** Scans-   , scanl             -- :: (a -> b -> a) -> a -> [b] -> [a]-   , scanl1            -- :: (a -> a -> a) -> [a] -> [a]-   , scanr             -- :: (a -> b -> b) -> b -> [a] -> [b]-   , scanr1            -- :: (a -> a -> a) -> [a] -> [a]+   , scanl+   , scanl1+   , scanr+   , scanr1     -- ** Accumulating maps-   , mapAccumL         -- :: (a -> b -> (a,c)) -> a -> [b] -> (a,[c])-   , mapAccumR         -- :: (a -> b -> (a,c)) -> a -> [b] -> (a,[c])+   , mapAccumL+   , mapAccumR     -- ** Infinite lists-   , iterate           -- :: (a -> a) -> a -> [a]-   , repeat            -- :: a -> [a]-   , replicate         -- :: Int -> a -> [a]-   , cycle             -- :: [a] -> [a]+   , iterate+   , repeat+   , replicate+   , cycle     -- ** Unfolding-   , unfoldr           -- :: (b -> Maybe (a, b)) -> b -> [a]+   , unfoldr     -- * Sublists     -- ** Extracting sublists-   , take              -- :: Int -> [a] -> [a]-   , drop              -- :: Int -> [a] -> [a]-   , splitAt           -- :: Int -> [a] -> ([a], [a])+   , take+   , drop+   , splitAt -   , takeWhile         -- :: (a -> Bool) -> [a] -> [a]-   , dropWhile         -- :: (a -> Bool) -> [a] -> [a]-   , dropWhileEnd      -- :: (a -> Bool) -> [a] -> [a]-   , span              -- :: (a -> Bool) -> [a] -> ([a], [a])-   , break             -- :: (a -> Bool) -> [a] -> ([a], [a])+   , takeWhile+   , dropWhile+   , dropWhileEnd+   , span+   , break -   , stripPrefix       -- :: Eq a => [a] -> [a] -> Maybe [a]+   , stripPrefix -   , group             -- :: Eq a => [a] -> [[a]]+   , group -   , inits             -- :: [a] -> [[a]]-   , tails             -- :: [a] -> [[a]]+   , inits+   , tails     -- ** Predicates-   , isPrefixOf        -- :: (Eq a) => [a] -> [a] -> Bool-   , isSuffixOf        -- :: (Eq a) => [a] -> [a] -> Bool-   , isInfixOf         -- :: (Eq a) => [a] -> [a] -> Bool+   , isPrefixOf+   , isSuffixOf+   , isInfixOf     -- * Searching lists     -- ** Searching by equality-   , elem              -- :: a -> [a] -> Bool-   , notElem           -- :: a -> [a] -> Bool-   , lookup            -- :: (Eq a) => a -> [(a,b)] -> Maybe b+   , elem+   , notElem+   , lookup     -- ** Searching with a predicate-   , find              -- :: (a -> Bool) -> [a] -> Maybe a-   , filter            -- :: (a -> Bool) -> [a] -> [a]-   , partition         -- :: (a -> Bool) -> [a] -> ([a], [a])+   , find+   , filter+   , partition     -- * Indexing lists    -- | These functions treat a list @xs@ as a indexed collection,    -- with indices ranging from 0 to @'length' xs - 1@. -   , (!!)              -- :: [a] -> Int -> a+   , (!!) -   , elemIndex         -- :: (Eq a) => a -> [a] -> Maybe Int-   , elemIndices       -- :: (Eq a) => a -> [a] -> [Int]+   , elemIndex+   , elemIndices -   , findIndex         -- :: (a -> Bool) -> [a] -> Maybe Int-   , findIndices       -- :: (a -> Bool) -> [a] -> [Int]+   , findIndex+   , findIndices     -- * Zipping and unzipping lists -   , zip               -- :: [a] -> [b] -> [(a,b)]+   , zip    , zip3    , zip4, zip5, zip6, zip7 -   , zipWith           -- :: (a -> b -> c) -> [a] -> [b] -> [c]+   , zipWith    , zipWith3    , zipWith4, zipWith5, zipWith6, zipWith7 -   , unzip             -- :: [(a,b)] -> ([a],[b])+   , unzip    , unzip3    , unzip4, unzip5, unzip6, unzip7     -- * Special lists     -- ** Functions on strings-   , lines             -- :: String   -> [String]-   , words             -- :: String   -> [String]-   , unlines           -- :: [String] -> String-   , unwords           -- :: [String] -> String+   , lines+   , words+   , unlines+   , unwords     -- ** \"Set\" operations -   , nub               -- :: (Eq a) => [a] -> [a]+   , nub -   , delete            -- :: (Eq a) => a -> [a] -> [a]-   , (\\)              -- :: (Eq a) => [a] -> [a] -> [a]+   , delete+   , (\\) -   , union             -- :: (Eq a) => [a] -> [a] -> [a]-   , intersect         -- :: (Eq a) => [a] -> [a] -> [a]+   , union+   , intersect     -- ** Ordered lists-   , sort              -- :: (Ord a) => [a] -> [a]-   , insert            -- :: (Ord a) => a -> [a] -> [a]+   , sort+   , insert     -- * Generalized functions @@ -183,46 +178,40 @@     -- *** User-supplied equality (replacing an @Eq@ context)    -- | The predicate is assumed to define an equivalence.-   , nubBy             -- :: (a -> a -> Bool) -> [a] -> [a]-   , deleteBy          -- :: (a -> a -> Bool) -> a -> [a] -> [a]-   , deleteFirstsBy    -- :: (a -> a -> Bool) -> [a] -> [a] -> [a]-   , unionBy           -- :: (a -> a -> Bool) -> [a] -> [a] -> [a]-   , intersectBy       -- :: (a -> a -> Bool) -> [a] -> [a] -> [a]-   , groupBy           -- :: (a -> a -> Bool) -> [a] -> [[a]]+   , nubBy+   , deleteBy+   , deleteFirstsBy+   , unionBy+   , intersectBy+   , groupBy     -- *** User-supplied comparison (replacing an @Ord@ context)    -- | The function is assumed to define a total ordering.-   , sortBy            -- :: (a -> a -> Ordering) -> [a] -> [a]-   , insertBy          -- :: (a -> a -> Ordering) -> a -> [a] -> [a]-   , maximumBy         -- :: (a -> a -> Ordering) -> [a] -> a-   , minimumBy         -- :: (a -> a -> Ordering) -> [a] -> a+   , sortBy+   , insertBy+   , maximumBy+   , minimumBy     -- ** The \"@generic@\" operations    -- | The prefix \`@generic@\' indicates an overloaded function that    -- is a generalized version of a "Prelude" function. -   , genericLength     -- :: (Integral a) => [b] -> a-   , genericTake       -- :: (Integral a) => a -> [b] -> [b]-   , genericDrop       -- :: (Integral a) => a -> [b] -> [b]-   , genericSplitAt    -- :: (Integral a) => a -> [b] -> ([b], [b])-   , genericIndex      -- :: (Integral a) => [b] -> a -> b-   , genericReplicate  -- :: (Integral a) => a -> b -> [b]+   , genericLength+   , genericTake+   , genericDrop+   , genericSplitAt+   , genericIndex+   , genericReplicate     ) where -#ifdef __NHC__-import Prelude-#endif- import Data.Maybe import Data.Char        ( isSpace ) -#ifdef __GLASGOW_HASKELL__ import GHC.Num import GHC.Real import GHC.List import GHC.Base-#endif  infix 5 \\ -- comment to fool cpp @@ -235,7 +224,8 @@ -- > dropWhileEnd isSpace "foo\n" == "foo" -- > dropWhileEnd isSpace "foo bar" == "foo bar" -- > dropWhileEnd isSpace ("foo\n" ++ undefined) == "foo" ++ undefined-+--+-- /Since: 4.5.0.0/ dropWhileEnd :: (a -> Bool) -> [a] -> [a] dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) [] @@ -279,8 +269,7 @@ -- | The 'findIndices' function extends 'findIndex', by returning the -- indices of all elements satisfying the predicate, in ascending order. findIndices      :: (a -> Bool) -> [a] -> [Int]--#if defined(USE_REPORT_PRELUDE) || !defined(__GLASGOW_HASKELL__)+#ifdef USE_REPORT_PRELUDE findIndices p xs = [ i | (x,i) <- zip xs [0..], p x] #else -- Efficient definition@@ -525,13 +514,12 @@      GT -> y : insertBy cmp x ys'      _  -> x : ys -#ifdef __GLASGOW_HASKELL__- -- | 'maximum' returns the maximum value from a list, -- which must be non-empty, finite, and of an ordered type. -- It is a special case of 'Data.List.maximumBy', which allows the -- programmer to supply their own comparison function. maximum                 :: (Ord a) => [a] -> a+{-# NOINLINE [1] maximum #-} maximum []              =  errorEmptyList "maximum" maximum xs              =  foldl1 max xs @@ -552,6 +540,7 @@ -- It is a special case of 'Data.List.minimumBy', which allows the -- programmer to supply their own comparison function. minimum                 :: (Ord a) => [a] -> a+{-# NOINLINE [1] minimum #-} minimum []              =  errorEmptyList "minimum" minimum xs              =  foldl1 min xs @@ -564,8 +553,6 @@ strictMinimum []        =  errorEmptyList "minimum" strictMinimum xs        =  foldl1' min xs -#endif /* __GLASGOW_HASKELL__ */- -- | The 'maximumBy' function takes a comparison function and a list -- and returns the greatest element of the list by the comparison function. -- The list must be finite and non-empty.@@ -591,7 +578,8 @@ -- | The 'genericLength' function is an overloaded version of 'length'.  In -- particular, instead of returning an 'Int', it returns any type which is -- an instance of 'Num'.  It is, however, less efficient than 'length'.-genericLength           :: (Num i) => [b] -> i+genericLength           :: (Num i) => [a] -> i+{-# NOINLINE [1] genericLength #-} genericLength []        =  0 genericLength (_:l)     =  1 + genericLength l @@ -623,7 +611,7 @@  -- | The 'genericSplitAt' function is an overloaded version of 'splitAt', which -- accepts any 'Integral' value as the position at which to split.-genericSplitAt          :: (Integral i) => i -> [b] -> ([b],[b])+genericSplitAt          :: (Integral i) => i -> [a] -> ([a], [a]) genericSplitAt n xs | n <= 0 =  ([],xs) genericSplitAt _ []     =  ([],[]) genericSplitAt n (x:xs) =  (x:xs',xs'') where@@ -631,7 +619,7 @@  -- | The 'genericIndex' function is an overloaded version of '!!', which -- accepts any 'Integral' value as the index.-genericIndex :: (Integral a) => [b] -> a -> b+genericIndex :: (Integral i) => [a] -> i -> a genericIndex (x:_)  0 = x genericIndex (_:xs) n  | n > 0     = genericIndex xs (n-1)@@ -1001,37 +989,34 @@ -- -----------------------------------------------------------------------------  -- | A strict version of 'foldl'.-foldl'           :: (a -> b -> a) -> a -> [b] -> a-#ifdef __GLASGOW_HASKELL__+foldl'           :: (b -> a -> b) -> b -> [a] -> b foldl' f z0 xs0 = lgo z0 xs0     where lgo z []     = z           lgo z (x:xs) = let z' = f z x in z' `seq` lgo z' xs-#else-foldl' f a []     = a-foldl' f a (x:xs) = let a' = f a x in a' `seq` foldl' f a' xs-#endif -#ifdef __GLASGOW_HASKELL__ -- | 'foldl1' is a variant of 'foldl' that has no starting value argument, -- and thus must be applied to non-empty lists. foldl1                  :: (a -> a -> a) -> [a] -> a foldl1 f (x:xs)         =  foldl f x xs foldl1 _ []             =  errorEmptyList "foldl1"-#endif /* __GLASGOW_HASKELL__ */  -- | A strict version of 'foldl1' foldl1'                  :: (a -> a -> a) -> [a] -> a foldl1' f (x:xs)         =  foldl' f x xs foldl1' _ []             =  errorEmptyList "foldl1'" -#ifdef __GLASGOW_HASKELL__ -- ----------------------------------------------------------------------------- -- List sum and product  {-# SPECIALISE sum     :: [Int] -> Int #-} {-# SPECIALISE sum     :: [Integer] -> Integer #-}+{-# INLINABLE sum #-} {-# SPECIALISE product :: [Int] -> Int #-} {-# SPECIALISE product :: [Integer] -> Integer #-}+{-# INLINABLE product #-}+-- We make 'sum' and 'product' inlinable so that we get specialisations+-- at other types.  See, for example, Trac #7507.+ -- | The 'sum' function computes the sum of a finite list of numbers. sum                     :: (Num a) => [a] -> a -- | The 'product' function computes the product of a finite list of numbers.@@ -1057,7 +1042,6 @@ -- characters.  The resulting strings do not contain newlines. lines                   :: String -> [String] lines ""                =  []-#ifdef __GLASGOW_HASKELL__ -- Somehow GHC doesn't detect the selector thunks in the below code, -- so s' keeps a reference to the first line via the pair and we have -- a space leak (cf. #4334).@@ -1068,12 +1052,6 @@                                                     _:s''   -> lines s''))   where     cons ~(h, t)        =  h : t-#else-lines s                 =  let (l, s') = break (== '\n') s-                           in  l : case s' of-                                        []      -> []-                                        (_:s'') -> lines s''-#endif  -- | 'unlines' is an inverse operation to 'lines'. -- It joins lines, after appending a terminating newline to each.@@ -1109,12 +1087,3 @@ unwords [w]             = w unwords (w:ws)          = w ++ ' ' : unwords ws #endif--#else  /* !__GLASGOW_HASKELL__ */--errorEmptyList :: String -> a-errorEmptyList fun =-  error ("Prelude." ++ fun ++ ": empty list")--#endif /* !__GLASGOW_HASKELL__ */-
Data/Maybe.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -17,41 +17,22 @@  module Data.Maybe    (-     Maybe(Nothing,Just)-- instance of: Eq, Ord, Show, Read,-                        --              Functor, Monad, MonadPlus+     Maybe(Nothing,Just) -   , maybe              -- :: b -> (a -> b) -> Maybe a -> b+   , maybe -   , isJust             -- :: Maybe a -> Bool-   , isNothing          -- :: Maybe a -> Bool-   , fromJust           -- :: Maybe a -> a-   , fromMaybe          -- :: a -> Maybe a -> a-   , listToMaybe        -- :: [a] -> Maybe a-   , maybeToList        -- :: Maybe a -> [a]-   , catMaybes          -- :: [Maybe a] -> [a]-   , mapMaybe           -- :: (a -> Maybe b) -> [a] -> [b]+   , isJust+   , isNothing+   , fromJust+   , fromMaybe+   , listToMaybe+   , maybeToList+   , catMaybes+   , mapMaybe    ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base-#endif -#ifdef __NHC__-import Prelude-import Prelude (Maybe(..), maybe)-import Maybe-    ( isJust-    , isNothing-    , fromJust-    , fromMaybe-    , listToMaybe-    , maybeToList-    , catMaybes-    , mapMaybe-    )-#else--#ifndef __HUGS__ -- --------------------------------------------------------------------------- -- The Maybe type, and instances @@ -92,7 +73,6 @@ maybe :: b -> (a -> b) -> Maybe a -> b maybe n _ Nothing  = n maybe _ f (Just x) = f x-#endif  /* __HUGS__ */  -- | The 'isJust' function returns 'True' iff its argument is of the -- form @Just _@.@@ -146,6 +126,16 @@  case f x of   Nothing -> rs   Just r  -> r:rs+{-# NOINLINE [1] mapMaybe #-} -#endif /* else not __NHC__ */+{-# RULES+"mapMaybe"     [~1] forall f xs. mapMaybe f xs+                    = build (\c n -> foldr (mapMaybeFB c f) n xs)+"mapMaybeList" [1]  forall f. foldr (mapMaybeFB (:) f) [] = mapMaybe f+  #-} +{-# NOINLINE [0] mapMaybeFB #-}+mapMaybeFB :: (b -> r -> r) -> (a -> Maybe b) -> a -> r -> r+mapMaybeFB cons f x next = case f x of+  Nothing -> next+  Just r -> cons r next
Data/Monoid.hs view
@@ -1,5 +1,8 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE AutoDeriveTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}  ----------------------------------------------------------------------------- -- |@@ -36,16 +39,14 @@   ) where  -- Push down the module in the dependency hierarchy.-#if defined(__GLASGOW_HASKELL__) import GHC.Base hiding (Any) import GHC.Enum import GHC.Num import GHC.Read import GHC.Show+import GHC.Generics import Data.Maybe-#else-import Prelude-#endif+import Data.Proxy  {- -- just for testing@@ -92,6 +93,8 @@ infixr 6 <>  -- | An infix synonym for 'mappend'.+--+-- /Since: 4.5.0.0/ (<>) :: Monoid m => m -> m -> m (<>) = mappend {-# INLINE (<>) #-}@@ -142,9 +145,14 @@         EQ `mappend` y = y         GT `mappend` _ = GT +instance Monoid (Proxy s) where+    mempty = Proxy+    mappend _ _ = Proxy+    mconcat _ = Proxy+ -- | The dual of a monoid, obtained by swapping the arguments of 'mappend'. newtype Dual a = Dual { getDual :: a }-        deriving (Eq, Ord, Read, Show, Bounded)+        deriving (Eq, Ord, Read, Show, Bounded, Generic, Generic1)  instance Monoid a => Monoid (Dual a) where         mempty = Dual mempty@@ -152,6 +160,7 @@  -- | The monoid of endomorphisms under composition. newtype Endo a = Endo { appEndo :: a -> a }+               deriving (Generic)  instance Monoid (Endo a) where         mempty = Endo id@@ -159,7 +168,7 @@  -- | Boolean monoid under conjunction. newtype All = All { getAll :: Bool }-        deriving (Eq, Ord, Read, Show, Bounded)+        deriving (Eq, Ord, Read, Show, Bounded, Generic)  instance Monoid All where         mempty = All True@@ -167,7 +176,7 @@  -- | Boolean monoid under disjunction. newtype Any = Any { getAny :: Bool }-        deriving (Eq, Ord, Read, Show, Bounded)+        deriving (Eq, Ord, Read, Show, Bounded, Generic)  instance Monoid Any where         mempty = Any False@@ -175,7 +184,7 @@  -- | Monoid under addition. newtype Sum a = Sum { getSum :: a }-        deriving (Eq, Ord, Read, Show, Bounded)+        deriving (Eq, Ord, Read, Show, Bounded, Generic, Generic1, Num)  instance Num a => Monoid (Sum a) where         mempty = Sum 0@@ -183,7 +192,7 @@  -- | Monoid under multiplication. newtype Product a = Product { getProduct :: a }-        deriving (Eq, Ord, Read, Show, Bounded)+        deriving (Eq, Ord, Read, Show, Bounded, Generic, Generic1, Num)  instance Num a => Monoid (Product a) where         mempty = Product 1@@ -235,7 +244,7 @@  -- | Maybe monoid returning the leftmost non-Nothing value. newtype First a = First { getFirst :: Maybe a }-        deriving (Eq, Ord, Read, Show)+        deriving (Eq, Ord, Read, Show, Generic, Generic1)  instance Monoid (First a) where         mempty = First Nothing@@ -244,7 +253,7 @@  -- | Maybe monoid returning the rightmost non-Nothing value. newtype Last a = Last { getLast :: Maybe a }-        deriving (Eq, Ord, Read, Show)+        deriving (Eq, Ord, Read, Show, Generic, Generic1)  instance Monoid (Last a) where         mempty = Last Nothing
+ Data/OldTypeable.hs view
@@ -0,0 +1,179 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP+           , NoImplicitPrelude+           , OverlappingInstances+           , ScopedTypeVariables+           , FlexibleInstances+  #-}+{-# OPTIONS_GHC -funbox-strict-fields -fno-warn-warnings-deprecations #-}++-- The -XOverlappingInstances flag allows the user to over-ride+-- the instances for Typeable given here.  In particular, we provide an instance+--      instance ... => Typeable (s a) +-- But a user might want to say+--      instance ... => Typeable (MyType a b)++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Typeable+-- Copyright   :  (c) The University of Glasgow, CWI 2001--2004+-- License     :  BSD-style (see the file libraries/base/LICENSE)+-- +-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  portable+--+-- This module defines the old, kind-monomorphic 'Typeable' class. It is now+-- deprecated; users are recommended to use the kind-polymorphic+-- "Data.Typeable" module instead.+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++module Data.OldTypeable {-# DEPRECATED "Use Data.Typeable instead" #-} -- deprecated in 7.8+  (++        -- * The Typeable class+        Typeable( typeOf ),     -- :: a -> TypeRep++        -- * Type-safe cast+        cast,                   -- :: (Typeable a, Typeable b) => a -> Maybe b+        gcast,                  -- a generalisation of cast++        -- * Type representations+        TypeRep,        -- abstract, instance of: Eq, Show, Typeable+        showsTypeRep,++        TyCon,          -- abstract, instance of: Eq, Show, Typeable+        tyConString,    -- :: TyCon   -> String+        tyConPackage,   -- :: TyCon   -> String+        tyConModule,    -- :: TyCon   -> String+        tyConName,      -- :: TyCon   -> String++        -- * Construction of type representations+        mkTyCon,        -- :: String  -> TyCon+        mkTyCon3,       -- :: String  -> String -> String -> TyCon+        mkTyConApp,     -- :: TyCon   -> [TypeRep] -> TypeRep+        mkAppTy,        -- :: TypeRep -> TypeRep   -> TypeRep+        mkFunTy,        -- :: TypeRep -> TypeRep   -> TypeRep++        -- * Observation of type representations+        splitTyConApp,  -- :: TypeRep -> (TyCon, [TypeRep])+        funResultTy,    -- :: TypeRep -> TypeRep   -> Maybe TypeRep+        typeRepTyCon,   -- :: TypeRep -> TyCon+        typeRepArgs,    -- :: TypeRep -> [TypeRep]+        typeRepKey,     -- :: TypeRep -> IO TypeRepKey+        TypeRepKey,     -- abstract, instance of Eq, Ord++        -- * The other Typeable classes+        -- | /Note:/ The general instances are provided for GHC only.+        Typeable1( typeOf1 ),   -- :: t a -> TypeRep+        Typeable2( typeOf2 ),   -- :: t a b -> TypeRep+        Typeable3( typeOf3 ),   -- :: t a b c -> TypeRep+        Typeable4( typeOf4 ),   -- :: t a b c d -> TypeRep+        Typeable5( typeOf5 ),   -- :: t a b c d e -> TypeRep+        Typeable6( typeOf6 ),   -- :: t a b c d e f -> TypeRep+        Typeable7( typeOf7 ),   -- :: t a b c d e f g -> TypeRep+        gcast1,                 -- :: ... => c (t a) -> Maybe (c (t' a))+        gcast2,                 -- :: ... => c (t a b) -> Maybe (c (t' a b))++        -- * Default instances+        -- | /Note:/ These are not needed by GHC, for which these instances+        -- are generated by general instance declarations.+        typeOfDefault,  -- :: (Typeable1 t, Typeable a) => t a -> TypeRep+        typeOf1Default, -- :: (Typeable2 t, Typeable a) => t a b -> TypeRep+        typeOf2Default, -- :: (Typeable3 t, Typeable a) => t a b c -> TypeRep+        typeOf3Default, -- :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep+        typeOf4Default, -- :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep+        typeOf5Default, -- :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep+        typeOf6Default  -- :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep++  ) where++import Data.OldTypeable.Internal hiding (mkTyCon)++import Unsafe.Coerce+import Data.Maybe++import GHC.Base++import GHC.Fingerprint.Type+import GHC.Fingerprint++#include "OldTypeable.h"++{-# DEPRECATED typeRepKey "TypeRep itself is now an instance of Ord" #-} -- deprecated in 7.2+-- | (DEPRECATED) Returns a unique key associated with a 'TypeRep'.+-- This function is deprecated because 'TypeRep' itself is now an+-- instance of 'Ord', so mappings can be made directly with 'TypeRep'+-- as the key.+--+typeRepKey :: TypeRep -> IO TypeRepKey+typeRepKey (TypeRep f _ _) = return (TypeRepKey f)++        -- +        -- let fTy = mkTyCon "Foo" in show (mkTyConApp (mkTyCon ",,")+        --                                 [fTy,fTy,fTy])+        -- +        -- returns "(Foo,Foo,Foo)"+        --+        -- The TypeRep Show instance promises to print tuple types+        -- correctly. Tuple type constructors are specified by a +        -- sequence of commas, e.g., (mkTyCon ",,,,") returns+        -- the 5-tuple tycon.++newtype TypeRepKey = TypeRepKey Fingerprint+  deriving (Eq,Ord)++----------------- Construction ---------------------++{-# DEPRECATED mkTyCon "either derive Typeable, or use mkTyCon3 instead" #-} -- deprecated in 7.2+-- | Backwards-compatible API+mkTyCon :: String       -- ^ unique string+        -> TyCon        -- ^ A unique 'TyCon' object+mkTyCon name = TyCon (fingerprintString name) "" "" name++-------------------------------------------------------------+--+--              Type-safe cast+--+-------------------------------------------------------------++-- | The type-safe cast operation+cast :: (Typeable a, Typeable b) => a -> Maybe b+cast x = r+       where+         r = if typeOf x == typeOf (fromJust r)+               then Just $ unsafeCoerce x+               else Nothing++-- | A flexible variation parameterised in a type constructor+gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)+gcast x = r+ where+  r = if typeOf (getArg x) == typeOf (getArg (fromJust r))+        then Just $ unsafeCoerce x+        else Nothing+  getArg :: c x -> x +  getArg = undefined++-- | Cast for * -> *+gcast1 :: (Typeable1 t, Typeable1 t') => c (t a) -> Maybe (c (t' a)) +gcast1 x = r+ where+  r = if typeOf1 (getArg x) == typeOf1 (getArg (fromJust r))+       then Just $ unsafeCoerce x+       else Nothing+  getArg :: c x -> x +  getArg = undefined++-- | Cast for * -> * -> *+gcast2 :: (Typeable2 t, Typeable2 t') => c (t a b) -> Maybe (c (t' a b)) +gcast2 x = r+ where+  r = if typeOf2 (getArg x) == typeOf2 (getArg (fromJust r))+       then Just $ unsafeCoerce x+       else Nothing+  getArg :: c x -> x +  getArg = undefined+
+ Data/OldTypeable/Internal.hs view
@@ -0,0 +1,475 @@+{-# LANGUAGE Unsafe #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Typeable.Internal+-- Copyright   :  (c) The University of Glasgow, CWI 2001--2011+-- License     :  BSD-style (see the file libraries/base/LICENSE)+-- +-- The representations of the types TyCon and TypeRep, and the+-- function mkTyCon which is used by derived instances of Typeable to+-- construct a TyCon.+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++{-# LANGUAGE CPP+           , NoImplicitPrelude+           , OverlappingInstances+           , ScopedTypeVariables+           , FlexibleInstances+           , MagicHash+           , DeriveDataTypeable+           , StandaloneDeriving #-}++module Data.OldTypeable.Internal {-# DEPRECATED "Use Data.Typeable.Internal instead" #-} ( -- deprecated in 7.8+    TypeRep(..),+    TyCon(..),+    mkTyCon,+    mkTyCon3,+    mkTyConApp,+    mkAppTy,+    typeRepTyCon,+    typeOfDefault,+    typeOf1Default,+    typeOf2Default,+    typeOf3Default,+    typeOf4Default,+    typeOf5Default,+    typeOf6Default,+    Typeable(..),+    Typeable1(..),+    Typeable2(..),+    Typeable3(..),+    Typeable4(..),+    Typeable5(..),+    Typeable6(..),+    Typeable7(..),+    mkFunTy,+    splitTyConApp,+    funResultTy,+    typeRepArgs,+    showsTypeRep,+    tyConString,+    listTc, funTc+  ) where++import GHC.Base+import GHC.Word+import GHC.Show+import Data.Maybe+import Data.List+import GHC.Num+import GHC.Real+import GHC.IORef+import GHC.IOArray+import GHC.MVar+import GHC.ST           ( ST )+import GHC.STRef        ( STRef )+import GHC.Ptr          ( Ptr, FunPtr )+import GHC.Stable+import GHC.Arr          ( Array, STArray )+import Data.Int++import GHC.Fingerprint.Type+import GHC.Fingerprint++-- | A concrete representation of a (monomorphic) type.  'TypeRep'+-- supports reasonably efficient equality.+data TypeRep = TypeRep {-# UNPACK #-} !Fingerprint TyCon [TypeRep]++-- Compare keys for equality+instance Eq TypeRep where+  (TypeRep k1 _ _) == (TypeRep k2 _ _) = k1 == k2++instance Ord TypeRep where+  (TypeRep k1 _ _) <= (TypeRep k2 _ _) = k1 <= k2++-- | An abstract representation of a type constructor.  'TyCon' objects can+-- be built using 'mkTyCon'.+data TyCon = TyCon {+   tyConHash    :: {-# UNPACK #-} !Fingerprint,+   tyConPackage :: String,+   tyConModule  :: String,+   tyConName    :: String+ }++instance Eq TyCon where+  (TyCon t1 _ _ _) == (TyCon t2 _ _ _) = t1 == t2++instance Ord TyCon where+  (TyCon k1 _ _ _) <= (TyCon k2 _ _ _) = k1 <= k2++----------------- Construction --------------------++#include "MachDeps.h"++-- mkTyCon is an internal function to make it easier for GHC to+-- generate derived instances.  GHC precomputes the MD5 hash for the+-- TyCon and passes it as two separate 64-bit values to mkTyCon.  The+-- TyCon for a derived Typeable instance will end up being statically+-- allocated.++#if WORD_SIZE_IN_BITS < 64+mkTyCon :: Word64# -> Word64# -> String -> String -> String -> TyCon+#else+mkTyCon :: Word#   -> Word#   -> String -> String -> String -> TyCon+#endif+mkTyCon high# low# pkg modl name+  = TyCon (Fingerprint (W64# high#) (W64# low#)) pkg modl name++-- | Applies a type constructor to a sequence of types+mkTyConApp  :: TyCon -> [TypeRep] -> TypeRep+mkTyConApp tc@(TyCon tc_k _ _ _) []+  = TypeRep tc_k tc [] -- optimisation: all derived Typeable instances+                       -- end up here, and it helps generate smaller+                       -- code for derived Typeable.+mkTyConApp tc@(TyCon tc_k _ _ _) args+  = TypeRep (fingerprintFingerprints (tc_k : arg_ks)) tc args+  where+    arg_ks = [k | TypeRep k _ _ <- args]++-- | A special case of 'mkTyConApp', which applies the function +-- type constructor to a pair of types.+mkFunTy  :: TypeRep -> TypeRep -> TypeRep+mkFunTy f a = mkTyConApp funTc [f,a]++-- | Splits a type constructor application+splitTyConApp :: TypeRep -> (TyCon,[TypeRep])+splitTyConApp (TypeRep _ tc trs) = (tc,trs)++-- | Applies a type to a function type.  Returns: @'Just' u@ if the+-- first argument represents a function of type @t -> u@ and the+-- second argument represents a function of type @t@.  Otherwise,+-- returns 'Nothing'.+funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep+funResultTy trFun trArg+  = case splitTyConApp trFun of+      (tc, [t1,t2]) | tc == funTc && t1 == trArg -> Just t2+      _ -> Nothing++-- | Adds a TypeRep argument to a TypeRep.+mkAppTy :: TypeRep -> TypeRep -> TypeRep+mkAppTy (TypeRep _ tc trs) arg_tr = mkTyConApp tc (trs ++ [arg_tr])+   -- Notice that we call mkTyConApp to construct the fingerprint from tc and+   -- the arg fingerprints.  Simply combining the current fingerprint with+   -- the new one won't give the same answer, but of course we want to +   -- ensure that a TypeRep of the same shape has the same fingerprint!+   -- See Trac #5962++-- | Builds a 'TyCon' object representing a type constructor.  An+-- implementation of "Data.Typeable" should ensure that the following holds:+--+-- >  A==A' ^ B==B' ^ C==C' ==> mkTyCon A B C == mkTyCon A' B' C'+--++--+mkTyCon3 :: String       -- ^ package name+         -> String       -- ^ module name+         -> String       -- ^ the name of the type constructor+         -> TyCon        -- ^ A unique 'TyCon' object+mkTyCon3 pkg modl name =+  TyCon (fingerprintString (unwords [pkg, modl, name])) pkg modl name++----------------- Observation ---------------------++-- | Observe the type constructor of a type representation+typeRepTyCon :: TypeRep -> TyCon+typeRepTyCon (TypeRep _ tc _) = tc++-- | Observe the argument types of a type representation+typeRepArgs :: TypeRep -> [TypeRep]+typeRepArgs (TypeRep _ _ args) = args++-- | Observe string encoding of a type representation+{-# DEPRECATED tyConString "renamed to tyConName; tyConModule and tyConPackage are also available." #-} -- deprecated in 7.4+tyConString :: TyCon   -> String+tyConString = tyConName++-------------------------------------------------------------+--+--      The Typeable class and friends+--+-------------------------------------------------------------++{- Note [Memoising typeOf]+~~~~~~~~~~~~~~~~~~~~~~~~~~+IMPORTANT: we don't want to recalculate the type-rep once per+call to the dummy argument.  This is what went wrong in Trac #3245+So we help GHC by manually keeping the 'rep' *outside* the value +lambda, thus+    +    typeOfDefault :: forall t a. (Typeable1 t, Typeable a) => t a -> TypeRep+    typeOfDefault = \_ -> rep+      where+        rep = typeOf1 (undefined :: t a) `mkAppTy` +              typeOf  (undefined :: a)++Notice the crucial use of scoped type variables here!+-}++-- | The class 'Typeable' allows a concrete representation of a type to+-- be calculated.+class Typeable a where+  typeOf :: a -> TypeRep+  -- ^ Takes a value of type @a@ and returns a concrete representation+  -- of that type.  The /value/ of the argument should be ignored by+  -- any instance of 'Typeable', so that it is safe to pass 'undefined' as+  -- the argument.++-- | Variant for unary type constructors+class Typeable1 t where+  typeOf1 :: t a -> TypeRep++-- | For defining a 'Typeable' instance from any 'Typeable1' instance.+typeOfDefault :: forall t a. (Typeable1 t, Typeable a) => t a -> TypeRep+typeOfDefault = \_ -> rep+ where+   rep = typeOf1 (undefined :: t a) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]++-- | Variant for binary type constructors+class Typeable2 t where+  typeOf2 :: t a b -> TypeRep++-- | For defining a 'Typeable1' instance from any 'Typeable2' instance.+typeOf1Default :: forall t a b. (Typeable2 t, Typeable a) => t a b -> TypeRep+typeOf1Default = \_ -> rep + where+   rep = typeOf2 (undefined :: t a b) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]++-- | Variant for 3-ary type constructors+class Typeable3 t where+  typeOf3 :: t a b c -> TypeRep++-- | For defining a 'Typeable2' instance from any 'Typeable3' instance.+typeOf2Default :: forall t a b c. (Typeable3 t, Typeable a) => t a b c -> TypeRep+typeOf2Default = \_ -> rep + where+   rep = typeOf3 (undefined :: t a b c) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]++-- | Variant for 4-ary type constructors+class Typeable4 t where+  typeOf4 :: t a b c d -> TypeRep++-- | For defining a 'Typeable3' instance from any 'Typeable4' instance.+typeOf3Default :: forall t a b c d. (Typeable4 t, Typeable a) => t a b c d -> TypeRep+typeOf3Default = \_ -> rep+ where+   rep = typeOf4 (undefined :: t a b c d) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]+   +-- | Variant for 5-ary type constructors+class Typeable5 t where+  typeOf5 :: t a b c d e -> TypeRep++-- | For defining a 'Typeable4' instance from any 'Typeable5' instance.+typeOf4Default :: forall t a b c d e. (Typeable5 t, Typeable a) => t a b c d e -> TypeRep+typeOf4Default = \_ -> rep + where+   rep = typeOf5 (undefined :: t a b c d e) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]++-- | Variant for 6-ary type constructors+class Typeable6 t where+  typeOf6 :: t a b c d e f -> TypeRep++-- | For defining a 'Typeable5' instance from any 'Typeable6' instance.+typeOf5Default :: forall t a b c d e f. (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep+typeOf5Default = \_ -> rep+ where+   rep = typeOf6 (undefined :: t a b c d e f) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]++-- | Variant for 7-ary type constructors+class Typeable7 t where+  typeOf7 :: t a b c d e f g -> TypeRep++-- | For defining a 'Typeable6' instance from any 'Typeable7' instance.+typeOf6Default :: forall t a b c d e f g. (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep+typeOf6Default = \_ -> rep+ where+   rep = typeOf7 (undefined :: t a b c d e f g) `mkAppTy` +         typeOf  (undefined :: a)+   -- Note [Memoising typeOf]++-- Given a @Typeable@/n/ instance for an /n/-ary type constructor,+-- define the instances for partial applications.+-- Programmers using non-GHC implementations must do this manually+-- for each type constructor.+-- (The INSTANCE_TYPEABLE/n/ macros in Typeable.h include this.)++-- | One Typeable instance for all Typeable1 instances+instance (Typeable1 s, Typeable a)+       => Typeable (s a) where+  typeOf = typeOfDefault++-- | One Typeable1 instance for all Typeable2 instances+instance (Typeable2 s, Typeable a)+       => Typeable1 (s a) where+  typeOf1 = typeOf1Default++-- | One Typeable2 instance for all Typeable3 instances+instance (Typeable3 s, Typeable a)+       => Typeable2 (s a) where+  typeOf2 = typeOf2Default++-- | One Typeable3 instance for all Typeable4 instances+instance (Typeable4 s, Typeable a)+       => Typeable3 (s a) where+  typeOf3 = typeOf3Default++-- | One Typeable4 instance for all Typeable5 instances+instance (Typeable5 s, Typeable a)+       => Typeable4 (s a) where+  typeOf4 = typeOf4Default++-- | One Typeable5 instance for all Typeable6 instances+instance (Typeable6 s, Typeable a)+       => Typeable5 (s a) where+  typeOf5 = typeOf5Default++-- | One Typeable6 instance for all Typeable7 instances+instance (Typeable7 s, Typeable a)+       => Typeable6 (s a) where+  typeOf6 = typeOf6Default++----------------- Showing TypeReps --------------------++instance Show TypeRep where+  showsPrec p (TypeRep _ tycon tys) =+    case tys of+      [] -> showsPrec p tycon+      [x]   | tycon == listTc -> showChar '[' . shows x . showChar ']'+      [a,r] | tycon == funTc  -> showParen (p > 8) $+                                 showsPrec 9 a .+                                 showString " -> " .+                                 showsPrec 8 r+      xs | isTupleTyCon tycon -> showTuple xs+         | otherwise         ->+            showParen (p > 9) $+            showsPrec p tycon . +            showChar ' '      . +            showArgs tys++showsTypeRep :: TypeRep -> ShowS+showsTypeRep = shows++instance Show TyCon where+  showsPrec _ t = showString (tyConName t)++isTupleTyCon :: TyCon -> Bool+isTupleTyCon (TyCon _ _ _ ('(':',':_)) = True+isTupleTyCon _                         = False++-- Some (Show.TypeRep) helpers:++showArgs :: Show a => [a] -> ShowS+showArgs [] = id+showArgs [a] = showsPrec 10 a+showArgs (a:as) = showsPrec 10 a . showString " " . showArgs as ++showTuple :: [TypeRep] -> ShowS+showTuple args = showChar '('+               . (foldr (.) id $ intersperse (showChar ',') +                               $ map (showsPrec 10) args)+               . showChar ')'++listTc :: TyCon+listTc = typeRepTyCon (typeOf [()])++funTc :: TyCon+funTc = mkTyCon3 "ghc-prim" "GHC.Types" "->"++-------------------------------------------------------------+--+--      Instances of the Typeable classes for Prelude types+--+-------------------------------------------------------------++#include "OldTypeable.h"++INSTANCE_TYPEABLE0((),unitTc,"()")+INSTANCE_TYPEABLE1([],listTc,"[]")+INSTANCE_TYPEABLE1(Maybe,maybeTc,"Maybe")+INSTANCE_TYPEABLE1(Ratio,ratioTc,"Ratio")++{-+TODO: Deriving this instance fails with:+libraries/base/Data/Typeable.hs:589:1:+    Can't make a derived instance of `Typeable2 (->)':+      The last argument of the instance must be a data or newtype application+    In the stand-alone deriving instance for `Typeable2 (->)'+-}+instance Typeable2 (->) where { typeOf2 _ = mkTyConApp funTc [] }++INSTANCE_TYPEABLE1(IO,ioTc,"IO")++-- Types defined in GHC.MVar+INSTANCE_TYPEABLE1(MVar,mvarTc,"MVar" )++INSTANCE_TYPEABLE2(Array,arrayTc,"Array")+INSTANCE_TYPEABLE2(IOArray,iOArrayTc,"IOArray")++INSTANCE_TYPEABLE2(ST,stTc,"ST")+INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")+INSTANCE_TYPEABLE3(STArray,sTArrayTc,"STArray")++INSTANCE_TYPEABLE2((,),pairTc,"(,)")+INSTANCE_TYPEABLE3((,,),tup3Tc,"(,,)")+INSTANCE_TYPEABLE4((,,,),tup4Tc,"(,,,)")+INSTANCE_TYPEABLE5((,,,,),tup5Tc,"(,,,,)")+INSTANCE_TYPEABLE6((,,,,,),tup6Tc,"(,,,,,)")+INSTANCE_TYPEABLE7((,,,,,,),tup7Tc,"(,,,,,,)")++INSTANCE_TYPEABLE1(Ptr,ptrTc,"Ptr")+INSTANCE_TYPEABLE1(FunPtr,funPtrTc,"FunPtr")+INSTANCE_TYPEABLE1(StablePtr,stablePtrTc,"StablePtr")+INSTANCE_TYPEABLE1(IORef,iORefTc,"IORef")++-------------------------------------------------------+--+-- Generate Typeable instances for standard datatypes+--+-------------------------------------------------------++INSTANCE_TYPEABLE0(Bool,boolTc,"Bool")+INSTANCE_TYPEABLE0(Char,charTc,"Char")+INSTANCE_TYPEABLE0(Float,floatTc,"Float")+INSTANCE_TYPEABLE0(Double,doubleTc,"Double")+INSTANCE_TYPEABLE0(Int,intTc,"Int")+INSTANCE_TYPEABLE0(Word,wordTc,"Word" )+INSTANCE_TYPEABLE0(Integer,integerTc,"Integer")+INSTANCE_TYPEABLE0(Ordering,orderingTc,"Ordering")++INSTANCE_TYPEABLE0(Int8,int8Tc,"Int8")+INSTANCE_TYPEABLE0(Int16,int16Tc,"Int16")+INSTANCE_TYPEABLE0(Int32,int32Tc,"Int32")+INSTANCE_TYPEABLE0(Int64,int64Tc,"Int64")++INSTANCE_TYPEABLE0(Word8,word8Tc,"Word8" )+INSTANCE_TYPEABLE0(Word16,word16Tc,"Word16")+INSTANCE_TYPEABLE0(Word32,word32Tc,"Word32")+INSTANCE_TYPEABLE0(Word64,word64Tc,"Word64")++INSTANCE_TYPEABLE0(TyCon,tyconTc,"TyCon")+INSTANCE_TYPEABLE0(TypeRep,typeRepTc,"TypeRep")++{-+TODO: This can't be derived currently:+libraries/base/Data/Typeable.hs:674:1:+    Can't make a derived instance of `Typeable RealWorld':+      The last argument of the instance must be a data or newtype application+    In the stand-alone deriving instance for `Typeable RealWorld'+-}+realWorldTc :: TyCon; \+realWorldTc = mkTyCon3 "ghc-prim" "GHC.Types" "RealWorld"; \+instance Typeable RealWorld where { typeOf _ = mkTyConApp realWorldTc [] }
+ Data/OldTypeable/Internal.hs-boot view
@@ -0,0 +1,28 @@+{-# LANGUAGE Unsafe #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}++module Data.OldTypeable.Internal (+    Typeable(typeOf),+    TypeRep,+    TyCon,+    mkTyCon,+    mkTyConApp+  ) where++import GHC.Base++data TypeRep+data TyCon++#include "MachDeps.h"++#if WORD_SIZE_IN_BITS < 64+mkTyCon :: Word64# -> Word64# -> String -> String -> String -> TyCon+#else+mkTyCon :: Word#   -> Word#   -> String -> String -> String -> TyCon+#endif++mkTyConApp   :: TyCon -> [TypeRep] -> TypeRep++class Typeable a where+  typeOf :: a -> TypeRep
Data/Ord.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -22,9 +22,9 @@    comparing,  ) where -#if __GLASGOW_HASKELL__ import GHC.Base-#endif+import GHC.Show+import GHC.Read  -- |  -- > comparing p x y = compare (p x) (p y)@@ -42,7 +42,11 @@ -- values thus wrapped will give you the opposite of their normal sort order. -- This is particularly useful when sorting in generalised list comprehensions, -- as in: @then sortWith by 'Down' x@-newtype Down a = Down a deriving (Eq)+--+-- Provides 'Show' and 'Read' instances (/since: 4.7.0.0/).+--+-- /Since: 4.6.0.0/+newtype Down a = Down a deriving (Eq, Show, Read)  instance Ord a => Ord (Down a) where     compare (Down x) (Down y) = y `compare` x
+ Data/Proxy.hs view
@@ -0,0 +1,88 @@+{-# LANGUAGE NoImplicitPrelude, Trustworthy #-}+{-# LANGUAGE PolyKinds #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Proxy+-- License     :  BSD-style (see the LICENSE file in the distribution)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  portable+--+-- Definition of a Proxy type (poly-kinded in GHC)+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++module Data.Proxy+  (+        Proxy(..), asProxyTypeOf+      , KProxy(..)+  ) where++import GHC.Base+import GHC.Show+import GHC.Read+import GHC.Enum+import GHC.Arr++-- | A concrete, poly-kinded proxy type+data Proxy t = Proxy++-- | A concrete, promotable proxy type, for use at the kind level+-- There are no instances for this because it is intended at the kind level only+data KProxy (t :: *) = KProxy++instance Eq (Proxy s) where+  _ == _ = True++instance Ord (Proxy s) where+  compare _ _ = EQ++instance Show (Proxy s) where+  showsPrec _ _ = showString "Proxy"++instance Read (Proxy s) where+  readsPrec d = readParen (d > 10) (\r -> [(Proxy, s) | ("Proxy",s) <- lex r ])++instance Enum (Proxy s) where+    succ _               = error "Proxy.succ"+    pred _               = error "Proxy.pred"+    fromEnum _           = 0+    toEnum 0             = Proxy+    toEnum _             = error "Proxy.toEnum: 0 expected"+    enumFrom _           = [Proxy]+    enumFromThen _ _     = [Proxy]+    enumFromThenTo _ _ _ = [Proxy]+    enumFromTo _ _       = [Proxy]++instance Ix (Proxy s) where+    range _           = [Proxy]+    index _ _         = 0+    inRange _ _       = True+    rangeSize _       = 1+    unsafeIndex _ _   = 0+    unsafeRangeSize _ = 1++instance Bounded (Proxy s) where+    minBound = Proxy+    maxBound = Proxy++instance Functor Proxy where+    fmap _ _ = Proxy+    {-# INLINE fmap #-}++instance Monad Proxy where+    return _ = Proxy+    {-# INLINE return #-}+    _ >>= _ = Proxy+    {-# INLINE (>>=) #-}++-- | 'asProxyTypeOf' is a type-restricted version of 'const'.+-- It is usually used as an infix operator, and its typing forces its first+-- argument (which is usually overloaded) to have the same type as the tag+-- of the second.+asProxyTypeOf :: a -> Proxy a -> a+asProxyTypeOf = const+{-# INLINE asProxyTypeOf #-}
Data/Ratio.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -18,38 +17,17 @@ module Data.Ratio     ( Ratio     , Rational-    , (%)               -- :: (Integral a) => a -> a -> Ratio a-    , numerator         -- :: (Integral a) => Ratio a -> a-    , denominator       -- :: (Integral a) => Ratio a -> a-    , approxRational    -- :: (RealFrac a) => a -> a -> Rational--    -- Ratio instances: -    --   (Integral a) => Eq   (Ratio a)-    --   (Integral a) => Ord  (Ratio a)-    --   (Integral a) => Num  (Ratio a)-    --   (Integral a) => Real (Ratio a)-    --   (Integral a) => Fractional (Ratio a)-    --   (Integral a) => RealFrac (Ratio a)-    --   (Integral a) => Enum     (Ratio a)-    --   (Read a, Integral a) => Read (Ratio a)-    --   (Integral a) => Show     (Ratio a)+    , (%)+    , numerator+    , denominator+    , approxRational    ) where  import Prelude -#ifdef __GLASGOW_HASKELL__ import GHC.Real         -- The basic defns for Ratio-#endif -#ifdef __HUGS__-import Hugs.Prelude(Ratio(..), (%), numerator, denominator)-#endif--#ifdef __NHC__-import Ratio (Ratio(..), (%), numerator, denominator, approxRational)-#else- -- ----------------------------------------------------------------------------- -- approxRational @@ -94,5 +72,4 @@                                            nd''       =  simplest' d' r' d r                                            n''        =  numerator nd''                                            d''        =  denominator nd''-#endif 
Data/STRef.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -17,29 +16,19 @@  module Data.STRef (         -- * STRefs-        STRef,          -- abstract, instance Eq-        newSTRef,       -- :: a -> ST s (STRef s a)-        readSTRef,      -- :: STRef s a -> ST s a-        writeSTRef,     -- :: STRef s a -> a -> ST s ()-        modifySTRef,    -- :: STRef s a -> (a -> a) -> ST s ()-        modifySTRef'    -- :: STRef s a -> (a -> a) -> ST s ()+        STRef,          -- abstract+        newSTRef,+        readSTRef,+        writeSTRef,+        modifySTRef,+        modifySTRef'  ) where  import Prelude -#ifdef __GLASGOW_HASKELL__ import GHC.ST import GHC.STRef-#endif -#ifdef __HUGS__-import Hugs.ST-import Data.Typeable--#include "Typeable.h"-INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")-#endif- -- | Mutate the contents of an 'STRef'. -- -- Be warned that 'modifySTRef' does not apply the function strictly.  This@@ -58,6 +47,8 @@ modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref  -- | Strict version of 'modifySTRef'+--+-- /Since: 4.6.0.0/ modifySTRef' :: STRef s a -> (a -> a) -> ST s () modifySTRef' ref f = do     x <- readSTRef ref
Data/STRef/Lazy.hs view
@@ -16,11 +16,11 @@  module Data.STRef.Lazy (         -- * STRefs-        ST.STRef,       -- abstract, instance Eq-        newSTRef,       -- :: a -> ST s (STRef s a)-        readSTRef,      -- :: STRef s a -> ST s a-        writeSTRef,     -- :: STRef s a -> a -> ST s ()-        modifySTRef     -- :: STRef s a -> (a -> a) -> ST s ()+        ST.STRef,       -- abstract+        newSTRef,+        readSTRef,+        writeSTRef,+        modifySTRef  ) where  import Control.Monad.ST.Lazy.Safe
Data/String.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude, FlexibleInstances #-}  ----------------------------------------------------------------------------- -- |@@ -26,19 +26,14 @@  , unwords  ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base-#endif- import Data.List (lines, words, unlines, unwords)  -- | Class for string-like datastructures; used by the overloaded string---   extension (-foverloaded-strings in GHC).+--   extension (-XOverloadedStrings in GHC). class IsString a where     fromString :: String -> a -#ifndef __NHC__ instance IsString [Char] where     fromString xs = xs-#endif 
Data/Traversable.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -16,15 +15,21 @@ -- -- See also -----  * /Applicative Programming with Effects/,---    by Conor McBride and Ross Paterson, online at+--  * \"Applicative Programming with Effects\",+--    by Conor McBride and Ross Paterson,+--    /Journal of Functional Programming/ 18:1 (2008) 1-13, online at --    <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>. -----  * /The Essence of the Iterator Pattern/,+--  * \"The Essence of the Iterator Pattern\", --    by Jeremy Gibbons and Bruno Oliveira,---    in /Mathematically-Structured Functional Programming/, 2006, and online at+--    in /Mathematically-Structured Functional Programming/, 2006, online at --    <http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/#iterator>. --+--  * \"An Investigation of the Laws of Traversals\",+--    by Mauro Jaskelioff and Ondrej Rypacek,+--    in /Mathematically-Structured Functional Programming/, 2012, online at+--    <http://arxiv.org/pdf/1202.2919>.+-- -- Note that the functions 'mapM' and 'sequence' generalize "Prelude" -- functions of the same names from lists to any 'Traversable' functor. -- To avoid ambiguity, either import the "Prelude" hiding these names@@ -33,11 +38,14 @@ -----------------------------------------------------------------------------  module Data.Traversable (+    -- * The 'Traversable' class     Traversable(..),+    -- * Utility functions     for,     forM,     mapAccumL,     mapAccumR,+    -- * General definitions for superclass methods     fmapDefault,     foldMapDefault,     ) where@@ -47,20 +55,72 @@ import Control.Applicative import Data.Foldable (Foldable()) import Data.Monoid (Monoid)+import Data.Proxy -#if defined(__GLASGOW_HASKELL__) import GHC.Arr-#elif defined(__HUGS__)-import Hugs.Array-#elif defined(__NHC__)-import Array-#endif  -- | Functors representing data structures that can be traversed from -- left to right. -- -- Minimal complete definition: 'traverse' or 'sequenceA'. --+-- A definition of 'traverse' must satisfy the following laws:+--+-- [/naturality/]+--   @t . 'traverse' f = 'traverse' (t . f)@+--   for every applicative transformation @t@+--+-- [/identity/]+--   @'traverse' Identity = Identity@+--+-- [/composition/]+--   @'traverse' (Compose . 'fmap' g . f) = Compose . 'fmap' ('traverse' g) . 'traverse' f@+--+-- A definition of 'sequenceA' must satisfy the following laws:+--+-- [/naturality/]+--   @t . 'sequenceA' = 'sequenceA' . 'fmap' t@+--   for every applicative transformation @t@+--+-- [/identity/]+--   @'sequenceA' . 'fmap' Identity = Identity@+--+-- [/composition/]+--   @'sequenceA' . 'fmap' Compose = Compose . 'fmap' 'sequenceA' . 'sequenceA'@+--+-- where an /applicative transformation/ is a function+--+-- @t :: (Applicative f, Applicative g) => f a -> g a@+--+-- preserving the 'Applicative' operations, i.e.+--+--  * @t ('pure' x) = 'pure' x@+--+--  * @t (x '<*>' y) = t x '<*>' t y@+--+-- and the identity functor @Identity@ and composition of functors @Compose@+-- are defined as+--+-- >   newtype Identity a = Identity a+-- >+-- >   instance Functor Identity where+-- >     fmap f (Identity x) = Identity (f x)+-- >+-- >   instance Applicative Indentity where+-- >     pure x = Identity x+-- >     Identity f <*> Identity x = Identity (f x)+-- >+-- >   newtype Compose f g a = Compose (f (g a))+-- >+-- >   instance (Functor f, Functor g) => Functor (Compose f g) where+-- >     fmap f (Compose x) = Compose (fmap (fmap f) x)+-- >+-- >   instance (Applicative f, Applicative g) => Applicative (Compose f g) where+-- >     pure x = Compose (pure (pure x))+-- >     Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)+--+-- (The naturality law is implied by parametricity.)+-- -- Instances are similar to 'Functor', e.g. given a data type -- -- > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)@@ -104,6 +164,7 @@     -- and collect the results.     sequence :: Monad m => t (m a) -> m (t a)     sequence = mapM id+    {-# MINIMAL traverse | sequenceA #-}  -- instances for Prelude types @@ -118,8 +179,28 @@      mapM = Prelude.mapM +instance Traversable (Either a) where+    traverse _ (Left x) = pure (Left x)+    traverse f (Right y) = Right <$> f y++instance Traversable ((,) a) where+    traverse f (x, y) = (,) x <$> f y+ instance Ix i => Traversable (Array i) where     traverse f arr = listArray (bounds arr) `fmap` traverse f (elems arr)++instance Traversable Proxy where+    traverse _ _ = pure Proxy+    {-# INLINE traverse #-}+    sequenceA _ = pure Proxy+    {-# INLINE sequenceA #-}+    mapM _ _ = return Proxy+    {-# INLINE mapM #-}+    sequence _ = return Proxy+    {-# INLINE sequence #-}++instance Traversable (Const m) where+    traverse _ (Const m) = pure $ Const m  -- general functions 
Data/Tuple.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- XXX -fno-warn-unused-imports needed for the GHC.Tuple import below. Sigh. @@ -18,32 +18,14 @@ -----------------------------------------------------------------------------  module Data.Tuple-  ( fst         -- :: (a,b) -> a-  , snd         -- :: (a,b) -> a-  , curry       -- :: ((a, b) -> c) -> a -> b -> c-  , uncurry     -- :: (a -> b -> c) -> ((a, b) -> c)-  , swap        -- :: (a,b) -> (b,a)-#ifdef __NHC__-  , (,)(..)-  , (,,)(..)-  , (,,,)(..)-  , (,,,,)(..)-  , (,,,,,)(..)-  , (,,,,,,)(..)-  , (,,,,,,,)(..)-  , (,,,,,,,,)(..)-  , (,,,,,,,,,)(..)-  , (,,,,,,,,,,)(..)-  , (,,,,,,,,,,,)(..)-  , (,,,,,,,,,,,,)(..)-  , (,,,,,,,,,,,,,)(..)-  , (,,,,,,,,,,,,,,)(..)-#endif+  ( fst+  , snd+  , curry+  , uncurry+  , swap   )     where -#ifdef __GLASGOW_HASKELL__- import GHC.Base -- We need to depend on GHC.Base so that -- a) so that we get GHC.Classes, GHC.Types@@ -56,37 +38,11 @@ -- data constructors of `(,)' are in scope when we do -- the standalone deriving instance for Eq (a,b) etc -#endif  /* __GLASGOW_HASKELL__ */--#ifdef __NHC__-import Prelude-import Prelude-  ( (,)(..)-  , (,,)(..)-  , (,,,)(..)-  , (,,,,)(..)-  , (,,,,,)(..)-  , (,,,,,,)(..)-  , (,,,,,,,)(..)-  , (,,,,,,,,)(..)-  , (,,,,,,,,,)(..)-  , (,,,,,,,,,,)(..)-  , (,,,,,,,,,,,)(..)-  , (,,,,,,,,,,,,)(..)-  , (,,,,,,,,,,,,,)(..)-  , (,,,,,,,,,,,,,,)(..)-  -- nhc98's prelude only supplies tuple instances up to size 15-  , fst, snd-  , curry, uncurry-  )-#endif- default ()              -- Double isn't available yet  -- --------------------------------------------------------------------------- -- Standard functions over tuples -#if !defined(__HUGS__) && !defined(__NHC__) -- | Extract the first component of a pair. fst                     :: (a,b) -> a fst (x,_)               =  x@@ -102,7 +58,6 @@ -- | 'uncurry' converts a curried function to a function on pairs. uncurry                 :: (a -> b -> c) -> ((a, b) -> c) uncurry f p             =  f (fst p) (snd p)-#endif  /* neither __HUGS__ nor __NHC__ */  -- | Swap the components of a pair. swap                    :: (a,b) -> (b,a)
+ Data/Type/Bool.hs view
@@ -0,0 +1,56 @@+{-# LANGUAGE TypeFamilies, TypeOperators, DataKinds, NoImplicitPrelude,+             PolyKinds #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Type.Bool+-- License     :  BSD-style (see the LICENSE file in the distribution)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  not portable+--+-- Basic operations on type-level Booleans.+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++module Data.Type.Bool (+  If, type (&&), type (||), Not+  ) where++import Data.Bool++-- This needs to be in base because (&&) is used in Data.Type.Equality.+-- The other functions do not need to be in base, but seemed to be appropriate+-- here.++-- | Type-level "If". @If True a b@ ==> @a@; @If False a b@ ==> @b@+type family If cond tru fls where+  If True  tru fls = tru+  If False tru fls = fls++-- | Type-level "and"+type family a && b where+  False && a     = False+  True  && a     = a+  a     && False = False+  a     && True  = a+  a     && a     = a+infixr 3 &&++-- | Type-level "or"+type family a || b where+  False || a     = a+  True  || a     = True+  a     || False = a+  a     || True  = True+  a     || a     = a+infixr 2 ||++-- | Type-level "not"+type family Not a where+  Not False = True+  Not True  = False++  
+ Data/Type/Coercion.hs view
@@ -0,0 +1,101 @@+{-# LANGUAGE DeriveGeneric       #-}+{-# LANGUAGE TypeOperators       #-}+{-# LANGUAGE TypeFamilies        #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE GADTs               #-}+{-# LANGUAGE FlexibleInstances   #-}+{-# LANGUAGE StandaloneDeriving  #-}+{-# LANGUAGE NoImplicitPrelude   #-}+{-# LANGUAGE PolyKinds           #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Type.Coercion+-- License     :  BSD-style (see the LICENSE file in the distribution)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  not portable+--+-- Definition of representational equality ('Coercion').+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++module Data.Type.Coercion+  ( Coercion(..)+  , coerceWith+  , sym+  , trans+  , repr+  , TestCoercion(..)+  ) where++import qualified Data.Type.Equality as Eq+import Data.Maybe+import GHC.Enum+import GHC.Show+import GHC.Read+import GHC.Base++-- | Representational equality. If @Coercion a b@ is inhabited by some terminating+-- value, then the type @a@ has the same underlying representation as the type @b@.+--+-- To use this equality in practice, pattern-match on the @Coercion a b@ to get out+-- the @Coercible a b@ instance, and then use 'coerce' to apply it.+--+-- /Since: 4.7.0.0/+data Coercion a b where+  Coercion :: Coercible a b => Coercion a b++-- with credit to Conal Elliott for 'ty', Erik Hesselink & Martijn van+-- Steenbergen for 'type-equality', Edward Kmett for 'eq', and Gabor Greif+-- for 'type-eq'++newtype Sym a b = Sym { unsym :: Coercion b a }++-- | Type-safe cast, using representational equality+coerceWith :: Coercion a b -> a -> b+coerceWith Coercion x = coerce x++-- | Symmetry of representational equality+sym :: forall a b. Coercion a b -> Coercion b a+sym Coercion = unsym (coerce (Sym Coercion :: Sym a a))++-- | Transitivity of representational equality+trans :: Coercion a b -> Coercion b c -> Coercion a c+trans c Coercion = coerce c++-- | Convert propositional (nominal) equality to representational equality+repr :: (a Eq.:~: b) -> Coercion a b+repr Eq.Refl = Coercion++deriving instance Eq   (Coercion a b)+deriving instance Show (Coercion a b)+deriving instance Ord  (Coercion a b)++instance Coercible a b => Read (Coercion a b) where+  readsPrec d = readParen (d > 10) (\r -> [(Coercion, s) | ("Coercion",s) <- lex r ])++instance Coercible a b => Enum (Coercion a b) where+  toEnum 0 = Coercion+  toEnum _ = error "Data.Type.Coercion.toEnum: bad argument"++  fromEnum Coercion = 0++instance Coercible a b => Bounded (Coercion a b) where+  minBound = Coercion+  maxBound = Coercion++-- | This class contains types where you can learn the equality of two types+-- from information contained in /terms/. Typically, only singleton types should+-- inhabit this class.+class TestCoercion f where+  -- | Conditionally prove the representational equality of @a@ and @b@.+  testCoercion :: f a -> f b -> Maybe (Coercion a b)++instance TestCoercion ((Eq.:~:) a) where+  testCoercion Eq.Refl Eq.Refl = Just Coercion++instance TestCoercion (Coercion a) where+  testCoercion c Coercion = Just $ coerce (sym c)
+ Data/Type/Equality.hs view
@@ -0,0 +1,227 @@+{-# LANGUAGE DeriveGeneric        #-}+{-# LANGUAGE TypeOperators        #-}+{-# LANGUAGE GADTs                #-}+{-# LANGUAGE FlexibleInstances    #-}+{-# LANGUAGE StandaloneDeriving   #-}+{-# LANGUAGE NoImplicitPrelude    #-}+{-# LANGUAGE PolyKinds            #-}+{-# LANGUAGE RankNTypes           #-}+{-# LANGUAGE DataKinds            #-}+{-# LANGUAGE TypeFamilies         #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE ExplicitNamespaces   #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Type.Equality+-- License     :  BSD-style (see the LICENSE file in the distribution)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  not portable+--+-- Definition of propositional equality @(:~:)@. Pattern-matching on a variable+-- of type @(a :~: b)@ produces a proof that @a ~ b@.+--+-- /Since: 4.7.0.0/+-----------------------------------------------------------------------------++++module Data.Type.Equality (+  -- * The equality type+  (:~:)(..),+  +  -- * Working with equality+  sym, trans, castWith, gcastWith, apply, inner, outer,++  -- * Inferring equality from other types+  TestEquality(..),++  -- * Boolean type-level equality+  type (==)+  ) where++import Data.Maybe+import GHC.Enum+import GHC.Show+import GHC.Read+import GHC.Base+import Data.Type.Bool++infix 4 :~:++-- | Propositional equality. If @a :~: b@ is inhabited by some terminating+-- value, then the type @a@ is the same as the type @b@. To use this equality+-- in practice, pattern-match on the @a :~: b@ to get out the @Refl@ constructor;+-- in the body of the pattern-match, the compiler knows that @a ~ b@.+--+-- /Since: 4.7.0.0/+data a :~: b where+  Refl :: a :~: a++-- with credit to Conal Elliott for 'ty', Erik Hesselink & Martijn van+-- Steenbergen for 'type-equality', Edward Kmett for 'eq', and Gabor Greif+-- for 'type-eq'++-- | Symmetry of equality+sym :: (a :~: b) -> (b :~: a)+sym Refl = Refl++-- | Transitivity of equality+trans :: (a :~: b) -> (b :~: c) -> (a :~: c)+trans Refl Refl = Refl++-- | Type-safe cast, using propositional equality+castWith :: (a :~: b) -> a -> b+castWith Refl x = x++-- | Generalized form of type-safe cast using propositional equality+gcastWith :: (a :~: b) -> ((a ~ b) => r) -> r+gcastWith Refl x = x++-- | Apply one equality to another, respectively+apply :: (f :~: g) -> (a :~: b) -> (f a :~: g b)+apply Refl Refl = Refl++-- | Extract equality of the arguments from an equality of a applied types+inner :: (f a :~: g b) -> (a :~: b)+inner Refl = Refl++-- | Extract equality of type constructors from an equality of applied types+outer :: (f a :~: g b) -> (f :~: g)+outer Refl = Refl++deriving instance Eq   (a :~: b)+deriving instance Show (a :~: b)+deriving instance Ord  (a :~: b)++instance a ~ b => Read (a :~: b) where+  readsPrec d = readParen (d > 10) (\r -> [(Refl, s) | ("Refl",s) <- lex r ])++instance a ~ b => Enum (a :~: b) where+  toEnum 0 = Refl+  toEnum _ = error "Data.Type.Equality.toEnum: bad argument"++  fromEnum Refl = 0++instance a ~ b => Bounded (a :~: b) where+  minBound = Refl+  maxBound = Refl++-- | This class contains types where you can learn the equality of two types+-- from information contained in /terms/. Typically, only singleton types should+-- inhabit this class.+class TestEquality f where+  -- | Conditionally prove the equality of @a@ and @b@.+  testEquality :: f a -> f b -> Maybe (a :~: b)++instance TestEquality ((:~:) a) where+  testEquality Refl Refl = Just Refl++-- | A type family to compute Boolean equality. Instances are provided+-- only for /open/ kinds, such as @*@ and function kinds. Instances are+-- also provided for datatypes exported from base. A poly-kinded instance+-- is /not/ provided, as a recursive definition for algebraic kinds is+-- generally more useful.+type family (a :: k) == (b :: k) :: Bool+infix 4 ==++-- all of the following closed type families are local to this module+type family EqStar (a :: *) (b :: *) where+  EqStar a a = True+  EqStar a b = False++-- This looks dangerous, but it isn't. This allows == to be defined+-- over arbitrary type constructors.+type family EqArrow (a :: k1 -> k2) (b :: k1 -> k2) where+  EqArrow a a = True+  EqArrow a b = False++type family EqBool a b where+  EqBool True  True  = True+  EqBool False False = True+  EqBool a     b     = False++type family EqOrdering a b where+  EqOrdering LT LT = True+  EqOrdering EQ EQ = True+  EqOrdering GT GT = True+  EqOrdering a  b  = False++type EqUnit (a :: ()) (b :: ()) = True++type family EqList a b where+  EqList '[]        '[]        = True+  EqList (h1 ': t1) (h2 ': t2) = (h1 == h2) && (t1 == t2)+  EqList a          b          = False++type family EqMaybe a b where+  EqMaybe Nothing  Nothing  = True+  EqMaybe (Just x) (Just y) = x == y+  EqMaybe a        b        = False++type family Eq2 a b where+  Eq2 '(a1, b1) '(a2, b2) = a1 == a2 && b1 == b2++type family Eq3 a b where+  Eq3 '(a1, b1, c1) '(a2, b2, c2) = a1 == a2 && b1 == b2 && c1 == c2++type family Eq4 a b where+  Eq4 '(a1, b1, c1, d1) '(a2, b2, c2, d2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2++type family Eq5 a b where+  Eq5 '(a1, b1, c1, d1, e1) '(a2, b2, c2, d2, e2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2++type family Eq6 a b where+  Eq6 '(a1, b1, c1, d1, e1, f1) '(a2, b2, c2, d2, e2, f2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2++type family Eq7 a b where+  Eq7 '(a1, b1, c1, d1, e1, f1, g1) '(a2, b2, c2, d2, e2, f2, g2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2++type family Eq8 a b where+  Eq8 '(a1, b1, c1, d1, e1, f1, g1, h1) '(a2, b2, c2, d2, e2, f2, g2, h2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2++type family Eq9 a b where+  Eq9 '(a1, b1, c1, d1, e1, f1, g1, h1, i1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2++type family Eq10 a b where+  Eq10 '(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2 && j1 == j2++type family Eq11 a b where+  Eq11 '(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2 && j1 == j2 && k1 == k2++type family Eq12 a b where+  Eq12 '(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2 && j1 == j2 && k1 == k2 && l1 == l2++type family Eq13 a b where+  Eq13 '(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2 && j1 == j2 && k1 == k2 && l1 == l2 && m1 == m2++type family Eq14 a b where+  Eq14 '(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2 && j1 == j2 && k1 == k2 && l1 == l2 && m1 == m2 && n1 == n2++type family Eq15 a b where+  Eq15 '(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1) '(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2) = a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2 && f1 == f2 && g1 == g2 && h1 == h2 && i1 == i2 && j1 == j2 && k1 == k2 && l1 == l2 && m1 == m2 && n1 == n2 && o1 == o2++-- these all look to be overlapping, but they are differentiated by their kinds+type instance a == b = EqStar a b+type instance a == b = EqArrow a b+type instance a == b = EqBool a b+type instance a == b = EqOrdering a b+type instance a == b = EqUnit a b+type instance a == b = EqList a b+type instance a == b = EqMaybe a b+type instance a == b = Eq2 a b+type instance a == b = Eq3 a b+type instance a == b = Eq4 a b+type instance a == b = Eq5 a b+type instance a == b = Eq6 a b+type instance a == b = Eq7 a b+type instance a == b = Eq8 a b+type instance a == b = Eq9 a b+type instance a == b = Eq10 a b+type instance a == b = Eq11 a b+type instance a == b = Eq12 a b+type instance a == b = Eq13 a b+type instance a == b = Eq14 a b+type instance a == b = Eq15 a b
Data/Typeable.hs view
@@ -1,10 +1,12 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude+{-# LANGUAGE NoImplicitPrelude            , OverlappingInstances            , ScopedTypeVariables-           , ForeignFunctionInterface            , FlexibleInstances+           , TypeOperators+           , PolyKinds+           , GADTs+           , MagicHash   #-} {-# OPTIONS_GHC -funbox-strict-fields #-} @@ -33,30 +35,53 @@ -- and type-safe cast (but not dynamics) to support the \"Scrap your -- boilerplate\" style of generic programming. --+-- == Compatibility Notes+--+-- Since GHC 7.8, 'Typeable' is poly-kinded. The changes required for this might+-- break some old programs involving 'Typeable'. More details on this, including+-- how to fix your code, can be found on the+-- <https://ghc.haskell.org/trac/ghc/wiki/GhcKinds/PolyTypeable PolyTypeable wiki page>+-- -----------------------------------------------------------------------------  module Data.Typeable   (-         -- * The Typeable class-        Typeable( typeOf ),     -- :: a -> TypeRep+        Typeable,+        typeRep, +        -- * Propositional equality+        (:~:)(Refl),++        -- * For backwards compatibility+        typeOf, typeOf1, typeOf2, typeOf3, typeOf4, typeOf5, typeOf6, typeOf7,+        Typeable1, Typeable2, Typeable3, Typeable4, Typeable5, Typeable6,+        Typeable7,+         -- * Type-safe cast-        cast,                   -- :: (Typeable a, Typeable b) => a -> Maybe b+        cast,+        eqT,         gcast,                  -- a generalisation of cast +        -- * Generalized casts for higher-order kinds+        gcast1,                 -- :: ... => c (t a) -> Maybe (c (t' a))+        gcast2,                 -- :: ... => c (t a b) -> Maybe (c (t' a b))++        -- * A canonical proxy type+        Proxy (..),+                 -- * Type representations         TypeRep,        -- abstract, instance of: Eq, Show, Typeable         showsTypeRep,          TyCon,          -- abstract, instance of: Eq, Show, Typeable-        tyConString,    -- :: TyCon   -> String-        tyConPackage,   -- :: TyCon   -> String-        tyConModule,    -- :: TyCon   -> String-        tyConName,      -- :: TyCon   -> String+        tyConString,+        tyConPackage,+        tyConModule,+        tyConName,          -- * Construction of type representations-        mkTyCon,        -- :: String  -> TyCon+        -- mkTyCon,        -- :: String  -> TyCon         mkTyCon3,       -- :: String  -> String -> String -> TyCon         mkTyConApp,     -- :: TyCon   -> [TypeRep] -> TypeRep         mkAppTy,        -- :: TypeRep -> TypeRep   -> TypeRep@@ -67,104 +92,15 @@         funResultTy,    -- :: TypeRep -> TypeRep   -> Maybe TypeRep         typeRepTyCon,   -- :: TypeRep -> TyCon         typeRepArgs,    -- :: TypeRep -> [TypeRep]-        typeRepKey,     -- :: TypeRep -> IO TypeRepKey-        TypeRepKey,     -- abstract, instance of Eq, Ord--        -- * The other Typeable classes-        -- | /Note:/ The general instances are provided for GHC only.-        Typeable1( typeOf1 ),   -- :: t a -> TypeRep-        Typeable2( typeOf2 ),   -- :: t a b -> TypeRep-        Typeable3( typeOf3 ),   -- :: t a b c -> TypeRep-        Typeable4( typeOf4 ),   -- :: t a b c d -> TypeRep-        Typeable5( typeOf5 ),   -- :: t a b c d e -> TypeRep-        Typeable6( typeOf6 ),   -- :: t a b c d e f -> TypeRep-        Typeable7( typeOf7 ),   -- :: t a b c d e f g -> TypeRep-        gcast1,                 -- :: ... => c (t a) -> Maybe (c (t' a))-        gcast2,                 -- :: ... => c (t a b) -> Maybe (c (t' a b))--        -- * Default instances-        -- | /Note:/ These are not needed by GHC, for which these instances-        -- are generated by general instance declarations.-        typeOfDefault,  -- :: (Typeable1 t, Typeable a) => t a -> TypeRep-        typeOf1Default, -- :: (Typeable2 t, Typeable a) => t a b -> TypeRep-        typeOf2Default, -- :: (Typeable3 t, Typeable a) => t a b c -> TypeRep-        typeOf3Default, -- :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep-        typeOf4Default, -- :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep-        typeOf5Default, -- :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep-        typeOf6Default  -- :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep-   ) where  import Data.Typeable.Internal hiding (mkTyCon)+import Data.Type.Equality  import Unsafe.Coerce import Data.Maybe--#ifdef __GLASGOW_HASKELL__ import GHC.Base-import GHC.Err          (undefined) -import {-# SOURCE #-} GHC.Fingerprint-   -- loop: GHC.Fingerprint -> Foreign.Ptr -> Data.Typeable-   -- Better to break the loop here, because we want non-SOURCE imports-   -- of Data.Typeable as much as possible so we can optimise the derived-   -- instances.--#endif--#ifdef __HUGS__-import Hugs.Prelude     ( Key(..), TypeRep(..), TyCon(..), Ratio,-                          Handle, Ptr, FunPtr, ForeignPtr, StablePtr )-import Hugs.IORef       ( IORef, newIORef, readIORef, writeIORef )-import Hugs.IOExts      ( unsafePerformIO )-        -- For the Typeable instance-import Hugs.Array       ( Array )-import Hugs.IOArray-import Hugs.ConcBase    ( MVar )-#endif--#ifdef __NHC__-import NHC.IOExtras (IOArray,IORef,newIORef,readIORef,writeIORef,unsafePerformIO)-import IO (Handle)-import Ratio (Ratio)-        -- For the Typeable instance-import NHC.FFI  ( Ptr,FunPtr,StablePtr,ForeignPtr )-import Array    ( Array )-#endif--#include "Typeable.h"--{-# DEPRECATED typeRepKey "TypeRep itself is now an instance of Ord" #-}--- | (DEPRECATED) Returns a unique key associated with a 'TypeRep'.--- This function is deprecated because 'TypeRep' itself is now an--- instance of 'Ord', so mappings can be made directly with 'TypeRep'--- as the key.----typeRepKey :: TypeRep -> IO TypeRepKey-typeRepKey (TypeRep f _ _) = return (TypeRepKey f)--        -- -        -- let fTy = mkTyCon "Foo" in show (mkTyConApp (mkTyCon ",,")-        --                                 [fTy,fTy,fTy])-        -- -        -- returns "(Foo,Foo,Foo)"-        ---        -- The TypeRep Show instance promises to print tuple types-        -- correctly. Tuple type constructors are specified by a -        -- sequence of commas, e.g., (mkTyCon ",,,,") returns-        -- the 5-tuple tycon.--newtype TypeRepKey = TypeRepKey Fingerprint-  deriving (Eq,Ord)------------------- Construction -----------------------{-# DEPRECATED mkTyCon "either derive Typeable, or use mkTyCon3 instead" #-}--- | Backwards-compatible API-mkTyCon :: String       -- ^ unique string-        -> TyCon        -- ^ A unique 'TyCon' object-mkTyCon name = TyCon (fingerprintString name) "" "" name- ------------------------------------------------------------- -- --              Type-safe cast@@ -172,40 +108,30 @@ -------------------------------------------------------------  -- | The type-safe cast operation-cast :: (Typeable a, Typeable b) => a -> Maybe b-cast x = r-       where-         r = if typeOf x == typeOf (fromJust r)-               then Just $ unsafeCoerce x-               else Nothing+cast :: forall a b. (Typeable a, Typeable b) => a -> Maybe b+cast x = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b)+           then Just $ unsafeCoerce x+           else Nothing +-- | Extract a witness of equality of two types+--+-- /Since: 4.7.0.0/+eqT :: forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)+eqT = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b)+      then Just $ unsafeCoerce Refl+      else Nothing+ -- | A flexible variation parameterised in a type constructor-gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)-gcast x = r- where-  r = if typeOf (getArg x) == typeOf (getArg (fromJust r))-        then Just $ unsafeCoerce x-        else Nothing-  getArg :: c x -> x -  getArg = undefined+gcast :: forall a b c. (Typeable a, Typeable b) => c a -> Maybe (c b)+gcast x = fmap (\Refl -> x) (eqT :: Maybe (a :~: b)) --- | Cast for * -> *-gcast1 :: (Typeable1 t, Typeable1 t') => c (t a) -> Maybe (c (t' a)) -gcast1 x = r- where-  r = if typeOf1 (getArg x) == typeOf1 (getArg (fromJust r))-       then Just $ unsafeCoerce x-       else Nothing-  getArg :: c x -> x -  getArg = undefined+-- | Cast over @k1 -> k2@+gcast1 :: forall c t t' a. (Typeable t, Typeable t')+       => c (t a) -> Maybe (c (t' a)) +gcast1 x = fmap (\Refl -> x) (eqT :: Maybe (t :~: t')) --- | Cast for * -> * -> *-gcast2 :: (Typeable2 t, Typeable2 t') => c (t a b) -> Maybe (c (t' a b)) -gcast2 x = r- where-  r = if typeOf2 (getArg x) == typeOf2 (getArg (fromJust r))-       then Just $ unsafeCoerce x-       else Nothing-  getArg :: c x -> x -  getArg = undefined+-- | Cast over @k1 -> k2 -> k3@+gcast2 :: forall c t t' a b. (Typeable t, Typeable t')+       => c (t a b) -> Maybe (c (t' a b)) +gcast2 x = fmap (\Refl -> x) (eqT :: Maybe (t :~: t')) 
− Data/Typeable.hs-boot
@@ -1,10 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude #-}--module Data.Typeable (Typeable, mkTyConApp, cast) where--import Data.Maybe-import {-# SOURCE #-} Data.Typeable.Internal--cast :: (Typeable a, Typeable b) => a -> Maybe b-
Data/Typeable/Internal.hs view
@@ -1,4 +1,5 @@-{-# LANGUAGE Unsafe #-}+{-# LANGUAGE Unsafe             #-}+{-# LANGUAGE ConstraintKinds    #-}  ----------------------------------------------------------------------------- -- |@@ -17,63 +18,53 @@            , OverlappingInstances            , ScopedTypeVariables            , FlexibleInstances-           , MagicHash #-}-#ifdef __GLASGOW_HASKELL__-{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif+           , MagicHash+           , KindSignatures+           , PolyKinds+           , DeriveDataTypeable+           , StandaloneDeriving #-}  module Data.Typeable.Internal (+    Proxy (..),     TypeRep(..),     Fingerprint(..),+    typeOf, typeOf1, typeOf2, typeOf3, typeOf4, typeOf5, typeOf6, typeOf7,+    Typeable1, Typeable2, Typeable3, Typeable4, Typeable5, Typeable6, Typeable7,     TyCon(..),+    typeRep,     mkTyCon,     mkTyCon3,     mkTyConApp,     mkAppTy,     typeRepTyCon,-    typeOfDefault,-    typeOf1Default,-    typeOf2Default,-    typeOf3Default,-    typeOf4Default,-    typeOf5Default,-    typeOf6Default,     Typeable(..),-    Typeable1(..),-    Typeable2(..),-    Typeable3(..),-    Typeable4(..),-    Typeable5(..),-    Typeable6(..),-    Typeable7(..),     mkFunTy,     splitTyConApp,     funResultTy,     typeRepArgs,     showsTypeRep,     tyConString,-#if defined(__GLASGOW_HASKELL__)     listTc, funTc-#endif   ) where  import GHC.Base import GHC.Word import GHC.Show-import GHC.Err          (undefined) import Data.Maybe-import Data.List+import Data.Proxy import GHC.Num import GHC.Real-import GHC.IORef-import GHC.IOArray-import GHC.MVar+-- import GHC.IORef+-- import GHC.IOArray+-- import GHC.MVar import GHC.ST           ( ST ) import GHC.STRef        ( STRef ) import GHC.Ptr          ( Ptr, FunPtr )-import GHC.Stable+-- import GHC.Stable import GHC.Arr          ( Array, STArray )-import Data.Int+import Data.Type.Coercion+import Data.Type.Equality+-- import Data.Int  import GHC.Fingerprint.Type import {-# SOURCE #-} GHC.Fingerprint@@ -97,9 +88,9 @@ -- be built using 'mkTyCon'. data TyCon = TyCon {    tyConHash    :: {-# UNPACK #-} !Fingerprint,-   tyConPackage :: String,-   tyConModule  :: String,-   tyConName    :: String+   tyConPackage :: String, -- ^ /Since: 4.5.0.0/+   tyConModule  :: String, -- ^ /Since: 4.5.0.0/+   tyConName    :: String  -- ^ /Since: 4.5.0.0/  }  instance Eq TyCon where@@ -177,7 +168,7 @@          -> String       -- ^ the name of the type constructor          -> TyCon        -- ^ A unique 'TyCon' object mkTyCon3 pkg modl name =-  TyCon (fingerprintString (unwords [pkg, modl, name])) pkg modl name+  TyCon (fingerprintString (pkg ++ (' ':modl) ++ (' ':name))) pkg modl name  ----------------- Observation --------------------- @@ -190,7 +181,7 @@ typeRepArgs (TypeRep _ _ args) = args  -- | Observe string encoding of a type representation-{-# DEPRECATED tyConString "renamed to tyConName; tyConModule and tyConPackage are also available." #-}+{-# DEPRECATED tyConString "renamed to 'tyConName'; 'tyConModule' and 'tyConPackage' are also available." #-} -- deprecated in 7.4 tyConString :: TyCon   -> String tyConString = tyConName @@ -200,221 +191,68 @@ -- ------------------------------------------------------------- -{- Note [Memoising typeOf]-~~~~~~~~~~~~~~~~~~~~~~~~~~-IMPORTANT: we don't want to recalculate the type-rep once per-call to the dummy argument.  This is what went wrong in Trac #3245-So we help GHC by manually keeping the 'rep' *outside* the value -lambda, thus-    -    typeOfDefault :: forall t a. (Typeable1 t, Typeable a) => t a -> TypeRep-    typeOfDefault = \_ -> rep-      where-        rep = typeOf1 (undefined :: t a) `mkAppTy` -              typeOf  (undefined :: a)--Notice the crucial use of scoped type variables here!--}- -- | The class 'Typeable' allows a concrete representation of a type to -- be calculated. class Typeable a where-  typeOf :: a -> TypeRep-  -- ^ Takes a value of type @a@ and returns a concrete representation-  -- of that type.  The /value/ of the argument should be ignored by-  -- any instance of 'Typeable', so that it is safe to pass 'undefined' as-  -- the argument.---- | Variant for unary type constructors-class Typeable1 t where-  typeOf1 :: t a -> TypeRep--#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable' instance from any 'Typeable1' instance.-typeOfDefault :: forall t a. (Typeable1 t, Typeable a) => t a -> TypeRep-typeOfDefault = \_ -> rep- where-   rep = typeOf1 (undefined :: t a) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable' instance from any 'Typeable1' instance.-typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep-typeOfDefault x = typeOf1 x `mkAppTy` typeOf (argType x)- where-   argType :: t a -> a-   argType = undefined-#endif---- | Variant for binary type constructors-class Typeable2 t where-  typeOf2 :: t a b -> TypeRep--#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable1' instance from any 'Typeable2' instance.-typeOf1Default :: forall t a b. (Typeable2 t, Typeable a) => t a b -> TypeRep-typeOf1Default = \_ -> rep - where-   rep = typeOf2 (undefined :: t a b) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable1' instance from any 'Typeable2' instance.-typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep-typeOf1Default x = typeOf2 x `mkAppTy` typeOf (argType x)- where-   argType :: t a b -> a-   argType = undefined-#endif---- | Variant for 3-ary type constructors-class Typeable3 t where-  typeOf3 :: t a b c -> TypeRep--#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable2' instance from any 'Typeable3' instance.-typeOf2Default :: forall t a b c. (Typeable3 t, Typeable a) => t a b c -> TypeRep-typeOf2Default = \_ -> rep - where-   rep = typeOf3 (undefined :: t a b c) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable2' instance from any 'Typeable3' instance.-typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep-typeOf2Default x = typeOf3 x `mkAppTy` typeOf (argType x)- where-   argType :: t a b c -> a-   argType = undefined-#endif---- | Variant for 4-ary type constructors-class Typeable4 t where-  typeOf4 :: t a b c d -> TypeRep--#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable3' instance from any 'Typeable4' instance.-typeOf3Default :: forall t a b c d. (Typeable4 t, Typeable a) => t a b c d -> TypeRep-typeOf3Default = \_ -> rep- where-   rep = typeOf4 (undefined :: t a b c d) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable3' instance from any 'Typeable4' instance.-typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep-typeOf3Default x = typeOf4 x `mkAppTy` typeOf (argType x)- where-   argType :: t a b c d -> a-   argType = undefined-#endif-   --- | Variant for 5-ary type constructors-class Typeable5 t where-  typeOf5 :: t a b c d e -> TypeRep--#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable4' instance from any 'Typeable5' instance.-typeOf4Default :: forall t a b c d e. (Typeable5 t, Typeable a) => t a b c d e -> TypeRep-typeOf4Default = \_ -> rep - where-   rep = typeOf5 (undefined :: t a b c d e) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable4' instance from any 'Typeable5' instance.-typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep-typeOf4Default x = typeOf5 x `mkAppTy` typeOf (argType x)- where-   argType :: t a b c d e -> a-   argType = undefined-#endif---- | Variant for 6-ary type constructors-class Typeable6 t where-  typeOf6 :: t a b c d e f -> TypeRep+  typeRep# :: Proxy# a -> TypeRep -#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable5' instance from any 'Typeable6' instance.-typeOf5Default :: forall t a b c d e f. (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep-typeOf5Default = \_ -> rep- where-   rep = typeOf6 (undefined :: t a b c d e f) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable5' instance from any 'Typeable6' instance.-typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep-typeOf5Default x = typeOf6 x `mkAppTy` typeOf (argType x)- where-   argType :: t a b c d e f -> a-   argType = undefined-#endif+-- | Takes a value of type @a@ and returns a concrete representation+-- of that type.+--+-- /Since: 4.7.0.0/+typeRep :: forall proxy a. Typeable a => proxy a -> TypeRep+typeRep _ = typeRep# (proxy# :: Proxy# a)+{-# INLINE typeRep #-} --- | Variant for 7-ary type constructors-class Typeable7 t where-  typeOf7 :: t a b c d e f g -> TypeRep+-- Keeping backwards-compatibility+typeOf :: forall a. Typeable a => a -> TypeRep+typeOf _ = typeRep (Proxy :: Proxy a) -#ifdef __GLASGOW_HASKELL__--- | For defining a 'Typeable6' instance from any 'Typeable7' instance.-typeOf6Default :: forall t a b c d e f g. (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep-typeOf6Default = \_ -> rep- where-   rep = typeOf7 (undefined :: t a b c d e f g) `mkAppTy` -         typeOf  (undefined :: a)-   -- Note [Memoising typeOf]-#else--- | For defining a 'Typeable6' instance from any 'Typeable7' instance.-typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep-typeOf6Default x = typeOf7 x `mkAppTy` typeOf (argType x)- where-   argType :: t a b c d e f g -> a-   argType = undefined-#endif+typeOf1 :: forall t (a :: *). Typeable t => t a -> TypeRep+typeOf1 _ = typeRep (Proxy :: Proxy t) -#ifdef __GLASGOW_HASKELL__--- Given a @Typeable@/n/ instance for an /n/-ary type constructor,--- define the instances for partial applications.--- Programmers using non-GHC implementations must do this manually--- for each type constructor.--- (The INSTANCE_TYPEABLE/n/ macros in Typeable.h include this.)+typeOf2 :: forall t (a :: *) (b :: *). Typeable t => t a b -> TypeRep+typeOf2 _ = typeRep (Proxy :: Proxy t) --- | One Typeable instance for all Typeable1 instances-instance (Typeable1 s, Typeable a)-       => Typeable (s a) where-  typeOf = typeOfDefault+typeOf3 :: forall t (a :: *) (b :: *) (c :: *). Typeable t+        => t a b c -> TypeRep+typeOf3 _ = typeRep (Proxy :: Proxy t) --- | One Typeable1 instance for all Typeable2 instances-instance (Typeable2 s, Typeable a)-       => Typeable1 (s a) where-  typeOf1 = typeOf1Default+typeOf4 :: forall t (a :: *) (b :: *) (c :: *) (d :: *). Typeable t+        => t a b c d -> TypeRep+typeOf4 _ = typeRep (Proxy :: Proxy t) --- | One Typeable2 instance for all Typeable3 instances-instance (Typeable3 s, Typeable a)-       => Typeable2 (s a) where-  typeOf2 = typeOf2Default+typeOf5 :: forall t (a :: *) (b :: *) (c :: *) (d :: *) (e :: *). Typeable t+        => t a b c d e -> TypeRep+typeOf5 _ = typeRep (Proxy :: Proxy t) --- | One Typeable3 instance for all Typeable4 instances-instance (Typeable4 s, Typeable a)-       => Typeable3 (s a) where-  typeOf3 = typeOf3Default+typeOf6 :: forall t (a :: *) (b :: *) (c :: *) (d :: *) (e :: *) (f :: *).+                Typeable t => t a b c d e f -> TypeRep+typeOf6 _ = typeRep (Proxy :: Proxy t) --- | One Typeable4 instance for all Typeable5 instances-instance (Typeable5 s, Typeable a)-       => Typeable4 (s a) where-  typeOf4 = typeOf4Default+typeOf7 :: forall t (a :: *) (b :: *) (c :: *) (d :: *) (e :: *) (f :: *)+                (g :: *). Typeable t => t a b c d e f g -> TypeRep+typeOf7 _ = typeRep (Proxy :: Proxy t) --- | One Typeable5 instance for all Typeable6 instances-instance (Typeable6 s, Typeable a)-       => Typeable5 (s a) where-  typeOf5 = typeOf5Default+type Typeable1 (a :: * -> *)                               = Typeable a+type Typeable2 (a :: * -> * -> *)                          = Typeable a+type Typeable3 (a :: * -> * -> * -> *)                     = Typeable a+type Typeable4 (a :: * -> * -> * -> * -> *)                = Typeable a+type Typeable5 (a :: * -> * -> * -> * -> * -> *)           = Typeable a+type Typeable6 (a :: * -> * -> * -> * -> * -> * -> *)      = Typeable a+type Typeable7 (a :: * -> * -> * -> * -> * -> * -> * -> *) = Typeable a --- | One Typeable6 instance for all Typeable7 instances-instance (Typeable7 s, Typeable a)-       => Typeable6 (s a) where-  typeOf6 = typeOf6Default+{-# DEPRECATED Typeable1 "renamed to 'Typeable'" #-} -- deprecated in 7.8+{-# DEPRECATED Typeable2 "renamed to 'Typeable'" #-} -- deprecated in 7.8+{-# DEPRECATED Typeable3 "renamed to 'Typeable'" #-} -- deprecated in 7.8+{-# DEPRECATED Typeable4 "renamed to 'Typeable'" #-} -- deprecated in 7.8+{-# DEPRECATED Typeable5 "renamed to 'Typeable'" #-} -- deprecated in 7.8+{-# DEPRECATED Typeable6 "renamed to 'Typeable'" #-} -- deprecated in 7.8+{-# DEPRECATED Typeable7 "renamed to 'Typeable'" #-} -- deprecated in 7.8 -#endif /* __GLASGOW_HASKELL__ */+-- | Kind-polymorphic Typeable instance for type application+instance (Typeable s, Typeable a) => Typeable (s a) where+  typeRep# _ = typeRep# (proxy# :: Proxy# s) `mkAppTy` typeRep# (proxy# :: Proxy# a)  ----------------- Showing TypeReps -------------------- @@ -432,7 +270,7 @@             showParen (p > 9) $             showsPrec p tycon .              showChar ' '      . -            showArgs tys+            showArgs (showChar ' ') tys  showsTypeRep :: TypeRep -> ShowS showsTypeRep = shows@@ -446,24 +284,21 @@  -- Some (Show.TypeRep) helpers: -showArgs :: Show a => [a] -> ShowS-showArgs [] = id-showArgs [a] = showsPrec 10 a-showArgs (a:as) = showsPrec 10 a . showString " " . showArgs as +showArgs :: Show a => ShowS -> [a] -> ShowS+showArgs _   []     = id+showArgs _   [a]    = showsPrec 10 a+showArgs sep (a:as) = showsPrec 10 a . sep . showArgs sep as   showTuple :: [TypeRep] -> ShowS showTuple args = showChar '('-               . (foldr (.) id $ intersperse (showChar ',') -                               $ map (showsPrec 10) args)+               . showArgs (showChar ',') args                . showChar ')' -#if defined(__GLASGOW_HASKELL__) listTc :: TyCon listTc = typeRepTyCon (typeOf [()])  funTc :: TyCon-funTc = mkTyCon3 "ghc-prim" "GHC.Types" "->"-#endif+funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->)))  ------------------------------------------------------------- --@@ -471,60 +306,28 @@ -- ------------------------------------------------------------- -#include "Typeable.h"--INSTANCE_TYPEABLE0((),unitTc,"()")-INSTANCE_TYPEABLE1([],listTc,"[]")-INSTANCE_TYPEABLE1(Maybe,maybeTc,"Maybe")-INSTANCE_TYPEABLE1(Ratio,ratioTc,"Ratio")-#if defined(__GLASGOW_HASKELL__)-{--TODO: Deriving this instance fails with:-libraries/base/Data/Typeable.hs:589:1:-    Can't make a derived instance of `Typeable2 (->)':-      The last argument of the instance must be a data or newtype application-    In the stand-alone deriving instance for `Typeable2 (->)'--}-instance Typeable2 (->) where { typeOf2 _ = mkTyConApp funTc [] }-#else-INSTANCE_TYPEABLE2((->),funTc,"->")-#endif-INSTANCE_TYPEABLE1(IO,ioTc,"IO")--#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)--- Types defined in GHC.MVar-INSTANCE_TYPEABLE1(MVar,mvarTc,"MVar" )-#endif+deriving instance Typeable ()+deriving instance Typeable []+deriving instance Typeable Maybe+deriving instance Typeable Ratio+deriving instance Typeable (->)+deriving instance Typeable IO -INSTANCE_TYPEABLE2(Array,arrayTc,"Array")-INSTANCE_TYPEABLE2(IOArray,iOArrayTc,"IOArray")+deriving instance Typeable Array -#ifdef __GLASGOW_HASKELL__--- Hugs has these too, but their Typeable<n> instances are defined--- elsewhere to keep this module within Haskell 98.--- This is important because every invocation of runhugs or ffihugs--- uses this module via Data.Dynamic.-INSTANCE_TYPEABLE2(ST,stTc,"ST")-INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")-INSTANCE_TYPEABLE3(STArray,sTArrayTc,"STArray")-#endif+deriving instance Typeable ST+deriving instance Typeable STRef+deriving instance Typeable STArray -#ifndef __NHC__-INSTANCE_TYPEABLE2((,),pairTc,"(,)")-INSTANCE_TYPEABLE3((,,),tup3Tc,"(,,)")-INSTANCE_TYPEABLE4((,,,),tup4Tc,"(,,,)")-INSTANCE_TYPEABLE5((,,,,),tup5Tc,"(,,,,)")-INSTANCE_TYPEABLE6((,,,,,),tup6Tc,"(,,,,,)")-INSTANCE_TYPEABLE7((,,,,,,),tup7Tc,"(,,,,,,)")-#endif /* __NHC__ */+deriving instance Typeable (,)+deriving instance Typeable (,,)+deriving instance Typeable (,,,)+deriving instance Typeable (,,,,)+deriving instance Typeable (,,,,,)+deriving instance Typeable (,,,,,,) -INSTANCE_TYPEABLE1(Ptr,ptrTc,"Ptr")-INSTANCE_TYPEABLE1(FunPtr,funPtrTc,"FunPtr")-#ifndef __GLASGOW_HASKELL__-INSTANCE_TYPEABLE1(ForeignPtr,foreignPtrTc,"ForeignPtr")-#endif-INSTANCE_TYPEABLE1(StablePtr,stablePtrTc,"StablePtr")-INSTANCE_TYPEABLE1(IORef,iORefTc,"IORef")+deriving instance Typeable Ptr+deriving instance Typeable FunPtr  ------------------------------------------------------- --@@ -532,43 +335,24 @@ -- ------------------------------------------------------- -INSTANCE_TYPEABLE0(Bool,boolTc,"Bool")-INSTANCE_TYPEABLE0(Char,charTc,"Char")-INSTANCE_TYPEABLE0(Float,floatTc,"Float")-INSTANCE_TYPEABLE0(Double,doubleTc,"Double")-INSTANCE_TYPEABLE0(Int,intTc,"Int")-#ifndef __NHC__-INSTANCE_TYPEABLE0(Word,wordTc,"Word" )-#endif-INSTANCE_TYPEABLE0(Integer,integerTc,"Integer")-INSTANCE_TYPEABLE0(Ordering,orderingTc,"Ordering")-#ifndef __GLASGOW_HASKELL__-INSTANCE_TYPEABLE0(Handle,handleTc,"Handle")-#endif--INSTANCE_TYPEABLE0(Int8,int8Tc,"Int8")-INSTANCE_TYPEABLE0(Int16,int16Tc,"Int16")-INSTANCE_TYPEABLE0(Int32,int32Tc,"Int32")-INSTANCE_TYPEABLE0(Int64,int64Tc,"Int64")--INSTANCE_TYPEABLE0(Word8,word8Tc,"Word8" )-INSTANCE_TYPEABLE0(Word16,word16Tc,"Word16")-INSTANCE_TYPEABLE0(Word32,word32Tc,"Word32")-INSTANCE_TYPEABLE0(Word64,word64Tc,"Word64")+deriving instance Typeable Bool+deriving instance Typeable Char+deriving instance Typeable Float+deriving instance Typeable Double+deriving instance Typeable Int+deriving instance Typeable Word+deriving instance Typeable Integer+deriving instance Typeable Ordering -INSTANCE_TYPEABLE0(TyCon,tyconTc,"TyCon")-INSTANCE_TYPEABLE0(TypeRep,typeRepTc,"TypeRep")+deriving instance Typeable Word8+deriving instance Typeable Word16+deriving instance Typeable Word32+deriving instance Typeable Word64 -#ifdef __GLASGOW_HASKELL__-{--TODO: This can't be derived currently:-libraries/base/Data/Typeable.hs:674:1:-    Can't make a derived instance of `Typeable RealWorld':-      The last argument of the instance must be a data or newtype application-    In the stand-alone deriving instance for `Typeable RealWorld'--}-realWorldTc :: TyCon; \-realWorldTc = mkTyCon3 "ghc-prim" "GHC.Types" "RealWorld"; \-instance Typeable RealWorld where { typeOf _ = mkTyConApp realWorldTc [] }+deriving instance Typeable TyCon+deriving instance Typeable TypeRep -#endif+deriving instance Typeable RealWorld+deriving instance Typeable Proxy+deriving instance Typeable (:~:)+deriving instance Typeable Coercion
Data/Typeable/Internal.hs-boot view
@@ -1,8 +1,9 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, PolyKinds #-}  module Data.Typeable.Internal (-    Typeable(typeOf),+    Proxy(..),+    Typeable(typeRep),     TypeRep,     TyCon,     mkTyCon,@@ -10,6 +11,7 @@   ) where  import GHC.Base+import {-# SOURCE #-} Data.Proxy  data TypeRep data TyCon@@ -25,4 +27,4 @@ mkTyConApp   :: TyCon -> [TypeRep] -> TypeRep  class Typeable a where-  typeOf :: a -> TypeRep+  typeRep :: proxy a -> TypeRep
Data/Unique.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}--#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE MagicHash, DeriveDataTypeable #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -21,29 +17,23 @@  module Data.Unique (    -- * Unique objects-   Unique,              -- instance (Eq, Ord)-   newUnique,           -- :: IO Unique-   hashUnique           -- :: Unique -> Int+   Unique,+   newUnique,+   hashUnique  ) where  import Prelude  import System.IO.Unsafe (unsafePerformIO) -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Num import Data.Typeable import Data.IORef-#endif  -- | An abstract unique object.  Objects of type 'Unique' may be -- compared for equality and ordering and hashed into 'Int'.-newtype Unique = Unique Integer deriving (Eq,Ord-#ifdef __GLASGOW_HASKELL__-   ,Typeable-#endif-   )+newtype Unique = Unique Integer deriving (Eq,Ord,Typeable)  uniqSource :: IORef Integer uniqSource = unsafePerformIO (newIORef 0)@@ -55,8 +45,8 @@ -- times 'newUnique' may be called. newUnique :: IO Unique newUnique = do-  r <- atomicModifyIORef uniqSource $ \x -> let z = x+1 in (z,z)-  r `seq` return (Unique r)+  r <- atomicModifyIORef' uniqSource $ \x -> let z = x+1 in (z,z)+  return (Unique r)  -- SDM (18/3/2010): changed from MVar to STM.  This fixes --  1. there was no async exception protection@@ -73,12 +63,12 @@ --     Unique. --  3. IORef version is very slightly faster. +-- IGL (08/06/2013): changed to using atomicModifyIORef' instead.+--  This feels a little safer, from the point of view of not leaking+--  memory, but the resulting core is identical.+ -- | Hashes a 'Unique' into an 'Int'.  Two 'Unique's may hash to the -- same value, although in practice this is unlikely.  The 'Int' -- returned makes a good hash key. hashUnique :: Unique -> Int-#if defined(__GLASGOW_HASKELL__) hashUnique (Unique i) = I# (hashInteger i)-#else-hashUnique (Unique u) = fromInteger (u `mod` (toInteger (maxBound :: Int) + 1))-#endif
Data/Version.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, DeriveDataTypeable #-}+{-# LANGUAGE DeriveDataTypeable #-}  ----------------------------------------------------------------------------- -- |@@ -35,23 +35,9 @@  import Prelude -- necessary to get dependencies right --- These #ifdefs are necessary because this code might be compiled as--- part of ghc/lib/compat, and hence might be compiled by an older version--- of GHC.  In which case, we might need to pick up ReadP from --- Distribution.Compat.ReadP, because the version in --- Text.ParserCombinators.ReadP doesn't have all the combinators we need.-#if __GLASGOW_HASKELL__ || __HUGS__ || __NHC__ import Text.ParserCombinators.ReadP-#else-import Distribution.Compat.ReadP-#endif -#if !__GLASGOW_HASKELL__-import Data.Typeable    ( Typeable, TyCon, mkTyCon, mkTyConApp )-#else import Data.Typeable    ( Typeable )-#endif- import Data.List        ( intersperse, sort ) import Control.Monad    ( liftM ) import Data.Char        ( isDigit, isAlphaNum )@@ -99,19 +85,7 @@                 -- The interpretation of the list of tags is entirely dependent                 -- on the entity that this version applies to.         }-  deriving (Read,Show-#if __GLASGOW_HASKELL__-        ,Typeable-#endif-        )--#if !__GLASGOW_HASKELL__-versionTc :: TyCon-versionTc = mkTyCon "Version"--instance Typeable Version where-  typeOf _ = mkTyConApp versionTc []-#endif+  deriving (Read,Show,Typeable)  instance Eq Version where   v1 == v2  =  versionBranch v1 == versionBranch v2 @@ -135,13 +109,7 @@  -- | A parser for versions in the format produced by 'showVersion'. ---#if __GLASGOW_HASKELL__ || __HUGS__ parseVersion :: ReadP Version-#elif __NHC__-parseVersion :: ReadPN r Version-#else-parseVersion :: ReadP r Version-#endif parseVersion = do branch <- sepBy1 (liftM read $ munch1 isDigit) (char '.')                   tags   <- many (char '-' >> munch1 isAlphaNum)                   return Version{versionBranch=branch, versionTags=tags}
Data/Word.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -22,24 +22,15 @@         Word,         Word8, Word16, Word32, Word64, +        -- * byte swapping+        byteSwap16, byteSwap32, byteSwap64,+         -- * Notes          -- $notes         ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Word-#endif--#ifdef __HUGS__-import Hugs.Word-#endif--#ifdef __NHC__-import NHC.FFI (Word8, Word16, Word32, Word64)-import NHC.SizedTypes (Word8, Word16, Word32, Word64)   -- instances of Bits-type Word = Word32-#endif  {- $notes 
Debug/Trace.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, ForeignFunctionInterface, MagicHash, UnboxedTuples #-}+{-# LANGUAGE MagicHash, UnboxedTuples #-}  ----------------------------------------------------------------------------- -- |@@ -21,32 +21,37 @@ module Debug.Trace (         -- * Tracing         -- $tracing-        trace,            -- :: String -> a -> a+        trace,+        traceId,         traceShow,+        traceShowId,         traceStack,-        traceIO,          -- :: String -> IO ()+        traceIO,+        traceM,+        traceShowM,         putTraceMsg,          -- * Eventlog tracing         -- $eventlog_tracing         traceEvent,         traceEventIO,+        +        -- * Execution phase markers+        -- $markers+        traceMarker,+        traceMarkerIO,   ) where  import Prelude import System.IO.Unsafe import Control.Monad -#ifdef __GLASGOW_HASKELL__ import Foreign.C.String import GHC.Base import qualified GHC.Foreign import GHC.IO.Encoding import GHC.Ptr import GHC.Stack-#else-import System.IO (hPutStrLn,stderr)-#endif  -- $tracing --@@ -62,11 +67,9 @@ -- | The 'traceIO' function outputs the trace message from the IO monad. -- This sequences the output with respect to other IO actions. --+-- /Since: 4.5.0.0/ traceIO :: String -> IO () traceIO msg = do-#ifndef __GLASGOW_HASKELL__-    hPutStrLn stderr msg-#else     withCString "%s\n" $ \cfmt ->      withCString msg  $ \cmsg ->       debugBelch cfmt cmsg@@ -75,13 +78,11 @@ -- using the FFI. foreign import ccall unsafe "HsBase.h debugBelch2"    debugBelch :: CString -> CString -> IO ()-#endif ---- | Deprecated. Use 'traceIO'.+-- | putTraceMsg :: String -> IO () putTraceMsg = traceIO-{-# DEPRECATED putTraceMsg "Use Debug.Trace.traceIO" #-}+{-# DEPRECATED putTraceMsg "Use 'Debug.Trace.traceIO'" #-} -- deprecated in 7.4   {-# NOINLINE trace #-}@@ -104,6 +105,14 @@     return expr  {-|+Like 'trace' but returns the message instead of a third value.++/Since: 4.7.0.0/+-}+traceId :: String -> String+traceId a = trace a a++{-| Like 'trace', but uses 'show' on the argument to convert it to a 'String'.  This makes it convenient for printing the values of interesting variables or@@ -119,7 +128,62 @@ traceShow :: (Show a) => a -> b -> b traceShow = trace . show +{-|+Like 'traceShow' but returns the shown value instead of a third value. +/Since: 4.7.0.0/+-}+traceShowId :: (Show a) => a -> a+traceShowId a = trace (show a) a++{-|+Like 'trace' but returning unit in an arbitrary monad. Allows for convenient+use in do-notation. Note that the application of 'trace' is not an action in the+monad, as 'traceIO' is in the 'IO' monad.++> ... = do+>   x <- ...+>   traceM $ "x: " ++ show x+>   y <- ...+>   traceM $ "y: " ++ show y++/Since: 4.7.0.0/+-}+traceM :: (Monad m) => String -> m ()+traceM string = trace string $ return ()++{-|+Like 'traceM', but uses 'show' on the argument to convert it to a 'String'.++> ... = do+>   x <- ...+>   traceMShow $ x+>   y <- ...+>   traceMShow $ x + y++/Since: 4.7.0.0/+-}+traceShowM :: (Show a, Monad m) => a -> m ()+traceShowM = traceM . show++-- | like 'trace', but additionally prints a call stack if one is+-- available.+--+-- In the current GHC implementation, the call stack is only+-- availble if the program was compiled with @-prof@; otherwise+-- 'traceStack' behaves exactly like 'trace'.  Entries in the call+-- stack correspond to @SCC@ annotations, so it is a good idea to use+-- @-fprof-auto@ or @-fprof-auto-calls@ to add SCC annotations automatically.+--+-- /Since: 4.5.0.0/+traceStack :: String -> a -> a+traceStack str expr = unsafePerformIO $ do+   traceIO str+   stack <- currentCallStack+   when (not (null stack)) $ traceIO (renderStack stack)+   return expr++ -- $eventlog_tracing -- -- Eventlog tracing is a performance profiling system. These functions emit@@ -144,6 +208,7 @@ -- duplicate events emitted if two CPUs simultaneously evaluate the same thunk -- that uses 'traceEvent'. --+-- /Since: 4.5.0.0/ traceEvent :: String -> a -> a traceEvent msg expr = unsafeDupablePerformIO $ do     traceEventIO msg@@ -155,27 +220,58 @@ -- Compared to 'traceEvent', 'traceEventIO' sequences the event with respect to -- other IO actions. --+-- /Since: 4.5.0.0/ traceEventIO :: String -> IO ()-#ifdef __GLASGOW_HASKELL__ traceEventIO msg =   GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->     case traceEvent# p s of s' -> (# s', () #)-#else-traceEventIO msg = (return $! length msg) >> return ()-#endif --- | like 'trace', but additionally prints a call stack if one is--- available.+-- $markers ----- In the current GHC implementation, the call stack is only--- availble if the program was compiled with @-prof@; otherwise--- 'traceStack' behaves exactly like 'trace'.  Entries in the call--- stack correspond to @SCC@ annotations, so it is a good idea to use--- @-fprof-auto@ or @-fprof-auto-calls@ to add SCC annotations automatically.+-- When looking at a profile for the execution of a program we often want to+-- be able to mark certain points or phases in the execution and see that+-- visually in the profile.++-- For example, a program might have several distinct phases with different+-- performance or resource behaviour in each phase. To properly interpret the+-- profile graph we really want to see when each phase starts and ends. ---traceStack :: String -> a -> a-traceStack str expr = unsafePerformIO $ do-   traceIO str-   stack <- currentCallStack-   when (not (null stack)) $ traceIO (renderStack stack)-   return expr+-- Markers let us do this: we can annotate the program to emit a marker at+-- an appropriate point during execution and then see that in a profile.+-- +-- Currently this feature is only supported in GHC by the eventlog tracing+-- system, but in future it may also be supported by the heap profiling or+-- other profiling tools. These function exists for other Haskell+-- implementations but they have no effect. Note that the string message is+-- always evaluated, whether or not profiling is available or enabled.++{-# NOINLINE traceMarker #-}+-- | The 'traceMarker' function emits a marker to the eventlog, if eventlog+-- profiling is available and enabled at runtime. The @String@ is the name of+-- the marker. The name is just used in the profiling tools to help you keep+-- clear which marker is which.+--+-- This function is suitable for use in pure code. In an IO context use+-- 'traceMarkerIO' instead.+--+-- Note that when using GHC's SMP runtime, it is possible (but rare) to get+-- duplicate events emitted if two CPUs simultaneously evaluate the same thunk+-- that uses 'traceMarker'.+--+-- /Since: 4.7.0.0/+traceMarker :: String -> a -> a+traceMarker msg expr = unsafeDupablePerformIO $ do+    traceMarkerIO msg+    return expr++-- | The 'traceMarkerIO' function emits a marker to the eventlog, if eventlog+-- profiling is available and enabled at runtime.+--+-- Compared to 'traceMarker', 'traceMarkerIO' sequences the event with respect to+-- other IO actions.+--+-- /Since: 4.7.0.0/+traceMarkerIO :: String -> IO ()+traceMarkerIO msg =+  GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->+    case traceMarker# p s of s' -> (# s', () #)
Foreign.hs view
@@ -25,14 +25,6 @@         , module Foreign.StablePtr         , module Foreign.Storable         , module Foreign.Marshal--        -- * Unsafe Functions--        -- | 'unsafePerformIO' is exported here for backwards-        -- compatibility reasons only.  For doing local marshalling in-        -- the FFI, use 'unsafeLocalState'.  For other uses, see-        -- 'System.IO.Unsafe.unsafePerformIO'.-        , unsafePerformIO         ) where  import Data.Bits@@ -43,13 +35,4 @@ import Foreign.StablePtr import Foreign.Storable import Foreign.Marshal--import GHC.IO (IO)-import qualified GHC.IO (unsafePerformIO)--{-# DEPRECATED unsafePerformIO "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release" #-}--{-# INLINE unsafePerformIO #-}-unsafePerformIO :: IO a -> a-unsafePerformIO = GHC.IO.unsafePerformIO 
Foreign/C/Error.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}-{-# OPTIONS_GHC -#include "HsBase.h" #-}+{-# LANGUAGE CPP, NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -20,7 +19,7 @@    -- * Haskell representations of @errno@ values -  Errno(..),            -- instance: Eq+  Errno(..),    -- ** Common @errno@ symbols   -- | Different operating systems and\/or C libraries often support@@ -35,7 +34,7 @@   eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,    eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,    eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS, -  eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTTY, eNXIO, +  eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,   eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,    ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,    eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN, @@ -43,44 +42,33 @@   eTOOMANYREFS, eTXTBSY, eUSERS, eWOULDBLOCK, eXDEV,    -- ** 'Errno' functions-                        -- :: Errno-  isValidErrno,         -- :: Errno -> Bool+  isValidErrno,    -- access to the current thread's "errno" value   ---  getErrno,             -- :: IO Errno-  resetErrno,           -- :: IO ()+  getErrno,+  resetErrno,    -- conversion of an "errno" value into IO error   ---  errnoToIOError,       -- :: String       -- location-                        -- -> Errno        -- errno-                        -- -> Maybe Handle -- handle-                        -- -> Maybe String -- filename-                        -- -> IOError+  errnoToIOError,    -- throw current "errno" value   ---  throwErrno,           -- ::                String               -> IO a+  throwErrno,    -- ** Guards for IO operations that may fail -  throwErrnoIf,         -- :: (a -> Bool) -> String -> IO a       -> IO a-  throwErrnoIf_,        -- :: (a -> Bool) -> String -> IO a       -> IO ()-  throwErrnoIfRetry,    -- :: (a -> Bool) -> String -> IO a       -> IO a-  throwErrnoIfRetry_,   -- :: (a -> Bool) -> String -> IO a       -> IO ()-  throwErrnoIfMinus1,   -- :: Num a -                        -- =>                String -> IO a       -> IO a-  throwErrnoIfMinus1_,  -- :: Num a -                        -- =>                String -> IO a       -> IO ()+  throwErrnoIf,+  throwErrnoIf_,+  throwErrnoIfRetry,+  throwErrnoIfRetry_,+  throwErrnoIfMinus1,+  throwErrnoIfMinus1_,   throwErrnoIfMinus1Retry,-                        -- :: Num a -                        -- =>                String -> IO a       -> IO a   throwErrnoIfMinus1Retry_,  -                        -- :: Num a -                        -- =>                String -> IO a       -> IO ()-  throwErrnoIfNull,     -- ::                String -> IO (Ptr a) -> IO (Ptr a)-  throwErrnoIfNullRetry,-- ::                String -> IO (Ptr a) -> IO (Ptr a)+  throwErrnoIfNull,+  throwErrnoIfNullRetry,    throwErrnoIfRetryMayBlock,    throwErrnoIfRetryMayBlock_,@@ -100,9 +88,7 @@ -- this is were we get the CONST_XXX definitions from that configure -- calculated for us ---#ifndef __NHC__ #include "HsBaseConfig.h"-#endif  import Foreign.Ptr import Foreign.C.Types@@ -110,27 +96,12 @@ import Control.Monad            ( void ) import Data.Maybe -#if __GLASGOW_HASKELL__ import GHC.IO import GHC.IO.Exception import GHC.IO.Handle.Types import GHC.Num import GHC.Base-#elif __HUGS__-import Hugs.Prelude             ( Handle, IOError, ioError )-import System.IO.Unsafe         ( unsafePerformIO )-#else-import System.IO                ( Handle )-import System.IO.Error          ( IOError, ioError )-import System.IO.Unsafe         ( unsafePerformIO )-import Foreign.Storable         ( Storable(poke,peek) )-#endif -#ifdef __HUGS__-{-# CFILES cbits/PrelIOUtils.c #-}-#endif-- -- "errno" type -- ------------ @@ -155,7 +126,7 @@   eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,    eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,    eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS, -  eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTTY, eNXIO, +  eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,   eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,    ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,    eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN, @@ -166,9 +137,6 @@ -- configure  -- eOK             = Errno 0-#ifdef __NHC__-#include "Errno.hs"-#else e2BIG           = Errno (CONST_E2BIG) eACCES          = Errno (CONST_EACCES) eADDRINUSE      = Errno (CONST_EADDRINUSE)@@ -235,6 +203,8 @@ eNOTDIR         = Errno (CONST_ENOTDIR) eNOTEMPTY       = Errno (CONST_ENOTEMPTY) eNOTSOCK        = Errno (CONST_ENOTSOCK)+eNOTSUP         = Errno (CONST_ENOTSUP)+-- ^ /Since: 4.7.0.0/ eNOTTY          = Errno (CONST_ENOTTY) eNXIO           = Errno (CONST_ENXIO) eOPNOTSUPP      = Errno (CONST_EOPNOTSUPP)@@ -267,7 +237,6 @@ eUSERS          = Errno (CONST_EUSERS) eWOULDBLOCK     = Errno (CONST_EWOULDBLOCK) eXDEV           = Errno (CONST_EXDEV)-#endif  -- | Yield 'True' if the given 'Errno' value is valid on the system. -- This implies that the 'Eq' instance of 'Errno' is also system dependent@@ -290,25 +259,16 @@ -- We must call a C function to get the value of errno in general.  On -- threaded systems, errno is hidden behind a C macro so that each OS -- thread gets its own copy.-#ifdef __NHC__-getErrno = do e <- peek _errno; return (Errno e)-foreign import ccall unsafe "errno.h &errno" _errno :: Ptr CInt-#else getErrno = do e <- get_errno; return (Errno e) foreign import ccall unsafe "HsBase.h __hscore_get_errno" get_errno :: IO CInt-#endif  -- | Reset the current thread\'s @errno@ value to 'eOK'. -- resetErrno :: IO ()  -- Again, setting errno has to be done via a C function.-#ifdef __NHC__-resetErrno = poke _errno 0-#else resetErrno = set_errno 0 foreign import ccall unsafe "HsBase.h __hscore_set_errno" set_errno :: CInt -> IO ()-#endif  -- throw current "errno" value -- ---------------------------@@ -506,7 +466,6 @@                 -> IOError errnoToIOError loc errno maybeHdl maybeName = unsafePerformIO $ do     str <- strerror errno >>= peekCString-#if __GLASGOW_HASKELL__     return (IOError maybeHdl errType loc str (Just errno') maybeName)     where     Errno errno' = errno@@ -611,9 +570,6 @@         | errno == eWOULDBLOCK     = OtherError         | errno == eXDEV           = UnsupportedOperation         | otherwise                = OtherError-#else-    return (userError (loc ++ ": " ++ str ++ maybe "" (": "++) maybeName))-#endif  foreign import ccall unsafe "string.h" strerror :: Errno -> IO (Ptr CChar) 
Foreign/C/String.hs view
@@ -26,36 +26,31 @@ module Foreign.C.String (   -- representation of strings in C   -- * C strings -  CString,           -- = Ptr CChar-  CStringLen,        -- = (Ptr CChar, Int)+  CString,+  CStringLen,    -- ** Using a locale-dependent encoding -#ifndef __GLASGOW_HASKELL__-  -- | Currently these functions are identical to their @CAString@ counterparts;-  -- eventually they will use an encoding determined by the current locale.-#else   -- | These functions are different from their @CAString@ counterparts   -- in that they will use an encoding determined by the current locale,   -- rather than always assuming ASCII.-#endif    -- conversion of C strings into Haskell strings   ---  peekCString,       -- :: CString    -> IO String-  peekCStringLen,    -- :: CStringLen -> IO String+  peekCString,+  peekCStringLen,    -- conversion of Haskell strings into C strings   ---  newCString,        -- :: String -> IO CString-  newCStringLen,     -- :: String -> IO CStringLen+  newCString,+  newCStringLen,    -- conversion of Haskell strings into C strings using temporary storage   ---  withCString,       -- :: String -> (CString    -> IO a) -> IO a-  withCStringLen,    -- :: String -> (CStringLen -> IO a) -> IO a+  withCString,+  withCStringLen, -  charIsRepresentable, -- :: Char -> IO Bool+  charIsRepresentable,    -- ** Using 8-bit characters @@ -63,20 +58,20 @@   -- that are ignorant of Unicode.  These functions should be used with   -- care, as a loss of information can occur. -  castCharToCChar,   -- :: Char -> CChar-  castCCharToChar,   -- :: CChar -> Char+  castCharToCChar,+  castCCharToChar, -  castCharToCUChar,  -- :: Char -> CUChar-  castCUCharToChar,  -- :: CUChar -> Char-  castCharToCSChar,  -- :: Char -> CSChar-  castCSCharToChar,  -- :: CSChar -> Char+  castCharToCUChar,+  castCUCharToChar,+  castCharToCSChar,+  castCSCharToChar, -  peekCAString,      -- :: CString    -> IO String-  peekCAStringLen,   -- :: CStringLen -> IO String-  newCAString,       -- :: String -> IO CString-  newCAStringLen,    -- :: String -> IO CStringLen-  withCAString,      -- :: String -> (CString    -> IO a) -> IO a-  withCAStringLen,   -- :: String -> (CStringLen -> IO a) -> IO a+  peekCAString,+  peekCAStringLen,+  newCAString,+  newCAStringLen,+  withCAString,+  withCAStringLen,    -- * C wide strings @@ -88,15 +83,15 @@   --   -- * UTF-16 (as used on Windows systems). -  CWString,          -- = Ptr CWchar-  CWStringLen,       -- = (Ptr CWchar, Int)+  CWString,+  CWStringLen, -  peekCWString,      -- :: CWString    -> IO String-  peekCWStringLen,   -- :: CWStringLen -> IO String-  newCWString,       -- :: String -> IO CWString-  newCWStringLen,    -- :: String -> IO CWStringLen-  withCWString,      -- :: String -> (CWString    -> IO a) -> IO a-  withCWStringLen,   -- :: String -> (CWStringLen -> IO a) -> IO a+  peekCWString,+  peekCWStringLen,+  newCWString,+  newCWStringLen,+  withCWString,+  withCWStringLen,    ) where @@ -107,7 +102,6 @@  import Data.Word -#ifdef __GLASGOW_HASKELL__ import Control.Monad  import GHC.Char@@ -118,10 +112,6 @@  import {-# SOURCE #-} GHC.IO.Encoding import qualified GHC.Foreign as GHC-#else-import Data.Char ( chr, ord )-#define unsafeChr chr-#endif  ----------------------------------------------------------------------------- -- Strings@@ -145,20 +135,12 @@ -- | Marshal a NUL terminated C string into a Haskell string. -- peekCString    :: CString -> IO String-#ifndef __GLASGOW_HASKELL__-peekCString = peekCAString-#else peekCString s = getForeignEncoding >>= flip GHC.peekCString s-#endif  -- | Marshal a C string with explicit length into a Haskell string. -- peekCStringLen           :: CStringLen -> IO String-#ifndef __GLASGOW_HASKELL__-peekCStringLen = peekCAStringLen-#else peekCStringLen s = getForeignEncoding >>= flip GHC.peekCStringLen s-#endif  -- | Marshal a Haskell string into a NUL terminated C string. --@@ -169,11 +151,7 @@ --   'Foreign.Marshal.Alloc.finalizerFree'. -- newCString :: String -> IO CString-#ifndef __GLASGOW_HASKELL__-newCString = newCAString-#else newCString s = getForeignEncoding >>= flip GHC.newCString s-#endif  -- | Marshal a Haskell string into a C string (ie, character array) with -- explicit length information.@@ -183,11 +161,7 @@ --   'Foreign.Marshal.Alloc.finalizerFree'. -- newCStringLen     :: String -> IO CStringLen-#ifndef __GLASGOW_HASKELL__-newCStringLen = newCAStringLen-#else newCStringLen s = getForeignEncoding >>= flip GHC.newCStringLen s-#endif  -- | Marshal a Haskell string into a NUL terminated C string using temporary -- storage.@@ -199,11 +173,7 @@ --   storage must /not/ be used after this. -- withCString :: String -> (CString -> IO a) -> IO a-#ifndef __GLASGOW_HASKELL__-withCString = withCAString-#else withCString s f = getForeignEncoding >>= \enc -> GHC.withCString enc s f-#endif  -- | Marshal a Haskell string into a C string (ie, character array) -- in temporary storage, with explicit length information.@@ -213,26 +183,12 @@ --   storage must /not/ be used after this. -- withCStringLen         :: String -> (CStringLen -> IO a) -> IO a-#ifndef __GLASGOW_HASKELL__-withCStringLen = withCAStringLen-#else withCStringLen s f = getForeignEncoding >>= \enc -> GHC.withCStringLen enc s f-#endif --#ifndef __GLASGOW_HASKELL__--- | Determines whether a character can be accurately encoded in a 'CString'.--- Unrepresentable characters are converted to @\'?\'@.------ Currently only Latin-1 characters are representable.-charIsRepresentable :: Char -> IO Bool-charIsRepresentable c = return (ord c < 256)-#else -- -- | Determines whether a character can be accurately encoded in a 'CString'. -- -- Unrepresentable characters are converted to '?' or their nearest visual equivalent. charIsRepresentable :: Char -> IO Bool charIsRepresentable c = getForeignEncoding >>= flip GHC.charIsRepresentable c-#endif  -- single byte characters -- ----------------------@@ -272,11 +228,6 @@ -- | Marshal a NUL terminated C string into a Haskell string. -- peekCAString    :: CString -> IO String-#ifndef __GLASGOW_HASKELL__-peekCAString cp  = do-  cs <- peekArray0 nUL cp-  return (cCharsToChars cs)-#else peekCAString cp = do   l <- lengthArray0 nUL cp   if l <= 0 then return "" else loop "" (l-1)@@ -285,16 +236,10 @@         xval <- peekElemOff cp i         let val = castCCharToChar xval         val `seq` if i <= 0 then return (val:s) else loop (val:s) (i-1)-#endif  -- | Marshal a C string with explicit length into a Haskell string. -- peekCAStringLen           :: CStringLen -> IO String-#ifndef __GLASGOW_HASKELL__-peekCAStringLen (cp, len)  = do-  cs <- peekArray len cp-  return (cCharsToChars cs)-#else peekCAStringLen (cp, len)    | len <= 0  = return "" -- being (too?) nice.   | otherwise = loop [] (len-1)@@ -306,7 +251,6 @@          if (val `seq` (i == 0))           then return (val:acc)           else loop (val:acc) (i-1)-#endif  -- | Marshal a Haskell string into a NUL terminated C string. --@@ -317,9 +261,6 @@ --   'Foreign.Marshal.Alloc.finalizerFree'. -- newCAString :: String -> IO CString-#ifndef __GLASGOW_HASKELL__-newCAString  = newArray0 nUL . charsToCChars-#else newCAString str = do   ptr <- mallocArray0 (length str)   let@@ -327,7 +268,6 @@         go (c:cs) n = do pokeElemOff ptr n (castCharToCChar c); go cs (n+1)   go str 0   return ptr-#endif  -- | Marshal a Haskell string into a C string (ie, character array) with -- explicit length information.@@ -337,9 +277,6 @@ --   'Foreign.Marshal.Alloc.finalizerFree'. -- newCAStringLen     :: String -> IO CStringLen-#ifndef __GLASGOW_HASKELL__-newCAStringLen str  = newArrayLen (charsToCChars str)-#else newCAStringLen str = do   ptr <- mallocArray0 len   let@@ -349,7 +286,6 @@   return (ptr, len)   where     len = length str-#endif  -- | Marshal a Haskell string into a NUL terminated C string using temporary -- storage.@@ -361,9 +297,6 @@ --   storage must /not/ be used after this. -- withCAString :: String -> (CString -> IO a) -> IO a-#ifndef __GLASGOW_HASKELL__-withCAString  = withArray0 nUL . charsToCChars-#else withCAString str f =   allocaArray0 (length str) $ \ptr ->       let@@ -372,7 +305,6 @@       in do       go str 0       f ptr-#endif  -- | Marshal a Haskell string into a C string (ie, character array) -- in temporary storage, with explicit length information.@@ -383,9 +315,6 @@ -- withCAStringLen         :: String -> (CStringLen -> IO a) -> IO a withCAStringLen str f    =-#ifndef __GLASGOW_HASKELL__-  withArrayLen (charsToCChars str) $ \ len ptr -> f (ptr, len)-#else   allocaArray len $ \ptr ->       let         go [] n     = n `seq` return () -- make it strict in n@@ -395,7 +324,6 @@       f (ptr,len)   where     len = length str-#endif  -- auxiliary definitions -- ----------------------@@ -410,18 +338,6 @@ newArrayLen xs      = do   a <- newArray xs   return (a, length xs)--#ifndef __GLASGOW_HASKELL__--- cast [CChar] to [Char]----cCharsToChars :: [CChar] -> [Char]-cCharsToChars xs  = map castCCharToChar xs---- cast [Char] to [CChar]----charsToCChars :: [Char] -> [CChar]-charsToCChars xs  = map castCharToCChar xs-#endif  ----------------------------------------------------------------------------- -- Wide strings
Foreign/C/Types.hs view
@@ -5,9 +5,7 @@            , GeneralizedNewtypeDeriving   #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif -- XXX -fno-warn-unused-binds stops us warning about unused constructors, -- but really we should just remove them if we don't want them @@ -44,18 +42,18 @@         , CIntPtr(..),  CUIntPtr(..), CIntMax(..),   CUIntMax(..)            -- ** Numeric types-          -- | These types are are represented as @newtype@s of basic+          -- | These types are represented as @newtype@s of basic           -- foreign types, and are instances of           -- 'Prelude.Eq', 'Prelude.Ord', 'Prelude.Num', 'Prelude.Read',           -- 'Prelude.Show', 'Prelude.Enum', 'Typeable' and 'Storable'.         , CClock(..),   CTime(..),    CUSeconds(..), CSUSeconds(..)          -- extracted from CTime, because we don't want this comment in-        -- the Haskell 2010 report:+        -- the Haskell language reports: -        -- | To convert 'CTime' to 'Data.Time.UTCTime', use the following formula:+        -- | To convert 'CTime' to 'Data.Time.UTCTime', use the following:         ---        -- >  posixSecondsToUTCTime (realToFrac :: POSIXTime)+        -- > \t -> posixSecondsToUTCTime (realToFrac t :: POSIXTime)         --            -- ** Floating types@@ -66,27 +64,21 @@           -- 'Prelude.Real', 'Prelude.Fractional', 'Prelude.Floating',           -- 'Prelude.RealFrac' and 'Prelude.RealFloat'.         , CFloat(..),   CDouble(..)--- GHC doesn't support CLDouble yet-#ifndef __GLASGOW_HASKELL__-        , CLDouble(..)-#endif+        -- XXX GHC doesn't support CLDouble yet+        -- , CLDouble(..)+           -- ** Other types            -- Instances of: Eq and Storable         , CFile,        CFpos,     CJmpBuf         ) where -#ifndef __NHC__- import Foreign.Storable-import Data.Bits        ( Bits(..) )+import Data.Bits        ( Bits(..), FiniteBits(..) ) import Data.Int         ( Int8,  Int16,  Int32,  Int64  ) import Data.Word        ( Word8, Word16, Word32, Word64 )-import {-# SOURCE #-} Data.Typeable-  -- loop: Data.Typeable -> Data.List -> Data.Char -> GHC.Unicode-  --            -> Foreign.C.Type+import Data.Typeable -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Float import GHC.Enum@@ -94,43 +86,36 @@ import GHC.Show import GHC.Read import GHC.Num-#else-import Control.Monad    ( liftM )-#endif -#ifdef __HUGS__-import Hugs.Ptr         ( castPtr )-#endif- #include "HsBaseConfig.h" #include "CTypes.h"  -- | Haskell type representing the C @char@ type.-INTEGRAL_TYPE(CChar,tyConCChar,"CChar",HTYPE_CHAR)+INTEGRAL_TYPE(CChar,HTYPE_CHAR) -- | Haskell type representing the C @signed char@ type.-INTEGRAL_TYPE(CSChar,tyConCSChar,"CSChar",HTYPE_SIGNED_CHAR)+INTEGRAL_TYPE(CSChar,HTYPE_SIGNED_CHAR) -- | Haskell type representing the C @unsigned char@ type.-INTEGRAL_TYPE(CUChar,tyConCUChar,"CUChar",HTYPE_UNSIGNED_CHAR)+INTEGRAL_TYPE(CUChar,HTYPE_UNSIGNED_CHAR)  -- | Haskell type representing the C @short@ type.-INTEGRAL_TYPE(CShort,tyConCShort,"CShort",HTYPE_SHORT)+INTEGRAL_TYPE(CShort,HTYPE_SHORT) -- | Haskell type representing the C @unsigned short@ type.-INTEGRAL_TYPE(CUShort,tyConCUShort,"CUShort",HTYPE_UNSIGNED_SHORT)+INTEGRAL_TYPE(CUShort,HTYPE_UNSIGNED_SHORT)  -- | Haskell type representing the C @int@ type.-INTEGRAL_TYPE(CInt,tyConCInt,"CInt",HTYPE_INT)+INTEGRAL_TYPE(CInt,HTYPE_INT) -- | Haskell type representing the C @unsigned int@ type.-INTEGRAL_TYPE(CUInt,tyConCUInt,"CUInt",HTYPE_UNSIGNED_INT)+INTEGRAL_TYPE(CUInt,HTYPE_UNSIGNED_INT)  -- | Haskell type representing the C @long@ type.-INTEGRAL_TYPE(CLong,tyConCLong,"CLong",HTYPE_LONG)+INTEGRAL_TYPE(CLong,HTYPE_LONG) -- | Haskell type representing the C @unsigned long@ type.-INTEGRAL_TYPE(CULong,tyConCULong,"CULong",HTYPE_UNSIGNED_LONG)+INTEGRAL_TYPE(CULong,HTYPE_UNSIGNED_LONG)  -- | Haskell type representing the C @long long@ type.-INTEGRAL_TYPE(CLLong,tyConCLLong,"CLLong",HTYPE_LONG_LONG)+INTEGRAL_TYPE(CLLong,HTYPE_LONG_LONG) -- | Haskell type representing the C @unsigned long long@ type.-INTEGRAL_TYPE(CULLong,tyConCULLong,"CULLong",HTYPE_UNSIGNED_LONG_LONG)+INTEGRAL_TYPE(CULLong,HTYPE_UNSIGNED_LONG_LONG)  {-# RULES "fromIntegral/a->CChar"   fromIntegral = \x -> CChar   (fromIntegral x)@@ -159,15 +144,10 @@  #-}  -- | Haskell type representing the C @float@ type.-FLOATING_TYPE(CFloat,tyConCFloat,"CFloat",HTYPE_FLOAT)+FLOATING_TYPE(CFloat,HTYPE_FLOAT) -- | Haskell type representing the C @double@ type.-FLOATING_TYPE(CDouble,tyConCDouble,"CDouble",HTYPE_DOUBLE)--- GHC doesn't support CLDouble yet-#ifndef __GLASGOW_HASKELL__--- HACK: Currently no long double in the FFI, so we simply re-use double--- | Haskell type representing the C @long double@ type.-FLOATING_TYPE(CLDouble,tyConCLDouble,"CLDouble",HTYPE_DOUBLE)-#endif+FLOATING_TYPE(CDouble,HTYPE_DOUBLE)+-- XXX GHC doesn't support CLDouble yet  {-# RULES "realToFrac/a->CFloat"    realToFrac = \x -> CFloat   (realToFrac x)@@ -182,13 +162,13 @@ -- "realToFrac/CLDouble->a"  realToFrac = \(CLDouble x) -> realToFrac x  -- | Haskell type representing the C @ptrdiff_t@ type.-INTEGRAL_TYPE(CPtrdiff,tyConCPtrdiff,"CPtrdiff",HTYPE_PTRDIFF_T)+INTEGRAL_TYPE(CPtrdiff,HTYPE_PTRDIFF_T) -- | Haskell type representing the C @size_t@ type.-INTEGRAL_TYPE(CSize,tyConCSize,"CSize",HTYPE_SIZE_T)+INTEGRAL_TYPE(CSize,HTYPE_SIZE_T) -- | Haskell type representing the C @wchar_t@ type.-INTEGRAL_TYPE(CWchar,tyConCWchar,"CWchar",HTYPE_WCHAR_T)+INTEGRAL_TYPE(CWchar,HTYPE_WCHAR_T) -- | Haskell type representing the C @sig_atomic_t@ type.-INTEGRAL_TYPE(CSigAtomic,tyConCSigAtomic,"CSigAtomic",HTYPE_SIG_ATOMIC_T)+INTEGRAL_TYPE(CSigAtomic,HTYPE_SIG_ATOMIC_T)  {-# RULES "fromIntegral/a->CPtrdiff"   fromIntegral = \x -> CPtrdiff   (fromIntegral x)@@ -203,13 +183,17 @@  #-}  -- | Haskell type representing the C @clock_t@ type.-ARITHMETIC_TYPE(CClock,tyConCClock,"CClock",HTYPE_CLOCK_T)+ARITHMETIC_TYPE(CClock,HTYPE_CLOCK_T) -- | Haskell type representing the C @time_t@ type.-ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T)+ARITHMETIC_TYPE(CTime,HTYPE_TIME_T) -- | Haskell type representing the C @useconds_t@ type.-ARITHMETIC_TYPE(CUSeconds,tyConCUSeconds,"CUSeconds",HTYPE_USECONDS_T)+--+-- /Since: 4.4.0.0/+ARITHMETIC_TYPE(CUSeconds,HTYPE_USECONDS_T) -- | Haskell type representing the C @suseconds_t@ type.-ARITHMETIC_TYPE(CSUSeconds,tyConCSUSeconds,"CSUSeconds",HTYPE_SUSECONDS_T)+--+-- /Since: 4.4.0.0/+ARITHMETIC_TYPE(CSUSeconds,HTYPE_SUSECONDS_T)  -- FIXME: Implement and provide instances for Eq and Storable -- | Haskell type representing the C @FILE@ type.@@ -219,10 +203,10 @@ -- | Haskell type representing the C @jmp_buf@ type. data CJmpBuf = CJmpBuf -INTEGRAL_TYPE(CIntPtr,tyConCIntPtr,"CIntPtr",HTYPE_INTPTR_T)-INTEGRAL_TYPE(CUIntPtr,tyConCUIntPtr,"CUIntPtr",HTYPE_UINTPTR_T)-INTEGRAL_TYPE(CIntMax,tyConCIntMax,"CIntMax",HTYPE_INTMAX_T)-INTEGRAL_TYPE(CUIntMax,tyConCUIntMax,"CUIntMax",HTYPE_UINTMAX_T)+INTEGRAL_TYPE(CIntPtr,HTYPE_INTPTR_T)+INTEGRAL_TYPE(CUIntPtr,HTYPE_UINTPTR_T)+INTEGRAL_TYPE(CIntMax,HTYPE_INTMAX_T)+INTEGRAL_TYPE(CUIntMax,HTYPE_UINTMAX_T)  {-# RULES "fromIntegral/a->CIntPtr"  fromIntegral = \x -> CIntPtr  (fromIntegral x)@@ -276,59 +260,4 @@   corresponding bitwise operation in C on @t@.  -}--#else   /* __NHC__ */--import NHC.FFI-  ( CChar(..),    CSChar(..),   CUChar(..)-  , CShort(..),   CUShort(..),  CInt(..),      CUInt(..)-  , CLong(..),    CULong(..),   CLLong(..),    CULLong(..)-  , CPtrdiff(..), CSize(..),    CWchar(..),    CSigAtomic(..)-  , CClock(..),   CTime(..),    CUSeconds(..), CSUSeconds(..)-  , CFloat(..),   CDouble(..),  CLDouble(..)-  , CIntPtr(..),  CUIntPtr(..), CIntMax(..),   CUIntMax(..)-  , CFile,        CFpos,        CJmpBuf-  , Storable(..)-  )-import Data.Bits-import NHC.SizedTypes--#define INSTANCE_BITS(T) \-instance Bits T where { \-  (T x) .&.     (T y)   = T (x .&.   y) ; \-  (T x) .|.     (T y)   = T (x .|.   y) ; \-  (T x) `xor`   (T y)   = T (x `xor` y) ; \-  complement    (T x)   = T (complement x) ; \-  shift         (T x) n = T (shift x n) ; \-  rotate        (T x) n = T (rotate x n) ; \-  bit                 n = T (bit n) ; \-  setBit        (T x) n = T (setBit x n) ; \-  clearBit      (T x) n = T (clearBit x n) ; \-  complementBit (T x) n = T (complementBit x n) ; \-  testBit       (T x) n = testBit x n ; \-  bitSize       (T x)   = bitSize x ; \-  isSigned      (T x)   = isSigned x ; \-  popCount      (T x)   = popCount x }--INSTANCE_BITS(CChar)-INSTANCE_BITS(CSChar)-INSTANCE_BITS(CUChar)-INSTANCE_BITS(CShort)-INSTANCE_BITS(CUShort)-INSTANCE_BITS(CInt)-INSTANCE_BITS(CUInt)-INSTANCE_BITS(CLong)-INSTANCE_BITS(CULong)-INSTANCE_BITS(CLLong)-INSTANCE_BITS(CULLong)-INSTANCE_BITS(CPtrdiff)-INSTANCE_BITS(CWchar)-INSTANCE_BITS(CSigAtomic)-INSTANCE_BITS(CSize)-INSTANCE_BITS(CIntPtr)-INSTANCE_BITS(CUIntPtr)-INSTANCE_BITS(CIntMax)-INSTANCE_BITS(CUIntMax)--#endif 
Foreign/Concurrent.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -29,7 +29,6 @@         addForeignPtrFinalizer,   ) where -#ifdef __GLASGOW_HASKELL__ import GHC.IO         ( IO ) import GHC.Ptr        ( Ptr ) import GHC.ForeignPtr ( ForeignPtr )@@ -50,5 +49,3 @@ -- is dropped, but /before/ all previously registered finalizers for the -- same object. addForeignPtrFinalizer = GHC.ForeignPtr.addForeignPtrConcFinalizer-#endif-
Foreign/ForeignPtr.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -22,22 +22,16 @@         -- * Finalised data pointers           ForeignPtr         , FinalizerPtr-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)         , FinalizerEnvPtr-#endif+         -- ** Basic operations         , newForeignPtr         , newForeignPtr_         , addForeignPtrFinalizer-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)         , newForeignPtrEnv         , addForeignPtrFinalizerEnv-#endif         , withForeignPtr--#ifdef __GLASGOW_HASKELL__         , finalizeForeignPtr-#endif          -- ** Low-level operations         , touchForeignPtr@@ -48,17 +42,7 @@         , mallocForeignPtrBytes         , mallocForeignPtrArray         , mallocForeignPtrArray0-        -- ** Unsafe low-level operations-        , unsafeForeignPtrToPtr     ) where  import Foreign.ForeignPtr.Safe--import Foreign.Ptr ( Ptr )-import qualified Foreign.ForeignPtr.Unsafe as U--{-# DEPRECATED unsafeForeignPtrToPtr "Use Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr instead; This function will be removed in the next release" #-}-{-# INLINE unsafeForeignPtrToPtr #-}-unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a-unsafeForeignPtrToPtr = U.unsafeForeignPtrToPtr 
Foreign/ForeignPtr/Imp.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -23,22 +23,16 @@         -- * Finalised data pointers           ForeignPtr         , FinalizerPtr-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)         , FinalizerEnvPtr-#endif+         -- ** Basic operations         , newForeignPtr         , newForeignPtr_         , addForeignPtrFinalizer-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)         , newForeignPtrEnv         , addForeignPtrFinalizerEnv-#endif         , withForeignPtr--#ifdef __GLASGOW_HASKELL__         , finalizeForeignPtr-#endif          -- ** Low-level operations         , unsafeForeignPtrToPtr@@ -54,53 +48,12 @@         where  import Foreign.Ptr--#ifdef __NHC__-import NHC.FFI-  ( ForeignPtr-  , FinalizerPtr-  , newForeignPtr-  , newForeignPtr_-  , addForeignPtrFinalizer-  , withForeignPtr-  , unsafeForeignPtrToPtr-  , touchForeignPtr-  , castForeignPtr-  , Storable(sizeOf)-  , malloc, mallocBytes, finalizerFree-  )-#endif--#ifdef __HUGS__-import Hugs.ForeignPtr-#endif--#ifndef __NHC__ import Foreign.Storable ( Storable(sizeOf) )-#endif -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Num-import GHC.Err          ( undefined ) import GHC.ForeignPtr-#endif -#if !defined(__NHC__) && !defined(__GLASGOW_HASKELL__)-import Foreign.Marshal.Alloc    ( malloc, mallocBytes, finalizerFree )--instance Eq (ForeignPtr a) where -    p == q  =  unsafeForeignPtrToPtr p == unsafeForeignPtrToPtr q--instance Ord (ForeignPtr a) where -    compare p q  =  compare (unsafeForeignPtrToPtr p) (unsafeForeignPtrToPtr q)--instance Show (ForeignPtr a) where-    showsPrec p f = showsPrec p (unsafeForeignPtrToPtr f)-#endif---#ifndef __NHC__ newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a) -- ^Turns a plain memory reference into a foreign pointer, and -- associates a finalizer with the reference.  The finalizer will be@@ -136,9 +89,7 @@   = do r <- io (unsafeForeignPtrToPtr fo)        touchForeignPtr fo        return r-#endif /* ! __NHC__ */ -#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__) -- | This variant of 'newForeignPtr' adds a finalizer that expects an -- environment in addition to the finalized pointer.  The environment -- that will be passed to the finalizer is fixed by the second argument to@@ -149,19 +100,6 @@   = do fObj <- newForeignPtr_ p        addForeignPtrFinalizerEnv finalizer env fObj        return fObj-#endif /* __HUGS__ */--#ifndef __GLASGOW_HASKELL__-mallocForeignPtr :: Storable a => IO (ForeignPtr a)-mallocForeignPtr = do-  r <- malloc-  newForeignPtr finalizerFree r--mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)-mallocForeignPtrBytes n = do-  r <- mallocBytes n-  newForeignPtr finalizerFree r-#endif /* !__GLASGOW_HASKELL__ */  -- | This function is similar to 'Foreign.Marshal.Array.mallocArray', -- but yields a memory area that has a finalizer attached that releases
Foreign/ForeignPtr/Safe.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -23,22 +23,16 @@         -- * Finalised data pointers           ForeignPtr         , FinalizerPtr-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)         , FinalizerEnvPtr-#endif+         -- ** Basic operations         , newForeignPtr         , newForeignPtr_         , addForeignPtrFinalizer-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)         , newForeignPtrEnv         , addForeignPtrFinalizerEnv-#endif         , withForeignPtr--#ifdef __GLASGOW_HASKELL__         , finalizeForeignPtr-#endif          -- ** Low-level operations         , touchForeignPtr
Foreign/ForeignPtr/Unsafe.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |
Foreign/Marshal.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -20,39 +20,7 @@          -- | The module "Foreign.Marshal" re-exports the safe content in the          -- @Foreign.Marshal@ hierarchy:           module Foreign.Marshal.Safe-         -- | and provides one function:-        , unsafeLocalState         ) where  import Foreign.Marshal.Safe--#ifdef __GLASGOW_HASKELL__-import GHC.IO-#else-import System.IO.Unsafe-#endif--{- |-Sometimes an external entity is a pure function, except that it passes-arguments and/or results via pointers.  The function-@unsafeLocalState@ permits the packaging of such entities as pure-functions.  --The only IO operations allowed in the IO action passed to-@unsafeLocalState@ are (a) local allocation (@alloca@, @allocaBytes@-and derived operations such as @withArray@ and @withCString@), and (b)-pointer operations (@Foreign.Storable@ and @Foreign.Ptr@) on the-pointers to local storage, and (c) foreign functions whose only-observable effect is to read and/or write the locally allocated-memory.  Passing an IO operation that does not obey these rules-results in undefined behaviour.--It is expected that this operation will be-replaced in a future revision of Haskell.--}-{-# DEPRECATED unsafeLocalState-               "Please import from Foreign.Marshall.Unsafe instead; This will be removed in the next release"- #-}-unsafeLocalState :: IO a -> a-unsafeLocalState = unsafePerformIO 
Foreign/Marshal/Alloc.hs view
@@ -1,9 +1,7 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude+{-# LANGUAGE NoImplicitPrelude            , MagicHash            , UnboxedTuples-           , ForeignFunctionInterface   #-}  -----------------------------------------------------------------------------@@ -46,50 +44,30 @@ module Foreign.Marshal.Alloc (   -- * Memory allocation   -- ** Local allocation-  alloca,       -- :: Storable a =>        (Ptr a -> IO b) -> IO b-  allocaBytes,  -- ::               Int -> (Ptr a -> IO b) -> IO b-  allocaBytesAligned,  -- ::        Int -> Int -> (Ptr a -> IO b) -> IO b+  alloca,+  allocaBytes,+  allocaBytesAligned,    -- ** Dynamic allocation-  malloc,       -- :: Storable a =>        IO (Ptr a)-  mallocBytes,  -- ::               Int -> IO (Ptr a)+  malloc,+  mallocBytes, -  realloc,      -- :: Storable b => Ptr a        -> IO (Ptr b)-  reallocBytes, -- ::               Ptr a -> Int -> IO (Ptr a)+  realloc,+  reallocBytes, -  free,         -- :: Ptr a -> IO ()-  finalizerFree -- :: FinalizerPtr a+  free,+  finalizerFree ) where  import Data.Maybe import Foreign.C.Types          ( CSize(..) ) import Foreign.Storable         ( Storable(sizeOf,alignment) )--#ifndef __GLASGOW_HASKELL__-import Foreign.Ptr              ( Ptr, nullPtr, FunPtr )-#endif--#ifdef __GLASGOW_HASKELL__ import Foreign.ForeignPtr       ( FinalizerPtr ) import GHC.IO.Exception import GHC.Real import GHC.Ptr-import GHC.Err import GHC.Base-#elif defined(__NHC__)-import NHC.FFI                  ( FinalizerPtr, CInt(..) )-import IO                       ( bracket )-#else-import Control.Exception.Base   ( bracket )-#endif -#ifdef __HUGS__-import Hugs.Prelude             ( IOException(IOError),-                                  IOErrorType(ResourceExhausted) )-import Hugs.ForeignPtr          ( FinalizerPtr )-#endif-- -- exported functions -- ------------------ @@ -139,7 +117,6 @@ -- The memory is freed when @f@ terminates (either normally or via an -- exception), so the pointer passed to @f@ must /not/ be used after this. ---#ifdef __GLASGOW_HASKELL__ allocaBytes :: Int -> (Ptr a -> IO b) -> IO b allocaBytes (I# size) action = IO $ \ s0 ->      case newPinnedByteArray# size s0      of { (# s1, mbarr# #) ->@@ -161,14 +138,7 @@      case touch# barr# s3 of { s4 ->      (# s4, r #)   }}}}}-#else-allocaBytes      :: Int -> (Ptr a -> IO b) -> IO b-allocaBytes size  = bracket (mallocBytes size) free -allocaBytesAligned :: Int -> Int -> (Ptr a -> IO b) -> IO b-allocaBytesAligned size align = allocaBytes size -- wrong-#endif- -- |Resize a memory area that was allocated with 'malloc' or 'mallocBytes' -- to the size needed to store values of type @b@.  The returned pointer -- may refer to an entirely different memory area, but will be suitably@@ -224,15 +194,8 @@ failWhenNULL name f = do    addr <- f    if addr == nullPtr-#if __GLASGOW_HASKELL__       then ioError (IOError Nothing ResourceExhausted name                                          "out of memory" Nothing Nothing)-#elif __HUGS__-      then ioError (IOError Nothing ResourceExhausted name -                                        "out of memory" Nothing)-#else-      then ioError (userError (name++": out of memory"))-#endif       else return addr  -- basic C routines needed for memory allocation
Foreign/Marshal/Array.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash #-}  ----------------------------------------------------------------------------- -- |@@ -21,47 +21,47 @@    -- ** Allocation   ---  mallocArray,    -- :: Storable a => Int -> IO (Ptr a)-  mallocArray0,   -- :: Storable a => Int -> IO (Ptr a)+  mallocArray,+  mallocArray0, -  allocaArray,    -- :: Storable a => Int -> (Ptr a -> IO b) -> IO b-  allocaArray0,   -- :: Storable a => Int -> (Ptr a -> IO b) -> IO b+  allocaArray,+  allocaArray0, -  reallocArray,   -- :: Storable a => Ptr a -> Int -> IO (Ptr a)-  reallocArray0,  -- :: Storable a => Ptr a -> Int -> IO (Ptr a)+  reallocArray,+  reallocArray0,    -- ** Marshalling   ---  peekArray,      -- :: Storable a =>         Int -> Ptr a -> IO [a]-  peekArray0,     -- :: (Storable a, Eq a) => a   -> Ptr a -> IO [a]+  peekArray,+  peekArray0, -  pokeArray,      -- :: Storable a =>      Ptr a -> [a] -> IO ()-  pokeArray0,     -- :: Storable a => a -> Ptr a -> [a] -> IO ()+  pokeArray,+  pokeArray0,    -- ** Combined allocation and marshalling   ---  newArray,       -- :: Storable a =>      [a] -> IO (Ptr a)-  newArray0,      -- :: Storable a => a -> [a] -> IO (Ptr a)+  newArray,+  newArray0, -  withArray,      -- :: Storable a =>      [a] -> (Ptr a -> IO b) -> IO b-  withArray0,     -- :: Storable a => a -> [a] -> (Ptr a -> IO b) -> IO b+  withArray,+  withArray0, -  withArrayLen,   -- :: Storable a =>      [a] -> (Int -> Ptr a -> IO b) -> IO b-  withArrayLen0,  -- :: Storable a => a -> [a] -> (Int -> Ptr a -> IO b) -> IO b+  withArrayLen,+  withArrayLen0,    -- ** Copying    -- | (argument order: destination, source)-  copyArray,      -- :: Storable a => Ptr a -> Ptr a -> Int -> IO ()-  moveArray,      -- :: Storable a => Ptr a -> Ptr a -> Int -> IO ()+  copyArray,+  moveArray,    -- ** Finding the length   ---  lengthArray0,   -- :: (Storable a, Eq a) => a -> Ptr a -> IO Int+  lengthArray0,    -- ** Indexing   ---  advancePtr,     -- :: Storable a => Ptr a -> Int -> Ptr a+  advancePtr, ) where  import Foreign.Ptr      (Ptr, plusPtr)@@ -69,14 +69,9 @@ import Foreign.Marshal.Alloc (mallocBytes, allocaBytesAligned, reallocBytes) import Foreign.Marshal.Utils (copyBytes, moveBytes) -#ifdef __GLASGOW_HASKELL__ import GHC.Num import GHC.List-import GHC.Err import GHC.Base-#else-import Control.Monad (zipWithM_)-#endif  -- allocation -- ----------@@ -152,28 +147,17 @@ -- |Write the list elements consecutive into memory -- pokeArray :: Storable a => Ptr a -> [a] -> IO ()-#ifndef __GLASGOW_HASKELL__-pokeArray ptr vals =  zipWithM_ (pokeElemOff ptr) [0..] vals-#else pokeArray ptr vals0 = go vals0 0#   where go [] _          = return ()         go (val:vals) n# = do pokeElemOff ptr (I# n#) val; go vals (n# +# 1#)-#endif  -- |Write the list elements consecutive into memory and terminate them with the -- given marker element -- pokeArray0 :: Storable a => a -> Ptr a -> [a] -> IO ()-#ifndef __GLASGOW_HASKELL__-pokeArray0 marker ptr vals  = do-  pokeArray ptr vals-  pokeElemOff ptr (length vals) marker-#else pokeArray0 marker ptr vals0 = go vals0 0#   where go [] n#         = pokeElemOff ptr (I# n#) marker         go (val:vals) n# = do pokeElemOff ptr (I# n#) val; go vals (n# +# 1#)-#endif-  -- combined allocation and marshalling -- -----------------------------------
Foreign/Marshal/Error.hs view
@@ -17,22 +17,19 @@ -----------------------------------------------------------------------------  module Foreign.Marshal.Error (-  throwIf,       -- :: (a -> Bool) -> (a -> String) -> IO a       -> IO a-  throwIf_,      -- :: (a -> Bool) -> (a -> String) -> IO a       -> IO ()-  throwIfNeg,    -- :: (Ord a, Num a) -                 -- =>                (a -> String) -> IO a       -> IO a-  throwIfNeg_,   -- :: (Ord a, Num a)-                 -- =>                (a -> String) -> IO a       -> IO ()-  throwIfNull,   -- ::                String        -> IO (Ptr a) -> IO (Ptr a)+  throwIf,+  throwIf_,+  throwIfNeg,+  throwIfNeg_,+  throwIfNull,    -- Discard return value   ---  void           -- IO a -> IO ()+  void ) where  import Foreign.Ptr -#ifdef __GLASGOW_HASKELL__ #ifdef __HADDOCK__ import Data.Bool import System.IO.Error@@ -40,7 +37,6 @@ import GHC.Base import GHC.Num import GHC.IO.Exception-#endif  -- exported functions -- ------------------@@ -83,4 +79,4 @@ -- void     :: IO a -> IO () void act  = act >> return ()-{-# DEPRECATED void "use Control.Monad.void instead" #-}+{-# DEPRECATED void "use 'Control.Monad.void' instead" #-} -- deprecated in 7.6
Foreign/Marshal/Pool.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  -------------------------------------------------------------------------------- -- |@@ -23,30 +23,29 @@ module Foreign.Marshal.Pool (    -- * Pool management    Pool,-   newPool,             -- :: IO Pool-   freePool,            -- :: Pool -> IO ()-   withPool,            -- :: (Pool -> IO b) -> IO b+   newPool,+   freePool,+   withPool,     -- * (Re-)Allocation within a pool-   pooledMalloc,        -- :: Storable a => Pool                 -> IO (Ptr a)-   pooledMallocBytes,   -- ::               Pool          -> Int -> IO (Ptr a)+   pooledMalloc,+   pooledMallocBytes, -   pooledRealloc,       -- :: Storable a => Pool -> Ptr a        -> IO (Ptr a)-   pooledReallocBytes,  -- ::               Pool -> Ptr a -> Int -> IO (Ptr a)+   pooledRealloc,+   pooledReallocBytes, -   pooledMallocArray,   -- :: Storable a => Pool ->          Int -> IO (Ptr a)-   pooledMallocArray0,  -- :: Storable a => Pool ->          Int -> IO (Ptr a)+   pooledMallocArray,+   pooledMallocArray0, -   pooledReallocArray,  -- :: Storable a => Pool -> Ptr a -> Int -> IO (Ptr a)-   pooledReallocArray0, -- :: Storable a => Pool -> Ptr a -> Int -> IO (Ptr a)+   pooledReallocArray,+   pooledReallocArray0,     -- * Combined allocation and marshalling-   pooledNew,           -- :: Storable a => Pool -> a            -> IO (Ptr a)-   pooledNewArray,      -- :: Storable a => Pool ->      [a]     -> IO (Ptr a)-   pooledNewArray0      -- :: Storable a => Pool -> a -> [a]     -> IO (Ptr a)+   pooledNew,+   pooledNewArray,+   pooledNewArray0 ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base              ( Int, Monad(..), (.), not ) import GHC.Err               ( undefined ) import GHC.Exception         ( throw )@@ -54,14 +53,6 @@ import GHC.IORef             ( IORef, newIORef, readIORef, writeIORef ) import GHC.List              ( elem, length ) import GHC.Num               ( Num(..) )-#else-import Data.IORef            ( IORef, newIORef, readIORef, writeIORef )-#if defined(__NHC__)-import IO                    ( bracket )-#else-import Control.Exception.Base ( bracket )-#endif-#endif  import Control.Monad         ( liftM ) import Data.List             ( delete )@@ -73,7 +64,7 @@  -------------------------------------------------------------------------------- --- To avoid non-H98 stuff like existentially quantified data constructors, we+-- To avoid non-H2010 stuff like existentially quantified data constructors, we -- simply use pointers to () below. Not very nice, but...  -- | A memory pool.@@ -97,7 +88,6 @@ -- deallocated (including its contents) after the action has finished.  withPool :: (Pool -> IO b) -> IO b-#ifdef __GLASGOW_HASKELL__ withPool act =   -- ATTENTION: cut-n-paste from Control.Exception below!    mask (\restore -> do       pool <- newPool@@ -106,9 +96,6 @@                 (\e -> do freePool pool; throw e)       freePool pool       return val)-#else-withPool = bracket newPool freePool-#endif  -------------------------------------------------------------------------------- 
Foreign/Marshal/Safe.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |
Foreign/Marshal/Unsafe.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -20,11 +20,7 @@         unsafeLocalState     ) where -#ifdef __GLASGOW_HASKELL__ import GHC.IO-#else-import System.IO.Unsafe-#endif  {- | Sometimes an external entity is a pure function, except that it passes
Foreign/Marshal/Utils.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -20,32 +20,29 @@    -- ** Combined allocation and marshalling   ---  with,          -- :: Storable a => a -> (Ptr a -> IO b) -> IO b-  new,           -- :: Storable a => a -> IO (Ptr a)+  with,+  new,    -- ** Marshalling of Boolean values (non-zero corresponds to 'True')   ---  fromBool,      -- :: Num a => Bool -> a-  toBool,        -- :: Num a => a -> Bool+  fromBool,+  toBool,    -- ** Marshalling of Maybe values   ---  maybeNew,      -- :: (      a -> IO (Ptr a))-                 -- -> (Maybe a -> IO (Ptr a))-  maybeWith,     -- :: (      a -> (Ptr b -> IO c) -> IO c)-                 -- -> (Maybe a -> (Ptr b -> IO c) -> IO c)-  maybePeek,     -- :: (Ptr a -> IO        b )-                 -- -> (Ptr a -> IO (Maybe b))+  maybeNew,+  maybeWith,+  maybePeek,    -- ** Marshalling lists of storable objects   ---  withMany,      -- :: (a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res+  withMany,    -- ** Haskellish interface to memcpy and memmove   -- | (argument order: destination, source)   ---  copyBytes,     -- :: Ptr a -> Ptr a -> Int -> IO ()-  moveBytes,     -- :: Ptr a -> Ptr a -> Int -> IO ()+  copyBytes,+  moveBytes, ) where  import Data.Maybe@@ -54,15 +51,9 @@ import Foreign.C.Types          ( CSize(..) ) import Foreign.Marshal.Alloc    ( malloc, alloca ) -#ifdef __GLASGOW_HASKELL__ import GHC.Real                 ( fromIntegral ) import GHC.Num import GHC.Base-#endif--#ifdef __NHC__-import Foreign.C.Types          ( CInt(..) )-#endif  -- combined allocation and marshalling -- -----------------------------------
Foreign/Ptr.hs view
@@ -1,13 +1,10 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP            , NoImplicitPrelude-           , ForeignFunctionInterface            , MagicHash            , GeneralizedNewtypeDeriving   #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -29,25 +26,24 @@      -- * Data pointers -    Ptr,      -- data Ptr a-    nullPtr,      -- :: Ptr a-    castPtr,      -- :: Ptr a -> Ptr b-    plusPtr,      -- :: Ptr a -> Int -> Ptr b-    alignPtr,     -- :: Ptr a -> Int -> Ptr a-    minusPtr,     -- :: Ptr a -> Ptr b -> Int+    Ptr,+    nullPtr,+    castPtr,+    plusPtr,+    alignPtr,+    minusPtr,      -- * Function pointers -    FunPtr,      -- data FunPtr a-    nullFunPtr,      -- :: FunPtr a-    castFunPtr,      -- :: FunPtr a -> FunPtr b-    castFunPtrToPtr, -- :: FunPtr a -> Ptr b-    castPtrToFunPtr, -- :: Ptr a -> FunPtr b+    FunPtr,+    nullFunPtr,+    castFunPtr,+    castFunPtrToPtr,+    castPtrToFunPtr, -    freeHaskellFunPtr, -- :: FunPtr a -> IO ()+    freeHaskellFunPtr,     -- Free the function pointer created by foreign export dynamic. -#ifndef __NHC__     -- * Integral types with lossless conversion to and from pointers     IntPtr,     ptrToIntPtr,@@ -55,10 +51,8 @@     WordPtr,     ptrToWordPtr,     wordPtrToPtr-#endif  ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Ptr import GHC.Base import GHC.Num@@ -66,60 +60,31 @@ import GHC.Real import GHC.Show import GHC.Enum-#else-import Control.Monad    ( liftM )-import Foreign.C.Types-#endif  import Data.Bits import Data.Typeable import Foreign.Storable ( Storable(..) ) -#ifdef __NHC__-import NHC.FFI-  ( Ptr-  , nullPtr-  , castPtr-  , plusPtr-  , alignPtr-  , minusPtr-  , FunPtr-  , nullFunPtr-  , castFunPtr-  , castFunPtrToPtr-  , castPtrToFunPtr-  , freeHaskellFunPtr-  )-#endif--#ifdef __HUGS__-import Hugs.Ptr-#endif--#ifdef __GLASGOW_HASKELL__ -- | Release the storage associated with the given 'FunPtr', which -- must have been obtained from a wrapper stub.  This should be called -- whenever the return value from a foreign import wrapper function is -- no longer required; otherwise, the storage it uses will leak. foreign import ccall unsafe "freeHaskellFunctionPtr"     freeHaskellFunPtr :: FunPtr a -> IO ()-#endif -#ifndef __NHC__-# include "HsBaseConfig.h"-# include "CTypes.h"+#include "HsBaseConfig.h"+#include "CTypes.h" -# ifdef __GLASGOW_HASKELL__ -- | An unsigned integral type that can be losslessly converted to and from -- @Ptr@. This type is also compatible with the C99 type @uintptr_t@, and -- can be marshalled to and from that type safely.-INTEGRAL_TYPE(WordPtr,tyConWordPtr,"WordPtr",Word)+INTEGRAL_TYPE(WordPtr,Word)         -- Word and Int are guaranteed pointer-sized in GHC  -- | A signed integral type that can be losslessly converted to and from -- @Ptr@.  This type is also compatible with the C99 type @intptr_t@, and -- can be marshalled to and from that type safely.-INTEGRAL_TYPE(IntPtr,tyConIntPtr,"IntPtr",Int)+INTEGRAL_TYPE(IntPtr,Int)         -- Word and Int are guaranteed pointer-sized in GHC  -- | casts a @Ptr@ to a @WordPtr@@@ -137,26 +102,3 @@ -- | casts an @IntPtr@ to a @Ptr@ intPtrToPtr :: IntPtr -> Ptr a intPtrToPtr (IntPtr (I# i#)) = Ptr (int2Addr# i#)--# else /* !__GLASGOW_HASKELL__ */--INTEGRAL_TYPE(WordPtr,tyConWordPtr,"WordPtr",CUIntPtr)-INTEGRAL_TYPE(IntPtr,tyConIntPtr,"IntPtr",CIntPtr)--{-# CFILES cbits/PrelIOUtils.c #-}--foreign import ccall unsafe "__hscore_to_uintptr"-    ptrToWordPtr :: Ptr a -> WordPtr--foreign import ccall unsafe "__hscore_from_uintptr"-    wordPtrToPtr :: WordPtr -> Ptr a--foreign import ccall unsafe "__hscore_to_intptr"-    ptrToIntPtr :: Ptr a -> IntPtr--foreign import ccall unsafe "__hscore_from_intptr"-    intPtrToPtr :: IntPtr -> Ptr a--# endif /* !__GLASGOW_HASKELL__ */-#endif /* !__NHC_ */-
Foreign/StablePtr.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -20,34 +20,17 @@ module Foreign.StablePtr         ( -- * Stable references to Haskell values           StablePtr          -- abstract-        , newStablePtr       -- :: a -> IO (StablePtr a)-        , deRefStablePtr     -- :: StablePtr a -> IO a-        , freeStablePtr      -- :: StablePtr a -> IO ()-        , castStablePtrToPtr -- :: StablePtr a -> Ptr ()-        , castPtrToStablePtr -- :: Ptr () -> StablePtr a+        , newStablePtr+        , deRefStablePtr+        , freeStablePtr+        , castStablePtrToPtr+        , castPtrToStablePtr         , -- ** The C-side interface            -- $cinterface         ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Stable-#endif--#ifdef __HUGS__-import Hugs.StablePtr-#endif--#ifdef __NHC__-import NHC.FFI-  ( StablePtr-  , newStablePtr-  , deRefStablePtr-  , freeStablePtr-  , castStablePtrToPtr-  , castPtrToStablePtr-  )-#endif  -- $cinterface --
Foreign/Storable.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, ScopedTypeVariables #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE BangPatterns #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -23,51 +21,33 @@  module Foreign.Storable         ( Storable(-             sizeOf,         -- :: a -> Int-             alignment,      -- :: a -> Int-             peekElemOff,    -- :: Ptr a -> Int      -> IO a-             pokeElemOff,    -- :: Ptr a -> Int -> a -> IO ()-             peekByteOff,    -- :: Ptr b -> Int      -> IO a-             pokeByteOff,    -- :: Ptr b -> Int -> a -> IO ()-             peek,           -- :: Ptr a             -> IO a-             poke)           -- :: Ptr a        -> a -> IO ()+             sizeOf,+             alignment,+             peekElemOff,+             pokeElemOff,+             peekByteOff,+             pokeByteOff,+             peek,+             poke)         ) where  -#ifdef __NHC__-import NHC.FFI (Storable(..),Ptr,FunPtr,StablePtr-               ,Int8,Int16,Int32,Int64,Word8,Word16,Word32,Word64)-#else- import Control.Monad            ( liftM )  #include "MachDeps.h" #include "HsBaseConfig.h" -#ifdef __GLASGOW_HASKELL__ import GHC.Storable import GHC.Stable       ( StablePtr ) import GHC.Num import GHC.Int import GHC.Word import GHC.Ptr-import GHC.Err import GHC.Base import GHC.Fingerprint.Type import Data.Bits import GHC.Real-#else-import Data.Int-import Data.Word-import Foreign.StablePtr-#endif -#ifdef __HUGS__-import Hugs.Prelude-import Hugs.Ptr-import Hugs.Storable-#endif- {- | The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the@@ -158,13 +138,9 @@    -- restrictions might apply; see 'peek'.      -- circular default instances-#ifdef __GLASGOW_HASKELL__    peekElemOff = peekElemOff_ undefined       where peekElemOff_ :: a -> Ptr a -> Int -> IO a             peekElemOff_ undef ptr off = peekByteOff ptr (off * sizeOf undef)-#else-   peekElemOff ptr off = peekByteOff ptr (off * sizeOfPtr ptr undefined)-#endif    pokeElemOff ptr off val = pokeByteOff ptr (off * sizeOf val) val     peekByteOff ptr off = peek (ptr `plusPtr` off)@@ -173,10 +149,9 @@    peek ptr = peekElemOff ptr 0    poke ptr = pokeElemOff ptr 0 -#ifndef __GLASGOW_HASKELL__-sizeOfPtr :: Storable a => Ptr a -> a -> Int-sizeOfPtr px x = sizeOf x-#endif+   {-# MINIMAL sizeOf, alignment,+               (peek | peekElemOff | peekByteOff),+               (poke | pokeElemOff | pokeByteOff) #-}  -- System-dependent, but rather obvious instances @@ -193,21 +168,14 @@     peekElemOff = read;                         \     pokeElemOff = write } -#ifdef __GLASGOW_HASKELL__ STORABLE(Char,SIZEOF_INT32,ALIGNMENT_INT32,          readWideCharOffPtr,writeWideCharOffPtr)-#elif defined(__HUGS__)-STORABLE(Char,SIZEOF_HSCHAR,ALIGNMENT_HSCHAR,-         readCharOffPtr,writeCharOffPtr)-#endif  STORABLE(Int,SIZEOF_HSINT,ALIGNMENT_HSINT,          readIntOffPtr,writeIntOffPtr) -#ifndef __NHC__ STORABLE(Word,SIZEOF_HSWORD,ALIGNMENT_HSWORD,          readWordOffPtr,writeWordOffPtr)-#endif  STORABLE((Ptr a),SIZEOF_HSPTR,ALIGNMENT_HSPTR,          readPtrOffPtr,writePtrOffPtr)@@ -248,10 +216,7 @@ STORABLE(Int64,SIZEOF_INT64,ALIGNMENT_INT64,          readInt64OffPtr,writeInt64OffPtr) -#endif- -- XXX: here to avoid orphan instance in GHC.Fingerprint-#ifdef __GLASGOW_HASKELL__ instance Storable Fingerprint where   sizeOf _ = 16   alignment _ = 8@@ -282,5 +247,3 @@        pokeW64 (castPtr p0) 8 high       pokeW64 (castPtr p0 `plusPtr` 8) 8 low-#endif-
GHC/Arr.lhs view
@@ -1,6 +1,6 @@ \begin{code} {-# LANGUAGE Unsafe #-}-{-# LANGUAGE NoImplicitPrelude, NoBangPatterns, MagicHash, UnboxedTuples #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} @@ -9,16 +9,15 @@ -- Module      :  GHC.Arr -- Copyright   :  (c) The University of Glasgow, 1994-2000 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC extensions) -- -- GHC\'s array implementation.--- +-- ----------------------------------------------------------------------------- --- #hide module GHC.Arr (         Ix(..), Array(..), STArray(..), @@ -47,7 +46,7 @@ import GHC.ST import GHC.Base import GHC.List-import GHC.Real+import GHC.Real( fromIntegral ) import GHC.Show  infixl 9  !, //@@ -105,7 +104,7 @@ 	-- the same code, but using indexError instead of hopelessIndexError 	-- Reason: we have 'Show' at the instances     {-# INLINE index #-}  -- See Note [Inlining index]-    index b i | inRange b i = unsafeIndex b i   +    index b i | inRange b i = unsafeIndex b i               | otherwise   = hopelessIndexError      unsafeIndex b i = index b i@@ -137,9 +136,9 @@  Note [Inlining index] ~~~~~~~~~~~~~~~~~~~~~-We inline the 'index' operation, +We inline the 'index' operation, - * Partly because it generates much faster code + * Partly because it generates much faster code    (although bigger); see Trac #1216   * Partly because it exposes the bounds checks to the simplifier which@@ -151,20 +150,20 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When you index an array, a!x, there are two possible bounds checks we might make: -  (A) Check that (inRange (bounds a) x) holds.  +  (A) Check that (inRange (bounds a) x) holds.        (A) is checked in the method for 'index' -  (B) Check that (index (bounds a) x) lies in the range 0..n, +  (B) Check that (index (bounds a) x) lies in the range 0..n,       where n is the size of the underlying array        (B) is checked in the top-level function (!), in safeIndex. -Of course it *should* be the case that (A) holds iff (B) holds, but that +Of course it *should* be the case that (A) holds iff (B) holds, but that is a property of the particular instances of index, bounds, and inRange, so GHC cannot guarantee it. - * If you do (A) and not (B), then you might get a seg-fault, + * If you do (A) and not (B), then you might get a seg-fault,    by indexing at some bizarre location.  Trac #1610   * If you do (B) but not (A), you may get no complaint when you index@@ -227,7 +226,7 @@               | otherwise   =  indexError b i "Int"      {-# INLINE inRange #-}-    inRange (I# m,I# n) (I# i) =  m <=# i && i <=# n+    inRange (I# m,I# n) (I# i) =  isTrue# (m <=# i) && isTrue# (i <=# n)  instance Ix Word where     range (m,n)         = [m..n]@@ -366,7 +365,7 @@      inRange ((l1,l2,l3,l4,l5),(u1,u2,u3,u4,u5)) (i1,i2,i3,i4,i5) =       inRange (l1,u1) i1 && inRange (l2,u2) i2 &&-      inRange (l3,u3) i3 && inRange (l4,u4) i4 && +      inRange (l3,u3) i3 && inRange (l4,u4) i4 &&       inRange (l5,u5) i5      -- Default method for index@@ -411,7 +410,7 @@ -- Just pointer equality on mutable arrays: instance Eq (STArray s i e) where     STArray _ _ _ arr1# == STArray _ _ _ arr2# =-        sameMutableArray# arr1# arr2#+        isTrue# (sameMutableArray# arr1# arr2#) \end{code}  @@ -430,7 +429,7 @@ -- for given indices within these bounds. -- -- The array is undefined (i.e. bottom) if any index in the list is--- out of bounds.  The Haskell 98 Report further specifies that if any+-- out of bounds.  The Haskell 2010 Report further specifies that if any -- two associations in the list have the same index, the value at that -- index is undefined (i.e. bottom).  However in GHC's implementation, -- the value at such an index is the value part of the last association@@ -483,16 +482,16 @@  {-# INLINE fill #-} fill :: MutableArray# s e -> (Int, e) -> STRep s a -> STRep s a--- NB: put the \s after the "=" so that 'fill' ---     inlines when applied to three args -fill marr# (I# i#, e) next - = \s1# -> case writeArray# marr# i# e s1# of -             s2# -> next s2# +-- NB: put the \s after the "=" so that 'fill'+--     inlines when applied to three args+fill marr# (I# i#, e) next+ = \s1# -> case writeArray# marr# i# e s1# of+             s2# -> next s2#  {-# INLINE done #-} done :: Ix i => i -> i -> Int -> MutableArray# s e -> STRep s (Array i e) -- See NB on 'fill'-done l u n marr# +done l u n marr#   = \s1# -> case unsafeFreezeArray# marr# s1# of               (# s2#, arr# #) -> (# s2#, Array l u n arr# #) @@ -509,7 +508,7 @@ listArray (l,u) es = runST (ST $ \s1# ->     case safeRangeSize (l,u)            of { n@(I# n#) ->     case newArray# n# arrEleBottom s1#  of { (# s2#, marr# #) ->-    let fillFromList i# xs s3# | i# ==# n# = s3#+    let fillFromList i# xs s3# | isTrue# (i# ==# n#) = s3#                                | otherwise = case xs of             []   -> s3#             y:ys -> case writeArray# marr# i# y s3# of { s4# ->@@ -551,7 +550,7 @@ lessSafeIndex :: Ix i => (i, i) -> Int -> i -> Int -- See Note [Double bounds-checking of index values] -- Do only (A), the semantic check-lessSafeIndex (l,u) _ i = index (l,u) i  +lessSafeIndex (l,u) _ i = index (l,u) i  -- Don't inline this long error message everywhere!! badSafeIndex :: Int -> Int -> Int@@ -644,7 +643,7 @@ -- is the same matrix, except with the diagonal zeroed. -- -- Repeated indices in the association list are handled as for 'array':--- Haskell 98 specifies that the resulting array is undefined (i.e. bottom),+-- Haskell 2010 specifies that the resulting array is undefined (i.e. bottom), -- but GHC's implementation uses the last association for each index. {-# INLINE (//) #-} (//) :: Ix i => Array i e -> [(i, e)] -> Array i e@@ -697,7 +696,7 @@     l1 == l2 && u1 == u2 &&     and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. n1 - 1]] -{-# INLINE cmpArray #-}+{-# INLINE [1] cmpArray #-} cmpArray :: (Ix i, Ord e) => Array i e -> Array i e -> Ordering cmpArray arr1 arr2 = compare (assocs arr1) (assocs arr2) @@ -776,7 +775,7 @@     (# s2#, STArray l u n marr# #) }}  {-# INLINE boundsSTArray #-}-boundsSTArray :: STArray s i e -> (i,i)  +boundsSTArray :: STArray s i e -> (i,i) boundsSTArray (STArray l u _ _) = (l,u)  {-# INLINE numElementsSTArray #-}@@ -794,12 +793,12 @@     = ST $ \s1# -> readArray# marr# i# s1#  {-# INLINE writeSTArray #-}-writeSTArray :: Ix i => STArray s i e -> i -> e -> ST s () +writeSTArray :: Ix i => STArray s i e -> i -> e -> ST s () writeSTArray marr@(STArray l u n _) i e =     unsafeWriteSTArray marr (safeIndex (l,u) n i) e  {-# INLINE unsafeWriteSTArray #-}-unsafeWriteSTArray :: Ix i => STArray s i e -> Int -> e -> ST s () +unsafeWriteSTArray :: Ix i => STArray s i e -> Int -> e -> ST s () unsafeWriteSTArray (STArray _ _ _ marr#) (I# i#) e = ST $ \s1# ->     case writeArray# marr# i# e s1# of         s2# -> (# s2#, () #)@@ -816,7 +815,7 @@ freezeSTArray :: Ix i => STArray s i e -> ST s (Array i e) freezeSTArray (STArray l u n@(I# n#) marr#) = ST $ \s1# ->     case newArray# n# arrEleBottom s1#  of { (# s2#, marr'# #) ->-    let copy i# s3# | i# ==# n# = s3#+    let copy i# s3# | isTrue# (i# ==# n#) = s3#                     | otherwise =             case readArray# marr# i# s3# of { (# s4#, e #) ->             case writeArray# marr'# i# e s4# of { s5# ->@@ -834,7 +833,7 @@ thawSTArray :: Ix i => Array i e -> ST s (STArray s i e) thawSTArray (Array l u n@(I# n#) arr#) = ST $ \s1# ->     case newArray# n# arrEleBottom s1#  of { (# s2#, marr# #) ->-    let copy i# s3# | i# ==# n# = s3#+    let copy i# s3# | isTrue# (i# ==# n#) = s3#                     | otherwise =             case indexArray# arr# i#    of { (# e #) ->             case writeArray# marr# i# e s3# of { s4# ->
GHC/Base.lhs view
@@ -11,7 +11,7 @@ So the rough structure is as follows, in (linearised) dependency order  -GHC.Prim                Has no implementation.  It defines built-in things, and+GHC.Prim        Has no implementation.  It defines built-in things, and                 by importing it you bring them into scope.                 The source file is GHC.Prim.hi-boot, which is just                 copied to make GHC.Prim.hi@@ -70,7 +70,7 @@            , MagicHash            , UnboxedTuples            , ExistentialQuantification-           , Rank2Types+           , RankNTypes   #-} -- -fno-warn-orphans is needed for things like: -- Orphan rule: "x# -# x#" ALWAYS forall x# :: Int# -# x# x# = 0@@ -82,34 +82,36 @@ -- Module      :  GHC.Base -- Copyright   :  (c) The University of Glasgow, 1992-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC extensions) -- -- Basic data types and classes.--- +-- -----------------------------------------------------------------------------  #include "MachDeps.h" --- #hide module GHC.Base         (         module GHC.Base,         module GHC.Classes,         module GHC.CString,+        module GHC.Magic,         module GHC.Types,-        module GHC.Prim,        -- Re-export GHC.Prim and GHC.Err, to avoid lots-        module GHC.Err          -- of people having to import it explicitly-  ) +        module GHC.Prim,        -- Re-export GHC.Prim and [boot] GHC.Err,+                                -- to avoid lots of people having to+        module GHC.Err          -- import it explicitly+  )         where  import GHC.Types import GHC.Classes import GHC.CString+import GHC.Magic import GHC.Prim-import {-# SOURCE #-} GHC.Err+import GHC.Err import {-# SOURCE #-} GHC.IO (failIO)  -- This is not strictly speaking required by this module, but is an@@ -141,7 +143,7 @@ \begin{code} {- data  Bool  =  False | True-data Ordering = LT | EQ | GT +data Ordering = LT | EQ | GT data Char = C# Char# type  String = [Char] data Int = I# Int#@@ -264,7 +266,7 @@ ---------------------------------------------- --      foldr/build/augment -----------------------------------------------  + \begin{code} -- | 'foldr', applied to a binary operator, a starting value (typically -- the right-identity of the operator), and a list, reduces the list@@ -277,7 +279,7 @@ -- foldr f z (x:xs) =  f x (foldr f z xs) {-# INLINE [0] foldr #-} -- Inline only in the final stage, after the foldr/cons rule has had a chance--- Also note that we inline it when it has *two* parameters, which are the +-- Also note that we inline it when it has *two* parameters, which are the -- ones we are keen about specialising! foldr k z = go           where@@ -318,10 +320,10 @@ augment g xs = g (:) xs  {-# RULES-"fold/build"    forall k z (g::forall b. (a->b->b) -> b -> b) . +"fold/build"    forall k z (g::forall b. (a->b->b) -> b -> b) .                 foldr k z (build g) = g k z -"foldr/augment" forall k z xs (g::forall b. (a->b->b) -> b -> b) . +"foldr/augment" forall k z xs (g::forall b. (a->b->b) -> b -> b) .                 foldr k z (augment g xs) = g k (foldr k z xs)  "foldr/id"                        foldr (:) [] = \x  -> x@@ -338,7 +340,7 @@ -- "foldr/cons" forall k z x xs. foldr k z (x:xs) = k x (foldr k z xs)  "foldr/single"  forall k z x. foldr k z [x] = k x z-"foldr/nil"     forall k z.   foldr k z []  = z +"foldr/nil"     forall k z.   foldr k z []  = z  "augment/build" forall (g::forall b. (a->b->b) -> b -> b)                        (h::forall b. (a->b->b) -> b -> b) .@@ -353,7 +355,7 @@   -------------------------------------------------              map     +--              map ----------------------------------------------  \begin{code}@@ -364,6 +366,9 @@ -- > map f [x1, x2, ...] == [f x1, f x2, ...]  map :: (a -> b) -> [a] -> [b]+{-# NOINLINE [1] map #-}    -- We want the RULE to fire first.+                            -- It's recursive, so won't inline anyway,+                            -- but saying so is more explicit map _ []     = [] map f (x:xs) = f x : map f xs @@ -373,33 +378,33 @@ mapFB c f = \x ys -> c (f x) ys  -- The rules for map work like this.--- +-- -- Up to (but not including) phase 1, we use the "map" rule to--- rewrite all saturated applications of map with its build/fold +-- rewrite all saturated applications of map with its build/fold -- form, hoping for fusion to happen. -- In phase 1 and 0, we switch off that rule, inline build, and -- switch on the "mapList" rule, which rewrites the foldr/mapFB--- thing back into plain map.  +-- thing back into plain map. ----- It's important that these two rules aren't both active at once --- (along with build's unfolding) else we'd get an infinite loop +-- It's important that these two rules aren't both active at once+-- (along with build's unfolding) else we'd get an infinite loop -- in the rules.  Hence the activation control below. -- -- The "mapFB" rule optimises compositions of map. ----- This same pattern is followed by many other functions: +-- This same pattern is followed by many other functions: -- e.g. append, filter, iterate, repeat, etc.  {-# RULES "map"       [~1] forall f xs.   map f xs                = build (\c n -> foldr (mapFB c f) n xs) "mapList"   [1]  forall f.      foldr (mapFB (:) f) []  = map f-"mapFB"     forall c f g.       mapFB (mapFB c f) g     = mapFB c (f.g) +"mapFB"     forall c f g.       mapFB (mapFB c f) g     = mapFB c (f.g)   #-} \end{code}   -------------------------------------------------              append  +--              append ---------------------------------------------- \begin{code} -- | Append two lists, i.e.,@@ -410,6 +415,9 @@ -- If the first list is not finite, the result is the first list.  (++) :: [a] -> [a] -> [a]+{-# NOINLINE [1] (++) #-}    -- We want the RULE to fire first.+                             -- It's recursive, so won't inline anyway,+                             -- but saying so is more explicit (++) []     ys = ys (++) (x:xs) ys = x : xs ++ ys @@ -448,15 +456,6 @@ -- type String = [Char] -{-# RULES-"x# `eqChar#` x#" forall x#. x# `eqChar#` x# = True-"x# `neChar#` x#" forall x#. x# `neChar#` x# = False-"x# `gtChar#` x#" forall x#. x# `gtChar#` x# = False-"x# `geChar#` x#" forall x#. x# `geChar#` x# = True-"x# `leChar#` x#" forall x#. x# `leChar#` x# = True-"x# `ltChar#` x#" forall x#. x# `ltChar#` x# = False-  #-}- unsafeChr :: Int -> Char unsafeChr (I# i#) = C# (chr# i#) @@ -495,7 +494,7 @@ #elif WORD_SIZE_IN_BITS == 32 minInt  = I# (-0x80000000#) maxInt  = I# 0x7FFFFFFF#-#else +#else minInt  = I# (-0x8000000000000000#) maxInt  = I# 0x7FFFFFFFFFFFFFFF# #endif@@ -513,17 +512,6 @@ id                      :: a -> a id x                    =  x --- | The call '(lazy e)' means the same as 'e', but 'lazy' has a --- magical strictness property: it is lazy in its first argument, --- even though its semantics is strict.-lazy :: a -> a-lazy x = x--- Implementation note: its strictness and unfolding are over-ridden--- by the definition in MkId.lhs; in both cases to nothing at all.--- That way, 'lazy' does not get inlined, and the strictness analyser--- sees it as lazy.  Then the worker/wrapper phase inlines it.--- Result: happiness- -- Assertion function.  This simply ignores its boolean argument. -- The compiler may rewrite it to @('assertError' line)@. @@ -533,7 +521,7 @@ -- call to 'assert'. -- -- Assertions can normally be turned on or off with a compiler flag--- (for GHC, assertions are normally on unless optimisation is turned on +-- (for GHC, assertions are normally on unless optimisation is turned on -- with @-O@ or the @-fignore-asserts@ -- option is given).  When assertions are turned off, the first -- argument to 'assert' is ignored, and the second argument is@@ -583,8 +571,10 @@  -- | @'until' p f@ yields the result of applying @f@ until @p@ holds. until                   :: (a -> Bool) -> (a -> a) -> a -> a-until p f x | p x       =  x-            | otherwise =  until p f (f x)+until p f = go+  where+    go x | p x          = x+         | otherwise    = go (f x)  -- | 'asTypeOf' is a type-restricted version of 'const'.  It is usually -- used as an infix operator, and its typing forces its first argument@@ -679,70 +669,14 @@  divModInt# :: Int# -> Int# -> (# Int#, Int# #) x# `divModInt#` y#- | (x# ># 0#) && (y# <# 0#) = case (x# -# 1#) `quotRemInt#` y# of-                              (# q, r #) -> (# q -# 1#, r +# y# +# 1# #)- | (x# <# 0#) && (y# ># 0#) = case (x# +# 1#) `quotRemInt#` y# of-                              (# q, r #) -> (# q -# 1#, r +# y# -# 1# #)- | otherwise                = x# `quotRemInt#` y#--{-# RULES-"x# +# 0#" forall x#. x# +# 0# = x#-"0# +# x#" forall x#. 0# +# x# = x#-"x# -# 0#" forall x#. x# -# 0# = x#-"x# -# x#" forall x#. x# -# x# = 0#-"x# *# 0#" forall x#. x# *# 0# = 0#-"0# *# x#" forall x#. 0# *# x# = 0#-"x# *# 1#" forall x#. x# *# 1# = x#-"1# *# x#" forall x#. 1# *# x# = x#-  #-}--{-# RULES-"x# ># x#"  forall x#. x# >#  x# = False-"x# >=# x#" forall x#. x# >=# x# = True-"x# ==# x#" forall x#. x# ==# x# = True-"x# /=# x#" forall x#. x# /=# x# = False-"x# <# x#"  forall x#. x# <#  x# = False-"x# <=# x#" forall x#. x# <=# x# = True-  #-}--{-# RULES-"plusFloat x 0.0"   forall x#. plusFloat#  x#   0.0# = x#-"plusFloat 0.0 x"   forall x#. plusFloat#  0.0# x#   = x#-"minusFloat x 0.0"  forall x#. minusFloat# x#   0.0# = x#-"timesFloat x 1.0"  forall x#. timesFloat# x#   1.0# = x#-"timesFloat 1.0 x"  forall x#. timesFloat# 1.0# x#   = x#-"divideFloat x 1.0" forall x#. divideFloat# x#  1.0# = x#-  #-}--{-# RULES-"plusDouble x 0.0"   forall x#. (+##) x#    0.0## = x#-"plusDouble 0.0 x"   forall x#. (+##) 0.0## x#    = x#-"minusDouble x 0.0"  forall x#. (-##) x#    0.0## = x#-"timesDouble x 1.0"  forall x#. (*##) x#    1.0## = x#-"timesDouble 1.0 x"  forall x#. (*##) 1.0## x#    = x#-"divideDouble x 1.0" forall x#. (/##) x#    1.0## = x#-  #-}--{--We'd like to have more rules, but for example:--This gives wrong answer (0) for NaN - NaN (should be NaN):-    "minusDouble x x"    forall x#. (-##) x#    x#    = 0.0##--This gives wrong answer (0) for 0 * NaN (should be NaN):-    "timesDouble 0.0 x"  forall x#. (*##) 0.0## x#    = 0.0##--This gives wrong answer (0) for NaN * 0 (should be NaN):-    "timesDouble x 0.0"  forall x#. (*##) x#    0.0## = 0.0##--These are tested by num014.--Similarly for Float (#5178):--"minusFloat x x"    forall x#. minusFloat# x#   x#   = 0.0#-"timesFloat0.0 x"   forall x#. timesFloat# 0.0# x#   = 0.0#-"timesFloat x 0.0"  forall x#. timesFloat# x#   0.0# = 0.0#--}+ | isTrue# (x# ># 0#) && isTrue# (y# <# 0#) =+                                    case (x# -# 1#) `quotRemInt#` y# of+                                      (# q, r #) -> (# q -# 1#, r +# y# +# 1# #)+ | isTrue# (x# <# 0#) && isTrue# (y# ># 0#) =+                                    case (x# +# 1#) `quotRemInt#` y# of+                                      (# q, r #) -> (# q -# 1#, r +# y# -# 1# #)+ | otherwise                                =+                                    x# `quotRemInt#` y#  -- Wrappers for the shift operations.  The uncheckedShift# family are -- undefined when the amount being shifted by is greater than the size@@ -755,45 +689,34 @@ -- | Shift the argument left by the specified number of bits -- (which must be non-negative). shiftL# :: Word# -> Int# -> Word#-a `shiftL#` b   | b >=# WORD_SIZE_IN_BITS# = 0##-                | otherwise                = a `uncheckedShiftL#` b+a `shiftL#` b   | isTrue# (b >=# WORD_SIZE_IN_BITS#) = 0##+                | otherwise                          = a `uncheckedShiftL#` b  -- | Shift the argument right by the specified number of bits -- (which must be non-negative). shiftRL# :: Word# -> Int# -> Word#-a `shiftRL#` b  | b >=# WORD_SIZE_IN_BITS# = 0##-                | otherwise                = a `uncheckedShiftRL#` b+a `shiftRL#` b  | isTrue# (b >=# WORD_SIZE_IN_BITS#) = 0##+                | otherwise                          = a `uncheckedShiftRL#` b  -- | Shift the argument left by the specified number of bits -- (which must be non-negative). iShiftL# :: Int# -> Int# -> Int#-a `iShiftL#` b  | b >=# WORD_SIZE_IN_BITS# = 0#-                | otherwise                = a `uncheckedIShiftL#` b+a `iShiftL#` b  | isTrue# (b >=# WORD_SIZE_IN_BITS#) = 0#+                | otherwise                          = a `uncheckedIShiftL#` b  -- | Shift the argument right (signed) by the specified number of bits -- (which must be non-negative). iShiftRA# :: Int# -> Int# -> Int#-a `iShiftRA#` b | b >=# WORD_SIZE_IN_BITS# = if a <# 0# then (-1#) else 0#-                | otherwise                = a `uncheckedIShiftRA#` b+a `iShiftRA#` b | isTrue# (b >=# WORD_SIZE_IN_BITS#) = if isTrue# (a <# 0#)+                                                          then (-1#)+                                                          else 0#+                | otherwise                          = a `uncheckedIShiftRA#` b  -- | Shift the argument right (unsigned) by the specified number of bits -- (which must be non-negative). iShiftRL# :: Int# -> Int# -> Int#-a `iShiftRL#` b | b >=# WORD_SIZE_IN_BITS# = 0#-                | otherwise                = a `uncheckedIShiftRL#` b--#if WORD_SIZE_IN_BITS == 32-{-# RULES-"narrow32Int#"  forall x#. narrow32Int#   x# = x#-"narrow32Word#" forall x#. narrow32Word#   x# = x#-   #-}-#endif--{-# RULES-"int2Word2Int"  forall x#. int2Word# (word2Int# x#) = x#-"word2Int2Word" forall x#. word2Int# (int2Word# x#) = x#-  #-}-+a `iShiftRL#` b | isTrue# (b >=# WORD_SIZE_IN_BITS#) = 0#+                | otherwise                          = a `uncheckedIShiftRL#` b  -- Rules for C strings (the functions themselves are now in GHC.CString) {-# RULES@@ -816,4 +739,3 @@ data RealWorld \end{code} #endif-
GHC/Char.hs view
@@ -9,7 +9,7 @@ -- | The 'Prelude.toEnum' method restricted to the type 'Data.Char.Char'. chr :: Int -> Char chr i@(I# i#)- | int2Word# i# `leWord#` 0x10FFFF## = C# (chr# i#)+ | isTrue# (int2Word# i# `leWord#` 0x10FFFF##) = C# (chr# i#)  | otherwise     = error ("Prelude.chr: bad argument: " ++ showSignedInt (I# 9#) i "") 
GHC/Conc.lhs view
@@ -21,75 +21,71 @@ -- No: #hide, because bits of this module are exposed by the stm package. -- However, we don't want this module to be the home location for the -- bits it exports, we'd rather have Control.Concurrent and the other--- higher level modules be the home.  Hence:--#include "Typeable.h"+-- higher level modules be the home.  Hence: #not-home --- #not-home module GHC.Conc         ( ThreadId(..)          -- * Forking and suchlike-        , forkIO        -- :: IO a -> IO ThreadId-        , forkIOUnmasked+        , forkIO         , forkIOWithUnmask         , forkOn-        , forkOnIO      -- :: Int -> IO a -> IO ThreadId-        , forkOnIOUnmasked         , forkOnWithUnmask-        , numCapabilities -- :: Int-        , getNumCapabilities -- :: IO Int-        , setNumCapabilities -- :: Int -> IO ()-        , getNumProcessors   -- :: IO Int-        , numSparks       -- :: IO Int-        , childHandler  -- :: Exception -> IO ()-        , myThreadId    -- :: IO ThreadId-        , killThread    -- :: ThreadId -> IO ()-        , throwTo       -- :: ThreadId -> Exception -> IO ()-        , par           -- :: a -> b -> b-        , pseq          -- :: a -> b -> b+        , numCapabilities+        , getNumCapabilities+        , setNumCapabilities+        , getNumProcessors+        , numSparks+        , childHandler+        , myThreadId+        , killThread+        , throwTo+        , par+        , pseq         , runSparks-        , yield         -- :: IO ()-        , labelThread   -- :: ThreadId -> String -> IO ()-        , mkWeakThreadId -- :: ThreadId -> IO (Weak ThreadId)+        , yield+        , labelThread+        , mkWeakThreadId          , ThreadStatus(..), BlockReason(..)-        , threadStatus  -- :: ThreadId -> IO ThreadStatus+        , threadStatus         , threadCapability          -- * Waiting-        , threadDelay           -- :: Int -> IO ()-        , registerDelay         -- :: Int -> IO (TVar Bool)-        , threadWaitRead        -- :: Int -> IO ()-        , threadWaitWrite       -- :: Int -> IO ()-        , closeFdWith           -- :: (Fd -> IO ()) -> Fd -> IO ()+        , threadDelay+        , registerDelay+        , threadWaitRead+        , threadWaitWrite+        , threadWaitReadSTM+        , threadWaitWriteSTM+        , closeFdWith          -- * TVars         , STM(..)-        , atomically    -- :: STM a -> IO a-        , retry         -- :: STM a-        , orElse        -- :: STM a -> STM a -> STM a-        , throwSTM      -- :: Exception e => e -> STM a-        , catchSTM      -- :: Exception e => STM a -> (e -> STM a) -> STM a-        , alwaysSucceeds -- :: STM a -> STM ()-        , always        -- :: STM Bool -> STM ()+        , atomically+        , retry+        , orElse+        , throwSTM+        , catchSTM+        , alwaysSucceeds+        , always         , TVar(..)-        , newTVar       -- :: a -> STM (TVar a)-        , newTVarIO     -- :: a -> STM (TVar a)-        , readTVar      -- :: TVar a -> STM a-        , readTVarIO    -- :: TVar a -> IO a-        , writeTVar     -- :: a -> TVar a -> STM ()-        , unsafeIOToSTM -- :: IO a -> STM a+        , newTVar+        , newTVarIO+        , readTVar+        , readTVarIO+        , writeTVar+        , unsafeIOToSTM          -- * Miscellaneous         , withMVar #ifdef mingw32_HOST_OS-        , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-        , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-        , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int+        , asyncRead+        , asyncWrite+        , asyncDoProc -        , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)-        , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+        , asyncReadBA+        , asyncWriteBA #endif  #ifndef mingw32_HOST_OS@@ -97,14 +93,15 @@ #endif          , ensureIOManagerIsRunning+        , ioManagerCapabilitiesChanged  #ifdef mingw32_HOST_OS         , ConsoleEvent(..)         , win32ConsoleHandler         , toWin32ConsoleEvent #endif-        , setUncaughtExceptionHandler      -- :: (Exception -> IO ()) -> IO ()-        , getUncaughtExceptionHandler      -- :: IO (Exception -> IO ())+        , setUncaughtExceptionHandler+        , getUncaughtExceptionHandler          , reportError, reportStackOverflow         ) where
GHC/Conc/IO.hs view
@@ -3,7 +3,6 @@            , NoImplicitPrelude            , MagicHash            , UnboxedTuples-           , ForeignFunctionInterface   #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-}@@ -25,28 +24,28 @@ -- No: #hide, because bits of this module are exposed by the stm package. -- However, we don't want this module to be the home location for the -- bits it exports, we'd rather have Control.Concurrent and the other--- higher level modules be the home.  Hence:--#include "Typeable.h"+-- higher level modules be the home.  Hence: #not-home --- #not-home module GHC.Conc.IO         ( ensureIOManagerIsRunning+        , ioManagerCapabilitiesChanged          -- * Waiting-        , threadDelay           -- :: Int -> IO ()-        , registerDelay         -- :: Int -> IO (TVar Bool)-        , threadWaitRead        -- :: Int -> IO ()-        , threadWaitWrite       -- :: Int -> IO ()-        , closeFdWith           -- :: (Fd -> IO ()) -> Fd -> IO ()+        , threadDelay+        , registerDelay+        , threadWaitRead+        , threadWaitWrite+        , threadWaitReadSTM+        , threadWaitWriteSTM+        , closeFdWith  #ifdef mingw32_HOST_OS-        , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-        , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-        , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int+        , asyncRead+        , asyncWrite+        , asyncDoProc -        , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)-        , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+        , asyncReadBA+        , asyncWriteBA          , ConsoleEvent(..)         , win32ConsoleHandler@@ -76,6 +75,13 @@ ensureIOManagerIsRunning = Windows.ensureIOManagerIsRunning #endif +ioManagerCapabilitiesChanged :: IO ()+#ifndef mingw32_HOST_OS+ioManagerCapabilitiesChanged = Event.ioManagerCapabilitiesChanged+#else+ioManagerCapabilitiesChanged = return ()+#endif+ -- | Block the current thread until data is available to read on the -- given file descriptor (GHC only). --@@ -107,6 +113,44 @@         case fromIntegral fd of { I# fd# ->         case waitWrite# fd# s of { s' -> (# s', () #)         }}++-- | Returns an STM action that can be used to wait for data+-- to read from a file descriptor. The second returned value+-- is an IO action that can be used to deregister interest+-- in the file descriptor.+threadWaitReadSTM :: Fd -> IO (Sync.STM (), IO ())+threadWaitReadSTM fd +#ifndef mingw32_HOST_OS+  | threaded  = Event.threadWaitReadSTM fd+#endif+  | otherwise = do+      m <- Sync.newTVarIO False+      _ <- Sync.forkIO $ do+        threadWaitRead fd+        Sync.atomically $ Sync.writeTVar m True+      let waitAction = do b <- Sync.readTVar m+                          if b then return () else retry+      let killAction = return ()+      return (waitAction, killAction)++-- | Returns an STM action that can be used to wait until data+-- can be written to a file descriptor. The second returned value+-- is an IO action that can be used to deregister interest+-- in the file descriptor.+threadWaitWriteSTM :: Fd -> IO (Sync.STM (), IO ())+threadWaitWriteSTM fd +#ifndef mingw32_HOST_OS+  | threaded  = Event.threadWaitWriteSTM fd+#endif+  | otherwise = do+      m <- Sync.newTVarIO False+      _ <- Sync.forkIO $ do+        threadWaitWrite fd+        Sync.atomically $ Sync.writeTVar m True+      let waitAction = do b <- Sync.readTVar m+                          if b then return () else retry+      let killAction = return ()+      return (waitAction, killAction)  -- | Close a file descriptor in a concurrency-safe way (GHC only).  If -- you are using 'threadWaitRead' or 'threadWaitWrite' to perform
GHC/Conc/Signal.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, ForeignFunctionInterface #-}+{-# LANGUAGE NoImplicitPrelude #-}  module GHC.Conc.Signal         ( Signal
GHC/Conc/Sync.lhs view
@@ -6,7 +6,6 @@            , MagicHash            , UnboxedTuples            , UnliftedFFITypes-           , ForeignFunctionInterface            , DeriveDataTypeable            , StandaloneDeriving            , RankNTypes@@ -33,70 +32,65 @@ -- bits it exports, we'd rather have Control.Concurrent and the other -- higher level modules be the home.  Hence: -#include "Typeable.h"- -- #not-home module GHC.Conc.Sync         ( ThreadId(..)          -- * Forking and suchlike-        , forkIO        -- :: IO a -> IO ThreadId-        , forkIOUnmasked+        , forkIO         , forkIOWithUnmask-        , forkOn      -- :: Int -> IO a -> IO ThreadId-        , forkOnIO    -- DEPRECATED-        , forkOnIOUnmasked+        , forkOn         , forkOnWithUnmask-        , numCapabilities -- :: Int-        , getNumCapabilities -- :: IO Int-        , setNumCapabilities -- :: Int -> IO ()-        , getNumProcessors   -- :: IO Int-        , numSparks      -- :: IO Int-        , childHandler  -- :: Exception -> IO ()-        , myThreadId    -- :: IO ThreadId-        , killThread    -- :: ThreadId -> IO ()-        , throwTo       -- :: ThreadId -> Exception -> IO ()-        , par           -- :: a -> b -> b-        , pseq          -- :: a -> b -> b+        , numCapabilities+        , getNumCapabilities+        , setNumCapabilities+        , getNumProcessors+        , numSparks+        , childHandler+        , myThreadId+        , killThread+        , throwTo+        , par+        , pseq         , runSparks-        , yield         -- :: IO ()-        , labelThread   -- :: ThreadId -> String -> IO ()-        , mkWeakThreadId -- :: ThreadId -> IO (Weak ThreadId)+        , yield+        , labelThread+        , mkWeakThreadId          , ThreadStatus(..), BlockReason(..)-        , threadStatus  -- :: ThreadId -> IO ThreadStatus+        , threadStatus         , threadCapability          -- * TVars         , STM(..)-        , atomically    -- :: STM a -> IO a-        , retry         -- :: STM a-        , orElse        -- :: STM a -> STM a -> STM a-        , throwSTM      -- :: Exception e => e -> STM a-        , catchSTM      -- :: Exception e => STM a -> (e -> STM a) -> STM a-        , alwaysSucceeds -- :: STM a -> STM ()-        , always        -- :: STM Bool -> STM ()+        , atomically+        , retry+        , orElse+        , throwSTM+        , catchSTM+        , alwaysSucceeds+        , always         , TVar(..)-        , newTVar       -- :: a -> STM (TVar a)-        , newTVarIO     -- :: a -> STM (TVar a)-        , readTVar      -- :: TVar a -> STM a-        , readTVarIO    -- :: TVar a -> IO a-        , writeTVar     -- :: a -> TVar a -> STM ()-        , unsafeIOToSTM -- :: IO a -> STM a+        , newTVar+        , newTVarIO+        , readTVar+        , readTVarIO+        , writeTVar+        , unsafeIOToSTM          -- * Miscellaneous         , withMVar         , modifyMVar_ -        , setUncaughtExceptionHandler      -- :: (Exception -> IO ()) -> IO ()-        , getUncaughtExceptionHandler      -- :: IO (Exception -> IO ())+        , setUncaughtExceptionHandler+        , getUncaughtExceptionHandler          , reportError, reportStackOverflow          , sharedCAF         ) where -import Foreign hiding (unsafePerformIO)+import Foreign import Foreign.C  #ifdef mingw32_HOST_OS@@ -152,8 +146,6 @@ garbage collected until you drop the 'ThreadId'. This misfeature will hopefully be corrected at a later date. -/Note/: Hugs does not provide any operations on other threads;-it defines 'ThreadId' as a synonym for (). -}  instance Show ThreadId where@@ -207,11 +199,6 @@  where   action_plus = catchException action childHandler -{-# DEPRECATED forkIOUnmasked "use forkIOWithUnmask instead" #-}--- | This function is deprecated; use 'forkIOWithUnmask' instead-forkIOUnmasked :: IO () -> IO ThreadId-forkIOUnmasked io = forkIO (unsafeUnmask io)- -- | Like 'forkIO', but the child thread is passed a function that can -- be used to unmask asynchronous exceptions.  This function is -- typically used in the following way@@ -227,6 +214,7 @@ -- only be used in that thread; the behaviour is undefined if it is -- invoked in a different thread. --+-- /Since: 4.4.0.0/ forkIOWithUnmask :: ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId forkIOWithUnmask io = forkIO (io unsafeUnmask) @@ -248,8 +236,10 @@ option when the program is started.  Capabilities can be fixed to actual processor cores with @+RTS -qa@ if the underlying operating system supports that, although in practice this is usually unnecessary-(and may actually degrade perforamnce in some cases - experimentation+(and may actually degrade performance in some cases - experimentation is recommended).++/Since: 4.4.0.0/ -} forkOn :: Int -> IO () -> IO ThreadId forkOn (I# cpu) action = IO $ \ s ->@@ -257,18 +247,10 @@  where   action_plus = catchException action childHandler -{-# DEPRECATED forkOnIO "renamed to forkOn" #-}--- | This function is deprecated; use 'forkOn' instead-forkOnIO :: Int -> IO () -> IO ThreadId-forkOnIO = forkOn--{-# DEPRECATED forkOnIOUnmasked "use forkOnWithUnmask instead" #-}--- | This function is deprecated; use 'forkOnWIthUnmask' instead-forkOnIOUnmasked :: Int -> IO () -> IO ThreadId-forkOnIOUnmasked cpu io = forkOn cpu (unsafeUnmask io)- -- | Like 'forkIOWithUnmask', but the child thread is pinned to the -- given CPU, as with 'forkOn'.+--+-- /Since: 4.4.0.0/ forkOnWithUnmask :: Int -> ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId forkOnWithUnmask cpu io = forkOn cpu (io unsafeUnmask) @@ -287,10 +269,12 @@ Returns the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time.  To change this value, use 'setNumCapabilities'.++/Since: 4.4.0.0/ -} getNumCapabilities :: IO Int getNumCapabilities = do-   n <- peek n_capabilities+   n <- peek enabled_capabilities    return (fromIntegral n)  {- |@@ -304,6 +288,8 @@ capabilities is not set larger than the number of physical processor cores, and it may often be beneficial to leave one or more cores free to avoid contention with other processes in the machine.++/Since: 4.5.0.0/ -} setNumCapabilities :: Int -> IO () setNumCapabilities i = c_setNumCapabilities (fromIntegral i)@@ -311,6 +297,9 @@ foreign import ccall safe "setNumCapabilities"   c_setNumCapabilities :: CUInt -> IO () +-- | Returns the number of CPUs that the machine has+--+-- /Since: 4.5.0.0/ getNumProcessors :: IO Int getNumProcessors = fmap fromIntegral c_getNumberOfProcessors @@ -321,24 +310,18 @@ numSparks :: IO Int numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) -foreign import ccall "&n_capabilities" n_capabilities :: Ptr CInt+foreign import ccall "&enabled_capabilities" enabled_capabilities :: Ptr CInt  childHandler :: SomeException -> IO () childHandler err = catchException (real_handler err) childHandler  real_handler :: SomeException -> IO ()-real_handler se@(SomeException ex) =-  -- ignore thread GC and killThread exceptions:-  case cast ex of-  Just BlockedIndefinitelyOnMVar        -> return ()-  _ -> case cast ex of-       Just BlockedIndefinitelyOnSTM    -> return ()-       _ -> case cast ex of-            Just ThreadKilled           -> return ()-            _ -> case cast ex of-                 -- report all others:-                 Just StackOverflow     -> reportStackOverflow-                 _                      -> reportError se+real_handler se+  | Just BlockedIndefinitelyOnMVar <- fromException se  =  return ()+  | Just BlockedIndefinitelyOnSTM  <- fromException se  =  return ()+  | Just ThreadKilled              <- fromException se  =  return ()+  | Just StackOverflow             <- fromException se  =  reportStackOverflow+  | otherwise                                           =  reportError se  {- | 'killThread' raises the 'ThreadKilled' exception in the given thread (GHC only).@@ -351,11 +334,12 @@  {- | 'throwTo' raises an arbitrary exception in the target thread (GHC only). +Exception delivery synchronizes between the source and target thread: 'throwTo' does not return until the exception has been raised in the-target thread.-The calling thread can thus be certain that the target-thread has received the exception.  This is a useful property to know-when dealing with race conditions: eg. if there are two threads that+target thread. The calling thread can thus be certain that the target+thread has received the exception.  Exception delivery is also atomic+with respect to other exceptions. Atomicity is a useful property to have+when dealing with race conditions: e.g. if there are two threads that can kill each other, it is guaranteed that only one of the threads will get to kill the other. @@ -458,8 +442,9 @@ runSparks = IO loop   where loop s = case getSpark# s of                    (# s', n, p #) ->-                      if n ==# 0# then (# s', () #)-                                  else p `seq` loop s'+                      if isTrue# (n ==# 0#)+                      then (# s', () #)+                      else p `seq` loop s'  data BlockReason   = BlockedOnMVar@@ -498,11 +483,13 @@         -- NB. keep these in sync with includes/Constants.h      mk_stat 0  = ThreadRunning      mk_stat 1  = ThreadBlocked BlockedOnMVar-     mk_stat 2  = ThreadBlocked BlockedOnBlackHole-     mk_stat 6  = ThreadBlocked BlockedOnSTM-     mk_stat 10 = ThreadBlocked BlockedOnForeignCall+     mk_stat 2  = ThreadBlocked BlockedOnMVar -- XXX distinguish?+     mk_stat 3  = ThreadBlocked BlockedOnBlackHole+     mk_stat 7  = ThreadBlocked BlockedOnSTM      mk_stat 11 = ThreadBlocked BlockedOnForeignCall-     mk_stat 12 = ThreadBlocked BlockedOnException+     mk_stat 12 = ThreadBlocked BlockedOnForeignCall+     mk_stat 13 = ThreadBlocked BlockedOnException+     -- NB. these are hardcoded in rts/PrimOps.cmm      mk_stat 16 = ThreadFinished      mk_stat 17 = ThreadDied      mk_stat _  = ThreadBlocked BlockedOnOther@@ -511,10 +498,12 @@ -- running, and a boolean indicating whether the thread is locked to -- that capability or not.  A thread is locked to a capability if it -- was created with @forkOn@.+--+-- /Since: 4.4.0.0/ threadCapability :: ThreadId -> IO (Int, Bool) threadCapability (ThreadId t) = IO $ \s ->    case threadStatus# t s of-     (# s', _, cap#, locked# #) -> (# s', (I# cap#, locked# /=# 0#) #)+     (# s', _, cap#, locked# #) -> (# s', (I# cap#, isTrue# (locked# /=# 0#)) #)  -- | make a weak pointer to a 'ThreadId'.  It can be important to do -- this if you want to hold a reference to a 'ThreadId' while still@@ -531,6 +520,7 @@ -- caller must use @deRefWeak@ first to determine whether the thread -- still exists. --+-- /Since: 4.6.0.0/ mkWeakThreadId :: ThreadId -> IO (Weak ThreadId) mkWeakThreadId t@(ThreadId t#) = IO $ \s ->    case mkWeakNoFinalizer# t# t s of@@ -550,12 +540,11 @@ \begin{code} -- |A monad supporting atomic memory transactions. newtype STM a = STM (State# RealWorld -> (# State# RealWorld, a #))+                deriving Typeable  unSTM :: STM a -> (State# RealWorld -> (# State# RealWorld, a #)) unSTM (STM a) = a -INSTANCE_TYPEABLE1(STM,stmTc,"STM")- instance  Functor STM where    fmap f x = x >>= (return . f) @@ -693,11 +682,10 @@  -- |Shared memory locations that support atomic memory transactions. data TVar a = TVar (TVar# RealWorld a)--INSTANCE_TYPEABLE1(TVar,tvarTc,"TVar")+              deriving Typeable  instance Eq (TVar a) where-        (TVar tvar1#) == (TVar tvar2#) = sameTVar# tvar1# tvar2#+        (TVar tvar1#) == (TVar tvar2#) = isTrue# (sameTVar# tvar1# tvar2#)  -- |Create a new TVar holding a value supplied newTVar :: a -> STM (TVar a)@@ -785,7 +773,9 @@                 deRefStablePtr (castPtrToStablePtr (castPtr ref2))  reportStackOverflow :: IO ()-reportStackOverflow = callStackOverflowHook+reportStackOverflow = do+     ThreadId tid <- myThreadId+     callStackOverflowHook tid  reportError :: SomeException -> IO () reportError ex = do@@ -795,7 +785,7 @@ -- SUP: Are the hooks allowed to re-enter Haskell land?  If so, remove -- the unsafe below. foreign import ccall unsafe "stackOverflow"-        callStackOverflowHook :: IO ()+        callStackOverflowHook :: ThreadId# -> IO ()  {-# NOINLINE uncaughtExceptionHandler #-} uncaughtExceptionHandler :: IORef (SomeException -> IO ())
GHC/Conc/Windows.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, ForeignFunctionInterface,-             DeriveDataTypeable #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples, DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-} @@ -27,12 +26,12 @@        , registerDelay         -- * Miscellaneous-       , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-       , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-       , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int+       , asyncRead+       , asyncWrite+       , asyncDoProc -       , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)-       , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+       , asyncReadBA+       , asyncWriteBA         , ConsoleEvent(..)        , win32ConsoleHandler
GHC/ConsoleHandler.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, ForeignFunctionInterface #-}+{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |
GHC/Constants.hs view
@@ -1,12 +1,10 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  module GHC.Constants where -import Prelude---- We use stage1 here, because that's guaranteed to exist-#include "../../../compiler/stage1/ghc_boot_platform.h"+import Prelude () -#include "../../../includes/HaskellConstants.hs"+-- TODO: This used to include HaskellConstants.hs, but that has now gone.+-- We probably want to include the constants in platformConstants somehow+-- instead. 
GHC/Desugar.hs view
@@ -1,9 +1,9 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude-           , Rank2Types+{-# LANGUAGE NoImplicitPrelude+           , RankNTypes            , ExistentialQuantification   #-}+{-# OPTIONS_HADDOCK hide #-}  ----------------------------------------------------------------------------- -- |@@ -19,7 +19,6 @@ --  ----------------------------------------------------------------------------- --- #hide module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where  import Control.Arrow    (Arrow(..))
GHC/Enum.lhs view
@@ -1,6 +1,6 @@ \begin{code} {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, BangPatterns, MagicHash #-}+{-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -8,16 +8,17 @@ -- Module      :  GHC.Enum -- Copyright   :  (c) The University of Glasgow, 1992-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC extensions) -- -- The 'Enum' and 'Bounded' classes.--- +-- ----------------------------------------------------------------------------- --- #hide+#include "MachDeps.h"+ module GHC.Enum(         Bounded(..), Enum(..),         boundedEnumFrom, boundedEnumFromThen,@@ -65,14 +66,14 @@ -- whose constructors have no fields).  The nullary constructors are -- assumed to be numbered left-to-right by 'fromEnum' from @0@ through @n-1@. -- See Chapter 10 of the /Haskell Report/ for more details.---  +-- -- For any type that is an instance of class 'Bounded' as well as 'Enum', -- the following should hold: -- -- * The calls @'succ' 'maxBound'@ and @'pred' 'minBound'@ should result in --   a runtime error.--- --- * 'fromEnum' and 'toEnum' should give a runtime error if the +--+-- * 'fromEnum' and 'toEnum' should give a runtime error if the --   result value is not representable in the result type. --   For example, @'toEnum' 7 :: 'Bool'@ is an error. --@@ -118,7 +119,7 @@ boundedEnumFrom n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)]  boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]-boundedEnumFromThen n1 n2 +boundedEnumFromThen n1 n2   | i_n2 >= i_n1  = map toEnum [i_n1, i_n2 .. fromEnum (maxBound `asTypeOf` n1)]   | otherwise     = map toEnum [i_n1, i_n2 .. fromEnum (minBound `asTypeOf` n1)]   where@@ -353,11 +354,11 @@  instance  Enum Char  where     succ (C# c#)-       | not (ord# c# ==# 0x10FFFF#) = C# (chr# (ord# c# +# 1#))-       | otherwise              = error ("Prelude.Enum.Char.succ: bad argument")+       | isTrue# (ord# c# /=# 0x10FFFF#) = C# (chr# (ord# c# +# 1#))+       | otherwise             = error ("Prelude.Enum.Char.succ: bad argument")     pred (C# c#)-       | not (ord# c# ==# 0#)   = C# (chr# (ord# c# -# 1#))-       | otherwise              = error ("Prelude.Enum.Char.pred: bad argument")+       | isTrue# (ord# c# /=# 0#) = C# (chr# (ord# c# -# 1#))+       | otherwise                = error ("Prelude.Enum.Char.pred: bad argument")      toEnum   = chr     fromEnum = ord@@ -368,10 +369,10 @@      {-# INLINE enumFromTo #-}     enumFromTo (C# x) (C# y) = eftChar (ord# x) (ord# y)-    +     {-# INLINE enumFromThen #-}     enumFromThen (C# x1) (C# x2) = efdChar (ord# x1) (ord# x2)-    +     {-# INLINE enumFromThenTo #-}     enumFromThenTo (C# x1) (C# x2) (C# y) = efdtChar (ord# x1) (ord# x2) (ord# y) @@ -391,42 +392,45 @@ eftCharFB :: (Char -> a -> a) -> a -> Int# -> Int# -> a eftCharFB c n x0 y = go x0                  where-                    go x | x ># y    = n-                         | otherwise = C# (chr# x) `c` go (x +# 1#)+                    go x | isTrue# (x ># y) = n+                         | otherwise        = C# (chr# x) `c` go (x +# 1#) +{-# NOINLINE [1] eftChar #-} eftChar :: Int# -> Int# -> String-eftChar x y | x ># y    = []-            | otherwise = C# (chr# x) : eftChar (x +# 1#) y+eftChar x y | isTrue# (x ># y ) = []+            | otherwise         = C# (chr# x) : eftChar (x +# 1#) y   -- For enumFromThenTo we give up on inlining {-# NOINLINE [0] efdCharFB #-} efdCharFB :: (Char -> a -> a) -> a -> Int# -> Int# -> a efdCharFB c n x1 x2-  | delta >=# 0# = go_up_char_fb c n x1 delta 0x10FFFF#-  | otherwise    = go_dn_char_fb c n x1 delta 0#+  | isTrue# (delta >=# 0#) = go_up_char_fb c n x1 delta 0x10FFFF#+  | otherwise              = go_dn_char_fb c n x1 delta 0#   where     !delta = x2 -# x1 +{-# NOINLINE [1] efdChar #-} efdChar :: Int# -> Int# -> String efdChar x1 x2-  | delta >=# 0# = go_up_char_list x1 delta 0x10FFFF#-  | otherwise    = go_dn_char_list x1 delta 0#+  | isTrue# (delta >=# 0#) = go_up_char_list x1 delta 0x10FFFF#+  | otherwise              = go_dn_char_list x1 delta 0#   where     !delta = x2 -# x1  {-# NOINLINE [0] efdtCharFB #-} efdtCharFB :: (Char -> a -> a) -> a -> Int# -> Int# -> Int# -> a efdtCharFB c n x1 x2 lim-  | delta >=# 0# = go_up_char_fb c n x1 delta lim-  | otherwise    = go_dn_char_fb c n x1 delta lim+  | isTrue# (delta >=# 0#) = go_up_char_fb c n x1 delta lim+  | otherwise              = go_dn_char_fb c n x1 delta lim   where     !delta = x2 -# x1 +{-# NOINLINE [1] efdtChar #-} efdtChar :: Int# -> Int# -> Int# -> String efdtChar x1 x2 lim-  | delta >=# 0# = go_up_char_list x1 delta lim-  | otherwise    = go_dn_char_list x1 delta lim+  | isTrue# (delta >=# 0#) = go_up_char_list x1 delta lim+  | otherwise              = go_dn_char_list x1 delta lim   where     !delta = x2 -# x1 @@ -434,29 +438,29 @@ go_up_char_fb c n x0 delta lim   = go_up x0   where-    go_up x | x ># lim  = n-            | otherwise = C# (chr# x) `c` go_up (x +# delta)+    go_up x | isTrue# (x ># lim) = n+            | otherwise          = C# (chr# x) `c` go_up (x +# delta)  go_dn_char_fb :: (Char -> a -> a) -> a -> Int# -> Int# -> Int# -> a go_dn_char_fb c n x0 delta lim   = go_dn x0   where-    go_dn x | x <# lim  = n-            | otherwise = C# (chr# x) `c` go_dn (x +# delta)+    go_dn x | isTrue# (x <# lim) = n+            | otherwise          = C# (chr# x) `c` go_dn (x +# delta)  go_up_char_list :: Int# -> Int# -> Int# -> String go_up_char_list x0 delta lim   = go_up x0   where-    go_up x | x ># lim  = []-            | otherwise = C# (chr# x) : go_up (x +# delta)+    go_up x | isTrue# (x ># lim) = []+            | otherwise          = C# (chr# x) : go_up (x +# delta)  go_dn_char_list :: Int# -> Int# -> Int# -> String go_dn_char_list x0 delta lim   = go_dn x0   where-    go_dn x | x <# lim  = []-            | otherwise = C# (chr# x) : go_dn (x +# delta)+    go_dn x | isTrue# (x <# lim) = []+            | otherwise          = C# (chr# x) : go_dn (x +# delta) \end{code}  @@ -466,7 +470,7 @@ %*                                                      * %********************************************************* -Be careful about these instances.  +Be careful about these instances.         (a) remember that you have to count down as well as up e.g. [13,12..0]         (b) be careful of Int overflow         (c) remember that Int is bounded, so [1..] terminates at maxInt@@ -477,7 +481,7 @@     maxBound =  maxInt  instance  Enum Int  where-    succ x  +    succ x        | x == maxBound  = error "Prelude.Enum.succ{Int}: tried to take `succ' of maxBound"        | otherwise      = x + 1     pred x@@ -503,7 +507,7 @@   -------------------------------------------------------- eftInt and eftIntFB deal with [a..b], which is the +-- eftInt and eftIntFB deal with [a..b], which is the -- most common form, so we take a lot of care -- In particular, we have rules for deforestation @@ -512,19 +516,24 @@ "eftIntList"    [1] eftIntFB  (:) [] = eftInt  #-} +{-# NOINLINE [1] eftInt #-} eftInt :: Int# -> Int# -> [Int] -- [x1..x2]-eftInt x0 y | x0 ># y    = []-            | otherwise = go x0+eftInt x0 y | isTrue# (x0 ># y) = []+            | otherwise         = go x0                where-                 go x = I# x : if x ==# y then [] else go (x +# 1#)+                 go x = I# x : if isTrue# (x ==# y)+                               then []+                               else go (x +# 1#)  {-# INLINE [0] eftIntFB #-} eftIntFB :: (Int -> r -> r) -> r -> Int# -> Int# -> r-eftIntFB c n x0 y | x0 ># y    = n        -                  | otherwise = go x0+eftIntFB c n x0 y | isTrue# (x0 ># y) = n+                  | otherwise         = go x0                  where-                   go x = I# x `c` if x ==# y then n else go (x +# 1#)+                   go x = I# x `c` if isTrue# (x ==# y)+                                   then n+                                   else go (x +# 1#)                         -- Watch out for y=maxBound; hence ==, not >         -- Be very careful not to have more than one "c"         -- so that when eftInfFB is inlined we can inline@@ -543,26 +552,27 @@  efdInt :: Int# -> Int# -> [Int] -- [x1,x2..maxInt]-efdInt x1 x2 - | x2 >=# x1 = case maxInt of I# y -> efdtIntUp x1 x2 y- | otherwise = case minInt of I# y -> efdtIntDn x1 x2 y+efdInt x1 x2+ | isTrue# (x2 >=# x1) = case maxInt of I# y -> efdtIntUp x1 x2 y+ | otherwise           = case minInt of I# y -> efdtIntDn x1 x2 y +{-# NOINLINE [1] efdtInt #-} efdtInt :: Int# -> Int# -> Int# -> [Int] -- [x1,x2..y] efdtInt x1 x2 y- | x2 >=# x1 = efdtIntUp x1 x2 y- | otherwise = efdtIntDn x1 x2 y+ | isTrue# (x2 >=# x1) = efdtIntUp x1 x2 y+ | otherwise           = efdtIntDn x1 x2 y  {-# INLINE [0] efdtIntFB #-} efdtIntFB :: (Int -> r -> r) -> r -> Int# -> Int# -> Int# -> r efdtIntFB c n x1 x2 y- | x2 >=# x1  = efdtIntUpFB c n x1 x2 y- | otherwise  = efdtIntDnFB c n x1 x2 y+ | isTrue# (x2 >=# x1) = efdtIntUpFB c n x1 x2 y+ | otherwise           = efdtIntDnFB c n x1 x2 y  -- Requires x2 >= x1 efdtIntUp :: Int# -> Int# -> Int# -> [Int] efdtIntUp x1 x2 y    -- Be careful about overflow!- | y <# x2   = if y <# x1 then [] else [I# x1]+ | isTrue# (y <# x2) = if isTrue# (y <# x1) then [] else [I# x1]  | otherwise = -- Common case: x1 <= x2 <= y                let !delta = x2 -# x1 -- >= 0                    !y' = y -# delta  -- x1 <= y' <= y; hence y' is representable@@ -570,14 +580,14 @@                    -- Invariant: x <= y                    -- Note that: z <= y' => z + delta won't overflow                    -- so we are guaranteed not to overflow if/when we recurse-                   go_up x | x ># y'  = [I# x]-                           | otherwise = I# x : go_up (x +# delta)+                   go_up x | isTrue# (x ># y') = [I# x]+                           | otherwise         = I# x : go_up (x +# delta)                in I# x1 : go_up x2  -- Requires x2 >= x1 efdtIntUpFB :: (Int -> r -> r) -> r -> Int# -> Int# -> Int# -> r efdtIntUpFB c n x1 x2 y    -- Be careful about overflow!- | y <# x2   = if y <# x1 then n else I# x1 `c` n+ | isTrue# (y <# x2) = if isTrue# (y <# x1) then n else I# x1 `c` n  | otherwise = -- Common case: x1 <= x2 <= y                let !delta = x2 -# x1 -- >= 0                    !y' = y -# delta  -- x1 <= y' <= y; hence y' is representable@@ -585,14 +595,14 @@                    -- Invariant: x <= y                    -- Note that: z <= y' => z + delta won't overflow                    -- so we are guaranteed not to overflow if/when we recurse-                   go_up x | x ># y'   = I# x `c` n-                           | otherwise = I# x `c` go_up (x +# delta)+                   go_up x | isTrue# (x ># y') = I# x `c` n+                           | otherwise         = I# x `c` go_up (x +# delta)                in I# x1 `c` go_up x2  -- Requires x2 <= x1 efdtIntDn :: Int# -> Int# -> Int# -> [Int] efdtIntDn x1 x2 y    -- Be careful about underflow!- | y ># x2   = if y ># x1 then [] else [I# x1]+ | isTrue# (y ># x2) = if isTrue# (y ># x1) then [] else [I# x1]  | otherwise = -- Common case: x1 >= x2 >= y                let !delta = x2 -# x1 -- <= 0                    !y' = y -# delta  -- y <= y' <= x1; hence y' is representable@@ -600,14 +610,14 @@                    -- Invariant: x >= y                    -- Note that: z >= y' => z + delta won't underflow                    -- so we are guaranteed not to underflow if/when we recurse-                   go_dn x | x <# y'  = [I# x]-                           | otherwise = I# x : go_dn (x +# delta)+                   go_dn x | isTrue# (x <# y') = [I# x]+                           | otherwise         = I# x : go_dn (x +# delta)    in I# x1 : go_dn x2  -- Requires x2 <= x1 efdtIntDnFB :: (Int -> r -> r) -> r -> Int# -> Int# -> Int# -> r efdtIntDnFB c n x1 x2 y    -- Be careful about underflow!- | y ># x2 = if y ># x1 then n else I# x1 `c` n+ | isTrue# (y ># x2) = if isTrue# (y ># x1) then n else I# x1 `c` n  | otherwise = -- Common case: x1 >= x2 >= y                let !delta = x2 -# x1 -- <= 0                    !y' = y -# delta  -- y <= y' <= x1; hence y' is representable@@ -615,8 +625,8 @@                    -- Invariant: x >= y                    -- Note that: z >= y' => z + delta won't underflow                    -- so we are guaranteed not to underflow if/when we recurse-                   go_dn x | x <# y'   = I# x `c` n-                           | otherwise = I# x `c` go_dn (x +# delta)+                   go_dn x | isTrue# (x <# y') = I# x `c` n+                           | otherwise         = I# x `c` go_dn (x +# delta)                in I# x1 `c` go_dn x2 \end{code} @@ -635,8 +645,10 @@     -- (fromInteger 0xffffffff :: Word). #if WORD_SIZE_IN_BITS == 32     maxBound = W# (int2Word# 0xFFFFFFFF#)-#else+#elif WORD_SIZE_IN_BITS == 64     maxBound = W# (int2Word# 0xFFFFFFFFFFFFFFFF#)+#else+#error Unhandled value for WORD_SIZE_IN_BITS #endif \end{code} @@ -658,8 +670,8 @@     {-# INLINE enumFromThen #-}     {-# INLINE enumFromTo #-}     {-# INLINE enumFromThenTo #-}-    enumFrom x             = enumDeltaInteger  x 1-    enumFromThen x y       = enumDeltaInteger  x (y-x)+    enumFrom x             = enumDeltaInteger   x 1+    enumFromThen x y       = enumDeltaInteger   x (y-x)     enumFromTo x lim       = enumDeltaToInteger x 1     lim     enumFromThenTo x y lim = enumDeltaToInteger x (y-x) lim @@ -670,9 +682,11 @@ "enumDeltaToInteger"    [1] enumDeltaToIntegerFB (:) [] = enumDeltaToInteger  #-} +{-# NOINLINE [0] enumDeltaIntegerFB #-} enumDeltaIntegerFB :: (Integer -> b -> b) -> Integer -> Integer -> b enumDeltaIntegerFB c x d = x `seq` (x `c` enumDeltaIntegerFB c (x+d) d) +{-# NOINLINE [1] enumDeltaInteger #-} enumDeltaInteger :: Integer -> Integer -> [Integer] enumDeltaInteger x d = x `seq` (x : enumDeltaInteger (x+d) d) -- strict accumulator, so@@ -687,6 +701,14 @@   | delta >= 0 = up_fb c n x delta lim   | otherwise  = dn_fb c n x delta lim +{-# RULES+"enumDeltaToInteger1"   [0] forall c n x . enumDeltaToIntegerFB c n x 1 = up_fb c n x 1+ #-}+-- This rule ensures that in the common case (delta = 1), we do not do the check here,+-- and also that we have the chance to inline up_fb, which would allow the constuctor to be+-- inlined and good things to happen.++{-# NOINLINE [1] enumDeltaToInteger #-} enumDeltaToInteger :: Integer -> Integer -> Integer -> [Integer] enumDeltaToInteger x delta lim   | delta >= 0 = up_list x delta lim
GHC/Environment.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, ForeignFunctionInterface #-}+{-# LANGUAGE CPP #-}  module GHC.Environment (getFullArgs) where 
GHC/Err.lhs view
@@ -1,6 +1,6 @@ \begin{code} {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -22,21 +22,14 @@ --  ----------------------------------------------------------------------------- --- #hide-module GHC.Err-       (-         absentErr                 -- :: a-       , divZeroError              -- :: a-       , ratioZeroDenominatorError -- :: a-       , overflowError             -- :: a--       , error                     -- :: String -> a--       , undefined                 -- :: a-       ) where-+module GHC.Err( absentErr, error, undefined ) where+import GHC.CString () import GHC.Types-import GHC.Exception+import GHC.Prim+import GHC.Integer ()   -- Make sure Integer is compiled first+                        -- because GHC depends on it in a wired-in way+                        -- so the build system doesn't see the dependency+import {-# SOURCE #-} GHC.Exception( errorCallException ) \end{code}  %*********************************************************@@ -48,7 +41,7 @@ \begin{code} -- | 'error' stops execution and displays an error message. error :: [Char] -> a-error s = throw (ErrorCall s)+error s = raise# (errorCallException s)  -- | A special case of 'error'. -- It is expected that compilers will recognize this and insert error@@ -70,25 +63,6 @@  \begin{code} absentErr :: a- absentErr = error "Oops! The program has entered an `absent' argument!\n"-\end{code}--Divide by zero and arithmetic overflow.-We put them here because they are needed relatively early-in the libraries before the Exception type has been defined yet.--\begin{code}-{-# NOINLINE divZeroError #-}-divZeroError :: a-divZeroError = throw DivideByZero--{-# NOINLINE ratioZeroDenominatorError #-}-ratioZeroDenominatorError :: a-ratioZeroDenominatorError = throw RatioZeroDenominator--{-# NOINLINE overflowError #-}-overflowError :: a-overflowError = throw Overflow \end{code} 
− GHC/Err.lhs-boot
@@ -1,22 +0,0 @@-\begin{code}-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude #-}--------------------------------------------------------------------------------                  Ghc.Err.hs-boot------------------------------------------------------------------------------module GHC.Err( error ) where---- The type signature for 'error' is a gross hack.--- First, we can't give an accurate type for error, because it mentions --- an open type variable.--- Second, we can't even say error :: [Char] -> a, because Char is defined--- in GHC.Base, and that would make Err.lhs-boot mutually recursive --- with GHC.Base.--- Fortunately it doesn't matter what type we give here because the --- compiler will use its wired-in version.  But we have--- to mention 'error' so that it gets exported from this .hi-boot--- file.-error    :: a-\end{code}
GHC/Event.hs view
@@ -13,15 +13,9 @@       EventManager        -- * Creation-    , new     , getSystemEventManager--      -- * Running-    , loop--    -- ** Stepwise running-    , step-    , shutdown+    , new+    , getSystemTimerManager        -- * Registering interest in I/O events     , Event@@ -44,5 +38,7 @@     ) where  import GHC.Event.Manager-import GHC.Event.Thread (getSystemEventManager)+import GHC.Event.TimerManager (TimeoutCallback, TimeoutKey, registerTimeout,+                               updateTimeout, unregisterTimeout)+import GHC.Event.Thread (getSystemEventManager, getSystemTimerManager) 
+ GHC/Event/Arr.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE MagicHash, NoImplicitPrelude, UnboxedTuples #-}++module GHC.Event.Arr+    (+      Arr(..)+    , new+    , size+    , read+    , write+    ) where++import GHC.Base (($))+import GHC.Prim (MutableArray#, RealWorld, newArray#, readArray#,+                 sizeofMutableArray#, writeArray#)+import GHC.Types (IO(..), Int(..))++data Arr a = Arr (MutableArray# RealWorld a)++new :: a -> Int -> IO (Arr a)+new defval (I# n#) = IO $ \s0# ->+  case newArray# n# defval s0# of (# s1#, marr# #) -> (# s1#, Arr marr# #)++size :: Arr a -> Int+size (Arr a) = I# (sizeofMutableArray# a)++read :: Arr a -> Int -> IO a+read (Arr a) (I# n#) = IO $ \s0# ->+  case readArray# a n# s0# of (# s1#, val #) -> (# s1#, val #)++write :: Arr a -> Int -> a -> IO ()+write (Arr a) (I# n#) val = IO $ \s0# ->+  case writeArray# a n# val s0# of s1# -> (# s1#, () #)
GHC/Event/Array.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, NoImplicitPrelude #-}+{-# LANGUAGE BangPatterns, CPP, NoImplicitPrelude #-}  module GHC.Event.Array     (@@ -26,14 +26,13 @@  import Control.Monad hiding (forM_) import Data.Bits ((.|.), shiftR)-import Data.IORef (IORef, atomicModifyIORef, newIORef, readIORef, writeIORef)+import Data.IORef (IORef, atomicModifyIORef', newIORef, readIORef, writeIORef) import Data.Maybe import Foreign.C.Types (CSize(..)) import Foreign.ForeignPtr (ForeignPtr, withForeignPtr) import Foreign.Ptr (Ptr, nullPtr, plusPtr) import Foreign.Storable (Storable(..)) import GHC.Base-import GHC.Err (undefined) import GHC.ForeignPtr (mallocPlainForeignPtrBytes, newForeignPtr_) import GHC.Num (Num(..)) import GHC.Real (fromIntegral)@@ -174,9 +173,8 @@  clear :: Storable a => Array a -> IO () clear (Array ref) = do-  !_ <- atomicModifyIORef ref $ \(AC es _ cap) ->-        let e = AC es 0 cap in (e, e)-  return ()+  atomicModifyIORef' ref $ \(AC es _ cap) ->+        (AC es 0 cap, ())  forM_ :: Storable a => Array a -> (a -> IO ()) -> IO () forM_ ary g = forHack ary g undefined
GHC/Event/Clock.hsc view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, ForeignFunctionInterface #-}+{-# LANGUAGE NoImplicitPrelude #-}  module GHC.Event.Clock (getMonotonicTime) where 
GHC/Event/Control.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Unsafe #-} {-# LANGUAGE CPP-           , ForeignFunctionInterface            , NoImplicitPrelude            , ScopedTypeVariables            , BangPatterns@@ -47,8 +46,8 @@ import System.Posix.Types (Fd)  #if defined(HAVE_EVENTFD)-import Data.Word (Word64) import Foreign.C.Error (throwErrnoIfMinus1)+import Foreign.C.Types (CULLong(..)) #else import Foreign.C.Error (eAGAIN, eWOULDBLOCK, getErrno, throwErrno) #endif@@ -77,38 +76,30 @@ {-# INLINE wakeupReadFd #-} #endif -setNonBlock :: CInt -> IO ()-setNonBlock fd =-#if __GLASGOW_HASKELL__ >= 611-  setNonBlockingFD fd True-#else-  setNonBlockingFD fd-#endif- -- | Create the structure (usually a pipe) used for waking up the IO -- manager thread from another thread.-newControl :: IO Control-newControl = allocaArray 2 $ \fds -> do+newControl :: Bool -> IO Control+newControl shouldRegister = allocaArray 2 $ \fds -> do   let createPipe = do         throwErrnoIfMinus1_ "pipe" $ c_pipe fds         rd <- peekElemOff fds 0         wr <- peekElemOff fds 1         -- The write end must be non-blocking, since we may need to         -- poke the event manager from a signal handler.-        setNonBlock wr+        setNonBlockingFD wr True         setCloseOnExec rd         setCloseOnExec wr         return (rd, wr)   (ctrl_rd, ctrl_wr) <- createPipe-  c_setIOManagerControlFd ctrl_wr+  when shouldRegister $ c_setIOManagerControlFd ctrl_wr #if defined(HAVE_EVENTFD)   ev <- throwErrnoIfMinus1 "eventfd" $ c_eventfd 0 0-  setNonBlock ev+  setNonBlockingFD ev True   setCloseOnExec ev-  c_setIOManagerWakeupFd ev+  when shouldRegister $ c_setIOManagerWakeupFd ev #else   (wake_rd, wake_wr) <- createPipe-  c_setIOManagerWakeupFd wake_wr+  when shouldRegister $ c_setIOManagerWakeupFd wake_wr #endif   return W { controlReadFd  = fromIntegral ctrl_rd            , controlWriteFd = fromIntegral ctrl_wr@@ -175,10 +166,9 @@  sendWakeup :: Control -> IO () #if defined(HAVE_EVENTFD)-sendWakeup c = alloca $ \p -> do-  poke p (1 :: Word64)+sendWakeup c =   throwErrnoIfMinus1_ "sendWakeup" $-    c_write (fromIntegral (controlEventFd c)) (castPtr p) 8+  c_eventfd_write (fromIntegral (controlEventFd c)) 1 #else sendWakeup c = do   n <- sendMessage (wakeupWriteFd c) CMsgWakeup@@ -205,6 +195,9 @@ #if defined(HAVE_EVENTFD) foreign import ccall unsafe "sys/eventfd.h eventfd"    c_eventfd :: CInt -> CInt -> IO CInt++foreign import ccall unsafe "sys/eventfd.h eventfd_write"+   c_eventfd_write :: CInt -> CULLong -> IO CInt #endif  -- Used to tell the RTS how it can send messages to the I/O manager.@@ -213,4 +206,3 @@  foreign import ccall "setIOManagerWakeupFd"    c_setIOManagerWakeupFd :: CInt -> IO ()-
GHC/Event/EPoll.hsc view
@@ -1,7 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , ForeignFunctionInterface-           , GeneralizedNewtypeDeriving+{-# LANGUAGE GeneralizedNewtypeDeriving            , NoImplicitPrelude            , BangPatterns   #-}@@ -41,16 +39,17 @@ #include <sys/epoll.h>  import Control.Monad (when)-import Data.Bits (Bits, (.|.), (.&.))+import Data.Bits (Bits, FiniteBits, (.|.), (.&.))+import Data.Maybe (Maybe(..)) import Data.Monoid (Monoid(..)) import Data.Word (Word32)-import Foreign.C.Error (throwErrnoIfMinus1, throwErrnoIfMinus1_)+import Foreign.C.Error (eNOENT, getErrno, throwErrno,+                        throwErrnoIfMinus1, throwErrnoIfMinus1_) import Foreign.C.Types (CInt(..)) import Foreign.Marshal.Utils (with) import Foreign.Ptr (Ptr) import Foreign.Storable (Storable(..)) import GHC.Base-import GHC.Err (undefined) import GHC.Num (Num(..)) import GHC.Real (ceiling, fromIntegral) import GHC.Show (Show)@@ -75,7 +74,7 @@ new = do   epfd <- epollCreate   evts <- A.new 64-  let !be = E.backend poll modifyFd delete (EPoll epfd evts)+  let !be = E.backend poll modifyFd modifyFdOnce delete (EPoll epfd evts)   return be  delete :: EPoll -> IO ()@@ -85,32 +84,51 @@  -- | Change the set of events we are interested in for a given file -- descriptor.-modifyFd :: EPoll -> Fd -> E.Event -> E.Event -> IO ()-modifyFd ep fd oevt nevt = with (Event (fromEvent nevt) fd) $-                             epollControl (epollFd ep) op fd+modifyFd :: EPoll -> Fd -> E.Event -> E.Event -> IO Bool+modifyFd ep fd oevt nevt =+  with (Event (fromEvent nevt) fd) $ \evptr -> do+    epollControl (epollFd ep) op fd evptr+    return True   where op | oevt == mempty = controlOpAdd            | nevt == mempty = controlOpDelete            | otherwise      = controlOpModify +modifyFdOnce :: EPoll -> Fd -> E.Event -> IO Bool+modifyFdOnce ep fd evt =+  do let !ev = fromEvent evt .|. epollOneShot+     res <- with (Event ev fd) $+            epollControl_ (epollFd ep) controlOpModify fd+     if res == 0+       then return True+       else do err <- getErrno+               if err == eNOENT+                 then with (Event ev fd) $ \evptr -> do+                        epollControl (epollFd ep) controlOpAdd fd evptr+                        return True+                 else throwErrno "modifyFdOnce"+ -- | Select a set of file descriptors which are ready for I/O -- operations and call @f@ for all ready file descriptors, passing the -- events that are ready. poll :: EPoll                     -- ^ state-     -> Timeout                   -- ^ timeout in milliseconds+     -> Maybe Timeout             -- ^ timeout in milliseconds      -> (Fd -> E.Event -> IO ())  -- ^ I/O callback-     -> IO ()-poll ep timeout f = do+     -> IO Int+poll ep mtimeout f = do   let events = epollEvents ep+      fd = epollFd ep    -- Will return zero if the system call was interupted, in which case   -- we just return (and try again later.)-  n <- A.unsafeLoad events $ \es cap ->-       epollWait (epollFd ep) es cap $ fromTimeout timeout+  n <- A.unsafeLoad events $ \es cap -> case mtimeout of+    Just timeout -> epollWait fd es cap $ fromTimeout timeout+    Nothing      -> epollWaitNonBlock fd es cap    when (n > 0) $ do     A.forM_ events $ \e -> f (eventFd e) (toEvent (eventTypes e))     cap <- A.capacity events     when (cap == n) $ A.ensureCapacity events (2 * cap)+  return n  newtype EPollFd = EPollFd {       fromEPollFd :: CInt@@ -145,13 +163,14 @@  newtype EventType = EventType {       unEventType :: Word32-    } deriving (Show, Eq, Num, Bits)+    } deriving (Show, Eq, Num, Bits, FiniteBits)  #{enum EventType, EventType  , epollIn  = EPOLLIN  , epollOut = EPOLLOUT  , epollErr = EPOLLERR  , epollHup = EPOLLHUP+ , epollOneShot = EPOLLONESHOT                }  -- | Create a new epoll context, returning a file descriptor associated with the context.@@ -171,15 +190,25 @@   return epollFd'  epollControl :: EPollFd -> ControlOp -> Fd -> Ptr Event -> IO ()-epollControl (EPollFd epfd) (ControlOp op) (Fd fd) event =-    throwErrnoIfMinus1_ "epollControl" $ c_epoll_ctl epfd op fd event+epollControl epfd op fd event =+    throwErrnoIfMinus1_ "epollControl" $ epollControl_ epfd op fd event +epollControl_ :: EPollFd -> ControlOp -> Fd -> Ptr Event -> IO CInt+epollControl_ (EPollFd epfd) (ControlOp op) (Fd fd) event =+    c_epoll_ctl epfd op fd event+ epollWait :: EPollFd -> Ptr Event -> Int -> Int -> IO Int epollWait (EPollFd epfd) events numEvents timeout =     fmap fromIntegral .     E.throwErrnoIfMinus1NoRetry "epollWait" $     c_epoll_wait epfd events (fromIntegral numEvents) (fromIntegral timeout) +epollWaitNonBlock :: EPollFd -> Ptr Event -> Int -> IO Int+epollWaitNonBlock (EPollFd epfd) events numEvents =+  fmap fromIntegral .+  E.throwErrnoIfMinus1NoRetry "epollWaitNonBlock" $+  c_epoll_wait_unsafe epfd events (fromIntegral numEvents) 0+ fromEvent :: E.Event -> EventType fromEvent e = remap E.evtRead  epollIn .|.               remap E.evtWrite epollOut@@ -207,5 +236,7 @@ foreign import ccall safe "sys/epoll.h epoll_wait"     c_epoll_wait :: CInt -> Ptr Event -> CInt -> CInt -> IO CInt +foreign import ccall unsafe "sys/epoll.h epoll_wait"+    c_epoll_wait_unsafe :: CInt -> Ptr Event -> CInt -> CInt -> IO CInt #endif /* defined(HAVE_EPOLL) */ 
− GHC/Event/IntMap.hs
@@ -1,376 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, MagicHash, NoImplicitPrelude #-}---------------------------------------------------------------------------------- |--- Module      :  GHC.Event.IntMap--- Copyright   :  (c) Daan Leijen 2002---                (c) Andriy Palamarchuk 2008--- License     :  BSD-style--- Maintainer  :  libraries@haskell.org--- Stability   :  provisional--- Portability :  portable------ An efficient implementation of maps from integer keys to values.------ Since many function names (but not the type name) clash with--- "Prelude" names, this module is usually imported @qualified@, e.g.------ >  import Data.IntMap (IntMap)--- >  import qualified Data.IntMap as IntMap------ The implementation is based on /big-endian patricia trees/.  This data--- structure performs especially well on binary operations like 'union'--- and 'intersection'.  However, my benchmarks show that it is also--- (much) faster on insertions and deletions when compared to a generic--- size-balanced map implementation (see "Data.Map").------    * Chris Okasaki and Andy Gill,  \"/Fast Mergeable Integer Maps/\",---      Workshop on ML, September 1998, pages 77-86,---      <http://citeseer.ist.psu.edu/okasaki98fast.html>------    * D.R. Morrison, \"/PATRICIA -- Practical Algorithm To Retrieve---      Information Coded In Alphanumeric/\", Journal of the ACM, 15(4),---      October 1968, pages 514-534.------ Operation comments contain the operation time complexity in--- the Big-O notation <http://en.wikipedia.org/wiki/Big_O_notation>.--- Many operations have a worst-case complexity of /O(min(n,W))/.--- This means that the operation can become linear in the number of--- elements with a maximum of /W/ -- the number of bits in an 'Int'--- (32 or 64).-----------------------------------------------------------------------------------module GHC.Event.IntMap-    (-    -- * Map type-    IntMap-    , Key--    -- * Query-    , lookup-    , member--    -- * Construction-    , empty--    -- * Insertion-    , insertWith--    -- * Delete\/Update-    , delete-    , updateWith--    -- * Traversal-    -- ** Fold-    , foldWithKey--    -- * Conversion-    , keys-    ) where--import Data.Bits--import Data.Maybe (Maybe(..))-import GHC.Base hiding (foldr)-import GHC.Num (Num(..))-import GHC.Real (fromIntegral)-import GHC.Show (Show(showsPrec), showParen, shows, showString)--#if !defined(__GLASGOW_HASKELL__)-import Data.Word-#endif---- | A @Nat@ is a natural machine word (an unsigned Int)-type Nat = Word--natFromInt :: Key -> Nat-natFromInt i = fromIntegral i--intFromNat :: Nat -> Key-intFromNat w = fromIntegral w--shiftRL :: Nat -> Key -> Nat-#if __GLASGOW_HASKELL__--- GHC: use unboxing to get @shiftRL@ inlined.-shiftRL (W# x) (I# i) = W# (shiftRL# x i)-#else-shiftRL x i = shiftR x i-#endif----------------------------------------------------------------------------- Types---- | A map of integers to values @a@.-data IntMap a = Nil-              | Tip {-# UNPACK #-} !Key !a-              | Bin {-# UNPACK #-} !Prefix-                    {-# UNPACK #-} !Mask-                    !(IntMap a)-                    !(IntMap a)--type Prefix = Int-type Mask   = Int-type Key    = Int----------------------------------------------------------------------------- Query---- | /O(min(n,W))/ Lookup the value at a key in the map.  See also--- 'Data.Map.lookup'.-lookup :: Key -> IntMap a -> Maybe a-lookup k t = let nk = natFromInt k in seq nk (lookupN nk t)--lookupN :: Nat -> IntMap a -> Maybe a-lookupN k t-  = case t of-      Bin _ m l r-        | zeroN k (natFromInt m) -> lookupN k l-        | otherwise              -> lookupN k r-      Tip kx x-        | (k == natFromInt kx)  -> Just x-        | otherwise             -> Nothing-      Nil -> Nothing---- | /O(min(n,W))/. Is the key a member of the map?------ > member 5 (fromList [(5,'a'), (3,'b')]) == True--- > member 1 (fromList [(5,'a'), (3,'b')]) == False--member :: Key -> IntMap a -> Bool-member k m-  = case lookup k m of-      Nothing -> False-      Just _  -> True----------------------------------------------------------------------------- Construction---- | /O(1)/ The empty map.------ > empty      == fromList []--- > size empty == 0-empty :: IntMap a-empty = Nil----------------------------------------------------------------------------- Insert---- | /O(min(n,W))/ Insert with a function, combining new value and old--- value.  @insertWith f key value mp@ will insert the pair (key,--- value) into @mp@ if key does not exist in the map.  If the key does--- exist, the function will insert the pair (key, f new_value--- old_value).  The result is a pair where the first element is the--- old value, if one was present, and the second is the modified map.-insertWith :: (a -> a -> a) -> Key -> a -> IntMap a -> (Maybe a, IntMap a)-insertWith f k x t = case t of-    Bin p m l r-        | nomatch k p m -> (Nothing, join k (Tip k x) p t)-        | zero k m      -> let (found, l') = insertWith f k x l-                           in (found, Bin p m l' r)-        | otherwise     -> let (found, r') = insertWith f k x r-                           in (found, Bin p m l r')-    Tip ky y-        | k == ky       -> (Just y, Tip k (f x y))-        | otherwise     -> (Nothing, join k (Tip k x) ky t)-    Nil                 -> (Nothing, Tip k x)------------------------------------------------------------------------------ Delete/Update---- | /O(min(n,W))/. Delete a key and its value from the map.  When the--- key is not a member of the map, the original map is returned.  The--- result is a pair where the first element is the value associated--- with the deleted key, if one existed, and the second element is the--- modified map.-delete :: Key -> IntMap a -> (Maybe a, IntMap a)-delete k t = case t of-   Bin p m l r-        | nomatch k p m -> (Nothing, t)-        | zero k m      -> let (found, l') = delete k l-                           in (found, bin p m l' r)-        | otherwise     -> let (found, r') = delete k r-                           in (found, bin p m l r')-   Tip ky y-        | k == ky       -> (Just y, Nil)-        | otherwise     -> (Nothing, t)-   Nil                  -> (Nothing, Nil)--updateWith :: (a -> Maybe a) -> Key -> IntMap a -> (Maybe a, IntMap a)-updateWith f k t = case t of-    Bin p m l r-        | nomatch k p m -> (Nothing, t)-        | zero k m      -> let (found, l') = updateWith f k l-                           in (found, bin p m l' r)-        | otherwise     -> let (found, r') = updateWith f k r-                           in (found, bin p m l r')-    Tip ky y-        | k == ky       -> case (f y) of-                               Just y' -> (Just y, Tip ky y')-                               Nothing -> (Just y, Nil)-        | otherwise     -> (Nothing, t)-    Nil                 -> (Nothing, Nil)--- | /O(n)/. Fold the keys and values in the map, such that--- @'foldWithKey' f z == 'Prelude.foldr' ('uncurry' f) z . 'toAscList'@.--- For example,------ > keys map = foldWithKey (\k x ks -> k:ks) [] map------ > let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"--- > foldWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"--foldWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> b-foldWithKey f z t-  = foldr f z t---- | /O(n)/. Convert the map to a list of key\/value pairs.------ > toList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")]--- > toList empty == []--toList :: IntMap a -> [(Key,a)]-toList t-  = foldWithKey (\k x xs -> (k,x):xs) [] t--foldr :: (Key -> a -> b -> b) -> b -> IntMap a -> b-foldr f z t-  = case t of-      Bin 0 m l r | m < 0 -> foldr' f (foldr' f z l) r  -- put negative numbers before.-      Bin _ _ _ _ -> foldr' f z t-      Tip k x     -> f k x z-      Nil         -> z--foldr' :: (Key -> a -> b -> b) -> b -> IntMap a -> b-foldr' f z t-  = case t of-      Bin _ _ l r -> foldr' f (foldr' f z r) l-      Tip k x     -> f k x z-      Nil         -> z---- | /O(n)/. Return all keys of the map in ascending order.------ > keys (fromList [(5,"a"), (3,"b")]) == [3,5]--- > keys empty == []--keys  :: IntMap a -> [Key]-keys m-  = foldWithKey (\k _ ks -> k:ks) [] m----------------------------------------------------------------------------- Eq--instance Eq a => Eq (IntMap a) where-    t1 == t2 = equal t1 t2-    t1 /= t2 = nequal t1 t2--equal :: Eq a => IntMap a -> IntMap a -> Bool-equal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)-    = (m1 == m2) && (p1 == p2) && (equal l1 l2) && (equal r1 r2)-equal (Tip kx x) (Tip ky y)-    = (kx == ky) && (x==y)-equal Nil Nil = True-equal _   _   = False--nequal :: Eq a => IntMap a -> IntMap a -> Bool-nequal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)-    = (m1 /= m2) || (p1 /= p2) || (nequal l1 l2) || (nequal r1 r2)-nequal (Tip kx x) (Tip ky y)-    = (kx /= ky) || (x/=y)-nequal Nil Nil = False-nequal _   _   = True--instance Show a => Show (IntMap a) where-  showsPrec d m   = showParen (d > 10) $-    showString "fromList " . shows (toList m)----------------------------------------------------------------------------- Utility functions--join :: Prefix -> IntMap a -> Prefix -> IntMap a -> IntMap a-join p1 t1 p2 t2-  | zero p1 m = Bin p m t1 t2-  | otherwise = Bin p m t2 t1-  where-    m = branchMask p1 p2-    p = mask p1 m---- | @bin@ assures that we never have empty trees within a tree.-bin :: Prefix -> Mask -> IntMap a -> IntMap a -> IntMap a-bin _ _ l Nil = l-bin _ _ Nil r = r-bin p m l r   = Bin p m l r----------------------------------------------------------------------------- Endian independent bit twiddling--zero :: Key -> Mask -> Bool-zero i m = (natFromInt i) .&. (natFromInt m) == 0--nomatch :: Key -> Prefix -> Mask -> Bool-nomatch i p m = (mask i m) /= p--mask :: Key -> Mask -> Prefix-mask i m = maskW (natFromInt i) (natFromInt m)--zeroN :: Nat -> Nat -> Bool-zeroN i m = (i .&. m) == 0----------------------------------------------------------------------------- Big endian operations--maskW :: Nat -> Nat -> Prefix-maskW i m = intFromNat (i .&. (complement (m-1) `xor` m))--branchMask :: Prefix -> Prefix -> Mask-branchMask p1 p2-    = intFromNat (highestBitMask (natFromInt p1 `xor` natFromInt p2))--{--Finding the highest bit mask in a word [x] can be done efficiently in-three ways:--* convert to a floating point value and the mantissa tells us the-  [log2(x)] that corresponds with the highest bit position. The mantissa-  is retrieved either via the standard C function [frexp] or by some bit-  twiddling on IEEE compatible numbers (float). Note that one needs to-  use at least [double] precision for an accurate mantissa of 32 bit-  numbers.--* use bit twiddling, a logarithmic sequence of bitwise or's and shifts (bit).--* use processor specific assembler instruction (asm).--The most portable way would be [bit], but is it efficient enough?-I have measured the cycle counts of the different methods on an AMD-Athlon-XP 1800 (~ Pentium III 1.8Ghz) using the RDTSC instruction:--highestBitMask: method  cycles-                ---------------                 frexp   200-                 float    33-                 bit      11-                 asm      12--Wow, the bit twiddling is on today's RISC like machines even faster-than a single CISC instruction (BSR)!--}---- | @highestBitMask@ returns a word where only the highest bit is--- set.  It is found by first setting all bits in lower positions than--- the highest bit and than taking an exclusive or with the original--- value.  Allthough the function may look expensive, GHC compiles--- this into excellent C code that subsequently compiled into highly--- efficient machine code. The algorithm is derived from Jorg Arndt's--- FXT library.-highestBitMask :: Nat -> Nat-highestBitMask x0-  = case (x0 .|. shiftRL x0 1) of-     x1 -> case (x1 .|. shiftRL x1 2) of-      x2 -> case (x2 .|. shiftRL x2 4) of-       x3 -> case (x3 .|. shiftRL x3 8) of-        x4 -> case (x4 .|. shiftRL x4 16) of-         x5 -> case (x5 .|. shiftRL x5 32) of   -- for 64 bit platforms-          x6 -> (x6 `xor` (shiftRL x6 1))-
+ GHC/Event/IntTable.hs view
@@ -0,0 +1,141 @@+{-# LANGUAGE BangPatterns, NoImplicitPrelude, RecordWildCards, Trustworthy #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}++module GHC.Event.IntTable+    (+      IntTable+    , new+    , lookup+    , insertWith+    , reset+    , delete+    , updateWith+    ) where++import Control.Monad ((=<<), liftM, unless, when)+import Data.Bits ((.&.), shiftL, shiftR)+import Data.IORef (IORef, newIORef, readIORef, writeIORef)+import Data.Maybe (Maybe(..), isJust)+import Foreign.ForeignPtr (ForeignPtr, mallocForeignPtr, withForeignPtr)+import Foreign.Storable (peek, poke)+import GHC.Base (Monad(..), ($), const, otherwise)+import GHC.Classes (Eq(..), Ord(..))+import GHC.Event.Arr (Arr)+import GHC.Num (Num(..))+import GHC.Prim (seq)+import GHC.Types (Bool(..), IO(..), Int(..))+import qualified GHC.Event.Arr as Arr++-- A very simple chained integer-keyed mutable hash table. We use+-- power-of-two sizing, grow at a load factor of 0.75, and never+-- shrink. The "hash function" is the identity function.++newtype IntTable a = IntTable (IORef (IT a))++data IT a = IT {+      tabArr  :: {-# UNPACK #-} !(Arr (Bucket a))+    , tabSize :: {-# UNPACK #-} !(ForeignPtr Int)+    }++data Bucket a = Empty+              | Bucket {+      bucketKey   :: {-# UNPACK #-} !Int+    , bucketValue :: a+    , bucketNext  :: Bucket a+    }++lookup :: Int -> IntTable a -> IO (Maybe a)+lookup k (IntTable ref) = do+  let go Bucket{..}+        | bucketKey == k = return (Just bucketValue)+        | otherwise      = go bucketNext+      go _ = return Nothing+  it@IT{..} <- readIORef ref+  go =<< Arr.read tabArr (indexOf k it)++new :: Int -> IO (IntTable a)+new capacity = IntTable `liftM` (newIORef =<< new_ capacity)++new_ :: Int -> IO (IT a)+new_ capacity = do+  arr <- Arr.new Empty capacity+  size <- mallocForeignPtr+  withForeignPtr size $ \ptr -> poke ptr 0+  return IT { tabArr = arr+            , tabSize = size+            }++grow :: IT a -> IORef (IT a) -> Int -> IO ()+grow oldit ref size = do+  newit <- new_ (Arr.size (tabArr oldit) `shiftL` 1)+  let copySlot n !i+        | n == size = return ()+        | otherwise = do+          let copyBucket !m Empty          = copySlot m (i+1)+              copyBucket  m bkt@Bucket{..} = do+                let idx = indexOf bucketKey newit+                next <- Arr.read (tabArr newit) idx+                Arr.write (tabArr newit) idx bkt { bucketNext = next }+                copyBucket (m+1) bucketNext+          copyBucket n =<< Arr.read (tabArr oldit) i+  copySlot 0 0+  withForeignPtr (tabSize newit) $ \ptr -> poke ptr size+  writeIORef ref newit++insertWith :: (a -> a -> a) -> Int -> a -> IntTable a -> IO (Maybe a)+insertWith f k v inttable@(IntTable ref) = do+  it@IT{..} <- readIORef ref+  let idx = indexOf k it+      go seen bkt@Bucket{..}+        | bucketKey == k = do+          let !v' = f v bucketValue+              !next = seen <> bucketNext+              Empty        <> bs = bs+              b@Bucket{..} <> bs = b { bucketNext = bucketNext <> bs }+          Arr.write tabArr idx (Bucket k v' next)+          return (Just bucketValue)+        | otherwise = go bkt { bucketNext = seen } bucketNext+      go seen _ = withForeignPtr tabSize $ \ptr -> do+        size <- peek ptr+        if size + 1 >= Arr.size tabArr - (Arr.size tabArr `shiftR` 2)+          then grow it ref size >> insertWith f k v inttable+          else do+            v `seq` Arr.write tabArr idx (Bucket k v seen)+            poke ptr (size + 1)+            return Nothing+  go Empty =<< Arr.read tabArr idx+{-# INLINABLE insertWith #-}++-- | Used to undo the effect of a prior insertWith.+reset :: Int -> Maybe a -> IntTable a -> IO ()+reset k (Just v) tbl = insertWith const k v tbl >> return ()+reset k Nothing  tbl = delete k tbl >> return ()++indexOf :: Int -> IT a -> Int+indexOf k IT{..} = k .&. (Arr.size tabArr - 1)++delete :: Int -> IntTable a -> IO (Maybe a)+delete k t = updateWith (const Nothing) k t++updateWith :: (a -> Maybe a) -> Int -> IntTable a -> IO (Maybe a)+updateWith f k (IntTable ref) = do+  it@IT{..} <- readIORef ref+  let idx = indexOf k it+      go changed bkt@Bucket{..}+        | bucketKey == k =+            let fbv = f bucketValue+                !nb = case fbv of+                        Just val -> bkt { bucketValue = val }+                        Nothing  -> bucketNext+            in (fbv, Just bucketValue, nb)+        | otherwise = case go changed bucketNext of+                        (fbv, ov, nb) -> (fbv, ov, bkt { bucketNext = nb })+      go _ e = (Nothing, Nothing, e)+  (fbv, oldVal, newBucket) <- go False `liftM` Arr.read tabArr idx+  when (isJust oldVal) $ do+    Arr.write tabArr idx newBucket+    unless (isJust fbv) $+      withForeignPtr tabSize $ \ptr -> do+        size <- peek ptr+        poke ptr (size - 1)+  return oldVal
GHC/Event/Internal.hs view
@@ -9,6 +9,7 @@     , delete     , poll     , modifyFd+    , modifyFdOnce     -- * Event type     , Event     , evtRead@@ -23,6 +24,7 @@  import Data.Bits ((.|.), (.&.)) import Data.List (foldl', intercalate)+import Data.Maybe (Maybe(..)) import Data.Monoid (Monoid(..)) import Foreign.C.Error (eINTR, getErrno, throwErrno) import System.Posix.Types (Fd)@@ -90,9 +92,9 @@     -- | Poll backend for new events.  The provided callback is called     -- once per file descriptor with new events.     , _bePoll :: a                          -- backend state-              -> Timeout                    -- timeout in milliseconds+              -> Maybe Timeout              -- timeout in milliseconds ('Nothing' for non-blocking poll)               -> (Fd -> Event -> IO ())     -- I/O callback-              -> IO ()+              -> IO Int      -- | Register, modify, or unregister interest in the given events     -- on the given file descriptor.@@ -100,29 +102,46 @@                   -> Fd       -- file descriptor                   -> Event    -- old events to watch for ('mempty' for new)                   -> Event    -- new events to watch for ('mempty' to delete)-                  -> IO ()+                  -> IO Bool +    , _beModifyFdOnce :: a+                         -> Fd    -- file descriptor+                         -> Event -- new events to watch+                         -> IO Bool+     , _beDelete :: a -> IO ()     } -backend :: (a -> Timeout -> (Fd -> Event -> IO ()) -> IO ())-        -> (a -> Fd -> Event -> Event -> IO ())+backend :: (a -> Maybe Timeout -> (Fd -> Event -> IO ()) -> IO Int)+        -> (a -> Fd -> Event -> Event -> IO Bool)+        -> (a -> Fd -> Event -> IO Bool)         -> (a -> IO ())         -> a         -> Backend-backend bPoll bModifyFd bDelete state = Backend state bPoll bModifyFd bDelete+backend bPoll bModifyFd bModifyFdOnce bDelete state =+  Backend state bPoll bModifyFd bModifyFdOnce bDelete {-# INLINE backend #-} -poll :: Backend -> Timeout -> (Fd -> Event -> IO ()) -> IO ()-poll (Backend bState bPoll _ _) = bPoll bState+poll :: Backend -> Maybe Timeout -> (Fd -> Event -> IO ()) -> IO Int+poll (Backend bState bPoll _ _ _) = bPoll bState {-# INLINE poll #-} -modifyFd :: Backend -> Fd -> Event -> Event -> IO ()-modifyFd (Backend bState _ bModifyFd _) = bModifyFd bState+-- | Returns 'True' if the modification succeeded.+-- Returns 'False' if this backend does not support+-- event notifications on this type of file.+modifyFd :: Backend -> Fd -> Event -> Event -> IO Bool+modifyFd (Backend bState _ bModifyFd _ _) = bModifyFd bState {-# INLINE modifyFd #-} +-- | Returns 'True' if the modification succeeded.+-- Returns 'False' if this backend does not support+-- event notifications on this type of file.+modifyFdOnce :: Backend -> Fd -> Event -> IO Bool+modifyFdOnce (Backend bState _ _ bModifyFdOnce _) = bModifyFdOnce bState+{-# INLINE modifyFdOnce #-}+ delete :: Backend -> IO ()-delete (Backend bState _ _ bDelete) = bDelete bState+delete (Backend bState _ _ _ bDelete) = bDelete bState {-# INLINE delete #-}  -- | Throw an 'IOError' corresponding to the current value of
GHC/Event/KQueue.hsc view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , ForeignFunctionInterface+{-# LANGUAGE CApiFFI            , GeneralizedNewtypeDeriving            , NoImplicitPrelude            , RecordWildCards@@ -27,18 +26,19 @@ {-# INLINE available #-} #else -import Control.Concurrent.MVar (MVar, newMVar, swapMVar, withMVar)-import Control.Monad (when, unless)-import Data.Bits (Bits(..))+import Control.Monad (when)+import Data.Bits (Bits(..), FiniteBits(..))+import Data.Maybe (Maybe(..))+import Data.Monoid (Monoid(..)) import Data.Word (Word16, Word32)-import Foreign.C.Error (throwErrnoIfMinus1)+import Foreign.C.Error (throwErrnoIfMinus1, eINTR, eINVAL,+                        eNOTSUP, getErrno, throwErrno) import Foreign.C.Types import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (Ptr, nullPtr) import Foreign.Storable (Storable(..)) import GHC.Base import GHC.Enum (toEnum)-import GHC.Err (undefined) import GHC.Num (Num(..)) import GHC.Real (ceiling, floor, fromIntegral) import GHC.Show (Show(show))@@ -47,10 +47,7 @@ import System.Posix.Types (Fd(..)) import qualified GHC.Event.Array as A -#if defined(HAVE_KEVENT64)-import Data.Int (Int64)-import Data.Word (Word64)-#elif defined(netbsd_HOST_OS)+#if defined(netbsd_HOST_OS) import Data.Int (Int64) #endif @@ -72,103 +69,66 @@ ------------------------------------------------------------------------ -- Exported interface -data EventQueue = EventQueue {-      eqFd       :: {-# UNPACK #-} !QueueFd-    , eqChanges  :: {-# UNPACK #-} !(MVar (A.Array Event))-    , eqEvents   :: {-# UNPACK #-} !(A.Array Event)+data KQueue = KQueue {+      kqueueFd     :: {-# UNPACK #-} !KQueueFd+    , kqueueEvents :: {-# UNPACK #-} !(A.Array Event)     }  new :: IO E.Backend new = do-  qfd <- kqueue-  changesArr <- A.empty-  changes <- newMVar changesArr +  kqfd <- kqueue   events <- A.new 64-  let !be = E.backend poll modifyFd delete (EventQueue qfd changes events)+  let !be = E.backend poll modifyFd modifyFdOnce delete (KQueue kqfd events)   return be -delete :: EventQueue -> IO ()-delete q = do-  _ <- c_close . fromQueueFd . eqFd $ q+delete :: KQueue -> IO ()+delete kq = do+  _ <- c_close . fromKQueueFd . kqueueFd $ kq   return () -modifyFd :: EventQueue -> Fd -> E.Event -> E.Event -> IO ()-modifyFd q fd oevt nevt = withMVar (eqChanges q) $ \ch -> do-  let addChange filt flag = A.snoc ch $ event fd filt flag noteEOF-  when (oevt `E.eventIs` E.evtRead)  $ addChange filterRead flagDelete-  when (oevt `E.eventIs` E.evtWrite) $ addChange filterWrite flagDelete-  when (nevt `E.eventIs` E.evtRead)  $ addChange filterRead flagAdd-  when (nevt `E.eventIs` E.evtWrite) $ addChange filterWrite flagAdd+modifyFd :: KQueue -> Fd -> E.Event -> E.Event -> IO Bool+modifyFd kq fd oevt nevt+  | nevt == mempty = do+      let !ev = event fd (toFilter oevt) flagDelete noteEOF+      kqueueControl (kqueueFd kq) ev+  | otherwise      = do+      let !ev = event fd (toFilter nevt) flagAdd noteEOF+      kqueueControl (kqueueFd kq) ev -poll :: EventQueue-     -> Timeout+toFilter :: E.Event -> Filter+toFilter evt+  | evt `E.eventIs` E.evtRead = filterRead+  | otherwise                 = filterWrite++modifyFdOnce :: KQueue -> Fd -> E.Event -> IO Bool+modifyFdOnce kq fd evt = do+    let !ev = event fd (toFilter evt) (flagAdd .|. flagOneshot) noteEOF+    kqueueControl (kqueueFd kq) ev++poll :: KQueue+     -> Maybe Timeout      -> (Fd -> E.Event -> IO ())-     -> IO ()-poll EventQueue{..} tout f = do-    changesArr <- A.empty-    changes <- swapMVar eqChanges changesArr-    changesLen <- A.length changes-    len <- A.length eqEvents-    when (changesLen > len) $ A.ensureCapacity eqEvents (2 * changesLen)-    n <- A.useAsPtr changes $ \changesPtr chLen ->-           A.unsafeLoad eqEvents $ \evPtr evCap ->-             withTimeSpec (fromTimeout tout) $-               kevent eqFd changesPtr chLen evPtr evCap+     -> IO Int+poll kq mtimeout f = do+    let events = kqueueEvents kq+        fd = kqueueFd kq -    unless (n == 0) $ do-        cap <- A.capacity eqEvents-        when (n == cap) $ A.ensureCapacity eqEvents (2 * cap)-        A.forM_ eqEvents $ \e -> f (fromIntegral (ident e)) (toEvent (filter e))+    n <- A.unsafeLoad events $ \es cap -> case mtimeout of+      Just timeout -> kqueueWait fd es cap $ fromTimeout timeout+      Nothing      -> kqueueWaitNonBlock fd es cap +    when (n > 0) $ do+        A.forM_ events $ \e -> f (fromIntegral (ident e)) (toEvent (filter e))+        cap <- A.capacity events+        when (n == cap) $ A.ensureCapacity events (2 * cap)+    return n ------------------------------------------------------------------------ -- FFI binding -newtype QueueFd = QueueFd {-      fromQueueFd :: CInt+newtype KQueueFd = KQueueFd {+      fromKQueueFd :: CInt     } deriving (Eq, Show) -#if defined(HAVE_KEVENT64)-data Event = KEvent64 {-      ident  :: {-# UNPACK #-} !Word64-    , filter :: {-# UNPACK #-} !Filter-    , flags  :: {-# UNPACK #-} !Flag-    , fflags :: {-# UNPACK #-} !FFlag-    , data_  :: {-# UNPACK #-} !Int64-    , udata  :: {-# UNPACK #-} !Word64-    , ext0   :: {-# UNPACK #-} !Word64-    , ext1   :: {-# UNPACK #-} !Word64-    } deriving Show--event :: Fd -> Filter -> Flag -> FFlag -> Event-event fd filt flag fflag = KEvent64 (fromIntegral fd) filt flag fflag 0 0 0 0--instance Storable Event where-    sizeOf _ = #size struct kevent64_s-    alignment _ = alignment (undefined :: CInt)--    peek ptr = do-        ident'  <- #{peek struct kevent64_s, ident} ptr-        filter' <- #{peek struct kevent64_s, filter} ptr-        flags'  <- #{peek struct kevent64_s, flags} ptr-        fflags' <- #{peek struct kevent64_s, fflags} ptr-        data'   <- #{peek struct kevent64_s, data} ptr-        udata'  <- #{peek struct kevent64_s, udata} ptr-        ext0'   <- #{peek struct kevent64_s, ext[0]} ptr-        ext1'   <- #{peek struct kevent64_s, ext[1]} ptr-        let !ev = KEvent64 ident' (Filter filter') (Flag flags') fflags' data'-                           udata' ext0' ext1'-        return ev--    poke ptr ev = do-        #{poke struct kevent64_s, ident} ptr (ident ev)-        #{poke struct kevent64_s, filter} ptr (filter ev)-        #{poke struct kevent64_s, flags} ptr (flags ev)-        #{poke struct kevent64_s, fflags} ptr (fflags ev)-        #{poke struct kevent64_s, data} ptr (data_ ev)-        #{poke struct kevent64_s, udata} ptr (udata ev)-        #{poke struct kevent64_s, ext[0]} ptr (ext0 ev)-        #{poke struct kevent64_s, ext[1]} ptr (ext1 ev)-#else data Event = KEvent {       ident  :: {-# UNPACK #-} !CUIntPtr     , filter :: {-# UNPACK #-} !Filter@@ -207,7 +167,6 @@         #{poke struct kevent, fflags} ptr (fflags ev)         #{poke struct kevent, data} ptr (data_ ev)         #{poke struct kevent, udata} ptr (udata ev)-#endif  newtype FFlag = FFlag Word32     deriving (Eq, Show, Storable)@@ -221,11 +180,12 @@ #else newtype Flag = Flag Word16 #endif-    deriving (Eq, Show, Storable)+    deriving (Bits, FiniteBits, Eq, Num, Show, Storable)  #{enum Flag, Flag  , flagAdd     = EV_ADD  , flagDelete  = EV_DELETE+ , flagOneshot = EV_ONESHOT  }  #if SIZEOF_KEV_FILTER == 4 /*kevent.filter: uint32_t or uint16_t. */@@ -233,12 +193,12 @@ #else newtype Filter = Filter Word16 #endif-    deriving (Bits, Eq, Num, Show, Storable)+    deriving (Bits, FiniteBits, Eq, Num, Show, Storable) -#{enum Filter, Filter- , filterRead   = EVFILT_READ- , filterWrite  = EVFILT_WRITE- }+filterRead :: Filter+filterRead = Filter (#const EVFILT_READ)+filterWrite :: Filter+filterWrite  = Filter (#const EVFILT_WRITE)  data TimeSpec = TimeSpec {       tv_sec  :: {-# UNPACK #-} !CTime@@ -259,27 +219,49 @@         #{poke struct timespec, tv_sec} ptr (tv_sec ts)         #{poke struct timespec, tv_nsec} ptr (tv_nsec ts) -kqueue :: IO QueueFd-kqueue = QueueFd `fmap` throwErrnoIfMinus1 "kqueue" c_kqueue+kqueue :: IO KQueueFd+kqueue = KQueueFd `fmap` throwErrnoIfMinus1 "kqueue" c_kqueue +kqueueControl :: KQueueFd -> Event -> IO Bool+kqueueControl kfd ev =+    withTimeSpec (TimeSpec 0 0) $ \tp ->+        withEvent ev $ \evp -> do+            res <- kevent False kfd evp 1 nullPtr 0 tp+            if res == -1+              then do+               err <- getErrno+               case err of+                 _ | err == eINTR  -> return True+                 _ | err == eINVAL -> return False+                 _ | err == eNOTSUP -> return False+                 _                 -> throwErrno "kevent"+              else return True++kqueueWait :: KQueueFd -> Ptr Event -> Int -> TimeSpec -> IO Int+kqueueWait fd es cap tm =+    fmap fromIntegral $ E.throwErrnoIfMinus1NoRetry "kevent" $+    withTimeSpec tm $ kevent True fd nullPtr 0 es cap++kqueueWaitNonBlock :: KQueueFd -> Ptr Event -> Int -> IO Int+kqueueWaitNonBlock fd es cap =+    fmap fromIntegral $ E.throwErrnoIfMinus1NoRetry "kevent" $+    withTimeSpec (TimeSpec 0 0) $ kevent False fd nullPtr 0 es cap+ -- TODO: We cannot retry on EINTR as the timeout would be wrong. -- Perhaps we should just return without calling any callbacks.-kevent :: QueueFd -> Ptr Event -> Int -> Ptr Event -> Int -> Ptr TimeSpec-       -> IO Int-kevent k chs chlen evs evlen ts-    = fmap fromIntegral $ E.throwErrnoIfMinus1NoRetry "kevent" $-#if defined(HAVE_KEVENT64)-      c_kevent64 k chs (fromIntegral chlen) evs (fromIntegral evlen) 0 ts-#else-      c_kevent k chs (fromIntegral chlen) evs (fromIntegral evlen) ts-#endif+kevent :: Bool -> KQueueFd -> Ptr Event -> Int -> Ptr Event -> Int -> Ptr TimeSpec+       -> IO CInt+kevent safe k chs chlen evs evlen ts+  | safe      = c_kevent k chs (fromIntegral chlen) evs (fromIntegral evlen) ts+  | otherwise = c_kevent_unsafe k chs (fromIntegral chlen) evs (fromIntegral evlen) ts +withEvent :: Event -> (Ptr Event -> IO a) -> IO a+withEvent ev f = alloca $ \ptr -> poke ptr ev >> f ptr+ withTimeSpec :: TimeSpec -> (Ptr TimeSpec -> IO a) -> IO a-withTimeSpec ts f =-    if tv_sec ts < 0 then-        f nullPtr-      else-        alloca $ \ptr -> poke ptr ts >> f ptr+withTimeSpec ts f+  | tv_sec ts < 0 = f nullPtr+  | otherwise     = alloca $ \ptr -> poke ptr ts >> f ptr  fromTimeout :: Timeout -> TimeSpec fromTimeout Forever     = TimeSpec (-1) (-1)@@ -293,24 +275,23 @@  toEvent :: Filter -> E.Event toEvent (Filter f)-    | f == (#const EVFILT_READ) = E.evtRead-    | f == (#const EVFILT_WRITE) = E.evtWrite-    | otherwise = error $ "toEvent: unknown filter " ++ show f+  | f == (#const EVFILT_READ) = E.evtRead+  | f == (#const EVFILT_WRITE) = E.evtWrite+  | otherwise = error $ "toEvent: unknown filter " ++ show f  foreign import ccall unsafe "kqueue"     c_kqueue :: IO CInt -#if defined(HAVE_KEVENT64)-foreign import ccall safe "kevent64"-    c_kevent64 :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt -> CUInt-               -> Ptr TimeSpec -> IO CInt-#elif defined(HAVE_KEVENT)-foreign import ccall safe "__hscore_kevent"-    c_kevent :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt+#if defined(HAVE_KEVENT)+foreign import capi safe "sys/event.h kevent"+    c_kevent :: KQueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt              -> Ptr TimeSpec -> IO CInt++foreign import ccall unsafe "kevent"+    c_kevent_unsafe :: KQueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt+                    -> Ptr TimeSpec -> IO CInt #else #error no kevent system call available!? #endif  #endif /* defined(HAVE_KQUEUE) */-
GHC/Event/Manager.hs view
@@ -7,7 +7,6 @@            , TypeSynonymInstances            , FlexibleInstances   #-}- module GHC.Event.Manager     ( -- * Types       EventManager@@ -22,27 +21,26 @@     , loop     , step     , shutdown+    , release     , cleanup     , wakeManager +      -- * State+    , callbackTableVar+       -- * Registering interest in I/O events     , Event     , evtRead     , evtWrite     , IOCallback     , FdKey(keyFd)+    , FdData     , registerFd_     , registerFd     , unregisterFd_     , unregisterFd     , closeFd--      -- * Registering interest in timeout events-    , TimeoutCallback-    , TimeoutKey-    , registerTimeout-    , updateTimeout-    , unregisterTimeout+    , closeFd_     ) where  #include "EventConfig.h"@@ -50,29 +48,32 @@ ------------------------------------------------------------------------ -- Imports -import Control.Concurrent.MVar (MVar, modifyMVar, newMVar, readMVar)-import Control.Exception (finally)-import Control.Monad ((=<<), forM_, liftM, sequence_, when)-import Data.IORef (IORef, atomicModifyIORef, mkWeakIORef, newIORef, readIORef,+import Control.Concurrent.MVar (MVar, newMVar, readMVar, putMVar,+                                tryPutMVar, takeMVar, withMVar)+import Control.Exception (onException)+import Control.Monad ((=<<), forM_, liftM, when, replicateM, void)+import Data.Bits ((.&.))+import Data.IORef (IORef, atomicModifyIORef', mkWeakIORef, newIORef, readIORef,                    writeIORef)-import Data.Maybe (Maybe(..))+import Data.Maybe (Maybe(..), maybe) import Data.Monoid (mappend, mconcat, mempty)+import GHC.Arr (Array, (!), listArray) import GHC.Base import GHC.Conc.Signal (runHandlers)+import GHC.Conc.Sync (yield) import GHC.List (filter) import GHC.Num (Num(..))-import GHC.Real ((/), fromIntegral )+import GHC.Real (fromIntegral) import GHC.Show (Show(..))-import GHC.Event.Clock (getMonotonicTime) import GHC.Event.Control+import GHC.Event.IntTable (IntTable) import GHC.Event.Internal (Backend, Event, evtClose, evtRead, evtWrite,                            Timeout(..)) import GHC.Event.Unique (Unique, UniqueSource, newSource, newUnique) import System.Posix.Types (Fd) -import qualified GHC.Event.IntMap as IM+import qualified GHC.Event.IntTable as IT import qualified GHC.Event.Internal as I-import qualified GHC.Event.PSQ as Q  #if defined(HAVE_KQUEUE) import qualified GHC.Event.KQueue as KQueue@@ -102,67 +103,51 @@ -- | Callback invoked on I/O events. type IOCallback = FdKey -> Event -> IO () --- | A timeout registration cookie.-newtype TimeoutKey   = TK Unique-    deriving (Eq)---- | Callback invoked on timeout events.-type TimeoutCallback = IO ()- data State = Created            | Running            | Dying+           | Releasing            | Finished              deriving (Eq, Show) --- | A priority search queue, with timeouts as priorities.-type TimeoutQueue = Q.PSQ TimeoutCallback--{--Instead of directly modifying the 'TimeoutQueue' in-e.g. 'registerTimeout' we keep a list of edits to perform, in the form-of a chain of function closures, and have the I/O manager thread-perform the edits later.  This exist to address the following GC-problem:--Since e.g. 'registerTimeout' doesn't force the evaluation of the-thunks inside the 'emTimeouts' IORef a number of thunks build up-inside the IORef.  If the I/O manager thread doesn't evaluate these-thunks soon enough they'll get promoted to the old generation and-become roots for all subsequent minor GCs.--When the thunks eventually get evaluated they will each create a new-intermediate 'TimeoutQueue' that immediately becomes garbage.  Since-the thunks serve as roots until the next major GC these intermediate-'TimeoutQueue's will get copied unnecesarily in the next minor GC,-increasing GC time.  This problem is known as "floating garbage".--Keeping a list of edits doesn't stop this from happening but makes the-amount of data that gets copied smaller.--TODO: Evaluate the content of the IORef to WHNF on each insert once-this bug is resolved: http://hackage.haskell.org/trac/ghc/ticket/3838--}---- | An edit to apply to a 'TimeoutQueue'.-type TimeoutEdit = TimeoutQueue -> TimeoutQueue- -- | The event manager state. data EventManager = EventManager     { emBackend      :: !Backend-    , emFds          :: {-# UNPACK #-} !(MVar (IM.IntMap [FdData]))-    , emTimeouts     :: {-# UNPACK #-} !(IORef TimeoutEdit)+    , emFds          :: {-# UNPACK #-} !(Array Int (MVar (IntTable [FdData])))     , emState        :: {-# UNPACK #-} !(IORef State)     , emUniqueSource :: {-# UNPACK #-} !UniqueSource     , emControl      :: {-# UNPACK #-} !Control+    , emOneShot      :: !Bool+    , emLock         :: {-# UNPACK #-} !(MVar ())     } +-- must be power of 2+callbackArraySize :: Int+callbackArraySize = 32++hashFd :: Fd -> Int+hashFd fd = fromIntegral fd .&. (callbackArraySize - 1)+{-# INLINE hashFd #-}++callbackTableVar :: EventManager -> Fd -> MVar (IntTable [FdData])+callbackTableVar mgr fd = emFds mgr ! hashFd fd+{-# INLINE callbackTableVar #-}++haveOneShot :: Bool+{-# INLINE haveOneShot #-}+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)+haveOneShot = False+#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)+haveOneShot = True+#else+haveOneShot = False+#endif ------------------------------------------------------------------------ -- Creation -handleControlEvent :: EventManager -> FdKey -> Event -> IO ()-handleControlEvent mgr reg _evt = do-  msg <- readControlMessage (emControl mgr) (keyFd reg)+handleControlEvent :: EventManager -> Fd -> Event -> IO ()+handleControlEvent mgr fd _evt = do+  msg <- readControlMessage (emControl mgr) fd   case msg of     CMsgWakeup      -> return ()     CMsgDie         -> writeIORef (emState mgr) Finished@@ -180,44 +165,67 @@ #endif  -- | Create a new event manager.-new :: IO EventManager-new = newWith =<< newDefaultBackend+new :: Bool -> IO EventManager+new oneShot = newWith oneShot =<< newDefaultBackend -newWith :: Backend -> IO EventManager-newWith be = do-  iofds <- newMVar IM.empty-  timeouts <- newIORef id-  ctrl <- newControl+newWith :: Bool -> Backend -> IO EventManager+newWith oneShot be = do+  iofds <- fmap (listArray (0, callbackArraySize-1)) $+           replicateM callbackArraySize (newMVar =<< IT.new 8)+  ctrl <- newControl False   state <- newIORef Created   us <- newSource   _ <- mkWeakIORef state $ do-               st <- atomicModifyIORef state $ \s -> (Finished, s)+               st <- atomicModifyIORef' state $ \s -> (Finished, s)                when (st /= Finished) $ do                  I.delete be                  closeControl ctrl+  lockVar <- newMVar ()   let mgr = EventManager { emBackend = be                          , emFds = iofds-                         , emTimeouts = timeouts                          , emState = state                          , emUniqueSource = us                          , emControl = ctrl+                         , emOneShot = oneShot+                         , emLock = lockVar                          }-  _ <- registerFd_ mgr (handleControlEvent mgr) (controlReadFd ctrl) evtRead-  _ <- registerFd_ mgr (handleControlEvent mgr) (wakeupReadFd ctrl) evtRead+  registerControlFd mgr (controlReadFd ctrl) evtRead+  registerControlFd mgr (wakeupReadFd ctrl) evtRead   return mgr +failOnInvalidFile :: String -> Fd -> IO Bool -> IO ()+failOnInvalidFile loc fd m = do+  ok <- m+  when (not ok) $+    let msg = "Failed while attempting to modify registration of file " +++              show fd ++ " at location " ++ loc+    in error msg++registerControlFd :: EventManager -> Fd -> Event -> IO ()+registerControlFd mgr fd evs =+  failOnInvalidFile "registerControlFd" fd $+  I.modifyFd (emBackend mgr) fd mempty evs+ -- | Asynchronously shuts down the event manager, if running. shutdown :: EventManager -> IO () shutdown mgr = do-  state <- atomicModifyIORef (emState mgr) $ \s -> (Dying, s)+  state <- atomicModifyIORef' (emState mgr) $ \s -> (Dying, s)   when (state == Running) $ sendDie (emControl mgr) +-- | Asynchronously tell the thread executing the event+-- manager loop to exit.+release :: EventManager -> IO ()+release EventManager{..} = do+  state <- atomicModifyIORef' emState $ \s -> (Releasing, s)+  when (state == Running) $ sendWakeup emControl+ finished :: EventManager -> IO Bool finished mgr = (== Finished) `liftM` readIORef (emState mgr)  cleanup :: EventManager -> IO () cleanup EventManager{..} = do   writeIORef emState Finished+  void $ tryPutMVar emLock ()   I.delete emBackend   closeControl emControl @@ -231,42 +239,52 @@ -- closes all of its control resources when it finishes. loop :: EventManager -> IO () loop mgr@EventManager{..} = do-  state <- atomicModifyIORef emState $ \s -> case s of+  void $ takeMVar emLock+  state <- atomicModifyIORef' emState $ \s -> case s of     Created -> (Running, s)+    Releasing -> (Running, s)     _       -> (s, s)   case state of-    Created -> go Q.empty `finally` cleanup mgr-    Dying   -> cleanup mgr-    _       -> do cleanup mgr-                  error $ "GHC.Event.Manager.loop: state is already " ++-                      show state+    Created   -> go `onException` cleanup mgr+    Releasing -> go `onException` cleanup mgr+    Dying     -> cleanup mgr+    -- While a poll loop is never forked when the event manager is in the+    -- 'Finished' state, its state could read 'Finished' once the new thread+    -- actually runs.  This is not an error, just an unfortunate race condition+    -- in Thread.restartPollLoop.  See #8235+    Finished  -> return ()+    _         -> do cleanup mgr+                    error $ "GHC.Event.Manager.loop: state is already " +++                            show state  where-  go q = do (running, q') <- step mgr q-            when running $ go q'+  go = do state <- step mgr+          case state of+            Running   -> yield >> go+            Releasing -> putMVar emLock ()+            _         -> cleanup mgr -step :: EventManager -> TimeoutQueue -> IO (Bool, TimeoutQueue)-step mgr@EventManager{..} tq = do-  (timeout, q') <- mkTimeout tq-  I.poll emBackend timeout (onFdEvent mgr)+-- | To make a step, we first do a non-blocking poll, in case+-- there are already events ready to handle. This improves performance+-- because we can make an unsafe foreign C call, thereby avoiding+-- forcing the current Task to release the Capability and forcing a context switch.+-- If the poll fails to find events, we yield, putting the poll loop thread at+-- end of the Haskell run queue. When it comes back around, we do one more+-- non-blocking poll, in case we get lucky and have ready events.+-- If that also returns no events, then we do a blocking poll.+step :: EventManager -> IO State+step mgr@EventManager{..} = do+  waitForIO   state <- readIORef emState-  state `seq` return (state == Running, q')- where--  -- | Call all expired timer callbacks and return the time to the-  -- next timeout.-  mkTimeout :: TimeoutQueue -> IO (Timeout, TimeoutQueue)-  mkTimeout q = do-      now <- getMonotonicTime-      applyEdits <- atomicModifyIORef emTimeouts $ \f -> (id, f)-      let (expired, q'') = let q' = applyEdits q in q' `seq` Q.atMost now q'-      sequence_ $ map Q.value expired-      let timeout = case Q.minView q'' of-            Nothing             -> Forever-            Just (Q.E _ t _, _) ->-                -- This value will always be positive since the call-                -- to 'atMost' above removed any timeouts <= 'now'-                let t' = t - now in t' `seq` Timeout t'-      return (timeout, q'')+  state `seq` return state+  where+    waitForIO = do+      n1 <- I.poll emBackend Nothing (onFdEvent mgr)+      when (n1 <= 0) $ do+        yield+        n2 <- I.poll emBackend Nothing (onFdEvent mgr)+        when (n2 <= 0) $ do+          _ <- I.poll emBackend (Just Forever) (onFdEvent mgr)+          return ()  ------------------------------------------------------------------------ -- Registering interest in I/O events@@ -276,21 +294,44 @@ -- event manager ought to be woken. registerFd_ :: EventManager -> IOCallback -> Fd -> Event             -> IO (FdKey, Bool)-registerFd_ EventManager{..} cb fd evs = do+registerFd_ mgr@(EventManager{..}) cb fd evs = do   u <- newUnique emUniqueSource-  modifyMVar emFds $ \oldMap -> do-    let fd'  = fromIntegral fd-        reg  = FdKey fd u-        !fdd = FdData reg evs cb-        (!newMap, (oldEvs, newEvs)) =-            case IM.insertWith (++) fd' [fdd] oldMap of-              (Nothing,   n) -> (n, (mempty, evs))-              (Just prev, n) -> (n, pairEvents prev newMap fd')-        modify = oldEvs /= newEvs-    when modify $ I.modifyFd emBackend fd oldEvs newEvs-    return (newMap, (reg, modify))+  let fd'  = fromIntegral fd+      reg  = FdKey fd u+      !fdd = FdData reg evs cb+  (modify,ok) <- withMVar (callbackTableVar mgr fd) $ \tbl ->+    if haveOneShot && emOneShot+    then do+      oldFdd <- IT.insertWith (++) fd' [fdd] tbl+      let evs' = maybe evs (combineEvents evs) oldFdd+      ok <- I.modifyFdOnce emBackend fd evs'+      if ok+        then return (False, True)+        else IT.reset fd' oldFdd tbl >> return (False, False)+    else do+      oldFdd <- IT.insertWith (++) fd' [fdd] tbl+      let (oldEvs, newEvs) =+            case oldFdd of+              Nothing   -> (mempty, evs)+              Just prev -> (eventsOf prev, combineEvents evs prev)+          modify = oldEvs /= newEvs+      ok <- if modify+            then I.modifyFd emBackend fd oldEvs newEvs+            else return True+      if ok+        then return (modify, True)+        else IT.reset fd' oldFdd tbl >> return (False, False)+  -- this simulates behavior of old IO manager:+  -- i.e. just call the callback if the registration fails.+  when (not ok) (cb reg evs)+  return (reg,modify) {-# INLINE registerFd_ #-} +combineEvents :: Event -> [FdData] -> Event+combineEvents ev [fdd] = mappend ev (fdEvents fdd)+combineEvents ev fdds  = mappend ev (eventsOf fdds)+{-# INLINE combineEvents #-}+ -- | @registerFd mgr cb fd evs@ registers interest in the events @evs@ -- on the file descriptor @fd@.  @cb@ is called for each event that -- occurs.  Returns a cookie that can be handed to 'unregisterFd'.@@ -301,37 +342,47 @@   return r {-# INLINE registerFd #-} +{-+    Building GHC with parallel IO manager on Mac freezes when+    compiling the dph libraries in the phase 2. As workaround, we+    don't use oneshot and we wake up an IO manager on Mac every time+    when we register an event.++    For more information, please read:+        http://hackage.haskell.org/trac/ghc/ticket/7651+-} -- | Wake up the event manager. wakeManager :: EventManager -> IO ()+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS) wakeManager mgr = sendWakeup (emControl mgr)+#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)+wakeManager _ = return ()+#else+wakeManager mgr = sendWakeup (emControl mgr)+#endif  eventsOf :: [FdData] -> Event eventsOf = mconcat . map fdEvents -pairEvents :: [FdData] -> IM.IntMap [FdData] -> Int -> (Event, Event)-pairEvents prev m fd = let l = eventsOf prev-                           r = case IM.lookup fd m of-                                 Nothing  -> mempty-                                 Just fds -> eventsOf fds-                       in (l, r)- -- | Drop a previous file descriptor registration, without waking the -- event manager thread.  The return value indicates whether the event -- manager ought to be woken. unregisterFd_ :: EventManager -> FdKey -> IO Bool-unregisterFd_ EventManager{..} (FdKey fd u) =-  modifyMVar emFds $ \oldMap -> do-    let dropReg cbs = case filter ((/= u) . keyUnique . fdKey) cbs of-                          []   -> Nothing-                          cbs' -> Just cbs'+unregisterFd_ mgr@(EventManager{..}) (FdKey fd u) =+  withMVar (callbackTableVar mgr fd) $ \tbl -> do+    let dropReg = nullToNothing . filter ((/= u) . keyUnique . fdKey)         fd' = fromIntegral fd-        (!newMap, (oldEvs, newEvs)) =-            case IM.updateWith dropReg fd' oldMap of-              (Nothing,   _)    -> (oldMap, (mempty, mempty))-              (Just prev, newm) -> (newm, pairEvents prev newm fd')-        modify = oldEvs /= newEvs-    when modify $ I.modifyFd emBackend fd oldEvs newEvs-    return (newMap, modify)+        pairEvents prev = do+          r <- maybe mempty eventsOf `fmap` IT.lookup fd' tbl+          return (eventsOf prev, r)+    (oldEvs, newEvs) <- IT.updateWith dropReg fd' tbl >>=+                        maybe (return (mempty, mempty)) pairEvents+    let modify = oldEvs /= newEvs+    when modify $ failOnInvalidFile "unregisterFd_" fd $+      if haveOneShot && emOneShot && newEvs /= mempty+      then I.modifyFdOnce emBackend fd newEvs+      else I.modifyFd emBackend fd oldEvs newEvs+    return modify  -- | Drop a previous file descriptor registration. unregisterFd :: EventManager -> FdKey -> IO ()@@ -342,66 +393,89 @@ -- | Close a file descriptor in a race-safe way. closeFd :: EventManager -> (Fd -> IO ()) -> Fd -> IO () closeFd mgr close fd = do-  fds <- modifyMVar (emFds mgr) $ \oldMap -> do-    close fd-    case IM.delete (fromIntegral fd) oldMap of-      (Nothing,  _)       -> return (oldMap, [])-      (Just fds, !newMap) -> do-        when (eventsOf fds /= mempty) $ wakeManager mgr-        return (newMap, fds)+  fds <- withMVar (callbackTableVar mgr fd) $ \tbl -> do+    prev <- IT.delete (fromIntegral fd) tbl+    case prev of+      Nothing  -> close fd >> return []+      Just fds -> do+        let oldEvs = eventsOf fds+        when (oldEvs /= mempty) $ do+          _ <- I.modifyFd (emBackend mgr) fd oldEvs mempty+          wakeManager mgr+        close fd+        return fds   forM_ fds $ \(FdData reg ev cb) -> cb reg (ev `mappend` evtClose) ---------------------------------------------------------------------------- Registering interest in timeout events---- | Register a timeout in the given number of microseconds.  The--- returned 'TimeoutKey' can be used to later unregister or update the--- timeout.  The timeout is automatically unregistered after the given--- time has passed.-registerTimeout :: EventManager -> Int -> TimeoutCallback -> IO TimeoutKey-registerTimeout mgr us cb = do-  !key <- newUnique (emUniqueSource mgr)-  if us <= 0 then cb-    else do-      now <- getMonotonicTime-      let expTime = fromIntegral us / 1000000.0 + now--      -- We intentionally do not evaluate the modified map to WHNF here.-      -- Instead, we leave a thunk inside the IORef and defer its-      -- evaluation until mkTimeout in the event loop.  This is a-      -- workaround for a nasty IORef contention problem that causes the-      -- thread-delay benchmark to take 20 seconds instead of 0.2.-      atomicModifyIORef (emTimeouts mgr) $ \f ->-          let f' = (Q.insert key expTime cb) . f in (f', ())-      wakeManager mgr-  return $ TK key---- | Unregister an active timeout.-unregisterTimeout :: EventManager -> TimeoutKey -> IO ()-unregisterTimeout mgr (TK key) = do-  atomicModifyIORef (emTimeouts mgr) $ \f ->-      let f' = (Q.delete key) . f in (f', ())-  wakeManager mgr---- | Update an active timeout to fire in the given number of--- microseconds.-updateTimeout :: EventManager -> TimeoutKey -> Int -> IO ()-updateTimeout mgr (TK key) us = do-  now <- getMonotonicTime-  let expTime = fromIntegral us / 1000000.0 + now--  atomicModifyIORef (emTimeouts mgr) $ \f ->-      let f' = (Q.adjust (const expTime) key) . f in (f', ())-  wakeManager mgr+-- | Close a file descriptor in a race-safe way.+-- It assumes the caller will update the callback tables and that the caller+-- holds the callback table lock for the fd. It must hold this lock because+-- this command executes a backend command on the fd.+closeFd_ :: EventManager+            -> IntTable [FdData]+            -> Fd+            -> IO (IO ())+closeFd_ mgr tbl fd = do+  prev <- IT.delete (fromIntegral fd) tbl+  case prev of+    Nothing  -> return (return ())+    Just fds -> do+      let oldEvs = eventsOf fds+      when (oldEvs /= mempty) $ do+        _ <- I.modifyFd (emBackend mgr) fd oldEvs mempty+        wakeManager mgr+      return $+        forM_ fds $ \(FdData reg ev cb) -> cb reg (ev `mappend` evtClose)  ------------------------------------------------------------------------ -- Utilities  -- | Call the callbacks corresponding to the given file descriptor. onFdEvent :: EventManager -> Fd -> Event -> IO ()-onFdEvent mgr fd evs = do-  fds <- readMVar (emFds mgr)-  case IM.lookup (fromIntegral fd) fds of-      Just cbs -> forM_ cbs $ \(FdData reg ev cb) ->-                    when (evs `I.eventIs` ev) $ cb reg evs-      Nothing  -> return ()+onFdEvent mgr fd evs =+  if fd == controlReadFd (emControl mgr) || fd == wakeupReadFd (emControl mgr)+  then handleControlEvent mgr fd evs+  else+    if emOneShot mgr+    then+      do fdds <- withMVar (callbackTableVar mgr fd) $ \tbl ->+           IT.delete fd' tbl >>=+           maybe (return []) (selectCallbacks tbl)+         forM_ fdds $ \(FdData reg _ cb) -> cb reg evs+    else+      do found <- IT.lookup fd' =<< readMVar (callbackTableVar mgr fd)+         case found of+           Just cbs -> forM_ cbs $ \(FdData reg ev cb) -> do+             when (evs `I.eventIs` ev) $ cb reg evs+           Nothing  -> return ()+  where+    fd' :: Int+    fd' = fromIntegral fd++    selectCallbacks :: IntTable [FdData] -> [FdData] -> IO [FdData]+    selectCallbacks tbl cbs = aux cbs [] []+      where+        -- nothing to rearm.+        aux [] _    []          =+          if haveOneShot+          then return cbs+          else do _ <- I.modifyFd (emBackend mgr) fd (eventsOf cbs) mempty+                  return cbs++        -- reinsert and rearm; note that we already have the lock on the+        -- callback table for this fd, and we deleted above, so we know there+        -- is no entry in the table for this fd.+        aux [] fdds saved@(_:_) = do+          _ <- if haveOneShot+               then I.modifyFdOnce (emBackend mgr) fd $ eventsOf saved+               else I.modifyFd (emBackend mgr) fd (eventsOf cbs) $ eventsOf saved+          _ <- IT.insertWith (\_ _ -> saved) fd' saved tbl+          return fdds++        -- continue, saving those callbacks that don't match the event+        aux (fdd@(FdData _ evs' _) : cbs') fdds saved+          | evs `I.eventIs` evs' = aux cbs' (fdd:fdds) saved+          | otherwise            = aux cbs' fdds (fdd:saved)++nullToNothing :: [a] -> Maybe [a]+nullToNothing []       = Nothing+nullToNothing xs@(_:_) = Just xs
GHC/Event/Poll.hsc view
@@ -1,7 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , ForeignFunctionInterface-           , GeneralizedNewtypeDeriving+{-# LANGUAGE GeneralizedNewtypeDeriving            , NoImplicitPrelude            , BangPatterns   #-}@@ -28,15 +26,16 @@  import Control.Concurrent.MVar (MVar, newMVar, swapMVar) import Control.Monad ((=<<), liftM, liftM2, unless)-import Data.Bits (Bits, (.|.), (.&.))+import Data.Bits (Bits, FiniteBits, (.|.), (.&.)) import Data.Maybe (Maybe(..)) import Data.Monoid (Monoid(..))-import Foreign.C.Types (CInt(..), CShort(..), CULong(..))+import Data.Word+import Foreign.C.Types (CInt(..), CShort(..)) import Foreign.Ptr (Ptr) import Foreign.Storable (Storable(..)) import GHC.Base import GHC.Conc.Sync (withMVar)-import GHC.Err (undefined)+import GHC.Enum (maxBound) import GHC.Num (Num(..)) import GHC.Real (ceiling, fromIntegral) import GHC.Show (Show)@@ -55,14 +54,18 @@     }  new :: IO E.Backend-new = E.backend poll modifyFd (\_ -> return ()) `liftM`+new = E.backend poll modifyFd modifyFdOnce (\_ -> return ()) `liftM`       liftM2 Poll (newMVar =<< A.empty) A.empty -modifyFd :: Poll -> Fd -> E.Event -> E.Event -> IO ()+modifyFd :: Poll -> Fd -> E.Event -> E.Event -> IO Bool modifyFd p fd oevt nevt =-  withMVar (pollChanges p) $ \ary ->+  withMVar (pollChanges p) $ \ary -> do     A.snoc ary $ PollFd fd (fromEvent nevt) (fromEvent oevt)+    return True +modifyFdOnce :: Poll -> Fd -> E.Event -> IO Bool+modifyFdOnce = error "modifyFdOnce not supported in Poll backend"+ reworkFd :: Poll -> PollFd -> IO () reworkFd p (PollFd fd npevt opevt) = do   let ary = pollFd p@@ -77,15 +80,20 @@           | otherwise  -> A.removeAt ary i  poll :: Poll-     -> E.Timeout+     -> Maybe E.Timeout      -> (Fd -> E.Event -> IO ())-     -> IO ()-poll p tout f = do+     -> IO Int+poll p mtout f = do   let a = pollFd p   mods <- swapMVar (pollChanges p) =<< A.empty   A.forM_ mods (reworkFd p)-  n <- A.useAsPtr a $ \ptr len -> E.throwErrnoIfMinus1NoRetry "c_poll" $-         c_poll ptr (fromIntegral len) (fromIntegral (fromTimeout tout))+  n <- A.useAsPtr a $ \ptr len ->+    E.throwErrnoIfMinus1NoRetry "c_poll" $+    case mtout of+      Just tout ->+        c_pollLoop ptr (fromIntegral len) (fromTimeout tout)+      Nothing   ->+        c_poll_unsafe ptr (fromIntegral len) 0   unless (n == 0) $ do     A.loop a 0 $ \i e -> do       let r = pfdRevents e@@ -94,7 +102,43 @@                 let i' = i + 1                 return (i', i' == n)         else return (i, True)+  return (fromIntegral n)+  where+    -- The poll timeout is specified as an Int, but c_poll takes a CInt. These+    -- can't be safely coerced as on many systems (e.g. x86_64) CInt has a+    -- maxBound of (2^32 - 1), even though Int may have a significantly higher+    -- bound.+    --+    -- This function deals with timeouts greater than maxBound :: CInt, by+    -- looping until c_poll returns a non-zero value (0 indicates timeout+    -- expired) OR the full timeout has passed.+    c_pollLoop :: Ptr PollFd -> (#type nfds_t) -> Int -> IO CInt+    c_pollLoop ptr len tout+        | tout <= maxPollTimeout = c_poll ptr len (fromIntegral tout)+        | otherwise = do+            result <- c_poll ptr len (fromIntegral maxPollTimeout)+            if result == 0+               then c_pollLoop ptr len (fromIntegral (tout - maxPollTimeout))+               else return result +    -- We need to account for 3 cases:+    --     1. Int and CInt are of equal size.+    --     2. Int is larger than CInt+    --     3. Int is smaller than CInt+    --+    -- In case 1, the value of maxPollTimeout will be the maxBound of Int.+    --+    -- In case 2, the value of maxPollTimeout will be the maxBound of CInt,+    -- which is the largest value accepted by c_poll. This will result in+    -- c_pollLoop recursing if the provided timeout is larger.+    --+    -- In case 3, "fromIntegral (maxBound :: CInt) :: Int" will result in a+    -- negative Int, max will thus return maxBound :: Int. Since poll doesn't+    -- accept values bigger than maxBound :: Int and CInt is larger than Int,+    -- there is no problem converting Int to CInt for the c_poll call.+    maxPollTimeout :: Int+    maxPollTimeout = max maxBound (fromIntegral (maxBound :: CInt))+ fromTimeout :: E.Timeout -> Int fromTimeout E.Forever     = -1 fromTimeout (E.Timeout s) = ceiling $ 1000 * s@@ -106,7 +150,7 @@     } deriving (Show)  newtype Event = Event CShort-    deriving (Eq, Show, Num, Storable, Bits)+    deriving (Eq, Show, Num, Storable, Bits, FiniteBits)  -- We have to duplicate the whole enum like this in order for the -- hsc2hs cross-compilation mode to work@@ -158,6 +202,8 @@       #{poke struct pollfd, revents} ptr (pfdRevents p)  foreign import ccall safe "poll.h poll"-    c_poll :: Ptr PollFd -> CULong -> CInt -> IO CInt+    c_poll :: Ptr PollFd -> (#type nfds_t) -> CInt -> IO CInt +foreign import ccall unsafe "poll.h poll"+    c_poll_unsafe :: Ptr PollFd -> (#type nfds_t) -> CInt -> IO CInt #endif /* defined(HAVE_POLL_H) */
GHC/Event/Thread.hs view
@@ -1,31 +1,43 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE BangPatterns, ForeignFunctionInterface, NoImplicitPrelude #-}-+{-# LANGUAGE BangPatterns, NoImplicitPrelude #-} module GHC.Event.Thread     ( getSystemEventManager+    , getSystemTimerManager     , ensureIOManagerIsRunning+    , ioManagerCapabilitiesChanged     , threadWaitRead     , threadWaitWrite+    , threadWaitReadSTM+    , threadWaitWriteSTM     , closeFdWith     , threadDelay     , registerDelay     ) where +import Control.Exception (finally)+import Control.Monad (forM, forM_, sequence_, zipWithM, when) import Data.IORef (IORef, newIORef, readIORef, writeIORef)+import Data.List (zipWith3) import Data.Maybe (Maybe(..))+import Data.Tuple (snd) import Foreign.C.Error (eBADF, errnoToIOError) import Foreign.Ptr (Ptr) import GHC.Base import GHC.Conc.Sync (TVar, ThreadId, ThreadStatus(..), atomically, forkIO,-                      labelThread, modifyMVar_, newTVar, sharedCAF,-                      threadStatus, writeTVar)+                      labelThread, modifyMVar_, withMVar, newTVar, sharedCAF,+                      getNumCapabilities, threadCapability, myThreadId, forkOn,+                      threadStatus, writeTVar, newTVarIO, readTVar, retry,throwSTM,STM) import GHC.IO (mask_, onException) import GHC.IO.Exception (ioError)+import GHC.IOArray (IOArray, newIOArray, readIOArray, writeIOArray,+                    boundsIOArray) import GHC.MVar (MVar, newEmptyMVar, newMVar, putMVar, takeMVar) import GHC.Event.Internal (eventIs, evtClose) import GHC.Event.Manager (Event, EventManager, evtRead, evtWrite, loop,-                             new, registerFd, unregisterFd_, registerTimeout)+                             new, registerFd, unregisterFd_) import qualified GHC.Event.Manager as M+import qualified GHC.Event.TimerManager as TM+import GHC.Num ((-), (+)) import System.IO.Unsafe (unsafePerformIO) import System.Posix.Types (Fd) @@ -37,10 +49,10 @@ -- run /earlier/ than specified. threadDelay :: Int -> IO () threadDelay usecs = mask_ $ do-  Just mgr <- getSystemEventManager+  mgr <- getSystemTimerManager   m <- newEmptyMVar-  reg <- registerTimeout mgr usecs (putMVar m ())-  takeMVar m `onException` M.unregisterTimeout mgr reg+  reg <- TM.registerTimeout mgr usecs (putMVar m ())+  takeMVar m `onException` TM.unregisterTimeout mgr reg  -- | Set the value of returned TVar to True after a given number of -- microseconds. The caveats associated with threadDelay also apply.@@ -48,8 +60,8 @@ registerDelay :: Int -> IO (TVar Bool) registerDelay usecs = do   t <- atomically $ newTVar False-  Just mgr <- getSystemEventManager-  _ <- registerTimeout mgr usecs . atomically $ writeTVar t True+  mgr <- getSystemTimerManager+  _ <- TM.registerTimeout mgr usecs . atomically $ writeTVar t True   return t  -- | Block the current thread until data is available to read from the@@ -81,57 +93,193 @@             -> Fd                   -- ^ File descriptor to close.             -> IO () closeFdWith close fd = do-  Just mgr <- getSystemEventManager-  M.closeFd mgr close fd+  eventManagerArray <- readIORef eventManager+  let (low, high) = boundsIOArray eventManagerArray+  mgrs <- forM [low..high] $ \i -> do+    Just (_,!mgr) <- readIOArray eventManagerArray i+    return mgr+  mask_ $ do+    tables <- forM mgrs $ \mgr -> takeMVar $ M.callbackTableVar mgr fd+    cbApps <- zipWithM (\mgr table -> M.closeFd_ mgr table fd) mgrs tables+    close fd `finally` sequence_ (zipWith3 finish mgrs tables cbApps)+  where+    finish mgr table cbApp = putMVar (M.callbackTableVar mgr fd) table >> cbApp  threadWait :: Event -> Fd -> IO () threadWait evt fd = mask_ $ do   m <- newEmptyMVar-  Just mgr <- getSystemEventManager-  reg <- registerFd mgr (\reg e -> unregisterFd_ mgr reg >> putMVar m e) fd evt+  mgr <- getSystemEventManager_+  reg <- registerFd mgr (\_ e -> putMVar m e) fd evt   evt' <- takeMVar m `onException` unregisterFd_ mgr reg   if evt' `eventIs` evtClose     then ioError $ errnoToIOError "threadWait" eBADF Nothing Nothing     else return () --- | Retrieve the system event manager.++threadWaitSTM :: Event -> Fd -> IO (STM (), IO ())+threadWaitSTM evt fd = mask_ $ do+  m <- newTVarIO Nothing+  mgr <- getSystemEventManager_+  reg <- registerFd mgr (\_ e -> atomically (writeTVar m (Just e))) fd evt+  let waitAction =+        do mevt <- readTVar m+           case mevt of+             Nothing -> retry+             Just evt' ->+               if evt' `eventIs` evtClose+               then throwSTM $ errnoToIOError "threadWaitSTM" eBADF Nothing Nothing+               else return ()+  return (waitAction, unregisterFd_ mgr reg >> return ())++-- | Allows a thread to use an STM action to wait for a file descriptor to be readable.+-- The STM action will retry until the file descriptor has data ready.+-- The second element of the return value pair is an IO action that can be used+-- to deregister interest in the file descriptor. ----- This function always returns 'Just' the system event manager when using the--- threaded RTS and 'Nothing' otherwise.+-- The STM action will throw an 'IOError' if the file descriptor was closed+-- while the STM action is being executed.  To safely close a file descriptor+-- that has been used with 'threadWaitReadSTM', use 'closeFdWith'.+threadWaitReadSTM :: Fd -> IO (STM (), IO ())+threadWaitReadSTM = threadWaitSTM evtRead+{-# INLINE threadWaitReadSTM #-}++-- | Allows a thread to use an STM action to wait until a file descriptor can accept a write.+-- The STM action will retry while the file until the given file descriptor can accept a write.+-- The second element of the return value pair is an IO action that can be used to deregister+-- interest in the file descriptor.+--+-- The STM action will throw an 'IOError' if the file descriptor was closed+-- while the STM action is being executed.  To safely close a file descriptor+-- that has been used with 'threadWaitWriteSTM', use 'closeFdWith'.+threadWaitWriteSTM :: Fd -> IO (STM (), IO ())+threadWaitWriteSTM = threadWaitSTM evtWrite+{-# INLINE threadWaitWriteSTM #-}+++-- | Retrieve the system event manager for the capability on which the+-- calling thread is running.+--+-- This function always returns 'Just' the current thread's event manager+-- when using the threaded RTS and 'Nothing' otherwise. getSystemEventManager :: IO (Maybe EventManager)-getSystemEventManager = readIORef eventManager+getSystemEventManager = do+  t <- myThreadId+  (cap, _) <- threadCapability t+  eventManagerArray <- readIORef eventManager+  mmgr <- readIOArray eventManagerArray cap+  return $ fmap snd mmgr +getSystemEventManager_ :: IO EventManager+getSystemEventManager_ = do+  Just mgr <- getSystemEventManager+  return mgr+{-# INLINE getSystemEventManager_ #-}+ foreign import ccall unsafe "getOrSetSystemEventThreadEventManagerStore"     getOrSetSystemEventThreadEventManagerStore :: Ptr a -> IO (Ptr a) -eventManager :: IORef (Maybe EventManager)+eventManager :: IORef (IOArray Int (Maybe (ThreadId, EventManager))) eventManager = unsafePerformIO $ do-    em <- newIORef Nothing+    numCaps <- getNumCapabilities+    eventManagerArray <- newIOArray (0, numCaps - 1) Nothing+    em <- newIORef eventManagerArray     sharedCAF em getOrSetSystemEventThreadEventManagerStore {-# NOINLINE eventManager #-} +numEnabledEventManagers :: IORef Int+numEnabledEventManagers = unsafePerformIO $ do+  newIORef 0+{-# NOINLINE numEnabledEventManagers #-}+ foreign import ccall unsafe "getOrSetSystemEventThreadIOManagerThreadStore"     getOrSetSystemEventThreadIOManagerThreadStore :: Ptr a -> IO (Ptr a) -{-# NOINLINE ioManager #-}-ioManager :: MVar (Maybe ThreadId)-ioManager = unsafePerformIO $ do-   m <- newMVar Nothing+-- | The ioManagerLock protects the 'eventManager' value:+-- Only one thread at a time can start or shutdown event managers.+{-# NOINLINE ioManagerLock #-}+ioManagerLock :: MVar ()+ioManagerLock = unsafePerformIO $ do+   m <- newMVar ()    sharedCAF m getOrSetSystemEventThreadIOManagerThreadStore +getSystemTimerManager :: IO TM.TimerManager+getSystemTimerManager = do+  Just mgr <- readIORef timerManager+  return mgr++foreign import ccall unsafe "getOrSetSystemTimerThreadEventManagerStore"+    getOrSetSystemTimerThreadEventManagerStore :: Ptr a -> IO (Ptr a)++timerManager :: IORef (Maybe TM.TimerManager)+timerManager = unsafePerformIO $ do+    em <- newIORef Nothing+    sharedCAF em getOrSetSystemTimerThreadEventManagerStore+{-# NOINLINE timerManager #-}++foreign import ccall unsafe "getOrSetSystemTimerThreadIOManagerThreadStore"+    getOrSetSystemTimerThreadIOManagerThreadStore :: Ptr a -> IO (Ptr a)++{-# NOINLINE timerManagerThreadVar #-}+timerManagerThreadVar :: MVar (Maybe ThreadId)+timerManagerThreadVar = unsafePerformIO $ do+   m <- newMVar Nothing+   sharedCAF m getOrSetSystemTimerThreadIOManagerThreadStore+ ensureIOManagerIsRunning :: IO () ensureIOManagerIsRunning   | not threaded = return ()   | otherwise = do-      startIOManagerThread+      startIOManagerThreads+      startTimerManagerThread -startIOManagerThread :: IO ()-startIOManagerThread = modifyMVar_ ioManager $ \old -> do+startIOManagerThreads :: IO ()+startIOManagerThreads =+  withMVar ioManagerLock $ \_ -> do+    eventManagerArray <- readIORef eventManager+    let (_, high) = boundsIOArray eventManagerArray+    forM_ [0..high] (startIOManagerThread eventManagerArray)+    writeIORef numEnabledEventManagers (high+1)++restartPollLoop :: EventManager -> Int -> IO ThreadId+restartPollLoop mgr i = do+  M.release mgr+  !t <- forkOn i $ loop mgr+  labelThread t "IOManager"+  return t++startIOManagerThread :: IOArray Int (Maybe (ThreadId, EventManager))+                        -> Int+                        -> IO ()+startIOManagerThread eventManagerArray i = do   let create = do-        !mgr <- new-        writeIORef eventManager $ Just mgr-        !t <- forkIO $ loop mgr+        !mgr <- new True+        !t <- forkOn i $ loop mgr         labelThread t "IOManager"+        writeIOArray eventManagerArray i (Just (t,mgr))+  old <- readIOArray eventManagerArray i+  case old of+    Nothing     -> create+    Just (t,em) -> do+      s <- threadStatus t+      case s of+        ThreadFinished -> create+        ThreadDied     -> do+          -- Sanity check: if the thread has died, there is a chance+          -- that event manager is still alive. This could happend during+          -- the fork, for example. In this case we should clean up+          -- open pipes and everything else related to the event manager.+          -- See #4449+          M.cleanup em+          create+        _other         -> return ()++startTimerManagerThread :: IO ()+startTimerManagerThread = modifyMVar_ timerManagerThreadVar $ \old -> do+  let create = do+        !mgr <- TM.new+        writeIORef timerManager $ Just mgr+        !t <- forkIO $ TM.loop mgr `finally` shutdownManagers+        labelThread t "TimerManager"         return $ Just t   case old of     Nothing            -> create@@ -139,17 +287,60 @@       s <- threadStatus t       case s of         ThreadFinished -> create-        ThreadDied     -> do +        ThreadDied     -> do           -- Sanity check: if the thread has died, there is a chance           -- that event manager is still alive. This could happend during           -- the fork, for example. In this case we should clean up           -- open pipes and everything else related to the event manager.           -- See #4449-          mem <- readIORef eventManager+          mem <- readIORef timerManager           _ <- case mem of                  Nothing -> return ()-                 Just em -> M.cleanup em+                 Just em -> TM.cleanup em           create         _other         -> return st +shutdownManagers :: IO ()+shutdownManagers =+  withMVar ioManagerLock $ \_ -> do+    eventManagerArray <- readIORef eventManager+    let (_, high) = boundsIOArray eventManagerArray+    forM_ [0..high] $ \i -> do+      mmgr <- readIOArray eventManagerArray i+      case mmgr of+        Nothing -> return ()+        Just (_,mgr) -> M.shutdown mgr+ foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool++ioManagerCapabilitiesChanged :: IO ()+ioManagerCapabilitiesChanged = do+  withMVar ioManagerLock $ \_ -> do+    new_n_caps <- getNumCapabilities+    numEnabled <- readIORef numEnabledEventManagers+    writeIORef numEnabledEventManagers new_n_caps+    eventManagerArray <- readIORef eventManager+    let (_, high) = boundsIOArray eventManagerArray+    let old_n_caps = high + 1+    if new_n_caps > old_n_caps+      then do new_eventManagerArray <- newIOArray (0, new_n_caps - 1) Nothing++              -- copy the existing values into the new array:+              forM_ [0..high] $ \i -> do+                Just (tid,mgr) <- readIOArray eventManagerArray i+                if i < numEnabled+                  then writeIOArray new_eventManagerArray i (Just (tid,mgr))+                  else do tid' <- restartPollLoop mgr i+                          writeIOArray new_eventManagerArray i (Just (tid',mgr))++              -- create new IO managers for the new caps:+              forM_ [old_n_caps..new_n_caps-1] $+                startIOManagerThread new_eventManagerArray++              -- update the event manager array reference:+              writeIORef eventManager new_eventManagerArray+      else when (new_n_caps > numEnabled) $+            forM_ [numEnabled..new_n_caps-1] $ \i -> do+              Just (_,mgr) <- readIOArray eventManagerArray i+              tid <- restartPollLoop mgr i+              writeIOArray eventManagerArray i (Just (tid,mgr))
+ GHC/Event/TimerManager.hs view
@@ -0,0 +1,270 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE BangPatterns+           , CPP+           , ExistentialQuantification+           , NoImplicitPrelude+           , TypeSynonymInstances+           , FlexibleInstances+  #-}++module GHC.Event.TimerManager+    ( -- * Types+      TimerManager++      -- * Creation+    , new+    , newWith+    , newDefaultBackend++      -- * Running+    , finished+    , loop+    , step+    , shutdown+    , cleanup+    , wakeManager++      -- * Registering interest in timeout events+    , TimeoutCallback+    , TimeoutKey+    , registerTimeout+    , updateTimeout+    , unregisterTimeout+    ) where++#include "EventConfig.h"++------------------------------------------------------------------------+-- Imports++import Control.Exception (finally)+import Control.Monad ((=<<), liftM, sequence_, when)+import Data.IORef (IORef, atomicModifyIORef', mkWeakIORef, newIORef, readIORef,+                   writeIORef)+import Data.Maybe (Maybe(..))+import Data.Monoid (mempty)+import GHC.Base+import GHC.Conc.Signal (runHandlers)+import GHC.Num (Num(..))+import GHC.Real ((/), fromIntegral )+import GHC.Show (Show(..))+import GHC.Event.Clock (getMonotonicTime)+import GHC.Event.Control+import GHC.Event.Internal (Backend, Event, evtRead, Timeout(..))+import GHC.Event.Unique (Unique, UniqueSource, newSource, newUnique)+import System.Posix.Types (Fd)++import qualified GHC.Event.Internal as I+import qualified GHC.Event.PSQ as Q++#if defined(HAVE_POLL)+import qualified GHC.Event.Poll   as Poll+#else+# error not implemented for this operating system+#endif++------------------------------------------------------------------------+-- Types++-- | A timeout registration cookie.+newtype TimeoutKey   = TK Unique+    deriving (Eq)++-- | Callback invoked on timeout events.+type TimeoutCallback = IO ()++data State = Created+           | Running+           | Dying+           | Finished+             deriving (Eq, Show)++-- | A priority search queue, with timeouts as priorities.+type TimeoutQueue = Q.PSQ TimeoutCallback++{-+Instead of directly modifying the 'TimeoutQueue' in+e.g. 'registerTimeout' we keep a list of edits to perform, in the form+of a chain of function closures, and have the I/O manager thread+perform the edits later.  This exist to address the following GC+problem:++Since e.g. 'registerTimeout' doesn't force the evaluation of the+thunks inside the 'emTimeouts' IORef a number of thunks build up+inside the IORef.  If the I/O manager thread doesn't evaluate these+thunks soon enough they'll get promoted to the old generation and+become roots for all subsequent minor GCs.++When the thunks eventually get evaluated they will each create a new+intermediate 'TimeoutQueue' that immediately becomes garbage.  Since+the thunks serve as roots until the next major GC these intermediate+'TimeoutQueue's will get copied unnecesarily in the next minor GC,+increasing GC time.  This problem is known as "floating garbage".++Keeping a list of edits doesn't stop this from happening but makes the+amount of data that gets copied smaller.++TODO: Evaluate the content of the IORef to WHNF on each insert once+this bug is resolved: http://hackage.haskell.org/trac/ghc/ticket/3838+-}++-- | An edit to apply to a 'TimeoutQueue'.+type TimeoutEdit = TimeoutQueue -> TimeoutQueue++-- | The event manager state.+data TimerManager = TimerManager+    { emBackend      :: !Backend+    , emTimeouts     :: {-# UNPACK #-} !(IORef TimeoutQueue)+    , emState        :: {-# UNPACK #-} !(IORef State)+    , emUniqueSource :: {-# UNPACK #-} !UniqueSource+    , emControl      :: {-# UNPACK #-} !Control+    }++------------------------------------------------------------------------+-- Creation++handleControlEvent :: TimerManager -> Fd -> Event -> IO ()+handleControlEvent mgr fd _evt = do+  msg <- readControlMessage (emControl mgr) fd+  case msg of+    CMsgWakeup      -> return ()+    CMsgDie         -> writeIORef (emState mgr) Finished+    CMsgSignal fp s -> runHandlers fp s++newDefaultBackend :: IO Backend+#if defined(HAVE_POLL)+newDefaultBackend = Poll.new+#else+newDefaultBackend = error "no back end for this platform"+#endif++-- | Create a new event manager.+new :: IO TimerManager+new = newWith =<< newDefaultBackend++newWith :: Backend -> IO TimerManager+newWith be = do+  timeouts <- newIORef Q.empty+  ctrl <- newControl True+  state <- newIORef Created+  us <- newSource+  _ <- mkWeakIORef state $ do+               st <- atomicModifyIORef' state $ \s -> (Finished, s)+               when (st /= Finished) $ do+                 I.delete be+                 closeControl ctrl+  let mgr = TimerManager { emBackend = be+                         , emTimeouts = timeouts+                         , emState = state+                         , emUniqueSource = us+                         , emControl = ctrl+                         }+  _ <- I.modifyFd be (controlReadFd ctrl) mempty evtRead+  _ <- I.modifyFd be (wakeupReadFd ctrl) mempty evtRead+  return mgr++-- | Asynchronously shuts down the event manager, if running.+shutdown :: TimerManager -> IO ()+shutdown mgr = do+  state <- atomicModifyIORef' (emState mgr) $ \s -> (Dying, s)+  when (state == Running) $ sendDie (emControl mgr)++finished :: TimerManager -> IO Bool+finished mgr = (== Finished) `liftM` readIORef (emState mgr)++cleanup :: TimerManager -> IO ()+cleanup mgr = do+  writeIORef (emState mgr) Finished+  I.delete (emBackend mgr)+  closeControl (emControl mgr)++------------------------------------------------------------------------+-- Event loop++-- | Start handling events.  This function loops until told to stop,+-- using 'shutdown'.+--+-- /Note/: This loop can only be run once per 'TimerManager', as it+-- closes all of its control resources when it finishes.+loop :: TimerManager -> IO ()+loop mgr = do+  state <- atomicModifyIORef' (emState mgr) $ \s -> case s of+    Created -> (Running, s)+    _       -> (s, s)+  case state of+    Created -> go `finally` cleanup mgr+    Dying   -> cleanup mgr+    _       -> do cleanup mgr+                  error $ "GHC.Event.Manager.loop: state is already " +++                      show state+ where+  go = do running <- step mgr+          when running go++step :: TimerManager -> IO Bool+step mgr = do+  timeout <- mkTimeout+  _ <- I.poll (emBackend mgr) (Just timeout) (handleControlEvent mgr)+  state <- readIORef (emState mgr)+  state `seq` return (state == Running)+ where++  -- | Call all expired timer callbacks and return the time to the+  -- next timeout.+  mkTimeout :: IO Timeout+  mkTimeout = do+      now <- getMonotonicTime+      (expired, timeout) <- atomicModifyIORef' (emTimeouts mgr) $ \tq ->+           let (expired, tq') = Q.atMost now tq+               timeout = case Q.minView tq' of+                 Nothing             -> Forever+                 Just (Q.E _ t _, _) ->+                     -- This value will always be positive since the call+                     -- to 'atMost' above removed any timeouts <= 'now'+                     let t' = t - now in t' `seq` Timeout t'+           in (tq', (expired, timeout))+      sequence_ $ map Q.value expired+      return timeout++-- | Wake up the event manager.+wakeManager :: TimerManager -> IO ()+wakeManager mgr = sendWakeup (emControl mgr)++------------------------------------------------------------------------+-- Registering interest in timeout events++-- | Register a timeout in the given number of microseconds.  The+-- returned 'TimeoutKey' can be used to later unregister or update the+-- timeout.  The timeout is automatically unregistered after the given+-- time has passed.+registerTimeout :: TimerManager -> Int -> TimeoutCallback -> IO TimeoutKey+registerTimeout mgr us cb = do+  !key <- newUnique (emUniqueSource mgr)+  if us <= 0 then cb+    else do+      now <- getMonotonicTime+      let expTime = fromIntegral us / 1000000.0 + now++      editTimeouts mgr (Q.insert key expTime cb)+      wakeManager mgr+  return $ TK key++-- | Unregister an active timeout.+unregisterTimeout :: TimerManager -> TimeoutKey -> IO ()+unregisterTimeout mgr (TK key) = do+  editTimeouts mgr (Q.delete key)+  wakeManager mgr++-- | Update an active timeout to fire in the given number of+-- microseconds.+updateTimeout :: TimerManager -> TimeoutKey -> Int -> IO ()+updateTimeout mgr (TK key) us = do+  now <- getMonotonicTime+  let expTime = fromIntegral us / 1000000.0 + now++  editTimeouts mgr (Q.adjust (const expTime) key)+  wakeManager mgr++editTimeouts :: TimerManager -> TimeoutEdit -> IO ()+editTimeouts mgr g = atomicModifyIORef' (emTimeouts mgr) $ \tq -> (g tq, ())+
GHC/Exception.lhs view
@@ -21,11 +21,16 @@ --  ----------------------------------------------------------------------------- --- #hide-module GHC.Exception where+module GHC.Exception+       ( Exception(..)    -- Class+       , throw+       , SomeException(..), ErrorCall(..), ArithException(..)+       , divZeroException, overflowException, ratioZeroDenomException+       , errorCallException+       ) where  import Data.Maybe-import {-# SOURCE #-} Data.Typeable (Typeable, cast)+import Data.Typeable (Typeable, cast)    -- loop: Data.Typeable -> GHC.Err -> GHC.Exception import GHC.Base import GHC.Show@@ -165,14 +170,17 @@ \begin{code} -- |This is thrown when the user calls 'error'. The @String@ is the -- argument given to 'error'.-data ErrorCall = ErrorCall String-    deriving Typeable+newtype ErrorCall = ErrorCall String+    deriving (Eq, Ord, Typeable)  instance Exception ErrorCall  instance Show ErrorCall where     showsPrec _ (ErrorCall err) = showString err +errorCallException :: String -> SomeException+errorCallException s = toException (ErrorCall s)+ -----  -- |Arithmetic exceptions.@@ -182,9 +190,14 @@   | LossOfPrecision   | DivideByZero   | Denormal-  | RatioZeroDenominator+  | RatioZeroDenominator -- ^ /Since: 4.6.0.0/   deriving (Eq, Ord, Typeable) +divZeroException, overflowException, ratioZeroDenomException  :: SomeException+divZeroException  	= toException DivideByZero+overflowException 	= toException Overflow+ratioZeroDenomException = toException RatioZeroDenominator+ instance Exception ArithException  instance Show ArithException where@@ -194,5 +207,4 @@   showsPrec _ DivideByZero    = showString "divide by zero"   showsPrec _ Denormal        = showString "denormal"   showsPrec _ RatioZeroDenominator = showString "Ratio has zero denominator"- \end{code}
+ GHC/Exception.lhs-boot view
@@ -0,0 +1,38 @@+This SOURCE-imported hs-boot module cuts a big dependency loop:++         GHC.Exception+imports  Data.Maybe+imports  GHC.Base+imports  GHC.Err+imports  {-# SOURCE #-} GHC.Exception++More dramatically++         GHC.Exception+imports  Data.Typeable+imports  Data.Typeable.Internals+imports  GHC.Arr (fingerprint representation etc)+imports  GHC.Real+imports  {-# SOURCE #-} GHC.Exception++However, GHC.Exceptions loop-breaking exports are all nice,+well-behaved, non-bottom values.  The clients use 'raise#'+to get a visibly-bottom value.++\begin{code}+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}++---------------------------------------------------------------------------+--                  Ghc.Exception.hs-boot+---------------------------------------------------------------------------++module GHC.Exception ( SomeException, errorCallException,+                       divZeroException, overflowException, ratioZeroDenomException  +    ) where +import GHC.Types( Char )++data SomeException+divZeroException, overflowException, ratioZeroDenomException  :: SomeException+errorCallException :: [Char] -> SomeException+\end{code}
GHC/Exts.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE MagicHash, UnboxedTuples, DeriveDataTypeable #-}+{-# LANGUAGE MagicHash, UnboxedTuples, DeriveDataTypeable, TypeFamilies, MultiParamTypeClasses, FlexibleInstances #-}  ----------------------------------------------------------------------------- -- | -- Module      :  GHC.Exts -- Copyright   :  (c) The University of Glasgow 2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC Extensions)@@ -31,6 +31,7 @@         shiftL#, shiftRL#, iShiftL#, iShiftRA#, iShiftRL#,         uncheckedShiftL64#, uncheckedShiftRL64#,         uncheckedIShiftL64#, uncheckedIShiftRA64#,+        isTrue#,          -- * Fusion         build, augment,@@ -44,6 +45,13 @@         -- * Ids with special behaviour         lazy, inline, +        -- * Safe coercions+        --+        -- | These are available from the /Trustworthy/ module "Data.Coerce" as well+        --+        -- /Since: 4.7.0.0/+        Data.Coerce.coerce, Data.Coerce.Coercible,+         -- * Transform comprehensions         Down(..), groupWith, sortWith, the, @@ -57,18 +65,21 @@         currentCallStack,          -- * The Constraint kind-        Constraint+        Constraint,++        -- * Overloaded lists+        IsList(..)        ) where  import Prelude -import GHC.Prim-import GHC.Base-import GHC.Magic+import GHC.Prim hiding (coerce, Coercible)+import GHC.Base hiding (coerce, Coercible) -- implicitly comes from GHC.Prim import GHC.Word import GHC.Int import GHC.Ptr import GHC.Stack+import qualified Data.Coerce import Data.String import Data.List import Data.Data@@ -111,7 +122,7 @@  traceEvent :: String -> IO () traceEvent = Debug.Trace.traceEventIO-{-# DEPRECATED traceEvent "Use Debug.Trace.traceEvent or Debug.Trace.traceEventIO" #-}+{-# DEPRECATED traceEvent "Use 'Debug.Trace.traceEvent' or 'Debug.Trace.traceEventIO'" #-} -- deprecated in 7.4   {- **********************************************************************@@ -120,7 +131,7 @@ *									* ********************************************************************** -} --- Annotating a type with NoSpecConstr will make SpecConstr +-- Annotating a type with NoSpecConstr will make SpecConstr -- not specialise for arguments of that type.  -- This data type is defined here, rather than in the SpecConstr module@@ -130,3 +141,39 @@ data SpecConstrAnnotation = NoSpecConstr | ForceSpecConstr                 deriving( Data, Typeable, Eq ) ++{- **********************************************************************+*									*+*              The IsList class                                         *+*									*+********************************************************************** -}++-- | The 'IsList' class and its methods are intended to be used in+--   conjunction with the OverloadedLists extension.+--+-- /Since: 4.7.0.0/+class IsList l where+  -- | The 'Item' type function returns the type of items of the structure+  --   @l@.+  type Item l++  -- | The 'fromList' function constructs the structure @l@ from the given+  --   list of @Item l@+  fromList  :: [Item l] -> l++  -- | The 'fromListN' function takes the input list's length as a hint. Its+  --   behaviour should be equivalent to 'fromList'. The hint can be used to+  --   construct the structure @l@ more efficiently compared to 'fromList'. If+  --   the given hint does not equal to the input list's length the behaviour of+  --   'fromListN' is not specified.+  fromListN :: Int -> [Item l] -> l+  fromListN _ = fromList++  -- | The 'toList' function extracts a list of @Item l@ from the structure @l@.+  --   It should satisfy fromList . toList = id.+  toList :: l -> [Item l]++instance IsList [a] where+  type (Item [a]) = a+  fromList = id+  toList = id
GHC/Fingerprint.hs view
@@ -1,12 +1,11 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude+{-# LANGUAGE CPP+           , NoImplicitPrelude            , BangPatterns-           , ForeignFunctionInterface-           , EmptyDataDecls   #-}  -- ------------------------------------------------------------------------------- +-- --  (c) The University of Glasgow 2006 -- -- Fingerprints for recompilation checking and ABI versioning, and@@ -15,10 +14,11 @@ -- ----------------------------------------------------------------------------  module GHC.Fingerprint (-        Fingerprint(..), fingerprint0, +        Fingerprint(..), fingerprint0,         fingerprintData,         fingerprintString,-        fingerprintFingerprints+        fingerprintFingerprints,+        getFileHash    ) where  import GHC.IO@@ -26,8 +26,11 @@ import GHC.Num import GHC.List import GHC.Real+import GHC.Show import Foreign import Foreign.C+import System.IO+import Control.Monad (when)  import GHC.Fingerprint.Type @@ -67,12 +70,46 @@                     fromIntegral (w32 `shiftR` 8),                     fromIntegral w32] +-- | Computes the hash of a given file.+-- This function loops over the handle, running in constant memory.+--+-- /Since: 4.7.0.0/+getFileHash :: FilePath -> IO Fingerprint+getFileHash path = withBinaryFile path ReadMode $ \h -> do+  allocaBytes SIZEOF_STRUCT_MD5CONTEXT $ \pctxt -> do+    c_MD5Init pctxt++    processChunks h (\buf size -> c_MD5Update pctxt buf (fromIntegral size))++    allocaBytes 16 $ \pdigest -> do+      c_MD5Final pdigest pctxt+      peek (castPtr pdigest :: Ptr Fingerprint)++  where+    _BUFSIZE = 4096++    -- | Loop over _BUFSIZE sized chunks read from the handle,+    -- passing the callback a block of bytes and its size.+    processChunks :: Handle -> (Ptr Word8 -> Int -> IO ()) -> IO ()+    processChunks h f = allocaBytes _BUFSIZE $ \arrPtr ->++      let loop = do+            count <- hGetBuf h arrPtr _BUFSIZE+            eof <- hIsEOF h+            when (count /= _BUFSIZE && not eof) $ error $+              "GHC.Fingerprint.getFileHash: only read " ++ show count ++ " bytes"++            f arrPtr count++            when (not eof) loop++      in loop+ data MD5Context -foreign import ccall unsafe "MD5Init"+foreign import ccall unsafe "__hsbase_MD5Init"    c_MD5Init   :: Ptr MD5Context -> IO ()-foreign import ccall unsafe "MD5Update"+foreign import ccall unsafe "__hsbase_MD5Update"    c_MD5Update :: Ptr MD5Context -> Ptr Word8 -> CInt -> IO ()-foreign import ccall unsafe "MD5Final"+foreign import ccall unsafe "__hsbase_MD5Final"    c_MD5Final  :: Ptr Word8 -> Ptr MD5Context -> IO ()-
GHC/Fingerprint/Type.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} -- ------------------------------------------------------------------------------- +-- --  (c) The University of Glasgow 2006 -- -- Fingerprints for recompilation checking and ABI versioning, and@@ -12,10 +12,21 @@ module GHC.Fingerprint.Type (Fingerprint(..)) where  import GHC.Base+import GHC.List (length, replicate)+import GHC.Num+import GHC.Show import GHC.Word+import Numeric (showHex)  -- Using 128-bit MD5 fingerprints for now.  data Fingerprint = Fingerprint {-# UNPACK #-} !Word64 {-# UNPACK #-} !Word64   deriving (Eq, Ord) +instance Show Fingerprint where+  show (Fingerprint w1 w2) = hex16 w1 ++ hex16 w2+    where+      -- | Formats a 64 bit number as 16 digits hex.+      hex16 :: Word64 -> String+      hex16 i = let hex = showHex i ""+                 in replicate (16 - length hex) '0' ++ hex
GHC/Float.lhs view
@@ -4,7 +4,6 @@            , NoImplicitPrelude            , MagicHash            , UnboxedTuples-           , ForeignFunctionInterface   #-} -- We believe we could deorphan this module, by moving lots of things -- around, but we haven't got there yet:@@ -28,7 +27,6 @@  #include "ieee-flpt.h" --- #hide module GHC.Float( module GHC.Float, Float(..), Double(..), Float#, Double#                 , double2Int, int2Double, float2Int, int2Float )     where@@ -220,29 +218,34 @@     toRational (F# x#)  =         case decodeFloat_Int# x# of           (# m#, e# #)-            | e# >=# 0#                                 ->+            | isTrue# (e# >=# 0#)                               ->                     (smallInteger m# `shiftLInteger` e#) :% 1-            | (int2Word# m# `and#` 1##) `eqWord#` 0##   ->+            | isTrue# ((int2Word# m# `and#` 1##) `eqWord#` 0##) ->                     case elimZerosInt# m# (negateInt# e#) of                       (# n, d# #) -> n :% shiftLInteger 1 d#-            | otherwise                                 ->+            | otherwise                                         ->                     smallInteger m# :% shiftLInteger 1 (negateInt# e#)  instance  Fractional Float  where     (/) x y             =  divideFloat x y-    fromRational (n:%0)-        | n == 0        = 0/0-        | n < 0         = (-1)/0-        | otherwise     = 1/0-    fromRational (n:%d)-        | n == 0        = encodeFloat 0 0-        | n < 0         = -(fromRat'' minEx mantDigs (-n) d)-        | otherwise     = fromRat'' minEx mantDigs n d-          where-            minEx       = FLT_MIN_EXP-            mantDigs    = FLT_MANT_DIG+    {-# INLINE fromRational #-}+    fromRational (n:%d) = rationalToFloat n d     recip x             =  1.0 / x +rationalToFloat :: Integer -> Integer -> Float+{-# NOINLINE [1] rationalToFloat #-}+rationalToFloat n 0+    | n == 0        = 0/0+    | n < 0         = (-1)/0+    | otherwise     = 1/0+rationalToFloat n d+    | n == 0        = encodeFloat 0 0+    | n < 0         = -(fromRat'' minEx mantDigs (-n) d)+    | otherwise     = fromRat'' minEx mantDigs n d+      where+        minEx       = FLT_MIN_EXP+        mantDigs    = FLT_MANT_DIG+ -- RULES for Integer and Int {-# RULES "properFraction/Float->Integer"     properFraction = properFractionFloatInteger@@ -381,29 +384,34 @@     toRational (D# x#)  =         case decodeDoubleInteger x# of           (# m, e# #)-            | e# >=# 0#                                     ->+            | isTrue# (e# >=# 0#)                                  ->                 shiftLInteger m e# :% 1-            | (integerToWord m `and#` 1##) `eqWord#` 0##    ->+            | isTrue# ((integerToWord m `and#` 1##) `eqWord#` 0##) ->                 case elimZerosInteger m (negateInt# e#) of                     (# n, d# #) ->  n :% shiftLInteger 1 d#-            | otherwise                                     ->+            | otherwise                                            ->                 m :% shiftLInteger 1 (negateInt# e#)  instance  Fractional Double  where     (/) x y             =  divideDouble x y-    fromRational (n:%0)-        | n == 0        = 0/0-        | n < 0         = (-1)/0-        | otherwise     = 1/0-    fromRational (n:%d)-        | n == 0        = encodeFloat 0 0-        | n < 0         = -(fromRat'' minEx mantDigs (-n) d)-        | otherwise     = fromRat'' minEx mantDigs n d-          where-            minEx       = DBL_MIN_EXP-            mantDigs    = DBL_MANT_DIG+    {-# INLINE fromRational #-}+    fromRational (n:%d) = rationalToDouble n d     recip x             =  1.0 / x +rationalToDouble :: Integer -> Integer -> Double+{-# NOINLINE [1] rationalToDouble #-}+rationalToDouble n 0+    | n == 0        = 0/0+    | n < 0         = (-1)/0+    | otherwise     = 1/0+rationalToDouble n d+    | n == 0        = encodeFloat 0 0+    | n < 0         = -(fromRat'' minEx mantDigs (-n) d)+    | otherwise     = fromRat'' minEx mantDigs n d+      where+        minEx       = DBL_MIN_EXP+        mantDigs    = DBL_MANT_DIG+ instance  Floating Double  where     pi                  =  3.141592653589793238     exp x               =  expDouble x@@ -570,8 +578,14 @@  data FFFormat = FFExponent | FFFixed | FFGeneric +-- This is just a compatibility stub, as the "alt" argument formerly+-- didn't exist. formatRealFloat :: (RealFloat a) => FFFormat -> Maybe Int -> a -> String-formatRealFloat fmt decs x+formatRealFloat fmt decs x = formatRealFloatAlt fmt decs False x++formatRealFloatAlt :: (RealFloat a) => FFFormat -> Maybe Int -> Bool -> a+                 -> String+formatRealFloatAlt fmt decs alt x    | isNaN x                   = "NaN"    | isInfinite x              = if x < 0 then "-Infinity" else "Infinity"    | x < 0 || isNegativeZero x = '-':doFmt fmt (floatToDigits (toInteger base) (-x))@@ -625,13 +639,13 @@           (ei,is') = roundTo base (dec' + e) is           (ls,rs)  = splitAt (e+ei) (map intToDigit is')          in-         mk0 ls ++ (if null rs then "" else '.':rs)+         mk0 ls ++ (if null rs && not alt then "" else '.':rs)         else          let           (ei,is') = roundTo base dec' (replicate (-e) 0 ++ is)           d:ds' = map intToDigit (if ei > 0 then is' else 0:is')          in-         d : (if null ds' then "" else '.':ds')+         d : (if null ds' && not alt then "" else '.':ds')   roundTo :: Int -> Int -> [Int] -> (Int,[Int])@@ -825,6 +839,8 @@ "fromRat/Float"     fromRat = (fromRational :: Rational -> Float) "fromRat/Double"    fromRat = (fromRational :: Rational -> Double)   #-}++{-# NOINLINE [1] fromRat #-} fromRat :: (RealFloat a) => Rational -> a  -- Deal with special cases first, delegating the real work to fromRat'@@ -921,12 +937,12 @@ fromRat'' minEx@(I# me#) mantDigs@(I# md#) n d =     case integerLog2IsPowerOf2# d of       (# ld#, pw# #)-        | pw# ==# 0# ->+        | isTrue# (pw# ==# 0#) ->           case integerLog2# n of-            ln# | ln# >=# (ld# +# me# -# 1#) ->+            ln# | isTrue# (ln# >=# (ld# +# me# -# 1#)) ->                   -- this means n/d >= 2^(minEx-1), i.e. we are guaranteed to get                   -- a normalised number, round to mantDigs bits-                  if ln# <# md#+                  if isTrue# (ln# <# md#)                     then encodeFloat n (I# (negateInt# ld#))                     else let n'  = n `shiftR` (I# (ln# +# 1# -# md#))                              n'' = case roundingMode# n (ln# -# md#) of@@ -941,9 +957,9 @@                   -- the exponent for encoding is always minEx-mantDigs                   -- so we must shift right by (minEx-mantDigs) - (-ld)                   case ld# +# (me# -# md#) of-                    ld'# | ld'# <=# 0#  -> -- we would shift left, so we don't shift+                    ld'# | isTrue# (ld'# <=# 0#) -> -- we would shift left, so we don't shift                            encodeFloat n (I# ((me# -# md#) -# ld'#))-                         | ld'# <=# ln#  ->+                         | isTrue# (ld'# <=# ln#) ->                            let n' = n `shiftR` (I# ld'#)                            in case roundingMode# n (ld'# -# 1#) of                                 0# -> encodeFloat n' (minEx - mantDigs)@@ -951,7 +967,7 @@                                         then encodeFloat n' (minEx-mantDigs)                                         else encodeFloat (n' + 1) (minEx-mantDigs)                                 _  -> encodeFloat (n' + 1) (minEx-mantDigs)-                         | ld'# ># (ln# +# 1#)  -> encodeFloat 0 0 -- result of shift < 0.5+                         | isTrue# (ld'# ># (ln# +# 1#)) -> encodeFloat 0 0 -- result of shift < 0.5                          | otherwise ->  -- first bit of n shifted to 0.5 place                            case integerLog2IsPowerOf2# n of                             (# _, 0# #) -> encodeFloat 0 0  -- round to even@@ -1003,12 +1019,12 @@ negateFloat (F# x)        = F# (negateFloat# x)  gtFloat, geFloat, eqFloat, neFloat, ltFloat, leFloat :: Float -> Float -> Bool-gtFloat     (F# x) (F# y) = gtFloat# x y-geFloat     (F# x) (F# y) = geFloat# x y-eqFloat     (F# x) (F# y) = eqFloat# x y-neFloat     (F# x) (F# y) = neFloat# x y-ltFloat     (F# x) (F# y) = ltFloat# x y-leFloat     (F# x) (F# y) = leFloat# x y+gtFloat     (F# x) (F# y) = isTrue# (gtFloat# x y)+geFloat     (F# x) (F# y) = isTrue# (geFloat# x y)+eqFloat     (F# x) (F# y) = isTrue# (eqFloat# x y)+neFloat     (F# x) (F# y) = isTrue# (neFloat# x y)+ltFloat     (F# x) (F# y) = isTrue# (ltFloat# x y)+leFloat     (F# x) (F# y) = isTrue# (leFloat# x y)  expFloat, logFloat, sqrtFloat :: Float -> Float sinFloat, cosFloat, tanFloat  :: Float -> Float@@ -1043,12 +1059,12 @@ negateDouble (D# x)        = D# (negateDouble# x)  gtDouble, geDouble, eqDouble, neDouble, leDouble, ltDouble :: Double -> Double -> Bool-gtDouble    (D# x) (D# y) = x >## y-geDouble    (D# x) (D# y) = x >=## y-eqDouble    (D# x) (D# y) = x ==## y-neDouble    (D# x) (D# y) = x /=## y-ltDouble    (D# x) (D# y) = x <## y-leDouble    (D# x) (D# y) = x <=## y+gtDouble    (D# x) (D# y) = isTrue# (x >##  y)+geDouble    (D# x) (D# y) = isTrue# (x >=## y)+eqDouble    (D# x) (D# y) = isTrue# (x ==## y)+neDouble    (D# x) (D# y) = isTrue# (x /=## y)+ltDouble    (D# x) (D# y) = isTrue# (x <##  y)+leDouble    (D# x) (D# y) = isTrue# (x <=## y)  double2Float :: Double -> Float double2Float (D# x) = F# (double2Float# x)@@ -1098,9 +1114,18 @@ %*********************************************************  \begin{code}++word2Double :: Word -> Double+word2Double (W# w) = D# (word2Double# w)++word2Float :: Word -> Float+word2Float (W# w) = F# (word2Float# w)+ {-# RULES "fromIntegral/Int->Float"   fromIntegral = int2Float "fromIntegral/Int->Double"  fromIntegral = int2Double+"fromIntegral/Word->Float"  fromIntegral = word2Float+"fromIntegral/Word->Double" fromIntegral = word2Double "realToFrac/Float->Float"   realToFrac   = id :: Float -> Float "realToFrac/Float->Double"  realToFrac   = float2Double "realToFrac/Double->Float"  realToFrac   = double2Float
GHC/Float/ConversionUtils.hs view
@@ -19,7 +19,6 @@  #include "MachDeps.h" --- #hide module GHC.Float.ConversionUtils ( elimZerosInteger, elimZerosInt# ) where  import GHC.Base@@ -41,9 +40,9 @@ elim64# :: Int64# -> Int# -> (# Integer, Int# #) elim64# n e =     case zeroCount (toByte64# n) of-      t | e <=# t   -> (# int64ToInteger (uncheckedIShiftRA64# n e), 0# #)-        | t <# 8#   -> (# int64ToInteger (uncheckedIShiftRA64# n t), e -# t #)-        | otherwise -> elim64# (uncheckedIShiftRA64# n 8#) (e -# 8#)+      t | isTrue# (e <=# t) -> (# int64ToInteger (uncheckedIShiftRA64# n e), 0# #)+        | isTrue# (t <# 8#) -> (# int64ToInteger (uncheckedIShiftRA64# n t), e -# t #)+        | otherwise         -> elim64# (uncheckedIShiftRA64# n 8#) (e -# 8#)  #else @@ -62,9 +61,9 @@ elimZerosInt# :: Int# -> Int# -> (# Integer, Int# #) elimZerosInt# n e =     case zeroCount (toByte# n) of-      t | e <=# t   -> (# smallInteger (uncheckedIShiftRA# n e), 0# #)-        | t <# 8#   -> (# smallInteger (uncheckedIShiftRA# n t), e -# t #)-        | otherwise -> elimZerosInt# (uncheckedIShiftRA# n 8#) (e -# 8#)+      t | isTrue# (e <=# t) -> (# smallInteger (uncheckedIShiftRA# n e), 0# #)+        | isTrue# (t <# 8#) -> (# smallInteger (uncheckedIShiftRA# n t), e -# t #)+        | otherwise         -> elimZerosInt# (uncheckedIShiftRA# n 8#) (e -# 8#)  {-# INLINE zeroCount #-} zeroCount :: Int# -> Int#@@ -87,9 +86,11 @@               case writeInt8Array# mba 0# 8# s1 of                 s2 ->                   let fillA step val idx st-                        | idx <# 256# = case writeInt8Array# mba idx val st of+                        | isTrue# (idx <# 256#) =+                                        case writeInt8Array# mba idx val st of                                           nx -> fillA step val (idx +# step) nx-                        | step <# 256# = fillA (2# *# step) (val +# 1#) step  st+                        | isTrue# (step <# 256#) =+                                        fillA (2# *# step) (val +# 1#) step  st                         | otherwise   = st                   in case fillA 2# 0# 1# s2 of                        s3 -> case unsafeFreezeByteArray# mba s3 of
GHC/Float/RealFracMethods.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, MagicHash, UnboxedTuples, ForeignFunctionInterface,-    NoImplicitPrelude #-}+{-# LANGUAGE CPP, MagicHash, UnboxedTuples, NoImplicitPrelude #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -22,7 +21,6 @@  #include "MachDeps.h" --- #hide module GHC.Float.RealFracMethods     ( -- * Double methods       -- ** Integer results@@ -99,7 +97,7 @@ -- of performance. properFractionFloatInt :: Float -> (Int, Float) properFractionFloatInt (F# x) =-    if x `eqFloat#` 0.0#+    if isTrue# (x `eqFloat#` 0.0#)         then (I# 0#, F# 0.0#)         else case float2Int# x of                 n -> (I# n, F# (x `minusFloat#` int2Float# n))@@ -109,14 +107,14 @@ floorFloatInt :: Float -> Int floorFloatInt (F# x) =     case float2Int# x of-      n | x `ltFloat#` int2Float# n -> I# (n -# 1#)-        | otherwise                 -> I# n+      n | isTrue# (x `ltFloat#` int2Float# n) -> I# (n -# 1#)+        | otherwise                           -> I# n  ceilingFloatInt :: Float -> Int ceilingFloatInt (F# x) =     case float2Int# x of-      n | int2Float# n `ltFloat#` x  -> I# (n +# 1#)-        | otherwise                 -> I# n+      n | isTrue# (int2Float# n `ltFloat#` x) -> I# (n +# 1#)+        | otherwise                           -> I# n  roundFloatInt :: Float -> Int roundFloatInt x = float2Int (c_rintFloat x)@@ -137,10 +135,10 @@ properFractionFloatInteger v@(F# x) =     case decodeFloat_Int# x of       (# m, e #)-        | e <# 0#   ->+        | isTrue# (e <# 0#) ->           case negateInt# e of-            s | s ># 23#    -> (0, v)-              | m <# 0#     ->+            s | isTrue# (s ># 23#) -> (0, v)+              | isTrue# (m <#  0#) ->                 case negateInt# (negateInt# m `uncheckedIShiftRA#` s) of                   k -> (smallInteger k,                             case m -# (k `uncheckedIShiftL#` s) of@@ -165,10 +163,10 @@ floorFloatInteger (F# x) =     case decodeFloat_Int# x of       (# m, e #)-        | e <# 0#   ->+        | isTrue# (e <# 0#) ->           case negateInt# e of-            s | s ># 23#    -> if m <# 0# then (-1) else 0-              | otherwise   -> smallInteger (m `uncheckedIShiftRA#` s)+            s | isTrue# (s ># 23#) -> if isTrue# (m <# 0#) then (-1) else 0+              | otherwise          -> smallInteger (m `uncheckedIShiftRA#` s)         | otherwise -> shiftLInteger (smallInteger m) e  -- ceiling x = -floor (-x)@@ -195,7 +193,7 @@ -- of performance. properFractionDoubleInt :: Double -> (Int, Double) properFractionDoubleInt (D# x) =-    if x ==## 0.0##+    if isTrue# (x ==## 0.0##)         then (I# 0#, D# 0.0##)         else case double2Int# x of                 n -> (I# n, D# (x -## int2Double# n))@@ -205,14 +203,14 @@ floorDoubleInt :: Double -> Int floorDoubleInt (D# x) =     case double2Int# x of-      n | x <## int2Double# n   -> I# (n -# 1#)-        | otherwise             -> I# n+      n | isTrue# (x <## int2Double# n) -> I# (n -# 1#)+        | otherwise                     -> I# n  ceilingDoubleInt :: Double -> Int ceilingDoubleInt (D# x) =     case double2Int# x of-      n | int2Double# n <## x   -> I# (n +# 1#)-        | otherwise             -> I# n+      n | isTrue# (int2Double# n <## x) -> I# (n +# 1#)+        | otherwise                     -> I# n  roundDoubleInt :: Double -> Int roundDoubleInt x = double2Int (c_rintDouble x)@@ -235,10 +233,10 @@ properFractionDoubleInteger v@(D# x) =     case decodeDoubleInteger x of       (# m, e #)-        | e <# 0#   ->+        | isTrue# (e <# 0#) ->           case negateInt# e of-            s | s ># 52#    -> (0, v)-              | m < 0       ->+            s | isTrue# (s ># 52#) -> (0, v)+              | m < 0                 ->                 case TO64 (negateInteger m) of                   n ->                     case n `uncheckedIShiftRA64#` s of@@ -269,10 +267,10 @@ floorDoubleInteger (D# x) =     case decodeDoubleInteger x of       (# m, e #)-        | e <# 0#   ->+        | isTrue# (e <# 0#) ->           case negateInt# e of-            s | s ># 52#    -> if m < 0 then (-1) else 0-              | otherwise   ->+            s | isTrue# (s ># 52#) -> if m < 0 then (-1) else 0+              | otherwise          ->                 case TO64 m of                   n -> FROM64 (n `uncheckedIShiftRA64#` s)         | otherwise -> shiftLInteger m e@@ -314,7 +312,7 @@ double2Integer (D# x) =     case decodeDoubleInteger x of       (# m, e #)-        | e <# 0#   ->+        | isTrue# (e <# 0#) ->           case TO64 m of             n -> FROM64 (n `uncheckedIShiftRA64#` negateInt# e)         | otherwise -> shiftLInteger m e@@ -324,8 +322,8 @@ float2Integer (F# x) =     case decodeFloat_Int# x of       (# m, e #)-        | e <# 0#   -> smallInteger (m `uncheckedIShiftRA#` negateInt# e)-        | otherwise -> shiftLInteger (smallInteger m) e+        | isTrue# (e <# 0#) -> smallInteger (m `uncheckedIShiftRA#` negateInt# e)+        | otherwise         -> shiftLInteger (smallInteger m) e  -- Foreign imports, the rounding is done faster in C when the value -- isn't integral, so we call out for rounding. For values of large
GHC/Foreign.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -20,20 +20,20 @@          -- conversion of C strings into Haskell strings     ---    peekCString,       -- :: TextEncoding -> CString    -> IO String-    peekCStringLen,    -- :: TextEncoding -> CStringLen -> IO String+    peekCString,+    peekCStringLen,          -- conversion of Haskell strings into C strings     ---    newCString,        -- :: TextEncoding -> String -> IO CString-    newCStringLen,     -- :: TextEncoding -> String -> IO CStringLen+    newCString,+    newCStringLen,          -- conversion of Haskell strings into C strings using temporary storage     ---    withCString,       -- :: TextEncoding -> String -> (CString    -> IO a) -> IO a-    withCStringLen,    -- :: TextEncoding -> String -> (CStringLen -> IO a) -> IO a+    withCString,+    withCStringLen,     -    charIsRepresentable, -- :: TextEncoding -> Char -> IO Bool+    charIsRepresentable,   ) where  import Foreign.Marshal.Array@@ -49,13 +49,12 @@ import Data.Tuple (fst) import Data.Maybe -import {-# SOURCE #-} System.Posix.Internals (puts) import GHC.Show ( show )  import Foreign.Marshal.Alloc import Foreign.ForeignPtr -import GHC.Err (undefined)+import GHC.Debug import GHC.List import GHC.Num import GHC.Base@@ -70,7 +69,7 @@ c_DEBUG_DUMP = False  putDebugMsg :: String -> IO ()-putDebugMsg | c_DEBUG_DUMP = puts+putDebugMsg | c_DEBUG_DUMP = debugLn             | otherwise    = const (return ())  
GHC/ForeignPtr.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude+{-# LANGUAGE NoImplicitPrelude            , BangPatterns            , MagicHash            , UnboxedTuples@@ -22,7 +21,6 @@ --  ----------------------------------------------------------------------------- --- #hide module GHC.ForeignPtr   (         ForeignPtr(..),@@ -51,15 +49,11 @@ import Data.Typeable  import GHC.Show-import GHC.List         ( null ) import GHC.Base import GHC.IORef import GHC.STRef        ( STRef(..) ) import GHC.Ptr          ( Ptr(..), FunPtr(..) )-import GHC.Err -#include "Typeable.h"- -- |The type 'ForeignPtr' represents references to objects that are -- maintained in a foreign language, i.e., that are not part of the -- data structures usually managed by the Haskell storage manager.@@ -77,6 +71,7 @@ -- class 'Storable'. -- data ForeignPtr a = ForeignPtr Addr# ForeignPtrContents+                    deriving Typeable         -- we cache the Addr# in the ForeignPtr object, but attach         -- the finalizer to the IORef (or the MutableByteArray# in         -- the case of a MallocPtr).  The aim of the representation@@ -87,17 +82,14 @@         -- object, because that ensures that whatever the finalizer is         -- attached to is kept alive. -INSTANCE_TYPEABLE1(ForeignPtr,foreignPtrTc,"ForeignPtr")- data Finalizers   = NoFinalizers-  | CFinalizers-  | HaskellFinalizers-    deriving Eq+  | CFinalizers (Weak# ())+  | HaskellFinalizers [IO ()]  data ForeignPtrContents-  = PlainForeignPtr !(IORef (Finalizers, [IO ()]))-  | MallocPtr      (MutableByteArray# RealWorld) !(IORef (Finalizers, [IO ()]))+  = PlainForeignPtr !(IORef Finalizers)+  | MallocPtr      (MutableByteArray# RealWorld) !(IORef Finalizers)   | PlainPtr       (MutableByteArray# RealWorld)  instance Eq (ForeignPtr a) where@@ -114,6 +106,8 @@ -- finalisation time, gets as an argument a plain pointer variant of the -- foreign pointer that the finalizer is associated with. -- +-- Note that the foreign function /must/ use the @ccall@ calling convention.+-- type FinalizerPtr a        = FunPtr (Ptr a -> IO ()) type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> IO ()) @@ -163,7 +157,7 @@         doMalloc a           | I# size < 0 = error "mallocForeignPtr: size must be >= 0"           | otherwise = do-          r <- newIORef (NoFinalizers, [])+          r <- newIORef NoFinalizers           IO $ \s ->             case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) ->              (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))@@ -178,7 +172,7 @@ mallocForeignPtrBytes size | size < 0 =   error "mallocForeignPtrBytes: size must be >= 0" mallocForeignPtrBytes (I# size) = do -  r <- newIORef (NoFinalizers, [])+  r <- newIORef NoFinalizers   IO $ \s ->      case newPinnedByteArray# size s      of { (# s', mbarr# #) ->        (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))@@ -192,7 +186,7 @@ mallocForeignPtrAlignedBytes size _align | size < 0 =   error "mallocForeignPtrAlignedBytes: size must be >= 0" mallocForeignPtrAlignedBytes (I# size) (I# align) = do-  r <- newIORef (NoFinalizers, [])+  r <- newIORef NoFinalizers   IO $ \s ->      case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) ->        (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))@@ -260,12 +254,7 @@   MallocPtr     _ r -> f r >> return ()   _ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"  where-    f r =-      noMixing CFinalizers r $-        IO $ \s ->-          case r of { IORef (STRef r#) ->-          case mkWeakForeignEnv# r# () fp p 0# nullAddr# s of { (# s1, w #) ->-          (# s1, finalizeForeign w #) }}+    f r = insertCFinalizer r fp 0# nullAddr# p  addForeignPtrFinalizerEnv ::   FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()@@ -278,18 +267,7 @@   MallocPtr     _ r -> f r >> return ()   _ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"  where-    f r =-      noMixing CFinalizers r $-        IO $ \s ->-          case r of { IORef (STRef r#) ->-          case mkWeakForeignEnv# r# () fp p 1# ep s of { (# s1, w #) ->-          (# s1, finalizeForeign w #) }}--finalizeForeign :: Weak# () -> IO ()-finalizeForeign w = IO $ \s ->-  case finalizeWeak# w s of-    (# s1, 0#, _ #) -> (# s1, () #)-    (# s1, _ , f #) -> f s1+    f r = insertCFinalizer r fp 1# ep p  addForeignPtrConcFinalizer :: ForeignPtr a -> IO () -> IO () -- ^This function adds a finalizer to the given @ForeignPtr@.  The@@ -311,7 +289,7 @@  addForeignPtrConcFinalizer_ :: ForeignPtrContents -> IO () -> IO () addForeignPtrConcFinalizer_ (PlainForeignPtr r) finalizer = do-  noFinalizers <- noMixing HaskellFinalizers r (return finalizer)+  noFinalizers <- insertHaskellFinalizer r finalizer   if noFinalizers      then IO $ \s ->               case r of { IORef (STRef r#) ->@@ -319,7 +297,7 @@               (# s1, () #) }}      else return () addForeignPtrConcFinalizer_ f@(MallocPtr fo r) finalizer = do-  noFinalizers <- noMixing HaskellFinalizers r (return finalizer)+  noFinalizers <- insertHaskellFinalizer r finalizer   if noFinalizers      then  IO $ \s ->                 case mkWeak# fo () (do foreignPtrFinalizer r; touch f) s of@@ -329,28 +307,69 @@ addForeignPtrConcFinalizer_ _ _ =   error "GHC.ForeignPtr: attempt to add a finalizer to plain pointer" -noMixing ::-  Finalizers -> IORef (Finalizers, [IO ()]) -> IO (IO ()) -> IO Bool-noMixing ftype0 r mkF = do-  (ftype, fs) <- readIORef r-  if ftype /= NoFinalizers && ftype /= ftype0-     then error ("GHC.ForeignPtr: attempt to mix Haskell and C finalizers " ++-                 "in the same ForeignPtr")-     else do-       f <- mkF-       writeIORef r (ftype0, f : fs)-       return (null fs)+insertHaskellFinalizer :: IORef Finalizers -> IO () -> IO Bool+insertHaskellFinalizer r f = do+  !wasEmpty <- atomicModifyIORef r $ \finalizers -> case finalizers of+      NoFinalizers -> (HaskellFinalizers [f], True)+      HaskellFinalizers fs -> (HaskellFinalizers (f:fs), False)+      _ -> noMixingError+  return wasEmpty -foreignPtrFinalizer :: IORef (Finalizers, [IO ()]) -> IO ()+-- | A box around Weak#, private to this module.+data MyWeak = MyWeak (Weak# ())++insertCFinalizer ::+  IORef Finalizers -> Addr# -> Int# -> Addr# -> Addr# -> IO ()+insertCFinalizer r fp flag ep p = do+  MyWeak w <- ensureCFinalizerWeak r+  IO $ \s -> case addCFinalizerToWeak# fp p flag ep w s of+      (# s1, 1# #) -> (# s1, () #)++      -- Failed to add the finalizer because some other thread+      -- has finalized w by calling foreignPtrFinalizer. We retry now.+      -- This won't be an infinite loop because that thread must have+      -- replaced the content of r before calling finalizeWeak#.+      (# s1, _ #) -> unIO (insertCFinalizer r fp flag ep p) s1++ensureCFinalizerWeak :: IORef Finalizers -> IO MyWeak+ensureCFinalizerWeak ref@(IORef (STRef r#)) = do+  fin <- readIORef ref+  case fin of+      CFinalizers weak -> return (MyWeak weak)+      HaskellFinalizers{} -> noMixingError+      NoFinalizers -> IO $ \s ->+          case mkWeakNoFinalizer# r# () s of { (# s1, w #) ->+          case atomicModifyMutVar# r# (update w) s1 of+              { (# s2, (weak, needKill ) #) ->+          if needKill+            then case finalizeWeak# w s2 of { (# s3, _, _ #) ->+              (# s3, weak #) }+            else (# s2, weak #) }}+  where+      update _ fin@(CFinalizers w) = (fin, (MyWeak w, True))+      update w NoFinalizers = (CFinalizers w, (MyWeak w, False))+      update _ _ = noMixingError++noMixingError :: a+noMixingError = error $+   "GHC.ForeignPtr: attempt to mix Haskell and C finalizers " +++   "in the same ForeignPtr"++foreignPtrFinalizer :: IORef Finalizers -> IO () foreignPtrFinalizer r = do-  fs <- atomicModifyIORef r $ \(f,fs) -> ((f,[]), fs) -- atomic, see #7170-  sequence_ fs+  fs <- atomicModifyIORef r $ \fs -> (NoFinalizers, fs) -- atomic, see #7170+  case fs of+    NoFinalizers -> return ()+    CFinalizers w -> IO $ \s -> case finalizeWeak# w s of+        (# s1, 1#, f #) -> f s1+        (# s1, _, _ #) -> (# s1, () #)+    HaskellFinalizers actions -> sequence_ actions  newForeignPtr_ :: Ptr a -> IO (ForeignPtr a) -- ^Turns a plain memory reference into a foreign pointer that may be -- associated with finalizers by using 'addForeignPtrFinalizer'. newForeignPtr_ (Ptr obj) =  do-  r <- newIORef (NoFinalizers, [])+  r <- newIORef NoFinalizers   return (ForeignPtr obj (PlainForeignPtr r))  touchForeignPtr :: ForeignPtr a -> IO ()
GHC/GHCi.hs view
@@ -17,7 +17,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.GHCi {-# WARNING "This is an unstable interface." #-} (         GHCiSandboxIO(..), NoIO()     ) where
GHC/Generics.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE Trustworthy            #-}+{-# LANGUAGE CPP                    #-} {-# LANGUAGE NoImplicitPrelude      #-}-{-# LANGUAGE EmptyDataDecls         #-} {-# LANGUAGE TypeSynonymInstances   #-} {-# LANGUAGE TypeOperators          #-} {-# LANGUAGE KindSignatures         #-}@@ -8,7 +8,541 @@ {-# LANGUAGE StandaloneDeriving     #-} {-# LANGUAGE DeriveGeneric          #-} +-----------------------------------------------------------------------------+-- |+-- Module      :  GHC.Generics+-- Copyright   :  (c) Universiteit Utrecht 2010-2011, University of Oxford 2012-2013+-- License     :  see libraries/base/LICENSE+-- +-- Maintainer  :  libraries@haskell.org+-- Stability   :  internal+-- Portability :  non-portable+--+-- /Since: 4.6.0.0/+-- +-- If you're using @GHC.Generics@, you should consider using the+-- <http://hackage.haskell.org/package/generic-deriving> package, which +-- contains many useful generic functions.+ module GHC.Generics  (+-- * Introduction+--+-- |+--+-- Datatype-generic functions are are based on the idea of converting values of+-- a datatype @T@ into corresponding values of a (nearly) isomorphic type @'Rep' T@.+-- The type @'Rep' T@ is+-- built from a limited set of type constructors, all provided by this module. A+-- datatype-generic function is then an overloaded function with instances+-- for most of these type constructors, together with a wrapper that performs+-- the mapping between @T@ and @'Rep' T@. By using this technique, we merely need+-- a few generic instances in order to implement functionality that works for any+-- representable type.+--+-- Representable types are collected in the 'Generic' class, which defines the+-- associated type 'Rep' as well as conversion functions 'from' and 'to'.+-- Typically, you will not define 'Generic' instances by hand, but have the compiler+-- derive them for you.++-- ** Representing datatypes+--+-- |+--+-- The key to defining your own datatype-generic functions is to understand how to+-- represent datatypes using the given set of type constructors.+--+-- Let us look at an example first:+--+-- @+-- data Tree a = Leaf a | Node (Tree a) (Tree a)+--   deriving 'Generic'+-- @+--+-- The above declaration (which requires the language pragma @DeriveGeneric@)+-- causes the following representation to be generated:+--+-- @+-- instance 'Generic' (Tree a) where+--   type 'Rep' (Tree a) =+--     'D1' D1Tree+--       ('C1' C1_0Tree+--          ('S1' 'NoSelector' ('Par0' a))+--        ':+:'+--        'C1' C1_1Tree+--          ('S1' 'NoSelector' ('Rec0' (Tree a))+--           ':*:'+--           'S1' 'NoSelector' ('Rec0' (Tree a))))+--   ...+-- @+--+-- /Hint:/ You can obtain information about the code being generated from GHC by passing+-- the @-ddump-deriv@ flag. In GHCi, you can expand a type family such as 'Rep' using+-- the @:kind!@ command.+--+#if 0+-- /TODO:/ Newer GHC versions abandon the distinction between 'Par0' and 'Rec0' and will+-- use 'Rec0' everywhere.+--+#endif+-- This is a lot of information! However, most of it is actually merely meta-information+-- that makes names of datatypes and constructors and more available on the type level.+--+-- Here is a reduced representation for 'Tree' with nearly all meta-information removed,+-- for now keeping only the most essential aspects:+--+-- @+-- instance 'Generic' (Tree a) where+--   type 'Rep' (Tree a) =+--     'Par0' a+--     ':+:'+--     ('Rec0' (Tree a) ':*:' 'Rec0' (Tree a))+-- @+--+-- The @Tree@ datatype has two constructors. The representation of individual constructors+-- is combined using the binary type constructor ':+:'.+--+-- The first constructor consists of a single field, which is the parameter @a@. This is+-- represented as @'Par0' a@.+--+-- The second constructor consists of two fields. Each is a recursive field of type @Tree a@,+-- represented as @'Rec0' (Tree a)@. Representations of individual fields are combined using+-- the binary type constructor ':*:'.+--+-- Now let us explain the additional tags being used in the complete representation:+--+--    * The @'S1' 'NoSelector'@ indicates that there is no record field selector associated with+--      this field of the constructor.+--+--    * The @'C1' C1_0Tree@ and @'C1' C1_1Tree@ invocations indicate that the enclosed part is+--      the representation of the first and second constructor of datatype @Tree@, respectively.+--      Here, @C1_0Tree@ and @C1_1Tree@ are datatypes generated by the compiler as part of+--      @deriving 'Generic'@. These datatypes are proxy types with no values. They are useful+--      because they are instances of the type class 'Constructor'. This type class can be used+--      to obtain information about the constructor in question, such as its name+--      or infix priority.+--+--    * The @'D1' D1Tree@ tag indicates that the enclosed part is the representation of the+--      datatype @Tree@. Again, @D1Tree@ is a datatype generated by the compiler. It is a+--      proxy type, and is useful by being an instance of class 'Datatype', which+--      can be used to obtain the name of a datatype, the module it has been defined in, and+--      whether it has been defined using @data@ or @newtype@.++-- ** Derived and fundamental representation types+--+-- |+--+-- There are many datatype-generic functions that do not distinguish between positions that+-- are parameters or positions that are recursive calls. There are also many datatype-generic+-- functions that do not care about the names of datatypes and constructors at all. To keep+-- the number of cases to consider in generic functions in such a situation to a minimum,+-- it turns out that many of the type constructors introduced above are actually synonyms,+-- defining them to be variants of a smaller set of constructors.++-- *** Individual fields of constructors: 'K1'+--+-- |+--+-- The type constructors 'Par0' and 'Rec0' are variants of 'K1':+--+-- @+-- type 'Par0' = 'K1' 'P'+-- type 'Rec0' = 'K1' 'R'+-- @+--+-- Here, 'P' and 'R' are type-level proxies again that do not have any associated values.++-- *** Meta information: 'M1'+--+-- |+--+-- The type constructors 'S1', 'C1' and 'D1' are all variants of 'M1':+--+-- @+-- type 'S1' = 'M1' 'S'+-- type 'C1' = 'M1' 'C'+-- type 'D1' = 'M1' 'D'+-- @+--+-- The types 'S', 'C' and 'R' are once again type-level proxies, just used to create+-- several variants of 'M1'.++-- *** Additional generic representation type constructors+--+-- |+--+-- Next to 'K1', 'M1', ':+:' and ':*:' there are a few more type constructors that occur+-- in the representations of other datatypes.++-- **** Empty datatypes: 'V1'+--+-- |+--+-- For empty datatypes, 'V1' is used as a representation. For example,+--+-- @+-- data Empty deriving 'Generic'+-- @+--+-- yields+--+-- @+-- instance 'Generic' Empty where+--   type 'Rep' Empty = 'D1' D1Empty 'V1'+-- @++-- **** Constructors without fields: 'U1'+--+-- |+--+-- If a constructor has no arguments, then 'U1' is used as its representation. For example+-- the representation of 'Bool' is+--+-- @+-- instance 'Generic' Bool where+--   type 'Rep' Bool =+--     'D1' D1Bool+--       ('C1' C1_0Bool 'U1' ':+:' 'C1' C1_1Bool 'U1')+-- @++-- *** Representation of types with many constructors or many fields+--+-- |+--+-- As ':+:' and ':*:' are just binary operators, one might ask what happens if the+-- datatype has more than two constructors, or a constructor with more than two+-- fields. The answer is simple: the operators are used several times, to combine+-- all the constructors and fields as needed. However, users /should not rely on+-- a specific nesting strategy/ for ':+:' and ':*:' being used. The compiler is+-- free to choose any nesting it prefers. (In practice, the current implementation+-- tries to produce a more or less balanced nesting, so that the traversal of the+-- structure of the datatype from the root to a particular component can be performed+-- in logarithmic rather than linear time.)++-- ** Defining datatype-generic functions+--+-- |+--+-- A datatype-generic function comprises two parts:+--+--    1. /Generic instances/ for the function, implementing it for most of the representation+--       type constructors introduced above.+--+--    2. A /wrapper/ that for any datatype that is in `Generic`, performs the conversion+--       between the original value and its `Rep`-based representation and then invokes the+--       generic instances.+--+-- As an example, let us look at a function 'encode' that produces a naive, but lossless+-- bit encoding of values of various datatypes. So we are aiming to define a function+--+-- @+-- encode :: 'Generic' a => a -> [Bool]+-- @+--+-- where we use 'Bool' as our datatype for bits.+--+-- For part 1, we define a class @Encode'@. Perhaps surprisingly, this class is parameterized+-- over a type constructor @f@ of kind @* -> *@. This is a technicality: all the representation+-- type constructors operate with kind @* -> *@ as base kind. But the type argument is never+-- being used. This may be changed at some point in the future. The class has a single method,+-- and we use the type we want our final function to have, but we replace the occurrences of+-- the generic type argument @a@ with @f p@ (where the @p@ is any argument; it will not be used).+--+-- > class Encode' f where+-- >   encode' :: f p -> [Bool]+--+-- With the goal in mind to make @encode@ work on @Tree@ and other datatypes, we now define+-- instances for the representation type constructors 'V1', 'U1', ':+:', ':*:', 'K1', and 'M1'.++-- *** Definition of the generic representation types+--+-- |+--+-- In order to be able to do this, we need to know the actual definitions of these types:+--+-- @+-- data    'V1'        p                       -- lifted version of Empty+-- data    'U1'        p = 'U1'                  -- lifted version of ()+-- data    (':+:') f g p = 'L1' (f p) | 'R1' (g p) -- lifted version of 'Either'+-- data    (':*:') f g p = (f p) ':*:' (g p)     -- lifted version of (,) +-- newtype 'K1'    i c p = 'K1' { 'unK1' :: c }    -- a container for a c+-- newtype 'M1'  i t f p = 'M1' { 'unM1' :: f p }  -- a wrapper+-- @+--+-- So, 'U1' is just the unit type, ':+:' is just a binary choice like 'Either',+-- ':*:' is a binary pair like the pair constructor @(,)@, and 'K1' is a value+-- of a specific type @c@, and 'M1' wraps a value of the generic type argument,+-- which in the lifted world is an @f p@ (where we do not care about @p@).++-- *** Generic instances+--+-- |+--+-- The instance for 'V1' is slightly awkward (but also rarely used):+--+-- @+-- instance Encode' 'V1' where+--   encode' x = undefined+-- @+--+-- There are no values of type @V1 p@ to pass (except undefined), so this is+-- actually impossible. One can ask why it is useful to define an instance for+-- 'V1' at all in this case? Well, an empty type can be used as an argument to+-- a non-empty type, and you might still want to encode the resulting type.+-- As a somewhat contrived example, consider @[Empty]@, which is not an empty+-- type, but contains just the empty list. The 'V1' instance ensures that we+-- can call the generic function on such types.+--+-- There is exactly one value of type 'U1', so encoding it requires no+-- knowledge, and we can use zero bits:+--+-- @+-- instance Encode' 'U1' where+--   encode' 'U1' = []+-- @+--+-- In the case for ':+:', we produce 'False' or 'True' depending on whether+-- the constructor of the value provided is located on the left or on the right:+--+-- @+-- instance (Encode' f, Encode' g) => Encode' (f ':+:' g) where+--   encode' ('L1' x) = False : encode' x+--   encode' ('R1' x) = True  : encode' x+-- @+--+-- In the case for ':*:', we append the encodings of the two subcomponents:+--+-- @+-- instance (Encode' f, Encode' g) => Encode' (f ':*:' g) where+--   encode' (x ':*:' y) = encode' x ++ encode' y+-- @+--+-- The case for 'K1' is rather interesting. Here, we call the final function+-- 'encode' that we yet have to define, recursively. We will use another type+-- class 'Encode' for that function:+--+-- @+-- instance (Encode c) => Encode' ('K1' i c) where+--   encode' ('K1' x) = encode x+-- @+--+-- Note how 'Par0' and 'Rec0' both being mapped to 'K1' allows us to define+-- a uniform instance here.+--+-- Similarly, we can define a uniform instance for 'M1', because we completely+-- disregard all meta-information:+--+-- @+-- instance (Encode' f) => Encode' ('M1' i t f) where+--   encode' ('M1' x) = encode' x+-- @+--+-- Unlike in 'K1', the instance for 'M1' refers to 'encode'', not 'encode'.++-- *** The wrapper and generic default+--+-- |+--+-- We now define class 'Encode' for the actual 'encode' function:+--+-- @+-- class Encode a where+--   encode :: a -> [Bool]+--   default encode :: ('Generic' a) => a -> [Bool]+--   encode x = encode' ('from' x)+-- @+--+-- The incoming 'x' is converted using 'from', then we dispatch to the+-- generic instances using 'encode''. We use this as a default definition+-- for 'encode'. We need the 'default encode' signature because ordinary+-- Haskell default methods must not introduce additional class constraints,+-- but our generic default does.+--+-- Defining a particular instance is now as simple as saying+--+-- @+-- instance (Encode a) => Encode (Tree a)+-- @+--+#if 0+-- /TODO:/ Add usage example?+--+#endif+-- The generic default is being used. In the future, it will hopefully be+-- possible to use @deriving Encode@ as well, but GHC does not yet support+-- that syntax for this situation.+--+-- Having 'Encode' as a class has the advantage that we can define+-- non-generic special cases, which is particularly useful for abstract+-- datatypes that have no structural representation. For example, given+-- a suitable integer encoding function 'encodeInt', we can define+--+-- @+-- instance Encode Int where+--   encode = encodeInt+-- @++-- *** Omitting generic instances+--+-- |+--+-- It is not always required to provide instances for all the generic+-- representation types, but omitting instances restricts the set of+-- datatypes the functions will work for:+--+--    * If no ':+:' instance is given, the function may still work for+--      empty datatypes or datatypes that have a single constructor,+--      but will fail on datatypes with more than one constructor.+--+--    * If no ':*:' instance is given, the function may still work for+--      datatypes where each constructor has just zero or one field,+--      in particular for enumeration types.+--+--    * If no 'K1' instance is given, the function may still work for+--      enumeration types, where no constructor has any fields.+--+--    * If no 'V1' instance is given, the function may still work for+--      any datatype that is not empty.+--+--    * If no 'U1' instance is given, the function may still work for+--      any datatype where each constructor has at least one field.+--+-- An 'M1' instance is always required (but it can just ignore the+-- meta-information, as is the case for 'encode' above).+#if 0+-- *** Using meta-information+--+-- |+--+-- TODO+#endif+-- ** Generic constructor classes+--+-- |+--+-- Datatype-generic functions as defined above work for a large class+-- of datatypes, including parameterized datatypes. (We have used 'Tree'+-- as our example above, which is of kind @* -> *@.) However, the+-- 'Generic' class ranges over types of kind @*@, and therefore, the+-- resulting generic functions (such as 'encode') must be parameterized+-- by a generic type argument of kind @*@.+--+-- What if we want to define generic classes that range over type+-- constructors (such as 'Functor', 'Traversable', or 'Foldable')?++-- *** The 'Generic1' class+--+-- |+--+-- Like 'Generic', there is a class 'Generic1' that defines a+-- representation 'Rep1' and conversion functions 'from1' and 'to1',+-- only that 'Generic1' ranges over types of kind @* -> *@.+-- The 'Generic1' class is also derivable.+--+-- The representation 'Rep1' is ever so slightly different from 'Rep'.+-- Let us look at 'Tree' as an example again:+--+-- @+-- data Tree a = Leaf a | Node (Tree a) (Tree a)+--   deriving 'Generic1'+-- @+--+-- The above declaration causes the following representation to be generated:+--+-- instance 'Generic1' Tree where+--   type 'Rep1' Tree =+--     'D1' D1Tree+--       ('C1' C1_0Tree+--          ('S1' 'NoSelector' 'Par1')+--        ':+:'+--        'C1' C1_1Tree+--          ('S1' 'NoSelector' ('Rec1' Tree)+--           ':*:'+--           'S1' 'NoSelector' ('Rec1' Tree)))+--   ...+--+-- The representation reuses 'D1', 'C1', 'S1' (and thereby 'M1') as well+-- as ':+:' and ':*:' from 'Rep'. (This reusability is the reason that we+-- carry around the dummy type argument for kind-@*@-types, but there are+-- already enough different names involved without duplicating each of+-- these.)+--+-- What's different is that we now use 'Par1' to refer to the parameter+-- (and that parameter, which used to be @a@), is not mentioned explicitly+-- by name anywhere; and we use 'Rec1' to refer to a recursive use of @Tree a@.++-- *** Representation of @* -> *@ types+--+-- |+--+-- Unlike 'Par0' and 'Rec0', the 'Par1' and 'Rec1' type constructors do not+-- map to 'K1'. They are defined directly, as follows:+--+-- @+-- newtype 'Par1'   p = 'Par1' { 'unPar1' ::   p } -- gives access to parameter p+-- newtype 'Rec1' f p = 'Rec1' { 'unRec1' :: f p } -- a wrapper+-- @+--+-- In 'Par1', the parameter @p@ is used for the first time, whereas 'Rec1' simply+-- wraps an application of @f@ to @p@.+--+-- Note that 'K1' (in the guise of 'Rec0') can still occur in a 'Rep1' representation,+-- namely when the datatype has a field that does not mention the parameter.+--+-- The declaration+--+-- @+-- data WithInt a = WithInt Int a+--   deriving 'Generic1'+-- @+--+-- yields+--+-- @+-- class 'Rep1' WithInt where+--   type 'Rep1' WithInt =+--     'D1' D1WithInt+--       ('C1' C1_0WithInt+--         ('S1' 'NoSelector' ('Rec0' Int)+--          ':*:'+--          'S1' 'NoSelector' 'Par1'))+-- @+--+-- If the parameter @a@ appears underneath a composition of other type constructors,+-- then the representation involves composition, too:+--+-- @+-- data Rose a = Fork a [Rose a]+-- @+--+-- yields+--+-- @+-- class 'Rep1' Rose where+--   type 'Rep1' Rose =+--     'D1' D1Rose+--       ('C1' C1_0Rose+--         ('S1' 'NoSelector' 'Par1'+--          ':*:'+--          'S1' 'NoSelector' ([] ':.:' 'Rec1' Rose)+-- @+--+-- where+--+-- @+-- newtype (':.:') f g p = 'Comp1' { 'unComp1' :: f (g p) }+-- @+#if 0+-- *** Limitations+--+-- |+--+-- /TODO/+--+-- /TODO:/ Also clear up confusion about 'Rec0' and 'Rec1' not really indicating recursion.+--+#endif+-----------------------------------------------------------------------------+   -- * Generic representation types     V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..)   , (:+:)(..), (:*:)(..), (:.:)(..)@@ -35,6 +569,7 @@ import GHC.Classes ( Eq, Ord ) import GHC.Read ( Read ) import GHC.Show ( Show )+import Data.Proxy  -------------------------------------------------------------------------------- -- Representation types@@ -45,31 +580,38 @@  -- | Unit: used for constructors without arguments data U1 p = U1+  deriving (Eq, Ord, Read, Show, Generic)  -- | Used for marking occurrences of the parameter newtype Par1 p = Par1 { unPar1 :: p }-+  deriving (Eq, Ord, Read, Show, Generic)  -- | Recursive calls of kind * -> * newtype Rec1 f p = Rec1 { unRec1 :: f p }+  deriving (Eq, Ord, Read, Show, Generic)  -- | Constants, additional parameters and recursion of kind * newtype K1 i c p = K1 { unK1 :: c }+  deriving (Eq, Ord, Read, Show, Generic)  -- | Meta-information (constructor names, etc.) newtype M1 i c f p = M1 { unM1 :: f p }+  deriving (Eq, Ord, Read, Show, Generic)  -- | Sums: encode choice between constructors infixr 5 :+: data (:+:) f g p = L1 (f p) | R1 (g p)+  deriving (Eq, Ord, Read, Show, Generic)  -- | Products: encode multiple arguments to constructors infixr 6 :*: data (:*:) f g p = f p :*: g p+  deriving (Eq, Ord, Read, Show, Generic)  -- | Composition of functors infixr 7 :.: newtype (:.:) f g p = Comp1 { unComp1 :: f (g p) }+  deriving (Eq, Ord, Read, Show, Generic)  -- | Tag for K1: recursion (of kind *) data R@@ -80,8 +622,8 @@ type Rec0  = K1 R -- | Type synonym for encoding parameters (other than the last) type Par0  = K1 P-{-# DEPRECATED Par0 "Par0 is no longer used; use Rec0 instead" #-}-{-# DEPRECATED P "P is no longer used; use R instead" #-}+{-# DEPRECATED Par0 "'Par0' is no longer used; use 'Rec0' instead" #-} -- deprecated in 7.6+{-# DEPRECATED P "'P' is no longer used; use 'R' instead" #-} -- deprecated in 7.6  -- | Tag for M1: datatype data D@@ -106,6 +648,9 @@   datatypeName :: t d (f :: * -> *) a -> [Char]   -- | The fully-qualified name of the module where the type is declared   moduleName   :: t d (f :: * -> *) a -> [Char]+  -- | Marks if the datatype is actually a newtype+  isNewtype    :: t d (f :: * -> *) a -> Bool+  isNewtype _ = False   -- | Class for datatypes that represent records@@ -134,12 +679,12 @@  -- | Datatype to represent the arity of a tuple. data Arity = NoArity | Arity Int-  deriving (Eq, Show, Ord, Read)+  deriving (Eq, Show, Ord, Read, Generic)  -- | Datatype to represent the fixity of a constructor. An infix -- | declaration directly corresponds to an application of 'Infix'. data Fixity = Prefix | Infix Associativity Int-  deriving (Eq, Show, Ord, Read)+  deriving (Eq, Show, Ord, Read, Generic)  -- | Get the precedence of a fixity value. prec :: Fixity -> Int@@ -150,7 +695,7 @@ data Associativity = LeftAssociative                    | RightAssociative                    | NotAssociative-  deriving (Eq, Show, Ord, Read)+  deriving (Eq, Show, Ord, Read, Generic)  -- | Representable types of kind *. -- This class is derivable in GHC with the DeriveGeneric flag on.@@ -270,3 +815,5 @@   type Rep Char = D1 D_Char (C1 C_Char (S1 NoSelector (Rec0 Char)))   from x = M1 (M1 (M1 (K1 x)))   to (M1 (M1 (M1 (K1 x)))) = x++deriving instance Generic (Proxy t)
− GHC/Handle.hs
@@ -1,57 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# OPTIONS_HADDOCK hide #-}---------------------------------------------------------------------------------- |--- Module      :  GHC.Handle--- Copyright   :  (c) The University of Glasgow, 1994-2001--- License     :  see libraries/base/LICENSE--- --- Maintainer  :  libraries@haskell.org--- Stability   :  internal--- Portability :  non-portable------ Backwards-compatibility interface------------------------------------------------------------------------------------- #hide-module GHC.Handle {-# DEPRECATED "use GHC.IO.Handle instead" #-} (-  withHandle, withHandle', withHandle_,-  wantWritableHandle, wantReadableHandle, wantSeekableHandle,----  newEmptyBuffer, allocateBuffer, readCharFromBuffer, writeCharIntoBuffer,---  flushWriteBufferOnly, flushWriteBuffer,---  flushReadBuffer,---  fillReadBuffer, fillReadBufferWithoutBlocking,---  readRawBuffer, readRawBufferPtr,---  readRawBufferNoBlock, readRawBufferPtrNoBlock,---  writeRawBuffer, writeRawBufferPtr,--  ioe_closedHandle, ioe_EOF, ioe_notReadable, ioe_notWritable,--  stdin, stdout, stderr,-  IOMode(..), openFile, openBinaryFile, ---  fdToHandle_stat,-  fdToHandle, fdToHandle',-  hFileSize, hSetFileSize, hIsEOF, isEOF, hLookAhead, hLookAhead_, -  hSetBuffering, hSetBinaryMode,-  hFlush, hDuplicate, hDuplicateTo,--  hClose, hClose_help,--  HandlePosition, HandlePosn(..), hGetPosn, hSetPosn,-  SeekMode(..), hSeek, hTell,--  hIsOpen, hIsClosed, hIsReadable, hIsWritable, hGetBuffering, hIsSeekable,-  hSetEcho, hGetEcho, hIsTerminalDevice,--  hShow,-- ) where--import GHC.IO.IOMode-import GHC.IO.Handle-import GHC.IO.Handle.Internals-import GHC.IO.Handle.FD-
GHC/IO.hs view
@@ -22,7 +22,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.IO (         IO(..), unIO, failIO, liftIO,         unsafePerformIO, unsafeInterleaveIO,@@ -37,7 +36,7 @@         catchException, catchAny, throwIO,         mask, mask_, uninterruptibleMask, uninterruptibleMask_,          MaskingState(..), getMaskingState,-        block, unblock, blocked, unsafeUnmask,+        unsafeUnmask,         onException, bracket, finally, evaluate     ) where @@ -171,7 +170,12 @@ single thread.  Hence, when you use 'unsafeDupablePerformIO', there is a possibility that the IO action may be performed multiple times (on a multiprocessor), and you should therefore ensure that-it gives the same results each time.+it gives the same results each time. It may even happen that one+of the duplicated IO actions is only run partially, and then interrupted+in the middle without an exception being raised. Therefore, functions+like 'bracket' cannot be used safely within 'unsafeDupablePerformIO'.++/Since: 4.4.0.0/ -} {-# NOINLINE unsafeDupablePerformIO #-} unsafeDupablePerformIO  :: IO a -> a@@ -191,7 +195,7 @@ --                             case writeIORef v r s of (# s1, _ #) -> --                             (# s1, r #) -- The strictness analyser will find that the binding for r is strict,--- (becuase of uPIO's strictness sig), and so it'll evaluate it before +-- (because of uPIO's strictness sig), and so it'll evaluate it before  -- doing the writeIORef.  This actually makes tests/lib/should_run/memo002 -- get a deadlock!   --@@ -302,9 +306,6 @@ -- ----------------------------------------------------------------------------- -- Controlling asynchronous exception delivery -{-# DEPRECATED block "use Control.Exception.mask instead" #-}--- | Note: this function is deprecated, please use 'mask' instead.--- -- Applying 'block' to a computation will -- execute that computation with asynchronous exceptions -- /blocked/.  That is, any thread which@@ -322,9 +323,6 @@ block :: IO a -> IO a block (IO io) = IO $ maskAsyncExceptions# io -{-# DEPRECATED unblock "use Control.Exception.mask instead" #-}--- | Note: this function is deprecated, please use 'mask' instead.--- -- To re-enable asynchronous exceptions inside the scope of -- 'block', 'unblock' can be -- used.  It scopes in exactly the same way, so on exit from@@ -357,12 +355,6 @@                              0# -> Unmasked                              1# -> MaskedUninterruptible                              _  -> MaskedInterruptible #)--{-# DEPRECATED blocked "use Control.Exception.getMaskingState instead" #-}--- | returns True if asynchronous exceptions are blocked in the--- current thread.-blocked :: IO Bool-blocked = fmap (/= Unmasked) getMaskingState  onException :: IO a -> IO b -> IO a onException io what = io `catchException` \e -> do _ <- what
GHC/IO/Buffer.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}+{-# LANGUAGE CPP, NoImplicitPrelude #-} {-# OPTIONS_GHC -funbox-strict-fields #-}  -----------------------------------------------------------------------------@@ -88,7 +88,7 @@ -- the Iconv codec, but there are some pieces that are known to be -- broken.  In particular, the built-in codecs -- e.g. GHC.IO.Encoding.UTF{8,16,32} need to use isFullCharBuffer or--- similar in place of the ow >= os comparisions.+-- similar in place of the ow >= os comparisons.  -- --------------------------------------------------------------------------- -- Raw blocks of data@@ -256,12 +256,12 @@ slideContents buf@Buffer{ bufL=l, bufR=r, bufRaw=raw } = do   let elems = r - l   withRawBuffer raw $ \p ->-      do _ <- memcpy p (p `plusPtr` l) (fromIntegral elems)+      do _ <- memmove p (p `plusPtr` l) (fromIntegral elems)          return ()   return buf{ bufL=0, bufR=elems } -foreign import ccall unsafe "memcpy"-   memcpy :: Ptr a -> Ptr a -> CSize -> IO (Ptr ())+foreign import ccall unsafe "memmove"+   memmove :: Ptr a -> Ptr a -> CSize -> IO (Ptr a)  summaryBuffer :: Buffer a -> String summaryBuffer buf = "buf" ++ show (bufSize buf) ++ "(" ++ show (bufL buf) ++ "-" ++ show (bufR buf) ++ ")"
GHC/IO/BufferedIO.hs view
@@ -123,5 +123,5 @@   let bytes = bufferElems bbuf   res <- withBuffer bbuf $ \ptr ->             IODevice.writeNonBlocking dev (ptr `plusPtr` bufL bbuf) bytes-  return (res, bufferAdjustL res bbuf)+  return (res, bufferAdjustL (bufL bbuf + res) bbuf) 
GHC/IO/Device.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns #-}+{-# LANGUAGE NoImplicitPrelude, BangPatterns #-}  ----------------------------------------------------------------------------- -- |@@ -22,7 +22,6 @@         SeekMode(..)     ) where   -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Word import GHC.Arr@@ -34,13 +33,6 @@ import GHC.Num import GHC.IO import {-# SOURCE #-} GHC.IO.Exception ( unsupportedOperation )-#endif-#ifdef __NHC__-import Foreign-import Ix-import Control.Exception.Base-unsupportedOperation = userError "unsupported operation"-#endif  -- | A low-level I/O provider where the data is bytes in memory. class RawIO a where
GHC/IO/Encoding.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, PatternGuards #-}+{-# LANGUAGE CPP, NoImplicitPrelude #-} {-# OPTIONS_GHC -funbox-strict-fields #-}  -----------------------------------------------------------------------------@@ -103,6 +103,8 @@ utf32be = UTF32.utf32be  -- | The Unicode encoding of the current locale+--+-- /Since: 4.5.0.0/ getLocaleEncoding :: IO TextEncoding  -- | The Unicode encoding of the current locale, but allowing arbitrary@@ -114,14 +116,20 @@ -- On Windows, this encoding *should not* be used if possible because -- the use of code pages is deprecated: Strings should be retrieved -- via the "wide" W-family of UTF-16 APIs instead+--+-- /Since: 4.5.0.0/ getFileSystemEncoding :: IO TextEncoding  -- | The Unicode encoding of the current locale, but where undecodable -- bytes are replaced with their closest visual match. Used for -- the 'CString' marshalling functions in "Foreign.C.String"+--+-- /Since: 4.5.0.0/ getForeignEncoding :: IO TextEncoding +-- | /Since: 4.5.0.0/ setLocaleEncoding, setFileSystemEncoding, setForeignEncoding :: TextEncoding -> IO ()+ (getLocaleEncoding, setLocaleEncoding)         = mkGlobal initLocaleEncoding (getFileSystemEncoding, setFileSystemEncoding) = mkGlobal initFileSystemEncoding (getForeignEncoding, setForeignEncoding)       = mkGlobal initForeignEncoding@@ -131,6 +139,7 @@     x_ref <- newIORef x     return (readIORef x_ref, writeIORef x_ref) +-- | /Since: 4.5.0.0/ initLocaleEncoding, initFileSystemEncoding, initForeignEncoding :: TextEncoding  #if !defined(mingw32_HOST_OS)@@ -160,6 +169,8 @@ -- This encoding never fails in either direction.  However, encoding -- discards information, so encode followed by decode is not the -- identity.+--+-- /Since: 4.4.0.0/ char8 :: TextEncoding char8 = Latin1.latin1 @@ -175,8 +186,8 @@ -- --  * @UTF-32@, @UTF-32BE@, @UTF-32LE@ ----- On systems using GNU iconv (e.g. Linux), there is additional--- notation for specifying how illegal characters are handled:+-- There is additional notation (borrowed from GNU iconv) for specifying+-- how illegal characters are handled: -- --  * a suffix of @\/\/IGNORE@, e.g. @UTF-8\/\/IGNORE@, will cause  --    all illegal sequences on input to be ignored, and on output@@ -186,6 +197,28 @@ --  * a suffix of @\/\/TRANSLIT@ will choose a replacement character --    for illegal sequences or code points. --+--  * a suffix of @\/\/ROUNDTRIP@ will use a PEP383-style escape mechanism+--    to represent any invalid bytes in the input as Unicode codepoints (specifically,+--    as lone surrogates, which are normally invalid in UTF-32).+--    Upon output, these special codepoints are detected and turned back into the+--    corresponding original byte.+--+--    In theory, this mechanism allows arbitrary data to be roundtripped via+--    a 'String' with no loss of data. In practice, there are two limitations+--    to be aware of:+--+--      1. This only stands a chance of working for an encoding which is an ASCII+--         superset, as for security reasons we refuse to escape any bytes smaller+--         than 128. Many encodings of interest are ASCII supersets (in particular,+--         you can assume that the locale encoding is an ASCII superset) but many+--         (such as UTF-16) are not.+--+--      2. If the underlying encoding is not itself roundtrippable, this mechanism+--         can fail. Roundtrippable encodings are those which have an injective mapping+--         into Unicode. Almost all encodings meet this criteria, but some do not. Notably,+--         Shift-JIS (CP932) and Big5 contain several different encodings of the same+--         Unicode codepoint.+-- -- On Windows, you can access supported code pages with the prefix -- @CP@; for example, @\"CP1250\"@. --@@ -194,8 +227,6 @@     Nothing -> unknownEncodingErr e     Just cfm -> mkTextEncoding' cfm enc   where-    -- The only problem with actually documenting //IGNORE and //TRANSLIT as-    -- supported suffixes is that they are not necessarily supported with non-GNU iconv     (enc, suffix) = span (/= '/') e     mb_coding_failure_mode = case suffix of         ""            -> Just ErrorOnCodingFailure
GHC/IO/Encoding/CodePage.hs view
@@ -1,15 +1,17 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, BangPatterns, ForeignFunctionInterface, NoImplicitPrelude,+{-# LANGUAGE CPP, BangPatterns, NoImplicitPrelude,              NondecreasingIndentation, MagicHash #-}  module GHC.IO.Encoding.CodePage(-#if !defined(mingw32_HOST_OS)- ) where-#else+#if defined(mingw32_HOST_OS)                         codePageEncoding, mkCodePageEncoding,                         localeEncoding, mkLocaleEncoding+#endif                             ) where +#if !defined(mingw32_HOST_OS)+import GHC.Base () -- Build ordering+#else import GHC.Base import GHC.Show import GHC.Num@@ -23,9 +25,9 @@ import Data.Maybe import Data.List (lookup) +import qualified GHC.IO.Encoding.CodePage.API as API import GHC.IO.Encoding.CodePage.Table -import GHC.IO.Encoding.Latin1 (mkLatin1) import GHC.IO.Encoding.UTF8 (mkUTF8) import GHC.IO.Encoding.UTF16 (mkUTF16le, mkUTF16be) import GHC.IO.Encoding.UTF32 (mkUTF32le, mkUTF32be)@@ -76,7 +78,7 @@ mkCodePageEncoding cfm 1201 = mkUTF16be cfm mkCodePageEncoding cfm 12000 = mkUTF32le cfm mkCodePageEncoding cfm 12001 = mkUTF32be cfm-mkCodePageEncoding cfm cp = maybe (mkLatin1 cfm) (buildEncoding cfm cp) (lookup cp codePageMap)+mkCodePageEncoding cfm cp = maybe (API.mkCodePageEncoding cfm cp) (buildEncoding cfm cp) (lookup cp codePageMap)  buildEncoding :: CodingFailureMode -> Word32 -> CodePageArrays -> TextEncoding buildEncoding cfm cp SingleByteCP {decoderArray = dec, encoderArray = enc}
+ GHC/IO/Encoding/CodePage/API.hs view
@@ -0,0 +1,426 @@+{-# LANGUAGE CPP, NoImplicitPrelude, NondecreasingIndentation, RecordWildCards, ScopedTypeVariables #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+module GHC.IO.Encoding.CodePage.API (+    mkCodePageEncoding+  ) where++import Foreign.C+import Foreign.Ptr+import Foreign.Marshal+import Foreign.Storable+import Control.Monad+import Data.Bits+import Data.Either+import Data.Word++import GHC.Base+import GHC.List+import GHC.IO.Buffer+import GHC.IO.Encoding.Failure+import GHC.IO.Encoding.Types+import GHC.IO.Encoding.UTF16+import GHC.Num+import GHC.Show+import GHC.Real+import GHC.Windows+import GHC.ForeignPtr (castForeignPtr)++import System.Posix.Internals+++c_DEBUG_DUMP :: Bool+c_DEBUG_DUMP = False++debugIO :: String -> IO ()+debugIO s+ | c_DEBUG_DUMP = puts s+ | otherwise    = return ()+++#if defined(i386_HOST_ARCH)+# define WINDOWS_CCONV stdcall+#elif defined(x86_64_HOST_ARCH)+# define WINDOWS_CCONV ccall+#else+# error Unknown mingw32 arch+#endif+++type LPCSTR = Ptr Word8+++mAX_DEFAULTCHAR :: Int+mAX_DEFAULTCHAR = 2++mAX_LEADBYTES :: Int+mAX_LEADBYTES = 12++-- Don't really care about the contents of this, but we have to make sure the size is right+data CPINFO = CPINFO {+    maxCharSize :: UINT,+    defaultChar :: [BYTE], -- ^ Always of length mAX_DEFAULTCHAR+    leadByte    :: [BYTE]  -- ^ Always of length mAX_LEADBYTES+  }++instance Storable CPINFO where+    sizeOf    _ = sizeOf (undefined :: UINT) + (mAX_DEFAULTCHAR + mAX_LEADBYTES) * sizeOf (undefined :: BYTE)+    alignment _ = alignment (undefined :: CInt)+    peek ptr = do+      ptr <- return $ castPtr ptr+      a <- peek ptr+      ptr <- return $ castPtr $ advancePtr ptr 1+      b <- peekArray mAX_DEFAULTCHAR ptr+      c <- peekArray mAX_LEADBYTES   (advancePtr ptr mAX_DEFAULTCHAR)+      return $ CPINFO a b c  +    poke ptr val = do+      ptr <- return $ castPtr ptr+      poke ptr (maxCharSize val)+      ptr <- return $ castPtr $ advancePtr ptr 1+      pokeArray' "CPINFO.defaultChar" mAX_DEFAULTCHAR ptr                              (defaultChar val)+      pokeArray' "CPINFO.leadByte"    mAX_LEADBYTES   (advancePtr ptr mAX_DEFAULTCHAR) (leadByte val) ++pokeArray' :: Storable a => String -> Int -> Ptr a -> [a] -> IO ()+pokeArray' msg sz ptr xs | length xs == sz = pokeArray ptr xs+                         | otherwise       = error $ msg ++ ": expected " ++ show sz ++ " elements in list but got " ++ show (length xs)+++foreign import WINDOWS_CCONV unsafe "windows.h GetCPInfo"+    c_GetCPInfo :: UINT       -- ^ CodePage+                -> Ptr CPINFO -- ^ lpCPInfo+                -> IO BOOL++foreign import WINDOWS_CCONV unsafe "windows.h MultiByteToWideChar"+    c_MultiByteToWideChar :: UINT   -- ^ CodePage+                          -> DWORD  -- ^ dwFlags+                          -> LPCSTR -- ^ lpMultiByteStr+                          -> CInt   -- ^ cbMultiByte+                          -> LPWSTR -- ^ lpWideCharStr+                          -> CInt   -- ^ cchWideChar+                          -> IO CInt++foreign import WINDOWS_CCONV unsafe "windows.h WideCharToMultiByte"+    c_WideCharToMultiByte :: UINT   -- ^ CodePage+                          -> DWORD  -- ^ dwFlags+                          -> LPWSTR -- ^ lpWideCharStr+                          -> CInt   -- ^ cchWideChar+                          -> LPCSTR -- ^ lpMultiByteStr+                          -> CInt   -- ^ cbMultiByte+                          -> LPCSTR -- ^ lpDefaultChar+                          -> LPBOOL -- ^ lpUsedDefaultChar+                          -> IO CInt++foreign import WINDOWS_CCONV unsafe "windows.h IsDBCSLeadByteEx"+    c_IsDBCSLeadByteEx :: UINT    -- ^ CodePage+                       -> BYTE    -- ^ TestChar+                       -> IO BOOL+++-- | Returns a slow but correct implementation of TextEncoding using the Win32 API.+--+-- This is useful for supporting DBCS text encoding on the console without having to statically link+-- in huge code tables into all of our executables, or just as a fallback mechanism if a new code page+-- is introduced that we don't know how to deal with ourselves yet.  +mkCodePageEncoding :: CodingFailureMode -> Word32 -> TextEncoding+mkCodePageEncoding cfm cp+  = TextEncoding { +        textEncodingName = "CP" ++ show cp,+        mkTextDecoder = newCP (recoverDecode cfm) cpDecode cp,+        mkTextEncoder = newCP (recoverEncode cfm) cpEncode cp+      }++newCP :: (Buffer from -> Buffer to -> IO (Buffer from, Buffer to))+      -> (Word32 -> Int -> CodeBuffer from to)+      -> Word32+      -> IO (BufferCodec from to ())+newCP rec fn cp = do+  -- Fail early if the code page doesn't exist, to match the behaviour of the IConv TextEncoding+  max_char_size <- alloca $ \cpinfo_ptr -> do+    success <- c_GetCPInfo cp cpinfo_ptr +    unless success $ throwGetLastError ("GetCPInfo " ++ show cp)+    fmap (fromIntegral . maxCharSize) $ peek cpinfo_ptr++  debugIO $ "GetCPInfo " ++ show cp ++ " = " ++ show max_char_size++  return $ BufferCodec {+    encode = fn cp max_char_size,+    recover = rec,+    close  = return (),+    -- Windows doesn't supply a way to save/restore the state and doesn't need one+    -- since it's a dumb string->string API rather than a clever streaming one.+    getState = return (),+    setState = const $ return ()+  }+++utf16_native_encode' :: EncodeBuffer+utf16_native_decode' :: DecodeBuffer+#ifdef WORDS_BIGENDIAN+utf16_native_encode' = utf16be_encode+utf16_native_decode' = utf16be_decode+#else+utf16_native_encode' = utf16le_encode+utf16_native_decode' = utf16le_decode+#endif++saner :: CodeBuffer from to+      -> Buffer from -> Buffer to+      -> IO (CodingProgress, Int, Buffer from, Buffer to)+saner code ibuf obuf = do+  (why, ibuf', obuf') <- code ibuf obuf+  -- Weird but true: the UTF16 codes have a special case (see the "done" functions)+  -- whereby if they entirely consume the input instead of returning an input buffer+  -- that is empty because bufL has reached bufR, they return a buffer that is empty+  -- because bufL = bufR = 0.+  --+  -- This is really very odd and confusing for our code that expects the difference+  -- between the old and new input buffer bufLs to indicate the number of elements+  -- that were consumed!+  --+  -- We fix it by explicitly extracting an integer which is the # of things consumed, like so:+  if isEmptyBuffer ibuf'+   then return (InputUnderflow, bufferElems ibuf,       ibuf', obuf')+   else return (why,            bufL ibuf' - bufL ibuf, ibuf', obuf')++byteView :: Buffer CWchar -> Buffer Word8+byteView (Buffer {..}) = Buffer { bufState = bufState, bufRaw = castForeignPtr bufRaw, bufSize = bufSize * 2, bufL = bufL * 2, bufR = bufR * 2 }++cwcharView :: Buffer Word8 -> Buffer CWchar+cwcharView (Buffer {..}) = Buffer { bufState = bufState, bufRaw = castForeignPtr bufRaw, bufSize = half bufSize, bufL = half bufL, bufR = half bufR }+  where half x = case x `divMod` 2 of (y, 0) -> y+                                      _      -> error "cwcharView: utf16_(encode|decode) (wrote out|consumed) non multiple-of-2 number of bytes"++utf16_native_encode :: CodeBuffer Char CWchar+utf16_native_encode ibuf obuf = do+  (why, ibuf, obuf) <- utf16_native_encode' ibuf (byteView obuf)+  return (why, ibuf, cwcharView obuf)++utf16_native_decode :: CodeBuffer CWchar Char+utf16_native_decode ibuf obuf = do+  (why, ibuf, obuf) <- utf16_native_decode' (byteView ibuf) obuf+  return (why, cwcharView ibuf, obuf)++cpDecode :: Word32 -> Int -> DecodeBuffer+cpDecode cp max_char_size = \ibuf obuf -> do+#ifdef CHARBUF_UTF16+    let mbuf = obuf+#else+    -- FIXME: share the buffer between runs, even if the buffer is not the perfect size+    let sz =       (bufferElems ibuf * 2)     -- I guess in the worst case the input CP text consists of 1-byte sequences that map entirely to things outside the BMP and so require 2 UTF-16 chars+             `min` (bufferAvailable obuf * 2) -- In the best case, each pair of UTF-16 points becomes a single UTF-32 point+    mbuf <- newBuffer (2 * sz) sz WriteBuffer :: IO (Buffer CWchar)+#endif+    debugIO $ "cpDecode " ++ summaryBuffer ibuf ++ " " ++ summaryBuffer mbuf+    (why1, ibuf', mbuf') <- cpRecode try' is_valid_prefix max_char_size 1 0 1 ibuf mbuf+    debugIO $ "cpRecode (cpDecode) = " ++ show why1 ++ " " ++ summaryBuffer ibuf' ++ " " ++ summaryBuffer mbuf'+#ifdef CHARBUF_UTF16+    return (why1, ibuf', mbuf')+#else+    -- Convert as much UTF-16 as possible to UTF-32. Note that it's impossible for this to fail+    -- due to illegal characters since the output from Window's encoding function should be correct UTF-16.+    -- However, it's perfectly possible to run out of either output or input buffer.+    debugIO $ "utf16_native_decode " ++ summaryBuffer mbuf' ++ " " ++ summaryBuffer obuf+    (why2, target_utf16_count, mbuf', obuf) <- saner utf16_native_decode (mbuf' { bufState = ReadBuffer }) obuf+    debugIO $ "utf16_native_decode = " ++ show why2 ++ " " ++ summaryBuffer mbuf' ++ " " ++ summaryBuffer obuf+    case why2 of+      -- If we successfully translate all of the UTF-16 buffer, we need to know why we couldn't get any more+      -- UTF-16 out of the Windows API+      InputUnderflow | isEmptyBuffer mbuf' -> return (why1, ibuf', obuf)+                     | otherwise           -> error "cpDecode: impossible underflown UTF-16 buffer"+      -- InvalidSequence should be impossible since mbuf' is output from Windows.+      InvalidSequence -> error "InvalidSequence on output of Windows API"+      -- If we run out of space in obuf, we need to ask for more output buffer space, while also returning+      -- the characters we have managed to consume so far.+      OutputUnderflow -> do+        -- We have an interesting problem here similar to the cpEncode case where we have to figure out how much+        -- of the byte buffer was consumed to reach as far as the last UTF-16 character we actually decoded to UTF-32 OK.+        --+        -- The minimum number of bytes it could take is half the number of UTF-16 chars we got on the output, since+        -- one byte could theoretically generate two UTF-16 characters.+        -- The common case (ASCII text) is that every byte in the input maps to a single UTF-16 character.+        -- In the worst case max_char_size bytes map to each UTF-16 character.+        byte_count <- bSearch "cpDecode" (cpRecode try' is_valid_prefix max_char_size 1 0 1) ibuf mbuf target_utf16_count (target_utf16_count `div` 2) target_utf16_count (target_utf16_count * max_char_size)+        return (OutputUnderflow, bufferRemove byte_count ibuf, obuf)+#endif+  where+    is_valid_prefix = c_IsDBCSLeadByteEx cp+    try' iptr icnt optr ocnt+     -- MultiByteToWideChar does surprising things if you have ocnt == 0+     | ocnt == 0 = return (Left True)+     | otherwise = do+        err <- c_MultiByteToWideChar (fromIntegral cp) 8 -- MB_ERR_INVALID_CHARS == 8: Fail if an invalid input character is encountered+                                     iptr (fromIntegral icnt) optr (fromIntegral ocnt)+        debugIO $ "MultiByteToWideChar " ++ show cp ++ " 8 " ++ show iptr ++ " " ++ show icnt ++ " " ++ show optr ++ " " ++ show ocnt ++ "\n = " ++ show err+        case err of+          -- 0 indicates that we did not succeed+          0 -> do+            err <- getLastError+            case err of+                122  -> return (Left True)+                1113 -> return (Left False)+                _    -> failWith "MultiByteToWideChar" err+          wrote_chars -> return (Right (fromIntegral wrote_chars))++cpEncode :: Word32 -> Int -> EncodeBuffer+cpEncode cp _max_char_size = \ibuf obuf -> do+#ifdef CHARBUF_UTF16+    let mbuf' = ibuf+#else+    -- FIXME: share the buffer between runs, even though that means we can't size the buffer as we want.+    let sz =       (bufferElems ibuf * 2)     -- UTF-32 always uses 4 bytes. UTF-16 uses at most 4 bytes.+             `min` (bufferAvailable obuf * 2) -- In the best case, each pair of UTF-16 points fits into only 1 byte+    mbuf <- newBuffer (2 * sz) sz WriteBuffer+    +    -- Convert as much UTF-32 as possible to UTF-16. NB: this can't fail due to output underflow+    -- since we sized the output buffer correctly. However, it could fail due to an illegal character+    -- in the input if it encounters a lone surrogate. In this case, our recovery will be applied as normal.+    (why1, ibuf', mbuf') <- utf16_native_encode ibuf mbuf+#endif+    debugIO $ "\ncpEncode " ++ summaryBuffer mbuf' ++ " " ++ summaryBuffer obuf+    (why2, target_utf16_count, mbuf', obuf) <- saner (cpRecode try' is_valid_prefix 2 1 1 0) (mbuf' { bufState = ReadBuffer }) obuf+    debugIO $ "cpRecode (cpEncode) = " ++ show why2 ++ " " ++ summaryBuffer mbuf' ++ " " ++ summaryBuffer obuf+#ifdef CHARBUF_UTF16+    return (why2, mbuf', obuf)+#else+    case why2 of+      -- If we succesfully translate all of the UTF-16 buffer, we need to know why+      -- we weren't able to get any more UTF-16 out of the UTF-32 buffer+      InputUnderflow | isEmptyBuffer mbuf' -> return (why1, ibuf', obuf)+                     | otherwise           -> error "cpEncode: impossible underflown UTF-16 buffer"+      -- With OutputUnderflow/InvalidSequence we only care about the failings of the UTF-16->CP translation.+      -- Yes, InvalidSequence is possible even though mbuf' is guaranteed to be valid UTF-16, because+      -- the code page may not be able to represent the encoded Unicode codepoint.+      _ -> do+        -- Here is an interesting problem. If we have only managed to translate part of the mbuf'+        -- then we need to return an ibuf which has consumed exactly those bytes required to obtain+        -- that part of the mbuf'. To reconstruct this information, we binary search for the number of+        -- UTF-32 characters required to get the consumed count of UTF-16 characters:+        --+        -- When dealing with data from the BMP (the common case), consuming N UTF-16 characters will be the same as consuming N+        -- UTF-32 characters. We start our search there so that most binary searches will terminate in a single iteration. +        -- Furthermore, the absolute minimum number of UTF-32 characters this can correspond to is 1/2 the UTF-16 byte count+        -- (this will be realised when the input data is entirely not in the BMP).+        utf32_count <- bSearch "cpEncode" utf16_native_encode ibuf mbuf target_utf16_count (target_utf16_count `div` 2) target_utf16_count target_utf16_count+        return (why2, bufferRemove utf32_count ibuf, obuf)+#endif+  where+    -- Single characters should be mappable to bytes. If they aren't supported by the CP then we have an invalid input sequence.+    is_valid_prefix _ = return False++    try' iptr icnt optr ocnt+     -- WideCharToMultiByte does surprising things if you call it with ocnt == 0+     | ocnt == 0 = return (Left True)+     | otherwise = alloca $ \defaulted_ptr -> do+      poke defaulted_ptr False+      err <- c_WideCharToMultiByte (fromIntegral cp) 0 -- NB: the WC_ERR_INVALID_CHARS flag is uselses: only has an effect with the UTF-8 code page+                                   iptr (fromIntegral icnt) optr (fromIntegral ocnt)+                                   nullPtr defaulted_ptr+      defaulted <- peek defaulted_ptr+      debugIO $ "WideCharToMultiByte " ++ show cp ++ " 0 " ++ show iptr ++ " " ++ show icnt ++ " " ++ show optr ++ " " ++ show ocnt ++ " NULL " ++ show defaulted_ptr ++ "\n = " ++ show err ++ ", " ++ show defaulted+      case err of+          -- 0 indicates that we did not succeed+          0 -> do+            err <- getLastError+            case err of+                122  -> return (Left True)+                1113 -> return (Left False)+                _    -> failWith "WideCharToMultiByte" err+          wrote_bytes | defaulted -> return (Left False)+                      | otherwise -> return (Right (fromIntegral wrote_bytes))++bSearch :: String+        -> CodeBuffer from to+        -> Buffer from -> Buffer to -- From buffer (crucial data source) and to buffer (temporary storage only). To buffer must be empty (L=R).+        -> Int               -- Target size of to buffer+        -> Int -> Int -> Int -- Binary search min, mid, max+        -> IO Int            -- Size of from buffer required to reach target size of to buffer+bSearch msg code ibuf mbuf target_to_elems = go+  where+    go mn md mx = do+      -- NB: this loop repeatedly reencodes on top of mbuf using a varying fraction of ibuf. It doesn't+      -- matter if we blast the contents of mbuf since we already consumed all of the contents we are going to use.+      (_why, ibuf, mbuf) <- code (ibuf { bufR = bufL ibuf + md }) mbuf+      debugIO $ "code (bSearch " ++ msg ++ ") " ++ show md ++ " = " ++ show _why ++ ", " ++ summaryBuffer ibuf ++ summaryBuffer mbuf+      -- The normal case is to get InputUnderflow here, which indicates that coding basically+      -- terminated normally.+      --+      -- However, InvalidSequence is also possible if we are being called from cpDecode if we+      -- have just been unlucky enough to set md so that ibuf straddles a byte boundary.+      -- In this case we have to be really careful, because we don't want to report that+      -- "md" elements is the right number when in actual fact we could have had md-1 input+      -- elements and still produced the same number of bufferElems in mbuf. +      --+      -- In fact, we have to worry about this possibility even if we get InputUnderflow+      -- since that will report InputUnderflow rather than InvalidSequence if the buffer+      -- ends in a valid lead byte. So the expedient thing to do is simply to check if+      -- the input buffer was entirely consumed.+      --+      -- When called from cpDecode, OutputUnderflow is also possible.+      --+      -- Luckily if we have InvalidSequence/OutputUnderflow and we do not appear to have reached+      -- the target, what we should do is the same as normal because the fraction of ibuf that our+      -- first "code" coded succesfully must be invalid-sequence-free, and ibuf will always+      -- have been decoded as far as the first invalid sequence in it. +      case bufferElems mbuf `compare` target_to_elems of+        -- Coding n "from" chars from the input yields exactly as many "to" chars+        -- as were consumed by the recode. All is peachy:+        EQ -> debugIO ("bSearch = " ++ show solution) >> return solution+          where solution = md - bufferElems ibuf+        -- If we encoded fewer "to" characters than the target number, try again with more "from" characters (and vice-versa)+        LT -> go' (md+1) mx+        GT -> go' mn (md-1)+    go' mn mx | mn <= mx  = go mn (mn + ((mx - mn) `div` 2)) mx+              | otherwise = error $ "bSearch(" ++ msg ++ "): search crossed! " ++ show (summaryBuffer ibuf, summaryBuffer mbuf, target_to_elems, mn, mx)++cpRecode :: forall from to. (Show from, Storable from)+         => (Ptr from -> Int -> Ptr to -> Int -> IO (Either Bool Int))+         -> (from -> IO Bool)+         -> Int -- ^ Maximum length of a complete translatable sequence in the input (e.g. 2 if the input is UTF-16, 1 if the input is a SBCS, 2 is the input is a DBCS). Must be at least 1.+         -> Int -- ^ Minimum number of output elements per complete translatable sequence in the input (almost certainly 1)+         -> Int -> Int+         -> CodeBuffer from to+cpRecode try' is_valid_prefix max_i_size min_o_size iscale oscale = go+  where+    go :: CodeBuffer from to+    go ibuf obuf | isEmptyBuffer ibuf                = return (InputUnderflow,  ibuf, obuf)+                 | bufferAvailable obuf < min_o_size = return (OutputUnderflow, ibuf, obuf)+                 | otherwise                         = try (bufferElems ibuf `min` ((max_i_size * bufferAvailable obuf) `div` min_o_size)) seek_smaller+      where+        done why = return (why, ibuf, obuf)++        seek_smaller n longer_was_valid+          -- In this case, we can't shrink any further via any method. Calling (try 0) wouldn't be right because that will always claim InputUnderflow...+          | n <= 1 = if longer_was_valid+                      -- try m (where m >= n) was valid but we overflowed the output buffer with even a single input element+                      then done OutputUnderflow+                      -- there was no initial valid sequence in the input, but it might just be a truncated buffer - we need to check+                      else do byte <- withBuffer ibuf $ \ptr -> peekElemOff ptr (bufL ibuf)+                              valid_prefix <- is_valid_prefix byte+                              done (if valid_prefix && bufferElems ibuf < max_i_size then InputUnderflow else InvalidSequence)+          -- If we're already looking at very small buffers, try every n down to 1, to ensure we spot as long a sequence as exists while avoiding trying 0.+          -- Doing it this way ensures that we spot a single initial sequence of length <= max_i_size if any such exists.+          | n < 2 * max_i_size = try (n - 1) (\pred_n pred_n_was_valid -> seek_smaller pred_n (longer_was_valid || pred_n_was_valid))+          -- Otherwise, try a binary chop to try to either get the prefix before the invalid input, or shrink the output down so it fits+          -- in the output buffer. After the chop, try to consume extra input elements to try to recover as much of the sequence as possible if we+          -- end up chopping a multi-element input sequence into two parts.+          --+          -- Note that since max_i_size >= 1:+          --  * (n `div` 2) >= 1, so we don't try 0+          --  * ((n `div` 2) + (max_i_size - 1)) < n, so we don't get into a loop where (seek_smaller n) calls post_divide (n `div` 2) calls (seek_smaller n)+          | let n' = n `div` 2 = try n' (post_divide n' longer_was_valid)++        post_divide _  _                n True  = seek_smaller n True+        post_divide n' longer_was_valid n False | n < n' + max_i_size - 1 = try (n + 1) (post_divide n' longer_was_valid) -- There's still a chance..+                                                | otherwise               = seek_smaller n' longer_was_valid              -- No amount of recovery could save us :(++        try n k_fail = withBuffer ibuf $ \iptr -> withBuffer obuf $ \optr -> do+          ei_err_wrote <- try' (iptr `plusPtr` (bufL ibuf `shiftL` iscale)) n+                               (optr `plusPtr` (bufR obuf `shiftL` oscale)) (bufferAvailable obuf)+          debugIO $ "try " ++ show n ++ " = " ++ show ei_err_wrote+          case ei_err_wrote of+            -- ERROR_INSUFFICIENT_BUFFER: A supplied buffer size was not large enough, or it was incorrectly set to NULL.+            Left True  -> k_fail n True+            -- ERROR_NO_UNICODE_TRANSLATION: Invalid Unicode was found in a string.+            Left False -> k_fail n False+            -- Must have interpreted all given bytes successfully+            -- We need to iterate until we have consumed the complete contents of the buffer+            Right wrote_elts -> go (bufferRemove n ibuf) (obuf { bufR = bufR obuf + wrote_elts })
GHC/IO/Encoding/CodePage/Table.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, MagicHash, NoImplicitPrelude #-}+{-# LANGUAGE MagicHash, NoImplicitPrelude #-} -- Do not edit this file directly! -- It was generated by the MakeTable.hs script using the files below. -- To regenerate it, run "make" in ../../../../codepages/
GHC/IO/Encoding/Failure.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, PatternGuards #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |
GHC/IO/Encoding/Iconv.hs view
@@ -1,9 +1,9 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP            , NoImplicitPrelude-           , ForeignFunctionInterface            , NondecreasingIndentation   #-}+{-# OPTIONS_HADDOCK hide #-}  ----------------------------------------------------------------------------- -- |@@ -19,7 +19,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.IO.Encoding.Iconv ( #if !defined(mingw32_HOST_OS)    iconvEncoding, mkIconvEncoding,@@ -30,7 +29,9 @@ #include "MachDeps.h" #include "HsBaseConfig.h" -#if !defined(mingw32_HOST_OS)+#if defined(mingw32_HOST_OS)+import GHC.Base () -- For build ordering+#else  import Foreign.Safe import Foreign.C@@ -140,7 +141,7 @@   input@Buffer{  bufRaw=iraw, bufL=ir, bufR=iw, bufSize=_  }  iscale   output@Buffer{ bufRaw=oraw, bufL=_,  bufR=ow, bufSize=os }  oscale   = do-    iconv_trace ("haskelChar=" ++ show haskellChar)+    iconv_trace ("haskellChar=" ++ show haskellChar)     iconv_trace ("iconvRecode before, input=" ++ show (summaryBuffer input))     iconv_trace ("iconvRecode before, output=" ++ show (summaryBuffer output))     withRawBuffer iraw $ \ piraw -> do
GHC/IO/Encoding/Latin1.hs view
@@ -45,6 +45,7 @@ latin1 :: TextEncoding latin1 = mkLatin1 ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkLatin1 :: CodingFailureMode -> TextEncoding mkLatin1 cfm = TextEncoding { textEncodingName = "ISO8859-1",                               mkTextDecoder = latin1_DF cfm,@@ -73,6 +74,7 @@ latin1_checked :: TextEncoding latin1_checked = mkLatin1_checked ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkLatin1_checked :: CodingFailureMode -> TextEncoding mkLatin1_checked cfm = TextEncoding { textEncodingName = "ISO8859-1(checked)",                                       mkTextDecoder = latin1_DF cfm,
GHC/IO/Encoding/Types.hs view
@@ -20,7 +20,7 @@     BufferCodec(..),     TextEncoding(..),     TextEncoder, TextDecoder,-    EncodeBuffer, DecodeBuffer,+    CodeBuffer, EncodeBuffer, DecodeBuffer,     CodingProgress(..)   ) where @@ -34,24 +34,21 @@ -- Text encoders/decoders  data BufferCodec from to state = BufferCodec {-  encode :: Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to),+  encode :: CodeBuffer from to,    -- ^ The @encode@ function translates elements of the buffer @from@    -- to the buffer @to@.  It should translate as many elements as possible    -- given the sizes of the buffers, including translating zero elements    -- if there is either not enough room in @to@, or @from@ does not    -- contain a complete multibyte sequence.    --+   -- If multiple CodingProgress returns are possible, OutputUnderflow must be+   -- preferred to InvalidSequence. This allows GHC's IO library to assume that+   -- if we observe InvalidSequence there is at least a single element available+   -- in the output buffer.+   --    -- The fact that as many elements as possible are translated is used by the IO    -- library in order to report translation errors at the point they    -- actually occur, rather than when the buffer is translated.-   ---   -- To allow us to use iconv as a BufferCode efficiently, character buffers are-   -- defined to contain lone surrogates instead of those private use characters that-   -- are used for roundtripping. Thus, Chars poked and peeked from a character buffer-   -- must undergo surrogatifyRoundtripCharacter and desurrogatifyRoundtripCharacter-   -- respectively.-   ---   -- For more information on this, see Note [Roundtripping] in GHC.IO.Encoding.Failure.      recover :: Buffer from -> Buffer to -> IO (Buffer from, Buffer to),    -- ^ The @recover@ function is used to continue decoding@@ -69,6 +66,8 @@    --    -- Currently, some implementations of @recover@ may mutate the input buffer.    -- In particular, this feature is used to implement transliteration.+   --+   -- /Since: 4.4.0.0/      close  :: IO (),    -- ^ Resources associated with the encoding may now be released.@@ -93,11 +92,9 @@    -- call to 'getState'.  } -type DecodeBuffer = Buffer Word8 -> Buffer Char-                  -> IO (CodingProgress, Buffer Word8, Buffer Char)--type EncodeBuffer = Buffer Char -> Buffer Word8-                  -> IO (CodingProgress, Buffer Char, Buffer Word8)+type CodeBuffer from to = Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)+type DecodeBuffer = CodeBuffer Word8 Char+type EncodeBuffer = CodeBuffer Char Word8  type TextDecoder state = BufferCodec Word8 CharBufElem state type TextEncoder state = BufferCodec CharBufElem Word8 state@@ -124,6 +121,7 @@   -- | Returns the value of 'textEncodingName'   show te = textEncodingName te +-- | /Since: 4.4.0.0/ data CodingProgress = InputUnderflow  -- ^ Stopped because the input contains insufficient available elements,                                       -- or all of the input sequence has been sucessfully translated.                     | OutputUnderflow -- ^ Stopped because the output contains insufficient free elements
GHC/IO/Encoding/UTF16.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude+{-# LANGUAGE NoImplicitPrelude            , BangPatterns            , NondecreasingIndentation            , MagicHash@@ -57,6 +56,7 @@ utf16  :: TextEncoding utf16 = mkUTF16 ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF16 :: CodingFailureMode -> TextEncoding mkUTF16 cfm =  TextEncoding { textEncodingName = "UTF-16",                               mkTextDecoder = utf16_DF cfm,@@ -142,6 +142,7 @@ utf16be :: TextEncoding utf16be = mkUTF16be ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF16be :: CodingFailureMode -> TextEncoding mkUTF16be cfm = TextEncoding { textEncodingName = "UTF-16BE",                                mkTextDecoder = utf16be_DF cfm,@@ -170,6 +171,7 @@ utf16le :: TextEncoding utf16le = mkUTF16le ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF16le :: CodingFailureMode -> TextEncoding mkUTF16le cfm = TextEncoding { textEncodingName = "UTF16-LE",                                mkTextDecoder = utf16le_DF cfm,
GHC/IO/Encoding/UTF32.hs view
@@ -56,6 +56,7 @@ utf32  :: TextEncoding utf32 = mkUTF32 ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF32 :: CodingFailureMode -> TextEncoding mkUTF32 cfm = TextEncoding { textEncodingName = "UTF-32",                              mkTextDecoder = utf32_DF cfm,@@ -144,6 +145,7 @@ utf32be :: TextEncoding utf32be = mkUTF32be ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF32be :: CodingFailureMode -> TextEncoding mkUTF32be cfm = TextEncoding { textEncodingName = "UTF-32BE",                                mkTextDecoder = utf32be_DF cfm,@@ -173,6 +175,7 @@ utf32le :: TextEncoding utf32le = mkUTF32le ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF32le :: CodingFailureMode -> TextEncoding mkUTF32le cfm = TextEncoding { textEncodingName = "UTF-32LE",                                mkTextDecoder = utf32le_DF cfm,
GHC/IO/Encoding/UTF8.hs view
@@ -43,6 +43,7 @@ utf8 :: TextEncoding utf8 = mkUTF8 ErrorOnCodingFailure +-- | /Since: 4.4.0.0/ mkUTF8 :: CodingFailureMode -> TextEncoding mkUTF8 cfm = TextEncoding { textEncodingName = "UTF-8",                             mkTextDecoder = utf8_DF cfm,@@ -156,7 +157,8 @@                 _ | c0 <= 0x7f -> do                             ow' <- writeCharBuf oraw ow (unsafeChr (fromIntegral c0))                            loop (ir+1) ow'-                  | c0 >= 0xc0 && c0 <= 0xdf ->+                  | c0 >= 0xc0 && c0 <= 0xc1 -> invalid -- Overlong forms+                  | c0 >= 0xc2 && c0 <= 0xdf ->                            if iw - ir < 2 then done InputUnderflow ir ow else do                            c1 <- readWord8Buf iraw (ir+1)                            if (c1 < 0x80 || c1 >= 0xc0) then invalid else do
GHC/IO/Exception.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, DeriveDataTypeable, MagicHash #-}+{-# LANGUAGE NoImplicitPrelude, DeriveDataTypeable, MagicHash,+             ExistentialQuantification #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} @@ -8,7 +9,7 @@ -- Module      :  GHC.IO.Exception -- Copyright   :  (c) The University of Glasgow, 2009 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  libraries@haskell.org -- Stability   :  internal -- Portability :  non-portable@@ -22,7 +23,11 @@   BlockedIndefinitelyOnSTM(..), blockedIndefinitelyOnSTM,   Deadlock(..),   AssertionFailed(..),++  SomeAsyncException(..),+  asyncExceptionToException, asyncExceptionFromException,   AsyncException(..), stackOverflow, heapOverflow,+   ArrayException(..),   ExitCode(..), @@ -47,7 +52,7 @@ import GHC.IO.Handle.Types import Foreign.C.Types -import Data.Typeable     ( Typeable )+import Data.Typeable     ( Typeable, cast )  -- ------------------------------------------------------------------------ -- Exception datatypes and operations@@ -105,6 +110,28 @@  ----- +-- |Superclass for asynchronous exceptions.+--+-- /Since: 4.7.0.0/+data SomeAsyncException = forall e . Exception e => SomeAsyncException e+  deriving Typeable++instance Show SomeAsyncException where+    show (SomeAsyncException e) = show e++instance Exception SomeAsyncException++-- |/Since: 4.7.0.0/+asyncExceptionToException :: Exception e => e -> SomeException+asyncExceptionToException = toException . SomeAsyncException++-- |/Since: 4.7.0.0/+asyncExceptionFromException :: Exception e => SomeException -> Maybe e+asyncExceptionFromException x = do+    SomeAsyncException a <- fromException x+    cast a++ -- |Asynchronous exceptions. data AsyncException   = StackOverflow@@ -118,9 +145,9 @@         -- the program should take action to reduce the amount of         -- live data it has. Notes:         ---        --      * It is undefined which thread receives this exception.+        --   * It is undefined which thread receives this exception.         ---        --      * GHC currently does not throw 'HeapOverflow' exceptions.+        --   * GHC currently does not throw 'HeapOverflow' exceptions.   | ThreadKilled         -- ^This exception is raised by another thread         -- calling 'Control.Concurrent.killThread', or by the system@@ -132,7 +159,9 @@         -- via the usual mechanism(s) (e.g. Control-C in the console).   deriving (Eq, Ord, Typeable) -instance Exception AsyncException+instance Exception AsyncException where+  toException = asyncExceptionToException+  fromException = asyncExceptionFromException  -- | Exceptions generated by array operations data ArrayException@@ -188,18 +217,18 @@ ioException err = throwIO err  -- | Raise an 'IOError' in the 'IO' monad.-ioError         :: IOError -> IO a +ioError         :: IOError -> IO a ioError         =  ioException  -- --------------------------------------------------------------------------- -- IOError type --- | The Haskell 98 type for exceptions in the 'IO' monad.+-- | The Haskell 2010 type for exceptions in the 'IO' monad. -- Any I\/O operation may raise an 'IOError' instead of returning a result. -- For a more general type of exception, including also those that arise -- in pure code, see "Control.Exception.Exception". ----- In Haskell 98, this is an opaque type.+-- In Haskell 2010, this is an opaque type. type IOError = IOException  -- |Exceptions that occur in the @IO@ monad.@@ -208,7 +237,7 @@ -- flagged. data IOException  = IOError {-     ioe_handle   :: Maybe Handle,   -- the handle used by the action flagging +     ioe_handle   :: Maybe Handle,   -- the handle used by the action flagging                                      -- the error.      ioe_type     :: IOErrorType,    -- what it was.      ioe_location :: String,         -- location.@@ -221,12 +250,12 @@ instance Exception IOException  instance Eq IOException where-  (IOError h1 e1 loc1 str1 en1 fn1) == (IOError h2 e2 loc2 str2 en2 fn2) = +  (IOError h1 e1 loc1 str1 en1 fn1) == (IOError h2 e2 loc2 str2 en2 fn2) =     e1==e2 && str1==str2 && h1==h2 && loc1==loc2 && en1==en2 && fn1==fn2  -- | An abstract type that contains a value for each variant of 'IOError'. data IOErrorType-  -- Haskell 98:+  -- Haskell 2010:   = AlreadyExists   | NoSuchThing   | ResourceBusy@@ -249,8 +278,8 @@   | Interrupted  instance Eq IOErrorType where-   x == y = getTag x ==# getTag y- +   x == y = isTrue# (getTag x ==# getTag y)+ instance Show IOErrorType where   showsPrec _ e =     showString $@@ -279,7 +308,7 @@ -- The 'fail' method of the 'IO' instance of the 'Monad' class raises a -- 'userError', thus: ----- > instance Monad IO where +-- > instance Monad IO where -- >   ... -- >   fail s = ioError (userError s) --@@ -299,7 +328,7 @@       (case loc of          "" -> id          _  -> showString loc . showString ": ") .-      showsPrec p iot . +      showsPrec p iot .       (case s of          "" -> id          _  -> showString " (" . showString s . showString ")")@@ -313,7 +342,7 @@   | otherwise = throw (AssertionFailed (untangle str "Assertion failed"))  unsupportedOperation :: IOError-unsupportedOperation = +unsupportedOperation =    (IOError Nothing UnsupportedOperation ""         "Operation is not supported" Nothing Nothing) 
GHC/IO/FD.hs view
@@ -2,7 +2,6 @@ {-# LANGUAGE CPP            , NoImplicitPrelude            , BangPatterns-           , ForeignFunctionInterface            , DeriveDataTypeable   #-} {-# OPTIONS_GHC -fno-warn-identities #-}@@ -217,7 +216,7 @@  -- | Make a 'FD' from an existing file descriptor.  Fails if the FD -- refers to a directory.  If the FD refers to a file, `mkFD` locks--- the file according to the Haskell 98 single writer/multiple reader+-- the file according to the Haskell 2010 single writer/multiple reader -- locking semantics (this is why we need the `IOMode` argument too). mkFD :: CInt      -> IOMode@@ -280,9 +279,9 @@ #else getUniqueFileInfo fd _ _ = do   with 0 $ \devptr -> do-  with 0 $ \inoptr -> do-  c_getUniqueFileInfo fd devptr inoptr-  liftM2 (,) (peek devptr) (peek inoptr)+    with 0 $ \inoptr -> do+      c_getUniqueFileInfo fd devptr inoptr+      liftM2 (,) (peek devptr) (peek inoptr) #endif  #ifdef mingw32_HOST_OS@@ -315,7 +314,6 @@  close :: FD -> IO () close fd =-  (flip finally) (release fd) $   do let closer realFd =            throwErrnoIfMinus1Retry_ "GHC.IO.FD.close" $ #ifdef mingw32_HOST_OS@@ -324,6 +322,12 @@            else #endif              c_close (fromIntegral realFd)++     -- release the lock *first*, because otherwise if we're preempted+     -- after closing but before releasing, the FD may have been reused.+     -- (#7646)+     release fd+      closeFdWith closer (fromIntegral (fdFD fd))  release :: FD -> IO ()
GHC/IO/Handle/FD.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, PatternGuards, ForeignFunctionInterface #-}+{-# LANGUAGE CPP, NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -156,6 +156,8 @@ -- This can be useful for opening a FIFO for reading: if we open in -- non-blocking mode then the open will fail if there are no writers, -- whereas a blocking open will block until a writer appears.+--+-- /Since: 4.4.0.0/ openFileBlocking :: FilePath -> IOMode -> IO Handle openFileBlocking fp im =   catchException@@ -275,7 +277,7 @@               --  on Windows we're guessing this is not a socket (XXX)             False{-is_nonblock-}               -- file descriptors that we get from external sources are-              -- not put into non-blocking mode, becuase that would affect+              -- not put into non-blocking mode, because that would affect               -- other users of the file descriptor    let fd_str = "<file descriptor: " ++ show fd ++ ">"    mkHandleFromFD fd fd_type fd_str iomode False{-non-block-} 
GHC/IO/Handle/Internals.hs view
@@ -2,9 +2,8 @@ {-# LANGUAGE NoImplicitPrelude            , RecordWildCards            , BangPatterns-           , PatternGuards            , NondecreasingIndentation-           , Rank2Types+           , RankNTypes   #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-}@@ -26,7 +25,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.IO.Handle.Internals (   withHandle, withHandle', withHandle_,   withHandle__', withHandle_', withAllHandles__,@@ -57,6 +55,7 @@ import GHC.IO import GHC.IO.IOMode import GHC.IO.Encoding as Encoding+import GHC.IO.Encoding.Types (CodeBuffer) import GHC.IO.Handle.Types import GHC.IO.Buffer import GHC.IO.BufferedIO (BufferedIO)@@ -172,7 +171,7 @@         _ | Just ioe <- fromException e ->             ioError (augmentIOError ioe fun h)         _ | Just async_ex <- fromException e -> do -- see Note [async]-            let _ = async_ex :: AsyncException+            let _ = async_ex :: SomeAsyncException             t <- myThreadId             throwTo t e             do_operation fun h act m@@ -370,16 +369,26 @@ streamEncode :: BufferCodec from to state              -> Buffer from -> Buffer to              -> IO (Buffer from, Buffer to)-streamEncode codec from to = go (from, to)-  where -    go (from, to) = do+streamEncode codec from to = fmap (\(_, from', to') -> (from', to')) $ recoveringEncode codec from to++-- | Just like 'encode', but interleaves calls to 'encode' with calls to 'recover' in order to make as much progress as possible+recoveringEncode :: BufferCodec from to state -> CodeBuffer from to+recoveringEncode codec from to = go from to+  where+    go from to = do       (why, from', to') <- encode codec from to       -- When we are dealing with Handles, we don't care about input/output       -- underflow particularly, and we want to delay errors about invalid       -- sequences as far as possible.       case why of-        Encoding.InvalidSequence | bufL from == bufL from' -> recover codec from' to' >>= go-        _ -> return (from', to')+        InvalidSequence | bufL from == bufL from' -> do+          -- NB: it is OK to call recover here. Because we saw InvalidSequence, by the invariants+          -- on "encode" it must be the case that there is at least one elements available in the output+          -- buffer. Furthermore, clearly there is at least one element in the input buffer since we found+          -- something invalid there!+          (from', to') <- recover codec from' to'+          go from' to'+        _ -> return (why, from', to')  -- ----------------------------------------------------------------------------- -- Handle Finalizers@@ -802,6 +811,16 @@ -- Read characters into the provided buffer.  Return when any -- characters are available; raise an exception if the end of  -- file is reached.+--+-- In uses of readTextDevice within base, the input buffer is either:+--   * empty+--   * or contains a single \r (when doing newline translation)+--+-- The input character buffer must have a capacity at least 1 greater+-- than the number of elements it currently contains.+--+-- Users of this function expect that the buffer returned contains+-- at least 1 more character than the input buffer. readTextDevice :: Handle__ -> CharBuffer -> IO CharBuffer readTextDevice h_@Handle__{..} cbuf = do   --@@ -832,9 +851,13 @@   debugIO ("readTextDevice after decoding: cbuf=" ++ summaryBuffer cbuf' ++          " bbuf=" ++ summaryBuffer bbuf2) +  -- We can't return from readTextDevice without reading at least a single extra character,+  -- so check that we have managed to achieve that   writeIORef haByteBuffer bbuf2-  if bufR cbuf' == bufR cbuf -- no new characters-     then readTextDevice' h_ bbuf2 cbuf -- we need more bytes to make a Char+  if bufR cbuf' == bufR cbuf+     -- we need more bytes to make a Char. NB: bbuf2 may be empty (even though bbuf1 wasn't) when we+     -- are using an encoding that can skip bytes without outputting characters, such as UTF8//IGNORE+     then readTextDevice' h_ bbuf2 cbuf      else return cbuf'  -- we have an incomplete byte sequence at the end of the buffer: try to@@ -853,7 +876,11 @@   (r,bbuf2) <- Buffered.fillReadBuffer haDevice bbuf1   if r == 0    then do+     -- bbuf2 can be empty here when we encounter an invalid byte sequence at the end of the input+     -- with a //IGNORE codec which consumes bytes without outputting characters+     if isEmptyBuffer bbuf2 then ioe_EOF else do      (bbuf3, cbuf1) <- recover decoder bbuf2 cbuf0+     debugIO ("readTextDevice' after recovery: bbuf=" ++ summaryBuffer bbuf3 ++ ", cbuf=" ++ summaryBuffer cbuf1)      writeIORef haByteBuffer bbuf3      -- We should recursively invoke readTextDevice after recovery,      -- if recovery did not add at least one new character to the buffer:
GHC/IO/Handle/Text.hs view
@@ -3,10 +3,8 @@            , NoImplicitPrelude            , RecordWildCards            , BangPatterns-           , PatternGuards            , NondecreasingIndentation            , MagicHash-           , ForeignFunctionInterface   #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-}@@ -26,7 +24,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.IO.Handle.Text (          hWaitForInput, hGetChar, hGetLine, hGetContents, hPutChar, hPutStr,         commitBuffer',       -- hack, see below@@ -87,7 +84,7 @@ --    in this Handle's encoding. -- -- NOTE for GHC users: unless you use the @-threaded@ flag,--- @hWaitForInput t@ where @t >= 0@ will block all other Haskell+-- @hWaitForInput hdl t@ where @t >= 0@ will block all other Haskell -- threads for the duration of the call.  It behaves like a -- @safe@ foreign call in this respect. --@@ -878,9 +875,9 @@          flushCharReadBuffer h_          buf@Buffer{ bufSize=sz } <- readIORef haByteBuffer          if isEmptyBuffer buf-            then if count > sz  -- large read?-                    then do RawIO.read (haFD h_) (castPtr ptr) count-                    else do (r,buf') <- Buffered.fillReadBuffer haDevice buf+            then case count > sz of  -- large read? optimize it with a little special case:+                    True | Just fd <- haFD h_ -> do RawIO.read fd (castPtr ptr) count+                    _ -> do (r,buf') <- Buffered.fillReadBuffer haDevice buf                             if r == 0                                then return 0                                else do writeIORef haByteBuffer buf'@@ -892,11 +889,8 @@               let count' = min count (bufferElems buf)               in bufReadNBNonEmpty h_ buf (castPtr ptr) 0 count' -haFD :: Handle__ -> FD-haFD h_@Handle__{..} =-   case cast haDevice of-             Nothing -> error "not an FD"-             Just fd -> fd+haFD :: Handle__ -> Maybe FD+haFD h_@Handle__{..} = cast haDevice  -- | 'hGetBufNonBlocking' @hdl buf count@ reads data from the handle @hdl@ -- into the buffer @buf@ until either EOF is reached, or
GHC/IOArray.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude, DeriveDataTypeable #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} @@ -27,6 +27,7 @@ import GHC.Base import GHC.IO import GHC.Arr+import Data.Typeable.Internal  -- --------------------------------------------------------------------------- -- | An 'IOArray' is a mutable, boxed, non-strict array in the 'IO' monad.@@ -38,7 +39,7 @@ -- -- -newtype IOArray i e = IOArray (STArray RealWorld i e)+newtype IOArray i e = IOArray (STArray RealWorld i e) deriving( Typeable )  -- explicit instance because Haddock can't figure out a derived one instance Eq (IOArray i e) where
− GHC/IOBase.hs
@@ -1,93 +0,0 @@-{-# LANGUAGE Unsafe #-}-{-# LANGUAGE DeriveDataTypeable #-}-{-# OPTIONS_HADDOCK hide #-}---------------------------------------------------------------------------------- |--- Module      :  GHC.IOBase--- Copyright   :  (c) The University of Glasgow 1994-2009--- License     :  see libraries/base/LICENSE------ Maintainer  :  cvs-ghc@haskell.org--- Stability   :  internal--- Portability :  non-portable (GHC Extensions)------ Backwards-compatibility interface-----------------------------------------------------------------------------------module GHC.IOBase {-# DEPRECATED "use GHC.IO instead" #-} (-    IO(..), unIO, failIO, liftIO, bindIO, thenIO, returnIO,-    unsafePerformIO, unsafeInterleaveIO,-    unsafeDupablePerformIO, unsafeDupableInterleaveIO,-    noDuplicate,--        -- To and from from ST-    stToIO, ioToST, unsafeIOToST, unsafeSTToIO,--        -- References-    IORef(..), newIORef, readIORef, writeIORef,-    IOArray(..), newIOArray, readIOArray, writeIOArray, unsafeReadIOArray, unsafeWriteIOArray,-    MVar(..),--        -- Handles, file descriptors,-    FilePath,-    Handle(..), Handle__(..), HandleType(..), IOMode(..), FD,-    isReadableHandleType, isWritableHandleType, isReadWriteHandleType, showHandle,--        -- Buffers-    -- Buffer(..), RawBuffer, BufferState(..),-    BufferList(..), BufferMode(..),-    --bufferIsWritable, bufferEmpty, bufferFull,--        -- Exceptions-    Exception(..), ArithException(..), AsyncException(..), ArrayException(..),-    stackOverflow, heapOverflow, ioException,-    IOError, IOException(..), IOErrorType(..), ioError, userError,-    ExitCode(..),-    throwIO, block, unblock, blocked, catchAny, catchException,-    evaluate,-    ErrorCall(..), AssertionFailed(..), assertError, untangle,-    BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),-    blockedOnDeadMVar, blockedIndefinitely-  ) where--import GHC.Base-import GHC.Exception-import GHC.IO-import GHC.IO.Handle.Types-import GHC.IO.IOMode-import GHC.IO.Exception-import GHC.IOArray-import GHC.IORef-import GHC.MVar-import Foreign.C.Types-import Data.Typeable--type FD = CInt---- Backwards compat: this was renamed to BlockedIndefinitelyOnMVar-data BlockedOnDeadMVar = BlockedOnDeadMVar-    deriving Typeable--instance Exception BlockedOnDeadMVar--instance Show BlockedOnDeadMVar where-    showsPrec _ BlockedOnDeadMVar = showString "thread blocked indefinitely"--blockedOnDeadMVar :: SomeException -- for the RTS-blockedOnDeadMVar = toException BlockedOnDeadMVar----- Backwards compat: this was renamed to BlockedIndefinitelyOnSTM-data BlockedIndefinitely = BlockedIndefinitely-    deriving Typeable--instance Exception BlockedIndefinitely--instance Show BlockedIndefinitely where-    showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"--blockedIndefinitely :: SomeException -- for the RTS-blockedIndefinitely = toException BlockedIndefinitely-
GHC/IORef.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE NoImplicitPrelude, MagicHash #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash, DeriveDataTypeable #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} @@ -25,12 +25,13 @@ import GHC.Base import GHC.STRef import GHC.IO+import Data.Typeable.Internal( Typeable )  -- --------------------------------------------------------------------------- -- IORefs  -- |A mutable variable in the 'IO' monad-newtype IORef a = IORef (STRef RealWorld a)+newtype IORef a = IORef (STRef RealWorld a) deriving( Typeable )  -- explicit instance because Haddock can't figure out a derived one instance Eq (IORef a) where
GHC/IP.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -XNoImplicitPrelude #-}++-- | /Since: 4.6.0.0/ module GHC.IP (IP(..)) where  import GHC.TypeLits
GHC/Int.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash, UnboxedTuples,-             StandaloneDeriving #-}+             StandaloneDeriving, DeriveDataTypeable, NegativeLiterals #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -19,13 +19,13 @@  #include "MachDeps.h" --- #hide module GHC.Int (         Int8(..), Int16(..), Int32(..), Int64(..),         uncheckedIShiftL64#, uncheckedIShiftRA64#     ) where  import Data.Bits+import Data.Maybe  #if WORD_SIZE_IN_BITS < 64 import GHC.IntWord64@@ -37,10 +37,10 @@ import GHC.Real import GHC.Read import GHC.Arr-import GHC.Err import GHC.Word hiding (uncheckedShiftL64#, uncheckedShiftRL64#) import GHC.Show import GHC.Float ()     -- for RealFrac methods+import Data.Typeable   ------------------------------------------------------------------------@@ -50,7 +50,7 @@ -- Int8 is represented in the same way as Int. Operations may assume -- and must ensure that it holds only values from its logical range. -data {-# CTYPE "HsInt8" #-} Int8 = I8# Int# deriving (Eq, Ord)+data {-# CTYPE "HsInt8" #-} Int8 = I8# Int# deriving (Eq, Ord, Typeable) -- ^ 8-bit signed integer type  instance Show Int8 where@@ -141,14 +141,14 @@     (I8# x#) `xor` (I8# y#)   = I8# (word2Int# (int2Word# x# `xor#` int2Word# y#))     complement (I8# x#)       = I8# (word2Int# (int2Word# x# `xor#` int2Word# (-1#)))     (I8# x#) `shift` (I# i#)-        | i# >=# 0#           = I8# (narrow8Int# (x# `iShiftL#` i#))+        | isTrue# (i# >=# 0#) = I8# (narrow8Int# (x# `iShiftL#` i#))         | otherwise           = I8# (x# `iShiftRA#` negateInt# i#)-    (I8# x#) `shiftL` (I# i#) = I8# (narrow8Int# (x# `iShiftL#` i#))+    (I8# x#) `shiftL`       (I# i#) = I8# (narrow8Int# (x# `iShiftL#` i#))     (I8# x#) `unsafeShiftL` (I# i#) = I8# (narrow8Int# (x# `uncheckedIShiftL#` i#))-    (I8# x#) `shiftR` (I# i#) = I8# (x# `iShiftRA#` i#)+    (I8# x#) `shiftR`       (I# i#) = I8# (x# `iShiftRA#` i#)     (I8# x#) `unsafeShiftR` (I# i#) = I8# (x# `uncheckedIShiftRA#` i#)     (I8# x#) `rotate` (I# i#)-        | i'# ==# 0#+        | isTrue# (i'# ==# 0#)         = I8# x#         | otherwise         = I8# (narrow8Int# (word2Int# ((x'# `uncheckedShiftL#` i'#) `or#`@@ -156,12 +156,16 @@         where         !x'# = narrow8Word# (int2Word# x#)         !i'# = word2Int# (int2Word# i# `and#` 7##)-    bitSize  _                = 8+    bitSizeMaybe i            = Just (finiteBitSize i)+    bitSize i                 = finiteBitSize i     isSigned _                = True     popCount (I8# x#)         = I# (word2Int# (popCnt8# (int2Word# x#)))     bit                       = bitDefault     testBit                   = testBitDefault +instance FiniteBits Int8 where+    finiteBitSize _ = 8+ {-# RULES "fromIntegral/Int8->Int8" fromIntegral = id :: Int8 -> Int8 "fromIntegral/a->Int8"    fromIntegral = \x -> case fromIntegral x of I# x# -> I8# (narrow8Int# x#)@@ -170,32 +174,32 @@  {-# RULES "properFraction/Float->(Int8,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int8) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int8) n, y :: Float) } "truncate/Float->Int8"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int8) (truncate x)+    truncate = (fromIntegral :: Int -> Int8) . (truncate :: Float -> Int) "floor/Float->Int8"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int8) (floor x)+    floor    = (fromIntegral :: Int -> Int8) . (floor :: Float -> Int) "ceiling/Float->Int8"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int8) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int8) . (ceiling :: Float -> Int) "round/Float->Int8"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int8) (round x)+    round    = (fromIntegral :: Int -> Int8) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Int8,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int8) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int8) n, y :: Double) } "truncate/Double->Int8"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int8) (truncate x)+    truncate = (fromIntegral :: Int -> Int8) . (truncate :: Double -> Int) "floor/Double->Int8"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int8) (floor x)+    floor    = (fromIntegral :: Int -> Int8) . (floor :: Double -> Int) "ceiling/Double->Int8"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int8) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int8) . (ceiling :: Double -> Int) "round/Double->Int8"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int8) (round x)+    round    = (fromIntegral :: Int -> Int8) . (round  :: Double -> Int)   #-}  ------------------------------------------------------------------------@@ -205,7 +209,7 @@ -- Int16 is represented in the same way as Int. Operations may assume -- and must ensure that it holds only values from its logical range. -data {-# CTYPE "HsInt16" #-} Int16 = I16# Int# deriving (Eq, Ord)+data {-# CTYPE "HsInt16" #-} Int16 = I16# Int# deriving (Eq, Ord, Typeable) -- ^ 16-bit signed integer type  instance Show Int16 where@@ -296,14 +300,14 @@     (I16# x#) `xor` (I16# y#)  = I16# (word2Int# (int2Word# x# `xor#` int2Word# y#))     complement (I16# x#)       = I16# (word2Int# (int2Word# x# `xor#` int2Word# (-1#)))     (I16# x#) `shift` (I# i#)-        | i# >=# 0#            = I16# (narrow16Int# (x# `iShiftL#` i#))+        | isTrue# (i# >=# 0#)  = I16# (narrow16Int# (x# `iShiftL#` i#))         | otherwise            = I16# (x# `iShiftRA#` negateInt# i#)-    (I16# x#) `shiftL` (I# i#) = I16# (narrow16Int# (x# `iShiftL#` i#))+    (I16# x#) `shiftL`       (I# i#) = I16# (narrow16Int# (x# `iShiftL#` i#))     (I16# x#) `unsafeShiftL` (I# i#) = I16# (narrow16Int# (x# `uncheckedIShiftL#` i#))-    (I16# x#) `shiftR` (I# i#) = I16# (x# `iShiftRA#` i#)+    (I16# x#) `shiftR`       (I# i#) = I16# (x# `iShiftRA#` i#)     (I16# x#) `unsafeShiftR` (I# i#) = I16# (x# `uncheckedIShiftRA#` i#)     (I16# x#) `rotate` (I# i#)-        | i'# ==# 0#+        | isTrue# (i'# ==# 0#)         = I16# x#         | otherwise         = I16# (narrow16Int# (word2Int# ((x'# `uncheckedShiftL#` i'#) `or#`@@ -311,12 +315,16 @@         where         !x'# = narrow16Word# (int2Word# x#)         !i'# = word2Int# (int2Word# i# `and#` 15##)-    bitSize  _                 = 16+    bitSizeMaybe i             = Just (finiteBitSize i)+    bitSize i                  = finiteBitSize i     isSigned _                 = True     popCount (I16# x#)         = I# (word2Int# (popCnt16# (int2Word# x#)))     bit                        = bitDefault     testBit                    = testBitDefault +instance FiniteBits Int16 where+    finiteBitSize _ = 16+ {-# RULES "fromIntegral/Word8->Int16"  fromIntegral = \(W8# x#) -> I16# (word2Int# x#) "fromIntegral/Int8->Int16"   fromIntegral = \(I8# x#) -> I16# x#@@ -327,32 +335,32 @@  {-# RULES "properFraction/Float->(Int16,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int16) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int16) n, y :: Float) } "truncate/Float->Int16"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int16) (truncate x)+    truncate = (fromIntegral :: Int -> Int16) . (truncate :: Float -> Int) "floor/Float->Int16"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int16) (floor x)+    floor    = (fromIntegral :: Int -> Int16) . (floor :: Float -> Int) "ceiling/Float->Int16"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int16) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int16) . (ceiling :: Float -> Int) "round/Float->Int16"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int16) (round x)+    round    = (fromIntegral :: Int -> Int16) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Int16,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int16) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int16) n, y :: Double) } "truncate/Double->Int16"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int16) (truncate x)+    truncate = (fromIntegral :: Int -> Int16) . (truncate :: Double -> Int) "floor/Double->Int16"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int16) (floor x)+    floor    = (fromIntegral :: Int -> Int16) . (floor :: Double -> Int) "ceiling/Double->Int16"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int16) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int16) . (ceiling :: Double -> Int) "round/Double->Int16"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int16) (round x)+    round    = (fromIntegral :: Int -> Int16) . (round  :: Double -> Int)   #-}  ------------------------------------------------------------------------@@ -365,7 +373,7 @@ -- from its logical range. #endif -data {-# CTYPE "HsInt32" #-} Int32 = I32# Int# deriving (Eq, Ord)+data {-# CTYPE "HsInt32" #-} Int32 = I32# Int# deriving (Eq, Ord, Typeable) -- ^ 32-bit signed integer type  instance Show Int32 where@@ -456,15 +464,15 @@     (I32# x#) `xor` (I32# y#)  = I32# (word2Int# (int2Word# x# `xor#` int2Word# y#))     complement (I32# x#)       = I32# (word2Int# (int2Word# x# `xor#` int2Word# (-1#)))     (I32# x#) `shift` (I# i#)-        | i# >=# 0#            = I32# (narrow32Int# (x# `iShiftL#` i#))+        | isTrue# (i# >=# 0#)  = I32# (narrow32Int# (x# `iShiftL#` i#))         | otherwise            = I32# (x# `iShiftRA#` negateInt# i#)-    (I32# x#) `shiftL` (I# i#) = I32# (narrow32Int# (x# `iShiftL#` i#))+    (I32# x#) `shiftL`       (I# i#) = I32# (narrow32Int# (x# `iShiftL#` i#))     (I32# x#) `unsafeShiftL` (I# i#) =         I32# (narrow32Int# (x# `uncheckedIShiftL#` i#))-    (I32# x#) `shiftR` (I# i#) = I32# (x# `iShiftRA#` i#)+    (I32# x#) `shiftR`       (I# i#) = I32# (x# `iShiftRA#` i#)     (I32# x#) `unsafeShiftR` (I# i#) = I32# (x# `uncheckedIShiftRA#` i#)     (I32# x#) `rotate` (I# i#)-        | i'# ==# 0#+        | isTrue# (i'# ==# 0#)         = I32# x#         | otherwise         = I32# (narrow32Int# (word2Int# ((x'# `uncheckedShiftL#` i'#) `or#`@@ -472,12 +480,16 @@         where         !x'# = narrow32Word# (int2Word# x#)         !i'# = word2Int# (int2Word# i# `and#` 31##)-    bitSize  _                 = 32+    bitSizeMaybe i             = Just (finiteBitSize i)+    bitSize i                  = finiteBitSize i     isSigned _                 = True     popCount (I32# x#)         = I# (word2Int# (popCnt32# (int2Word# x#)))     bit                        = bitDefault     testBit                    = testBitDefault +instance FiniteBits Int32 where+    finiteBitSize _ = 32+ {-# RULES "fromIntegral/Word8->Int32"  fromIntegral = \(W8# x#) -> I32# (word2Int# x#) "fromIntegral/Word16->Int32" fromIntegral = \(W16# x#) -> I32# (word2Int# x#)@@ -490,32 +502,32 @@  {-# RULES "properFraction/Float->(Int32,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int32) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int32) n, y :: Float) } "truncate/Float->Int32"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int32) (truncate x)+    truncate = (fromIntegral :: Int -> Int32) . (truncate :: Float -> Int) "floor/Float->Int32"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int32) (floor x)+    floor    = (fromIntegral :: Int -> Int32) . (floor :: Float -> Int) "ceiling/Float->Int32"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int32) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int32) . (ceiling :: Float -> Int) "round/Float->Int32"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int32) (round x)+    round    = (fromIntegral :: Int -> Int32) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Int32,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int32) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int32) n, y :: Double) } "truncate/Double->Int32"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int32) (truncate x)+    truncate = (fromIntegral :: Int -> Int32) . (truncate :: Double -> Int) "floor/Double->Int32"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int32) (floor x)+    floor    = (fromIntegral :: Int -> Int32) . (floor :: Double -> Int) "ceiling/Double->Int32"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int32) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int32) . (ceiling :: Double -> Int) "round/Double->Int32"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int32) (round x)+    round    = (fromIntegral :: Int -> Int32) . (round  :: Double -> Int)   #-}  instance Real Int32 where@@ -536,18 +548,18 @@  #if WORD_SIZE_IN_BITS < 64 -data {-# CTYPE "HsInt64" #-} Int64 = I64# Int64#+data {-# CTYPE "HsInt64" #-} Int64 = I64# Int64# deriving( Typeable ) -- ^ 64-bit signed integer type  instance Eq Int64 where-    (I64# x#) == (I64# y#) = x# `eqInt64#` y#-    (I64# x#) /= (I64# y#) = x# `neInt64#` y#+    (I64# x#) == (I64# y#) = isTrue# (x# `eqInt64#` y#)+    (I64# x#) /= (I64# y#) = isTrue# (x# `neInt64#` y#)  instance Ord Int64 where-    (I64# x#) <  (I64# y#) = x# `ltInt64#` y#-    (I64# x#) <= (I64# y#) = x# `leInt64#` y#-    (I64# x#) >  (I64# y#) = x# `gtInt64#` y#-    (I64# x#) >= (I64# y#) = x# `geInt64#` y#+    (I64# x#) <  (I64# y#) = isTrue# (x# `ltInt64#` y#)+    (I64# x#) <= (I64# y#) = isTrue# (x# `leInt64#` y#)+    (I64# x#) >  (I64# y#) = isTrue# (x# `gtInt64#` y#)+    (I64# x#) >= (I64# y#) = isTrue# (x# `geInt64#` y#)  instance Show Int64 where     showsPrec p x = showsPrec p (toInteger x)@@ -623,9 +635,9 @@  -- Define div in terms of quot, being careful to avoid overflow (#7233) x# `divInt64#` y#-    | (x# `gtInt64#` zero) && (y# `ltInt64#` zero)+    | isTrue# (x# `gtInt64#` zero) && isTrue# (y# `ltInt64#` zero)         = ((x# `minusInt64#` one) `quotInt64#` y#) `minusInt64#` one-    | (x# `ltInt64#` zero) && (y# `gtInt64#` zero)+    | isTrue# (x# `ltInt64#` zero) && isTrue# (y# `gtInt64#` zero)         = ((x# `plusInt64#` one)  `quotInt64#` y#) `minusInt64#` one     | otherwise         = x# `quotInt64#` y#@@ -634,9 +646,9 @@     !one  = intToInt64# 1#  x# `modInt64#` y#-    | (x# `gtInt64#` zero) && (y# `ltInt64#` zero) ||-      (x# `ltInt64#` zero) && (y# `gtInt64#` zero)-        = if r# `neInt64#` zero then r# `plusInt64#` y# else zero+    | isTrue# (x# `gtInt64#` zero) && isTrue# (y# `ltInt64#` zero) ||+      isTrue# (x# `ltInt64#` zero) && isTrue# (y# `gtInt64#` zero)+        = if isTrue# (r# `neInt64#` zero) then r# `plusInt64#` y# else zero     | otherwise = r#     where     !zero = intToInt64# 0#@@ -655,14 +667,14 @@     (I64# x#) `xor` (I64# y#)  = I64# (word64ToInt64# (int64ToWord64# x# `xor64#` int64ToWord64# y#))     complement (I64# x#)       = I64# (word64ToInt64# (not64# (int64ToWord64# x#)))     (I64# x#) `shift` (I# i#)-        | i# >=# 0#            = I64# (x# `iShiftL64#` i#)+        | isTrue# (i# >=# 0#)  = I64# (x# `iShiftL64#` i#)         | otherwise            = I64# (x# `iShiftRA64#` negateInt# i#)     (I64# x#) `shiftL` (I# i#) = I64# (x# `iShiftL64#` i#)     (I64# x#) `unsafeShiftL` (I# i#) = I64# (x# `uncheckedIShiftL64#` i#)     (I64# x#) `shiftR` (I# i#) = I64# (x# `iShiftRA64#` i#)     (I64# x#) `unsafeShiftR` (I# i#) = I64# (x# `uncheckedIShiftRA64#` i#)     (I64# x#) `rotate` (I# i#)-        | i'# ==# 0#+        | isTrue# (i'# ==# 0#)         = I64# x#         | otherwise         = I64# (word64ToInt64# ((x'# `uncheckedShiftL64#` i'#) `or64#`@@ -670,7 +682,8 @@         where         !x'# = int64ToWord64# x#         !i'# = word2Int# (int2Word# i# `and#` 63##)-    bitSize  _                 = 64+    bitSizeMaybe i             = Just (finiteBitSize i)+    bitSize i                  = finiteBitSize i     isSigned _                 = True     popCount (I64# x#)         =         I# (word2Int# (popCnt64# (int64ToWord64# x#)))@@ -684,12 +697,12 @@  iShiftL64#, iShiftRA64# :: Int64# -> Int# -> Int64# -a `iShiftL64#` b  | b >=# 64# = intToInt64# 0#-		  | otherwise = a `uncheckedIShiftL64#` b+a `iShiftL64#` b  | isTrue# (b >=# 64#) = intToInt64# 0#+		  | otherwise           = a `uncheckedIShiftL64#` b -a `iShiftRA64#` b | b >=# 64# = if a `ltInt64#` (intToInt64# 0#)-					then intToInt64# (-1#)-					else intToInt64# 0#+a `iShiftRA64#` b | isTrue# (b >=# 64#) = if isTrue# (a `ltInt64#` (intToInt64# 0#))+				          then intToInt64# (-1#)+					  else intToInt64# 0# 		  | otherwise = a `uncheckedIShiftRA64#` b  {-# RULES@@ -710,7 +723,7 @@ -- Operations may assume and must ensure that it holds only values -- from its logical range. -data {-# CTYPE "HsInt64" #-} Int64 = I64# Int# deriving (Eq, Ord)+data {-# CTYPE "HsInt64" #-} Int64 = I64# Int# deriving (Eq, Ord, Typeable) -- ^ 64-bit signed integer type  instance Show Int64 where@@ -792,14 +805,14 @@     (I64# x#) `xor` (I64# y#)  = I64# (word2Int# (int2Word# x# `xor#` int2Word# y#))     complement (I64# x#)       = I64# (word2Int# (int2Word# x# `xor#` int2Word# (-1#)))     (I64# x#) `shift` (I# i#)-        | i# >=# 0#            = I64# (x# `iShiftL#` i#)+        | isTrue# (i# >=# 0#)  = I64# (x# `iShiftL#` i#)         | otherwise            = I64# (x# `iShiftRA#` negateInt# i#)-    (I64# x#) `shiftL` (I# i#) = I64# (x# `iShiftL#` i#)+    (I64# x#) `shiftL`       (I# i#) = I64# (x# `iShiftL#` i#)     (I64# x#) `unsafeShiftL` (I# i#) = I64# (x# `uncheckedIShiftL#` i#)-    (I64# x#) `shiftR` (I# i#) = I64# (x# `iShiftRA#` i#)+    (I64# x#) `shiftR`       (I# i#) = I64# (x# `iShiftRA#` i#)     (I64# x#) `unsafeShiftR` (I# i#) = I64# (x# `uncheckedIShiftRA#` i#)     (I64# x#) `rotate` (I# i#)-        | i'# ==# 0#+        | isTrue# (i'# ==# 0#)         = I64# x#         | otherwise         = I64# (word2Int# ((x'# `uncheckedShiftL#` i'#) `or#`@@ -807,7 +820,8 @@         where         !x'# = int2Word# x#         !i'# = word2Int# (int2Word# i# `and#` 63##)-    bitSize  _                 = 64+    bitSizeMaybe i             = Just (finiteBitSize i)+    bitSize i                  = finiteBitSize i     isSigned _                 = True     popCount (I64# x#)         = I# (word2Int# (popCnt64# (int2Word# x#)))     bit                        = bitDefault@@ -820,32 +834,32 @@  {-# RULES "properFraction/Float->(Int64,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int64) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int64) n, y :: Float) } "truncate/Float->Int64"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int64) (truncate x)+    truncate = (fromIntegral :: Int -> Int64) . (truncate :: Float -> Int) "floor/Float->Int64"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int64) (floor x)+    floor    = (fromIntegral :: Int -> Int64) . (floor :: Float -> Int) "ceiling/Float->Int64"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int64) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int64) . (ceiling :: Float -> Int) "round/Float->Int64"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int64) (round x)+    round    = (fromIntegral :: Int -> Int64) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Int64,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Int64) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Int64) n, y :: Double) } "truncate/Double->Int64"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int64) (truncate x)+    truncate = (fromIntegral :: Int -> Int64) . (truncate :: Double -> Int) "floor/Double->Int64"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int64) (floor x)+    floor    = (fromIntegral :: Int -> Int64) . (floor :: Double -> Int) "ceiling/Double->Int64"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int64) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Int64) . (ceiling :: Double -> Int) "round/Double->Int64"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int64) (round x)+    round    = (fromIntegral :: Int -> Int64) . (round  :: Double -> Int)   #-}  uncheckedIShiftL64# :: Int# -> Int# -> Int#@@ -854,6 +868,9 @@ uncheckedIShiftRA64# :: Int# -> Int# -> Int# uncheckedIShiftRA64# = uncheckedIShiftRA# #endif++instance FiniteBits Int64 where+    finiteBitSize _ = 64  instance Real Int64 where     toRational x = toInteger x % 1
GHC/List.lhs view
@@ -8,7 +8,7 @@ -- Module      :  GHC.List -- Copyright   :  (c) The University of Glasgow 1994-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC Extensions)@@ -17,9 +17,8 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.List (-   -- [] (..),          -- Not Haskell 98; built in syntax+   -- [] (..),          -- built-in syntax; can't be used in export list     map, (++), filter, concat,    head, last, tail, init, null, length, (!!),@@ -58,16 +57,17 @@ head                    :: [a] -> a head (x:_)              =  x head []                 =  badHead+{-# NOINLINE [1] head #-}  badHead :: a badHead = errorEmptyList "head" --- This rule is useful in cases like +-- This rule is useful in cases like --      head [y | (x,y) <- ps, x==t] {-# RULES "head/build"    forall (g::forall b.(a->b->b)->b->b) .                 head (build g) = g (\x _ -> x) badHead-"head/augment"  forall xs (g::forall b. (a->b->b) -> b -> b) . +"head/augment"  forall xs (g::forall b. (a->b->b) -> b -> b) .                 head (augment g xs) = g (\x _ -> x) (head xs)  #-} @@ -113,18 +113,32 @@ -- | /O(n)/. 'length' returns the length of a finite list as an 'Int'. -- It is an instance of the more general 'Data.List.genericLength', -- the result type of which may be any kind of number.+{-# NOINLINE [1] length #-} length                  :: [a] -> Int-length l                =  len l 0#-  where-    len :: [a] -> Int# -> Int-    len []     a# = I# a#-    len (_:xs) a# = len xs (a# +# 1#)+length l                =  lenAcc l 0# +lenAcc :: [a] -> Int# -> Int+lenAcc []     a# = I# a#+lenAcc (_:xs) a# = lenAcc xs (a# +# 1#)++incLen :: a -> (Int# -> Int) -> Int# -> Int+incLen _ g x = g (x +# 1#)++-- These rules make length into a good consumer+-- Note that we use a higher-order-style use of foldr, so that+-- the accumulating parameter can be evaluated strictly+-- See Trac #876 for what goes wrong otherwise+{-# RULES+"length"     [~1] forall xs. length xs = foldr incLen I# xs 0#+"lengthList" [1]  foldr incLen I# = lenAcc+ #-}+ -- | 'filter', applied to a predicate and a list, returns the list of -- those elements that satisfy the predicate; i.e., -- -- > filter p xs = [ x | x <- xs, p x] +{-# NOINLINE [1] filter #-} filter :: (a -> Bool) -> [a] -> [a] filter _pred []    = [] filter pred (x:xs)@@ -164,7 +178,7 @@ -- can be inlined, and then (often) strictness-analysed, -- and hence the classic space leak on foldl (+) 0 xs -foldl        :: (a -> b -> a) -> a -> [b] -> a+foldl        :: (b -> a -> b) -> b -> [a] -> b foldl f z0 xs0 = lgo z0 xs0              where                 lgo z []     =  z@@ -179,7 +193,7 @@ -- -- > last (scanl f z xs) == foldl f z xs. -scanl                   :: (a -> b -> a) -> a -> [b] -> [a]+scanl                   :: (b -> a -> b) -> b -> [a] -> [b] scanl f q ls            =  q : (case ls of                                 []   -> []                                 x:xs -> scanl f (f q x) xs)@@ -211,7 +225,7 @@ scanr                   :: (a -> b -> b) -> b -> [a] -> [b] scanr _ q0 []           =  [q0] scanr f q0 (x:xs)       =  f x q : qs-                           where qs@(q:_) = scanr f q0 xs +                           where qs@(q:_) = scanr f q0 xs  -- | 'scanr1' is a variant of 'scanr' that has no starting value argument. @@ -219,20 +233,21 @@ scanr1 _ []             =  [] scanr1 _ [x]            =  [x] scanr1 f (x:xs)         =  f x q : qs-                           where qs@(q:_) = scanr1 f xs +                           where qs@(q:_) = scanr1 f xs  -- | 'iterate' @f x@ returns an infinite list of repeated applications -- of @f@ to @x@: -- -- > iterate f x == [x, f x, f (f x), ...] +{-# NOINLINE [1] iterate #-} iterate :: (a -> a) -> a -> [a] iterate f x =  x : iterate f (f x) +{-# NOINLINE [0] iterateFB #-} iterateFB :: (a -> b -> b) -> (a -> a) -> a -> b iterateFB c f x = x `c` iterateFB c f (f x) - {-# RULES "iterate"    [~1] forall f x.   iterate f x = build (\c _n -> iterateFB c f x) "iterateFB"  [1]                iterateFB (:) = iterate@@ -281,7 +296,7 @@  takeWhile               :: (a -> Bool) -> [a] -> [a] takeWhile _ []          =  []-takeWhile p (x:xs) +takeWhile p (x:xs)             | p x       =  x : takeWhile p xs             | otherwise =  [] @@ -356,14 +371,14 @@  #else /* hack away */ {-# RULES-"take"     [~1] forall n xs . take n xs = takeFoldr n xs +"take"     [~1] forall n xs . take n xs = takeFoldr n xs "takeList"  [1] forall n xs . foldr (takeFB (:) []) (takeConst []) xs n = takeUInt n xs  #-}  {-# INLINE takeFoldr #-} takeFoldr :: Int -> [a] -> [a] takeFoldr (I# n#) xs-  = build (\c nil -> if n# <=# 0# then nil else+  = build (\c nil -> if isTrue# (n# <=# 0#) then nil else                      foldr (takeFB c nil) (takeConst nil) xs n#)  {-# NOINLINE [0] takeConst #-}@@ -374,8 +389,8 @@  {-# NOINLINE [0] takeFB #-} takeFB :: (a -> b -> b) -> b -> a -> (Int# -> b) -> Int# -> b-takeFB c n x xs m | m <=# 1#  = x `c` n-                  | otherwise = x `c` xs (m -# 1#)+takeFB c n x xs m | isTrue# (m <=# 1#) = x `c` n+                  | otherwise          = x `c` xs (m -# 1#)  {-# INLINE [0] take #-} take (I# n#) xs = takeUInt n# xs@@ -386,8 +401,8 @@  takeUInt :: Int# -> [b] -> [b] takeUInt n xs-  | n >=# 0#  =  take_unsafe_UInt n xs-  | otherwise =  []+  | isTrue# (n >=# 0#) = take_unsafe_UInt n xs+  | otherwise          = []  take_unsafe_UInt :: Int# -> [b] -> [b] take_unsafe_UInt 0#  _  = []@@ -398,8 +413,8 @@  takeUInt_append :: Int# -> [b] -> [b] -> [b] takeUInt_append n xs rs-  | n >=# 0#  =  take_unsafe_UInt_append n xs rs-  | otherwise =  []+  | isTrue# (n >=# 0#) = take_unsafe_UInt_append n xs rs+  | otherwise          = []  take_unsafe_UInt_append :: Int# -> [b] -> [b] -> [b] take_unsafe_UInt_append 0#  _ rs  = rs@@ -409,8 +424,8 @@     (x:xs) -> x : take_unsafe_UInt_append (m -# 1#) xs rs  drop (I# n#) ls-  | n# <# 0#    = ls-  | otherwise   = drop# n# ls+  | isTrue# (n# <# 0#) = ls+  | otherwise          = drop# n# ls     where         drop# :: Int# -> [a] -> [a]         drop# 0# xs      = xs@@ -418,8 +433,8 @@         drop# m# (_:xs)  = drop# (m# -# 1#) xs  splitAt (I# n#) ls-  | n# <# 0#    = ([], ls)-  | otherwise   = splitAt# n# ls+  | isTrue# (n# <# 0#) = ([], ls)+  | otherwise          = splitAt# n# ls     where         splitAt# :: Int# -> [a] -> ([a], [a])         splitAt# 0# xs     = ([], xs)@@ -433,11 +448,11 @@ -- | 'span', applied to a predicate @p@ and a list @xs@, returns a tuple where -- first element is longest prefix (possibly empty) of @xs@ of elements that -- satisfy @p@ and second element is the remainder of the list:--- +-- -- > span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4]) -- > span (< 9) [1,2,3] == ([1,2,3],[]) -- > span (< 0) [1,2,3] == ([],[1,2,3])--- +-- -- 'span' @p xs@ is equivalent to @('takeWhile' p xs, 'dropWhile' p xs)@  span                    :: (a -> Bool) -> [a] -> ([a],[a])@@ -449,7 +464,7 @@ -- | 'break', applied to a predicate @p@ and a list @xs@, returns a tuple where -- first element is longest prefix (possibly empty) of @xs@ of elements that -- /do not satisfy/ @p@ and second element is the remainder of the list:--- +-- -- > break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4]) -- > break (< 9) [1,2,3] == ([],[1,2,3]) -- > break (> 9) [1,2,3] == ([1,2,3],[])@@ -497,10 +512,13 @@ or []           =  False or (x:xs)       =  x || or xs +{-# NOINLINE [1] and #-}+{-# NOINLINE [1] or #-}+ {-# RULES-"and/build"     forall (g::forall b.(Bool->b->b)->b->b) . +"and/build"     forall (g::forall b.(Bool->b->b)->b->b) .                 and (build g) = g (&&) True-"or/build"      forall (g::forall b.(Bool->b->b)->b->b) . +"or/build"      forall (g::forall b.(Bool->b->b)->b->b) .                 or (build g) = g (||) False  #-} #endif@@ -525,10 +543,14 @@  all _ []        =  True all p (x:xs)    =  p x && all p xs++{-# NOINLINE [1] any #-}+{-# NOINLINE [1] all #-}+ {-# RULES-"any/build"     forall p (g::forall b.(a->b->b)->b->b) . +"any/build"     forall p (g::forall b.(a->b->b)->b->b) .                 any p (build g) = g ((||) . p) False-"all/build"     forall p (g::forall b.(a->b->b)->b->b) . +"all/build"     forall p (g::forall b.(a->b->b)->b->b) .                 all p (build g) = g ((&&) . p) True  #-} #endif@@ -566,6 +588,8 @@ concat :: [[a]] -> [a] concat = foldr (++) [] +{-# NOINLINE [1] concat #-}+ {-# RULES   "concat" forall xs. concat xs = build (\c n -> foldr (\x y -> foldr c y x) n xs) -- We don't bother to turn non-fusible applications of concat back into concat@@ -589,12 +613,12 @@ -- The semantics is not quite the same for error conditions -- in the more efficient version. ---xs !! (I# n0) | n0 <# 0#   =  error "Prelude.(!!): negative index\n"-               | otherwise =  sub xs n0+xs !! (I# n0) | isTrue# (n0 <# 0#) =  error "Prelude.(!!): negative index\n"+              | otherwise          =  sub xs n0                          where                             sub :: [a] -> Int# -> a                             sub []     _ = error "Prelude.(!!): index too large\n"-                            sub (y:ys) n = if n ==# 0#+                            sub (y:ys) n = if isTrue# (n ==# 0#)                                            then y                                            else sub ys (n -# 1#) #endif@@ -609,9 +633,12 @@  \begin{code} foldr2 :: (a -> b -> c -> c) -> c -> [a] -> [b] -> c-foldr2 _k z []    _ys    = z-foldr2 _k z _xs   []     = z-foldr2 k z (x:xs) (y:ys) = k x y (foldr2 k z xs ys)+foldr2 k z = go+  where+	go []    _ys     = z+	go _xs   []      = z+	go (x:xs) (y:ys) = k x y (go xs ys)+{-# INLINE [0] foldr2 #-}  foldr2_left :: (a -> b -> c -> d) -> d -> a -> ([b] -> c) -> [b] -> d foldr2_left _k  z _x _r []     = z@@ -624,10 +651,10 @@ -- foldr2 k z xs ys = foldr (foldr2_left k z)  (\_ -> z) xs ys -- foldr2 k z xs ys = foldr (foldr2_right k z) (\_ -> z) ys xs {-# RULES-"foldr2/left"   forall k z ys (g::forall b.(a->b->b)->b->b) . +"foldr2/left"   forall k z ys (g::forall b.(a->b->b)->b->b) .                   foldr2 k z (build g) ys = g (foldr2_left  k z) (\_ -> z) ys -"foldr2/right"  forall k z xs (g::forall b.(a->b->b)->b->b) . +"foldr2/right"  forall k z xs (g::forall b.(a->b->b)->b->b) .                   foldr2 k z xs (build g) = g (foldr2_right k z) (\_ -> z) xs  #-} \end{code}@@ -649,6 +676,7 @@ -- | 'zip' takes two lists and returns a list of corresponding pairs. -- If one input list is short, excess elements of the longer list are -- discarded.+{-# NOINLINE [1] zip #-} zip :: [a] -> [b] -> [(a,b)] zip (a:as) (b:bs) = (a,b) : zip as bs zip _      _      = []@@ -684,6 +712,7 @@ -- as the first argument, instead of a tupling function. -- For example, @'zipWith' (+)@ is applied to two lists to produce the -- list of corresponding sums.+{-# NOINLINE [1] zipWith #-} zipWith :: (a->b->c) -> [a]->[b]->[c] zipWith f (a:as) (b:bs) = f a b : zipWith f as bs zipWith _ _      _      = []
GHC/MVar.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE Unsafe #-}+{-# LANGUAGE Unsafe, DeriveDataTypeable #-} {-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-}@@ -20,20 +20,23 @@ module GHC.MVar (         -- * MVars           MVar(..)-        , newMVar       -- :: a -> IO (MVar a)-        , newEmptyMVar  -- :: IO (MVar a)-        , takeMVar      -- :: MVar a -> IO a-        , putMVar       -- :: MVar a -> a -> IO ()-        , tryTakeMVar   -- :: MVar a -> IO (Maybe a)-        , tryPutMVar    -- :: MVar a -> a -> IO Bool-        , isEmptyMVar   -- :: MVar a -> IO Bool-        , addMVarFinalizer -- :: MVar a -> IO () -> IO ()+        , newMVar+        , newEmptyMVar+        , takeMVar+        , readMVar+        , putMVar+        , tryTakeMVar+        , tryPutMVar+        , tryReadMVar+        , isEmptyMVar+        , addMVarFinalizer     ) where  import GHC.Base import Data.Maybe+import Data.Typeable -data MVar a = MVar (MVar# RealWorld a)+data MVar a = MVar (MVar# RealWorld a) deriving( Typeable ) {- ^ An 'MVar' (pronounced \"em-var\") is a synchronising variable, used for communication between concurrent threads.  It can be thought of@@ -42,7 +45,7 @@  -- pull in Eq (Mvar a) too, to avoid GHC.Conc being an orphan-instance module instance Eq (MVar a) where-        (MVar mvar1#) == (MVar mvar2#) = sameMVar# mvar1# mvar2#+        (MVar mvar1#) == (MVar mvar2#) = isTrue# (sameMVar# mvar1# mvar2#)  {- M-Vars are rendezvous points for concurrent threads.  They begin@@ -87,6 +90,31 @@ takeMVar :: MVar a -> IO a takeMVar (MVar mvar#) = IO $ \ s# -> takeMVar# mvar# s# +-- |Atomically read the contents of an 'MVar'.  If the 'MVar' is+-- currently empty, 'readMVar' will wait until its full.+-- 'readMVar' is guaranteed to receive the next 'putMVar'.+--+-- 'readMVar' is multiple-wakeup, so when multiple readers are+-- blocked on an 'MVar', all of them are woken up at the same time.+--+-- /Compatibility note:/ Prior to base 4.7, 'readMVar' was a combination+-- of 'takeMVar' and 'putMVar'.  This mean that in the presence of+-- other threads attempting to 'putMVar', 'readMVar' could block.+-- Furthermore, 'readMVar' would not receive the next 'putMVar' if there+-- was already a pending thread blocked on 'takeMVar'.  The old behavior+-- can be recovered by implementing 'readMVar as follows:+--+-- @+--  readMVar :: MVar a -> IO a+--  readMVar m =+--    mask_ $ do+--      a <- takeMVar m+--      putMVar m a+--      return a+-- @+readMVar :: MVar a -> IO a+readMVar (MVar mvar#) = IO $ \ s# -> readMVar# mvar# s#+ -- |Put a value into an 'MVar'.  If the 'MVar' is currently full, -- 'putMVar' will wait until it becomes empty. --@@ -125,6 +153,17 @@         (# s, 0# #) -> (# s, False #)         (# s, _  #) -> (# s, True #) +-- |A non-blocking version of 'readMVar'.  The 'tryReadMVar' function+-- returns immediately, with 'Nothing' if the 'MVar' was empty, or+-- @'Just' a@ if the 'MVar' was full with contents @a@.+--+-- /Since: 4.7.0.0/+tryReadMVar :: MVar a -> IO (Maybe a)+tryReadMVar (MVar m) = IO $ \ s ->+    case tryReadMVar# m s of+        (# s', 0#, _ #) -> (# s', Nothing #)      -- MVar is empty+        (# s', _,  a #) -> (# s', Just a  #)      -- MVar is full+ -- |Check whether a given 'MVar' is empty. -- -- Notice that the boolean value returned  is just a snapshot of@@ -134,7 +173,7 @@ isEmptyMVar :: MVar a -> IO Bool isEmptyMVar (MVar mv#) = IO $ \ s# ->     case isEmptyMVar# mv# s# of-        (# s2#, flg #) -> (# s2#, not (flg ==# 0#) #)+        (# s2#, flg #) -> (# s2#, isTrue# (flg /=# 0#) #)  -- |Add a finalizer to an 'MVar' (GHC only).  See "Foreign.ForeignPtr" and -- "System.Mem.Weak" for more about finalizers.
GHC/Num.lhs view
@@ -16,7 +16,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Num (module GHC.Num, module GHC.Integer) where  import GHC.Base@@ -63,6 +62,7 @@     {-# INLINE negate #-}     x - y               = x + negate y     negate x            = 0 - x+    {-# MINIMAL (+), (*), abs, signum, fromInteger, (negate | (-)) #-}  -- | the same as @'flip' ('-')@. --
GHC/PArr.hs view
@@ -20,7 +20,6 @@ --                This will be cleaned up when we change the internal represention of '[::]' to not --                rely on a wired-in type constructor. --- #hide module GHC.PArr where  import GHC.Base
GHC/Pack.lhs view
@@ -22,15 +22,14 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Pack        (         -- (**) - emitted by compiler. -        packCString#,      -- :: [Char] -> ByteArray#    (**)+        packCString#,         unpackCString,-        unpackCString#,    -- :: Addr# -> [Char]         (**)-        unpackNBytes#,     -- :: Addr# -> Int# -> [Char] (**)+        unpackCString#,+        unpackNBytes#,         unpackFoldrCString#,  -- (**)         unpackAppendCString#,  -- (**)        ) 
+ GHC/Profiling.hs view
@@ -0,0 +1,5 @@+-- | /Since: 4.7.0.0/+module GHC.Profiling where++foreign import ccall startProfTimer :: IO ()+foreign import ccall stopProfTimer :: IO ()
GHC/Ptr.lhs view
@@ -1,6 +1,6 @@ \begin{code} {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, RoleAnnotations #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -17,7 +17,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Ptr (         Ptr(..), FunPtr(..),         nullPtr, castPtr, plusPtr, alignPtr, minusPtr,@@ -38,6 +37,7 @@ ------------------------------------------------------------------------ -- Data pointers. +type role Ptr representational data Ptr a = Ptr Addr# deriving (Eq, Ord) -- ^ A value of type @'Ptr' a@ represents a pointer to an object, or an -- array of objects, which may be marshalled to or from Haskell values@@ -82,6 +82,7 @@ ------------------------------------------------------------------------ -- Function pointers for the default calling convention. +type role FunPtr representational data FunPtr a = FunPtr Addr# deriving (Eq, Ord) -- ^ A value of type @'FunPtr' a@ is a pointer to a function callable -- from foreign code.  The type @a@ will normally be a /foreign type/,
GHC/Read.lhs view
@@ -1,7 +1,6 @@ \begin{code} {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, StandaloneDeriving, PatternGuards,-             ScopedTypeVariables #-}+{-# LANGUAGE NoImplicitPrelude, StandaloneDeriving, ScopedTypeVariables #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -18,40 +17,36 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Read   ( Read(..)   -- class    -- ReadS type-  , ReadS      -- :: *; = String -> [(a,String)]+  , ReadS -  -- H98 compatibility-  , lex         -- :: ReadS String-  , lexLitChar  -- :: ReadS String-  , readLitChar -- :: ReadS Char-  , lexDigits   -- :: ReadS String+  -- H2010 compatibility+  , lex+  , lexLitChar+  , readLitChar+  , lexDigits    -- defining readers-  , lexP       -- :: ReadPrec Lexeme-  , paren      -- :: ReadPrec a -> ReadPrec a-  , parens     -- :: ReadPrec a -> ReadPrec a-  , list       -- :: ReadPrec a -> ReadPrec [a]-  , choose     -- :: [(String, ReadPrec a)] -> ReadPrec a+  , lexP, expectP+  , paren+  , parens+  , list+  , choose   , readListDefault, readListPrecDefault+  , readNumber    -- Temporary   , readParen--  -- XXX Can this be removed?-  , readp   )  where  import qualified Text.ParserCombinators.ReadP as P  import Text.ParserCombinators.ReadP-  ( ReadP-  , ReadS+  ( ReadS   , readP_to_S   ) @@ -71,7 +66,6 @@ import GHC.Float import GHC.Show import GHC.Base-import GHC.Err import GHC.Arr \end{code} @@ -83,7 +77,7 @@ -- @'readParen' 'False' p@ parses what @p@ parses, but optionally -- surrounded with parentheses. readParen       :: Bool -> ReadS a -> ReadS a--- A Haskell 98 function+-- A Haskell 2010 function readParen b g   =  if b then mandatory else optional                    where optional r  = g r ++ mandatory r                          mandatory r = do@@ -131,7 +125,7 @@ -- > infixr 5 :^: -- > data Tree a =  Leaf a  |  Tree a :^: Tree a ----- the derived instance of 'Read' in Haskell 98 is equivalent to+-- the derived instance of 'Read' in Haskell 2010 is equivalent to -- -- > instance (Read a) => Read (Tree a) where -- >@@ -210,6 +204,7 @@   readList     = readPrec_to_S (list readPrec) 0   readPrec     = readS_to_Prec readsPrec   readListPrec = readS_to_Prec (\_ -> readList)+  {-# MINIMAL readsPrec | readPrec #-}  readListDefault :: Read a => ReadS [a] -- ^ A possible replacement definition for the 'readList' method (GHC only).@@ -223,7 +218,7 @@ readListPrecDefault = list readPrec  --------------------------------------------------------------------------- H98 compatibility+-- H2010 compatibility  -- | The 'lex' function reads a single lexeme from the input, discarding -- initial white space, and returning the characters that constitute the@@ -240,7 +235,7 @@ -- * Octal and hexadecimal numerics are not recognized as a single token -- -- * Comments are not treated properly-lex :: ReadS String             -- As defined by H98+lex :: ReadS String             -- As defined by H2010 lex s  = readP_to_S L.hsLex s  -- | Read a string representation of a character, using Haskell@@ -248,7 +243,7 @@ -- -- > lexLitChar  "\\nHello"  =  [("\\n", "Hello")] ---lexLitChar :: ReadS String      -- As defined by H98+lexLitChar :: ReadS String      -- As defined by H2010 lexLitChar = readP_to_S (do { (s, _) <- P.gather L.lexChar ;                               return s })         -- There was a skipSpaces before the P.gather L.lexChar,@@ -260,7 +255,7 @@ -- -- > readLitChar "\\nHello"  =  [('\n', "Hello")] ---readLitChar :: ReadS Char       -- As defined by H98+readLitChar :: ReadS Char       -- As defined by H2010 readLitChar = readP_to_S L.lexChar  -- | Reads a non-empty string of decimal digits.@@ -274,12 +269,15 @@ -- ^ Parse a single lexeme lexP = lift L.lex +expectP :: L.Lexeme -> ReadPrec ()+expectP lexeme = lift (L.expect lexeme)+ paren :: ReadPrec a -> ReadPrec a -- ^ @(paren p)@ parses \"(P0)\" --      where @p@ parses \"P0\" in precedence context zero-paren p = do L.Punc "(" <- lexP-             x          <- reset p-             L.Punc ")" <- lexP+paren p = do expectP (L.Punc "(")+             x <- reset p+             expectP (L.Punc ")")              return x  parens :: ReadPrec a -> ReadPrec a@@ -296,7 +294,7 @@ -- using the usual square-bracket syntax. list readx =   parens-  ( do L.Punc "[" <- lexP+  ( do expectP (L.Punc "[")        (listRest False +++ listNext)   )  where@@ -317,7 +315,7 @@ -- Esp useful for nullary constructors; e.g. --    @choose [(\"A\", return A), (\"B\", return B)]@ -- We match both Ident and Symbol because the constructor--- might be an operator eg (:=:)+-- might be an operator eg @(:~:)@ choose sps = foldr ((+++) . try_one) pfail sps            where              try_one (s,p) = do { token <- lexP ;@@ -348,7 +346,7 @@          return s      +++       readListPrecDefault       -- Looks for ['f','o','o']-    )                           -- (more generous than H98 spec)+    )                           -- (more generous than H2010 spec)    readList = readListDefault @@ -412,12 +410,12 @@ instance Read a => Read (Maybe a) where   readPrec =     parens-    (do L.Ident "Nothing" <- lexP+    (do expectP (L.Ident "Nothing")         return Nothing      +++      prec appPrec (-        do L.Ident "Just" <- lexP-           x              <- step readPrec+        do expectP (L.Ident "Just")+           x <- step readPrec            return (Just x))     ) @@ -431,7 +429,7 @@  instance  (Ix a, Read a, Read b) => Read (Array a b)  where     readPrec = parens $ prec appPrec $-               do L.Ident "array" <- lexP+               do expectP (L.Ident "array")                   theBounds <- step readPrec                   vals   <- step readPrec                   return (array theBounds vals)@@ -508,9 +506,9 @@   readPrec =     parens     ( prec ratioPrec-      ( do x            <- step readPrec-           L.Symbol "%" <- lexP-           y            <- step readPrec+      ( do x <- step readPrec+           expectP (L.Symbol "%")+           y <- step readPrec            return (x % y)       )     )@@ -547,7 +545,7 @@ wrap_tup p = parens (paren p)  read_comma :: ReadPrec ()-read_comma = do { L.Punc "," <- lexP; return () }+read_comma = expectP (L.Punc ",")  read_tup2 :: (Read a, Read b) => ReadPrec (a,b) -- Reads "a , b"  no parens!@@ -682,9 +680,3 @@   readList     = readListDefault \end{code} -\begin{code}--- XXX Can this be removed?--readp :: Read a => ReadP a-readp = readPrec_to_P readPrec minPrec-\end{code}
GHC/Real.lhs view
@@ -18,7 +18,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Real where  import GHC.Base@@ -26,7 +25,7 @@ import GHC.List import GHC.Enum import GHC.Show-import GHC.Err+import {-# SOURCE #-} GHC.Exception( divZeroException, overflowException, ratioZeroDenomException )  #ifdef OPTIMISE_INTEGER_GCD_LCM import GHC.Integer.GMP.Internals@@ -43,6 +42,29 @@  %********************************************************* %*                                                      *+       Divide by zero and arithmetic overflow+%*                                                      *+%*********************************************************++We put them here because they are needed relatively early+in the libraries before the Exception type has been defined yet.++\begin{code}+{-# NOINLINE divZeroError #-}+divZeroError :: a+divZeroError = raise# divZeroException++{-# NOINLINE ratioZeroDenominatorError #-}+ratioZeroDenominatorError :: a+ratioZeroDenominatorError = raise# ratioZeroDenomException++{-# NOINLINE overflowError #-}+overflowError :: a+overflowError = raise# overflowException+\end{code}++%*********************************************************+%*                                                      * \subsection{The @Ratio@ and @Rational@ types} %*                                                      * %*********************************************************@@ -169,6 +191,7 @@     {-# INLINE (/) #-}     recip x             =  1 / x     x / y               = x * recip y+    {-# MINIMAL fromRational, (recip | (/)) #-}  -- | Extracting components of fractions. --@@ -323,7 +346,7 @@         | y /= 0                = (W# (x# `quotWord#` y#), W# (x# `remWord#` y#))         | otherwise             = divZeroError     toInteger (W# x#)-        | i# >=# 0#             = smallInteger i#+        | isTrue# (i# >=# 0#)   = smallInteger i#         | otherwise             = wordToInteger x#         where         !i# = word2Int# x#@@ -359,30 +382,46 @@ instance  Real Integer  where     toRational x        =  x :% 1 +-- Note [Integer division constant folding]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+--+-- Constant folding of quot, rem, div, mod, divMod and quotRem for+-- Integer arguments depends crucially on inlining. Constant folding+-- rules defined in compiler/prelude/PrelRules.lhs trigger for+-- quotInteger, remInteger and so on. So if calls to quot, rem and so on+-- were not inlined the rules would not fire. The rules would also not+-- fire if calls to quotInteger and so on were inlined, but this does not+-- happen because they are all marked with NOINLINE pragma - see documentation+-- of integer-gmp or integer-simple.+ instance  Integral Integer where     toInteger n      = n +    {-# INLINE quot #-}     _ `quot` 0 = divZeroError     n `quot` d = n `quotInteger` d +    {-# INLINE rem #-}     _ `rem` 0 = divZeroError-    n `rem`  d = n `remInteger`  d+    n `rem` d = n `remInteger` d +    {-# INLINE div #-}     _ `div` 0 = divZeroError     n `div` d = n `divInteger` d +    {-# INLINE mod #-}     _ `mod` 0 = divZeroError-    n `mod`  d = n `modInteger`  d+    n `mod` d = n `modInteger` d +    {-# INLINE divMod #-}     _ `divMod` 0 = divZeroError-    a `divMod` b = case a `divModInteger` b of-                   (# x, y #) -> (x, y)+    n `divMod` d = case n `divModInteger` d of+                     (# x, y #) -> (x, y) +    {-# INLINE quotRem #-}     _ `quotRem` 0 = divZeroError-    a `quotRem` b = case a `quotRemInteger` b of-                    (# q, r #) -> (q, r)--    -- use the defaults for div & mod+    n `quotRem` d = case n `quotRemInteger` d of+                      (# q, r #) -> (q, r) \end{code}  @@ -461,6 +500,7 @@  \begin{code} -- | general coercion from integral types+{-# NOINLINE [1] fromIntegral #-} fromIntegral :: (Integral a, Num b) => a -> b fromIntegral = fromInteger . toInteger @@ -476,6 +516,7 @@  -- | general coercion to fractional types realToFrac :: (Real a, Fractional b) => a -> b+{-# NOINLINE [1] realToFrac #-} realToFrac = fromRational . toRational \end{code} @@ -506,7 +547,7 @@         Integer -> Integer -> Integer,         Integer -> Int -> Integer,         Int -> Int -> Int #-}-{-# INLINABLE (^) #-}    -- See Note [Inlining (^)]+{-# INLINABLE [1] (^) #-}    -- See Note [Inlining (^)] (^) :: (Num a, Integral b) => a -> b -> a x0 ^ y0 | y0 < 0    = error "Negative exponent"         | y0 == 0   = 1@@ -522,7 +563,7 @@  -- | raise a number to an integral power (^^)            :: (Fractional a, Integral b) => a -> b -> a-{-# INLINABLE (^^) #-}         -- See Note [Inlining (^)+{-# INLINABLE [1] (^^) #-}         -- See Note [Inlining (^) x ^^ n          =  if n >= 0 then x^n else recip (x^(negate n))  {- Note [Inlining (^)@@ -644,6 +685,7 @@ -- the result may be negative if one of the arguments is @'minBound'@ (and -- necessarily is if the other is @0@ or @'minBound'@) for such types. gcd             :: (Integral a) => a -> a -> a+{-# NOINLINE [1] gcd #-} gcd x y         =  gcd' (abs x) (abs y)                    where gcd' a 0  =  a                          gcd' a b  =  gcd' b (a `rem` b)@@ -651,19 +693,20 @@ -- | @'lcm' x y@ is the smallest positive integer that both @x@ and @y@ divide. lcm             :: (Integral a) => a -> a -> a {-# SPECIALISE lcm :: Int -> Int -> Int #-}+{-# NOINLINE [1] lcm #-} lcm _ 0         =  0 lcm 0 _         =  0 lcm x y         =  abs ((x `quot` (gcd x y)) * y)  #ifdef OPTIMISE_INTEGER_GCD_LCM {-# RULES-"gcd/Int->Int->Int"             gcd = gcdInt+"gcd/Int->Int->Int"             gcd = gcdInt' "gcd/Integer->Integer->Integer" gcd = gcdInteger "lcm/Integer->Integer->Integer" lcm = lcmInteger  #-} -gcdInt :: Int -> Int -> Int-gcdInt a b = fromIntegral (gcdInteger (fromIntegral a) (fromIntegral b))+gcdInt' :: Int -> Int -> Int+gcdInt' (I# x) (I# y) = I# (gcdInt x y) #endif  integralEnumFrom :: (Integral a, Bounded a) => a -> [a]
GHC/ST.lhs view
@@ -1,6 +1,6 @@ \begin{code} {-# LANGUAGE Unsafe #-}-{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, Rank2Types #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- |@@ -16,7 +16,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.ST (         ST(..), STret(..), STRep,         fixST, runST, runSTRep,
GHC/STRef.lhs view
@@ -17,7 +17,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.STRef (         STRef(..),         newSTRef, readSTRef, writeSTRef@@ -48,6 +47,6 @@  -- Just pointer equality on mutable references: instance Eq (STRef s a) where-    STRef v1# == STRef v2# = sameMutVar# v1# v2#+    STRef v1# == STRef v2# = isTrue# (sameMutVar# v1# v2#)  \end{code}
GHC/Show.lhs view
@@ -32,7 +32,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Show         (         Show(..), ShowS,@@ -157,6 +156,7 @@     showsPrec _ x s = show x ++ s     show x          = shows x ""     showList ls   s = showList__ shows ls s+    {-# MINIMAL showsPrec | show #-}  showList__ :: (a -> ShowS) ->  [a] -> ShowS showList__ _     []     s = "[]" ++ s@@ -209,7 +209,7 @@  showWord :: Word# -> ShowS showWord w# cs- | w# `ltWord#` 10## = C# (chr# (ord# '0'# +# word2Int# w#)) : cs+ | isTrue# (w# `ltWord#` 10##) = C# (chr# (ord# '0'# +# word2Int# w#)) : cs  | otherwise = case chr# (ord# '0'# +# word2Int# (w# `remWord#` 10##)) of                c# ->                    showWord (w# `quotWord#` 10##) (C# c# : cs)@@ -366,7 +366,7 @@ showLitChar '\v'           s =  showString "\\v" s showLitChar '\SO'          s =  protectEsc (== 'H') (showString "\\SO") s showLitChar c              s =  showString ('\\' : asciiTab!!ord c) s-        -- I've done manual eta-expansion here, becuase otherwise it's+        -- I've done manual eta-expansion here, because otherwise it's         -- impossible to stop (asciiTab!!ord) getting floated out as an MFE  showLitString :: String -> ShowS@@ -390,12 +390,12 @@ --   * break the string into multiple lines --   * wrap the entire thing in double quotes -- Example:  @showMultiLineString "hello\ngoodbye\nblah"@--- returns   @["\"hello\\", "\\goodbye\\", "\\blah\""]@+-- returns   @["\"hello\\n\\", "\\goodbye\n\\", "\\blah\""]@ showMultiLineString str   = go '\"' str   where     go ch s = case break (== '\n') s of-                (l, _:s'@(_:_)) -> (ch : showLitString l "\\") : go '\\' s'+                (l, _:s'@(_:_)) -> (ch : showLitString l "\\n\\") : go '\\' s'                 (l, _)          -> [ch : showLitString l "\""]  isDec :: Char -> Bool@@ -424,20 +424,20 @@ -- lower-case hexadecimal digits. intToDigit :: Int -> Char intToDigit (I# i)-    | i >=# 0#  && i <=#  9# =  unsafeChr (ord '0' + I# i)-    | i >=# 10# && i <=# 15# =  unsafeChr (ord 'a' + I# i - 10)-    | otherwise           =  error ("Char.intToDigit: not a digit " ++ show (I# i))+    | isTrue# (i >=# 0#)  && isTrue# (i <=#  9#) = unsafeChr (ord '0' + I# i)+    | isTrue# (i >=# 10#) && isTrue# (i <=# 15#) = unsafeChr (ord 'a' + I# i - 10)+    | otherwise =  error ("Char.intToDigit: not a digit " ++ show (I# i))  showSignedInt :: Int -> Int -> ShowS showSignedInt (I# p) (I# n) r-    | n <# 0# && p ># 6# = '(' : itos n (')' : r)-    | otherwise          = itos n r+    | isTrue# (n <# 0#) && isTrue# (p ># 6#) = '(' : itos n (')' : r)+    | otherwise                              = itos n r  itos :: Int# -> String -> String itos n# cs-    | n# <# 0# =+    | isTrue# (n# <# 0#) =         let !(I# minInt#) = minInt in-        if n# ==# minInt#+        if isTrue# (n# ==# minInt#)                 -- negateInt# minInt overflows, so we can't do that:            then '-' : (case n# `quotRemInt#` 10# of                        (# q, r #) ->@@ -447,7 +447,7 @@     where     itos' :: Int# -> String -> String     itos' x# cs'-        | x# <# 10#  = C# (chr# (ord# '0'# +# x#)) : cs'+        | isTrue# (x# <# 10#) = C# (chr# (ord# '0'# +# x#)) : cs'         | otherwise = case x# `quotRemInt#` 10# of                       (# q, r #) ->                           case chr# (ord# '0'# +# r) of
GHC/Stable.lhs view
@@ -1,9 +1,8 @@ \begin{code}-{-# LANGUAGE Unsafe #-}+{-# LANGUAGE Unsafe, DeriveDataTypeable #-} {-# LANGUAGE NoImplicitPrelude            , MagicHash            , UnboxedTuples-           , ForeignFunctionInterface   #-} {-# OPTIONS_HADDOCK hide #-} @@ -21,18 +20,18 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Stable (         StablePtr(..),-        newStablePtr,         -- :: a -> IO (StablePtr a)    -        deRefStablePtr,       -- :: StablePtr a -> a-        freeStablePtr,        -- :: StablePtr a -> IO ()-        castStablePtrToPtr,   -- :: StablePtr a -> Ptr ()-        castPtrToStablePtr    -- :: Ptr () -> StablePtr a+        newStablePtr,+        deRefStablePtr,+        freeStablePtr,+        castStablePtrToPtr,+        castPtrToStablePtr     ) where  import GHC.Ptr import GHC.Base+import Data.Typeable.Internal  ----------------------------------------------------------------------------- -- Stable Pointers@@ -49,6 +48,7 @@ expression of type @a@. -} data {-# CTYPE "HsStablePtr" #-} StablePtr a = StablePtr (StablePtr# a)+  deriving( Typeable )  -- | -- Create a stable pointer referring to the given Haskell value.
GHC/Stack.hsc view
@@ -10,13 +10,15 @@ -- -- Access to GHC's call-stack simulation --+-- /Since: 4.5.0.0/ ----------------------------------------------------------------------------- -{-# LANGUAGE UnboxedTuples, MagicHash, EmptyDataDecls #-}+{-# LANGUAGE UnboxedTuples, MagicHash #-} module GHC.Stack (     -- * Call stack     currentCallStack,     whoCreated,+    errorWithStackTrace,      -- * Internals     CostCentreStack,@@ -40,6 +42,7 @@ import GHC.Ptr import GHC.Foreign as GHC import GHC.IO.Encoding+import GHC.Exception  #define PROFILING #include "Rts.h"@@ -80,6 +83,8 @@ -- and contains suitable SCC annotations (e.g. by using @-fprof-auto@). -- Otherwise, the list returned is likely to be empty or -- uninformative.+--+-- /Since: 4.5.0.0/  currentCallStack :: IO [String] currentCallStack = ccsToStrings =<< getCurrentCCS ()@@ -99,6 +104,9 @@            then return acc            else go parent ((mdl ++ '.':lbl ++ ' ':'(':loc ++ ")") : acc) +-- | Get the stack trace attached to an object.+--+-- /Since: 4.5.0.0/ whoCreated :: a -> IO [String] whoCreated obj = do   ccs <- getCCSOf obj@@ -106,3 +114,14 @@  renderStack :: [String] -> String renderStack strs = "Stack trace:" ++ concatMap ("\n  "++) (reverse strs)++-- | Like the function 'error', but appends a stack trace to the error+-- message if one is available.+--+-- /Since: 4.7.0.0/+errorWithStackTrace :: String -> a+errorWithStackTrace x = unsafeDupablePerformIO $ do+   stack <- ccsToStrings =<< getCurrentCCS x+   if null stack+      then throwIO (ErrorCall x)+      else throwIO (ErrorCall (x ++ '\n' : renderStack stack))
GHC/Stats.hsc view
@@ -1,6 +1,4 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP #-}-{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -funbox-strict-fields #-} @@ -11,6 +9,7 @@ -- -- This module is GHC-only and should not be considered portable. --+-- /Since: 4.5.0.0/ ----------------------------------------------------------------------------- module GHC.Stats     ( GCStats(..)@@ -28,11 +27,17 @@ #include "Rts.h"  foreign import ccall "getGCStats"        getGCStats_       :: Ptr () -> IO ()++-- | Returns whether GC stats have been enabled (with @+RTS -T@, for example).+--+-- /Since: 4.6.0.0/ foreign import ccall "getGCStatsEnabled" getGCStatsEnabled :: IO Bool  -- I'm probably violating a bucket of constraints here... oops.  -- | Global garbage collection and memory statistics.+--+-- /Since: 4.5.0.0/ data GCStats = GCStats     { bytesAllocated :: !Int64 -- ^ Total number of bytes allocated     , numGcs :: !Int64 -- ^ Number of garbage collections performed@@ -79,6 +84,8 @@ -- | Retrieves garbage collection and memory statistics as of the last -- garbage collection.  If you would like your statistics as recent as -- possible, first run a 'System.Mem.performGC'.+--+-- /Since: 4.5.0.0/ getGCStats :: IO GCStats getGCStats = do   statsEnabled <- getGCStatsEnabled
GHC/Storable.lhs view
@@ -17,7 +17,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Storable         ( readWideCharOffPtr           , readIntOffPtr       
GHC/TopHandler.lhs view
@@ -2,10 +2,8 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP            , NoImplicitPrelude-           , ForeignFunctionInterface            , MagicHash            , UnboxedTuples-           , PatternGuards   #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_HADDOCK hide #-}@@ -25,7 +23,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.TopHandler (         runMainIO, runIO, runIOFastExit, runNonIO,         topHandler, topHandlerFastExit,@@ -148,22 +145,22 @@ --  another error, etc.) -- real_handler :: (Int -> IO a) -> SomeException -> IO a-real_handler exit se@(SomeException exn) = do+real_handler exit se = do   flushStdHandles -- before any error output-  case cast exn of+  case fromException se of       Just StackOverflow -> do            reportStackOverflow            exit 2        Just UserInterrupt  -> exitInterrupted -      _ -> case cast exn of+      _ -> case fromException se of            -- only the main thread gets ExitException exceptions            Just ExitSuccess     -> exit 0            Just (ExitFailure n) -> exit n             -- EPIPE errors received for stdout are ignored (#2699)-           _ -> case cast exn of+           _ -> case fromException se of                 Just IOError{ ioe_type = ResourceVanished,                               ioe_errno = Just ioe,                               ioe_handle = Just hdl }@@ -180,11 +177,34 @@   hFlush stdout `catchAny` \_ -> return ()   hFlush stderr `catchAny` \_ -> return () --- we have to use unsafeCoerce# to get the 'IO a' result type, since the--- compiler doesn't let us declare that as the result type of a foreign export.-safeExit :: Int -> IO a-safeExit r = unsafeCoerce# (shutdownHaskellAndExit $ fromIntegral r)+safeExit, fastExit :: Int -> IO a+safeExit = exitHelper useSafeExit+fastExit = exitHelper useFastExit +unreachable :: IO a+unreachable = fail "If you can read this, shutdownHaskellAndExit did not exit."++exitHelper :: CInt -> Int -> IO a+#ifdef mingw32_HOST_OS+exitHelper exitKind r =+  shutdownHaskellAndExit (fromIntegral r) exitKind >> unreachable+#else+-- On Unix we use an encoding for the ExitCode:+--      0 -- 255  normal exit code+--   -127 -- -1   exit by signal+-- For any invalid encoding we just use a replacement (0xff).+exitHelper exitKind r+  | r >= 0 && r <= 255+  = shutdownHaskellAndExit   (fromIntegral   r)  exitKind >> unreachable+  | r >= -127 && r <= -1+  = shutdownHaskellAndSignal (fromIntegral (-r)) exitKind >> unreachable+  | otherwise+  = shutdownHaskellAndExit   0xff                exitKind >> unreachable++foreign import ccall "shutdownHaskellAndSignal"+  shutdownHaskellAndSignal :: CInt -> CInt -> IO ()+#endif+ exitInterrupted :: IO a exitInterrupted =  #ifdef mingw32_HOST_OS@@ -192,20 +212,16 @@ #else   -- we must exit via the default action for SIGINT, so that the   -- parent of this process can take appropriate action (see #2301)-  unsafeCoerce# (shutdownHaskellAndSignal CONST_SIGINT)--foreign import ccall "shutdownHaskellAndSignal"-  shutdownHaskellAndSignal :: CInt -> IO ()+  safeExit (-CONST_SIGINT) #endif  -- NOTE: shutdownHaskellAndExit must be called "safe", because it *can* -- re-enter Haskell land through finalizers. foreign import ccall "Rts.h shutdownHaskellAndExit"-  shutdownHaskellAndExit :: CInt -> IO ()+  shutdownHaskellAndExit :: CInt -> CInt -> IO () -fastExit :: Int -> IO a-fastExit r = unsafeCoerce# (stg_exit (fromIntegral r))+useFastExit, useSafeExit :: CInt+useFastExit = 1+useSafeExit = 0 -foreign import ccall "Rts.h stg_exit"-  stg_exit :: CInt -> IO () \end{code}
GHC/TypeLits.hs view
@@ -1,187 +1,228 @@-{-# LANGUAGE DataKinds #-}              -- to declare the kinds-{-# LANGUAGE KindSignatures #-}         -- (used all over)-{-# LANGUAGE TypeFamilies #-}           -- for declaring operators + sing family-{-# LANGUAGE TypeOperators #-}          -- for declaring operator-{-# LANGUAGE EmptyDataDecls #-}         -- for declaring the kinds-{-# LANGUAGE GADTs #-}                  -- for examining type nats-{-# LANGUAGE PolyKinds #-}              -- for Sing family-{-# LANGUAGE UndecidableInstances #-}   -- for a bunch of the instances-{-# LANGUAGE FlexibleInstances #-}      -- for kind parameters-{-# LANGUAGE FlexibleContexts #-}       -- for kind parameters-{-# LANGUAGE ScopedTypeVariables #-}    -- for kind parameters-{-# LANGUAGE MultiParamTypeClasses #-}  -- for <=, singRep, SingE-{-# LANGUAGE FunctionalDependencies #-} -- for SingRep and SingE+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE UndecidableInstances #-}  -- for compiling instances of (==) {-# OPTIONS_GHC -XNoImplicitPrelude #-} {-| This module is an internal GHC module.  It declares the constants used in the implementation of type-level natural numbers.  The programmer interface-for workin with type-level naturals should be defined in a separate library. -}+for working with type-level naturals should be defined in a separate library. +/Since: 4.6.0.0/+-}+ module GHC.TypeLits   ( -- * Kinds     Nat, Symbol      -- * Linking type and value level-  , Sing, SingI, SingE, SingRep, sing, fromSing-  , unsafeSingNat, unsafeSingSymbol-  , Kind+  , KnownNat, natVal+  , KnownSymbol, symbolVal+  , SomeNat(..), SomeSymbol(..)+  , someNatVal, someSymbolVal+  , sameNat, sameSymbol -    -- * Working with singletons-  , withSing, singThat -    -- * Functions on type nats-  , type (<=), type (<=?), type (+), type (*), type (^)+    -- * Functions on type literals+  , type (<=), type (<=?), type (+), type (*), type (^), type (-)+  , CmpNat, CmpSymbol -    -- * Destructing type-nats.-  , isZero, IsZero(..)-  , isEven, IsEven(..)   ) where -import GHC.Base(Eq((==)), Bool(..), ($), otherwise, (.))-import GHC.Num(Integer, (-))+import GHC.Base(Eq(..), Ord(..), Bool(True,False), Ordering(..), otherwise)+import GHC.Num(Integer) import GHC.Base(String)-import GHC.Read(Read(..)) import GHC.Show(Show(..))-import GHC.Prim(Any)-import Unsafe.Coerce(unsafeCoerce)-import Data.Bits(testBit,shiftR)+import GHC.Read(Read(..))+import GHC.Prim(magicDict) import Data.Maybe(Maybe(..))-import Data.List((++))---- | A type synonym useful for passing kinds as parameters.-type Kind = Any-+import Data.Proxy(Proxy(..))+import Data.Type.Equality(type (==), (:~:)(Refl))+import Unsafe.Coerce(unsafeCoerce) --- | This is the *kind* of type-level natural numbers.+-- | (Kind) This is the kind of type-level natural numbers. data Nat --- | This is the *kind* of type-level symbols.+-- | (Kind) This is the kind of type-level symbols. data Symbol   ---------------------------------------------------------------------------------data family Sing (n :: k) -newtype instance Sing (n :: Nat)    = SNat Integer+-- | This class gives the integer associated with a type-level natural.+-- There are instances of the class for every concrete literal: 0, 1, 2, etc.+--+-- /Since: 4.7.0.0/+class KnownNat (n :: Nat) where+  natSing :: SNat n -newtype instance Sing (n :: Symbol) = SSym String+-- | This class gives the integer associated with a type-level symbol.+-- There are instances of the class for every concrete literal: "hello", etc.+--+-- /Since: 4.7.0.0/+class KnownSymbol (n :: Symbol) where+  symbolSing :: SSymbol n -unsafeSingNat :: Integer -> Sing (n :: Nat)-unsafeSingNat = SNat+-- | /Since: 4.7.0.0/+natVal :: forall n proxy. KnownNat n => proxy n -> Integer+natVal _ = case natSing :: SNat n of+             SNat x -> x -unsafeSingSymbol :: String -> Sing (n :: Symbol)-unsafeSingSymbol = SSym+-- | /Since: 4.7.0.0/+symbolVal :: forall n proxy. KnownSymbol n => proxy n -> String+symbolVal _ = case symbolSing :: SSymbol n of+                SSymbol x -> x --------------------------------------------------------------------------------- --- | The class 'SingI' provides a \"smart\" constructor for singleton types.--- There are built-in instances for the singleton types corresponding--- to type literals. -class SingI a where+-- | This type represents unknown type-level natural numbers.+data SomeNat    = forall n. KnownNat n    => SomeNat    (Proxy n)+                  -- ^ /Since: 4.7.0.0/ -  -- | The only value of type @Sing a@-  sing :: Sing a+-- | This type represents unknown type-level symbols.+data SomeSymbol = forall n. KnownSymbol n => SomeSymbol (Proxy n)+                  -- ^ /Since: 4.7.0.0/ ------------------------------------------------------------------------------------ | Comparsion of type-level naturals.-class (m :: Nat) <= (n :: Nat)+-- | Convert an integer into an unknown type-level natural.+--+-- /Since: 4.7.0.0/+someNatVal :: Integer -> Maybe SomeNat+someNatVal n+  | n >= 0        = Just (withSNat SomeNat (SNat n) Proxy)+  | otherwise     = Nothing -type family (m :: Nat) <=? (n :: Nat) :: Bool+-- | Convert a string into an unknown type-level symbol.+--+-- /Since: 4.7.0.0/+someSymbolVal :: String -> SomeSymbol+someSymbolVal n   = withSSymbol SomeSymbol (SSymbol n) Proxy --- | Addition of type-level naturals.-type family (m :: Nat) + (n :: Nat) :: Nat --- | Multiplication of type-level naturals.-type family (m :: Nat) * (n :: Nat) :: Nat --- | Exponentiation of type-level naturals.-type family (m :: Nat) ^ (n :: Nat) :: Nat+instance Eq SomeNat where+  SomeNat x == SomeNat y = natVal x == natVal y +instance Ord SomeNat where+  compare (SomeNat x) (SomeNat y) = compare (natVal x) (natVal y) ---------------------------------------------------------------------------------+instance Show SomeNat where+  showsPrec p (SomeNat x) = showsPrec p (natVal x) -{- | A class that converts singletons of a given kind into values of some-representation type (i.e., we "forget" the extra information carried-by the singletons, and convert them to ordinary values).+instance Read SomeNat where+  readsPrec p xs = do (a,ys) <- readsPrec p xs+                      case someNatVal a of+                        Nothing -> []+                        Just n  -> [(n,ys)] -Note that 'fromSing' is overloaded based on the /kind/ of the values-and not their type---all types of a given kind are processed by the-same instances.--} -class (kparam ~ Kind) => SingE (kparam :: k) rep | kparam -> rep where-  fromSing :: Sing (a :: k) -> rep+instance Eq SomeSymbol where+  SomeSymbol x == SomeSymbol y = symbolVal x == symbolVal y -instance SingE (Kind :: Nat) Integer where-  fromSing (SNat n) = n+instance Ord SomeSymbol where+  compare (SomeSymbol x) (SomeSymbol y) = compare (symbolVal x) (symbolVal y) -instance SingE (Kind :: Symbol) String where-  fromSing (SSym s) = s+instance Show SomeSymbol where+  showsPrec p (SomeSymbol x) = showsPrec p (symbolVal x) +instance Read SomeSymbol where+  readsPrec p xs = [ (someSymbolVal a, ys) | (a,ys) <- readsPrec p xs ] -{- | A convenience class, useful when we need to both introduce and eliminate-a given singleton value. Users should never need to define instances of-this classes. -}-class    (SingI a, SingE (Kind :: k) rep) => SingRep (a :: k) rep | a -> rep-instance (SingI a, SingE (Kind :: k) rep) => SingRep (a :: k) rep+type family EqNat (a :: Nat) (b :: Nat) where+  EqNat a a = True+  EqNat a b = False+type instance a == b = EqNat a b +type family EqSymbol (a :: Symbol) (b :: Symbol) where+  EqSymbol a a = True+  EqSymbol a b = False+type instance a == b = EqSymbol a b -{- | A convenience function useful when we need to name a singleton value-multiple times.  Without this function, each use of 'sing' could potentially-refer to a different singleton, and one has to use type signatures to-ensure that they are the same. -}+-------------------------------------------------------------------------------- -withSing :: SingI a => (Sing a -> b) -> b-withSing f = f sing+infix  4 <=?, <=+infixl 6 +, -+infixl 7 *+infixr 8 ^ +-- | Comparison of type-level naturals, as a constraint.+type x <= y = (x <=? y) ~ True -{- | A convenience function that names a singleton satisfying a certain-property.  If the singleton does not satisfy the property, then the function-returns 'Nothing'. The property is expressed in terms of the underlying-representation of the singleton. -}+-- | Comparison of type-level symbols, as a function.+--+-- /Since: 4.7.0.0/+type family CmpSymbol (m :: Symbol) (n :: Symbol) :: Ordering -singThat :: (SingRep a rep) => (rep -> Bool) -> Maybe (Sing a)-singThat p = withSing $ \x -> if p (fromSing x) then Just x else Nothing+-- | Comparison of type-level naturals, as a function.+--+-- /Since: 4.7.0.0/+type family CmpNat    (m :: Nat)    (n :: Nat)    :: Ordering +{- | Comparison of type-level naturals, as a function.+NOTE: The functionality for this function should be subsumed+by 'CmpNat', so this might go away in the future.+Please let us know, if you encounter discrepancies between the two. -}+type family (m :: Nat) <=? (n :: Nat) :: Bool +-- | Addition of type-level naturals.+type family (m :: Nat) + (n :: Nat) :: Nat -instance (SingE (Kind :: k) rep, Show rep) => Show (Sing (a :: k)) where-  showsPrec p = showsPrec p . fromSing+-- | Multiplication of type-level naturals.+type family (m :: Nat) * (n :: Nat) :: Nat -instance (SingRep a rep, Read rep, Eq rep) => Read (Sing a) where-  readsPrec p cs = do (x,ys) <- readsPrec p cs-                      case singThat (== x) of-                        Just y  -> [(y,ys)]-                        Nothing -> []+-- | Exponentiation of type-level naturals.+type family (m :: Nat) ^ (n :: Nat) :: Nat +-- | Subtraction of type-level naturals.+--+-- /Since: 4.7.0.0/+type family (m :: Nat) - (n :: Nat) :: Nat   ---------------------------------------------------------------------------------data IsZero :: Nat -> * where-  IsZero :: IsZero 0-  IsSucc :: !(Sing n) -> IsZero (n + 1) -isZero :: Sing n -> IsZero n-isZero (SNat n) | n == 0    = unsafeCoerce IsZero-                | otherwise = unsafeCoerce (IsSucc (SNat (n-1)))+-- | We either get evidence that this function was instantiated with the+-- same type-level numbers, or 'Nothing'.+--+-- /Since: 4.7.0.0/+sameNat :: (KnownNat a, KnownNat b) =>+           Proxy a -> Proxy b -> Maybe (a :~: b)+sameNat x y+  | natVal x == natVal y = Just (unsafeCoerce Refl)+  | otherwise            = Nothing -instance Show (IsZero n) where-  show IsZero     = "0"-  show (IsSucc n) = "(" ++ show n ++ " + 1)"+-- | We either get evidence that this function was instantiated with the+-- same type-level symbols, or 'Nothing'.+--+-- /Since: 4.7.0.0/+sameSymbol :: (KnownSymbol a, KnownSymbol b) =>+              Proxy a -> Proxy b -> Maybe (a :~: b)+sameSymbol x y+  | symbolVal x == symbolVal y  = Just (unsafeCoerce Refl)+  | otherwise                   = Nothing -data IsEven :: Nat -> * where-  IsEvenZero :: IsEven 0-  IsEven     :: !(Sing (n+1)) -> IsEven (2 * n + 2)-  IsOdd      :: !(Sing n)     -> IsEven (2 * n + 1)+--------------------------------------------------------------------------------+-- PRIVATE: -isEven :: Sing n -> IsEven n-isEven (SNat n) | n == 0      = unsafeCoerce IsEvenZero-                | testBit n 0 = unsafeCoerce (IsOdd  (SNat (n `shiftR` 1)))-                | otherwise   = unsafeCoerce (IsEven (SNat (n `shiftR` 1)))+newtype SNat    (n :: Nat)    = SNat    Integer+newtype SSymbol (s :: Symbol) = SSymbol String -instance Show (IsEven n) where-  show IsEvenZero = "0"-  show (IsEven x) = "(2 * " ++ show x ++ ")"-  show (IsOdd  x) = "(2 * " ++ show x ++ " + 1)"+data WrapN a b = WrapN (KnownNat    a => Proxy a -> b)+data WrapS a b = WrapS (KnownSymbol a => Proxy a -> b)++-- See Note [magicDictId magic] in "basicType/MkId.hs"+withSNat :: (KnownNat a => Proxy a -> b)+         -> SNat a      -> Proxy a -> b+withSNat f x y = magicDict (WrapN f) x y++-- See Note [magicDictId magic] in "basicType/MkId.hs"+withSSymbol :: (KnownSymbol a => Proxy a -> b)+            -> SSymbol a      -> Proxy a -> b+withSSymbol f x y = magicDict (WrapS f) x y  
GHC/Unicode.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}-{-# OPTIONS -#include "WCsubst.h" #-}+{-# LANGUAGE CPP, NoImplicitPrelude #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -19,7 +18,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Unicode (         isAscii, isLatin1, isControl,         isAsciiUpper, isAsciiLower,
GHC/Weak.lhs view
@@ -1,7 +1,6 @@ \begin{code} {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude+{-# LANGUAGE NoImplicitPrelude            , BangPatterns            , MagicHash            , UnboxedTuples@@ -24,7 +23,6 @@ -- ----------------------------------------------------------------------------- --- #hide module GHC.Weak (         Weak(..),         mkWeak,@@ -95,10 +93,7 @@ by the compiler.  -}-data Weak v = Weak (Weak# v)--#include "Typeable.h"-INSTANCE_TYPEABLE1(Weak,weakTc,"Weak")+data Weak v = Weak (Weak# v) deriving Typeable  -- | Establishes a weak pointer to @k@, with value @v@ and a finalizer. --
GHC/Windows.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, ForeignFunctionInterface #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module      :  GHC.Windows@@ -19,30 +20,176 @@ -----------------------------------------------------------------------------  module GHC.Windows (-        HANDLE, DWORD, LPTSTR, iNFINITE,-        throwGetLastError, c_maperrno-    ) where+        -- * Types+        BOOL,+        LPBOOL,+        BYTE,+        DWORD,+        UINT,+        ErrCode,+        HANDLE,+        LPWSTR,+        LPTSTR, -import GHC.Base-import GHC.Ptr+        -- * Constants+        iNFINITE,+        iNVALID_HANDLE_VALUE, -import Data.Word+        -- * System errors+        throwGetLastError,+        failWith,+        getLastError,+        getErrorMessage,+        errCodeToIOError, -import Foreign.C.Error (throwErrno)+        -- ** Guards for system calls that might fail+        failIf,+        failIf_,+        failIfNull,+        failIfZero,+        failIfFalse_,+        failUnlessSuccess,+        failUnlessSuccessOr,++        -- ** Mapping system errors to errno+        -- $errno+        c_maperrno,+        c_maperrno_func,+    ) where++import Data.Char+import Data.List+import Data.Maybe+import Data.Word+import Foreign.C.Error+import Foreign.C.String import Foreign.C.Types+import Foreign.Ptr+import GHC.Base+import GHC.IO+import GHC.Num+import System.IO.Error +import qualified Numeric -type HANDLE       = Ptr ()-type DWORD        = Word32+#if defined(i386_HOST_ARCH)+# define WINDOWS_CCONV stdcall+#elif defined(x86_64_HOST_ARCH)+# define WINDOWS_CCONV ccall+#else+# error Unknown mingw32 arch+#endif -type LPTSTR = Ptr CWchar+type BOOL    = Bool+type LPBOOL  = Ptr BOOL+type BYTE    = Word8+type DWORD   = Word32+type UINT    = Word32+type ErrCode = DWORD+type HANDLE  = Ptr ()+type LPWSTR  = Ptr CWchar +-- | Be careful with this.  LPTSTR can mean either WCHAR* or CHAR*, depending+-- on whether the UNICODE macro is defined in the corresponding C code.+-- Consider using LPWSTR instead.+type LPTSTR = LPWSTR+ iNFINITE :: DWORD iNFINITE = 0xFFFFFFFF -- urgh +iNVALID_HANDLE_VALUE :: HANDLE+iNVALID_HANDLE_VALUE = wordPtrToPtr (-1)++-- | Get the last system error, and throw it as an 'IOError' exception. throwGetLastError :: String -> IO a-throwGetLastError where_from = c_maperrno >> throwErrno where_from+throwGetLastError where_from =+    getLastError >>= failWith where_from +-- | Convert a Windows error code to an exception, then throw it.+failWith :: String -> ErrCode -> IO a+failWith fn_name err_code =+    errCodeToIOError fn_name err_code >>= throwIO++-- | Convert a Windows error code to an exception.+errCodeToIOError :: String -> ErrCode -> IO IOError+errCodeToIOError fn_name err_code = do+    msg <- getErrorMessage err_code++    -- turn GetLastError() into errno, which errnoToIOError knows+    -- how to convert to an IOException we can throw.+    -- XXX we should really do this directly.+    let errno = c_maperrno_func err_code++    let msg' = reverse $ dropWhile isSpace $ reverse msg -- drop trailing \n+        ioerror = errnoToIOError fn_name errno Nothing Nothing+                    `ioeSetErrorString` msg'+    return ioerror++-- | Get a string describing a Windows error code.  This uses the+-- @FormatMessage@ system call.+getErrorMessage :: ErrCode -> IO String+getErrorMessage err_code =+    mask_ $ do+        c_msg <- c_getErrorMessage err_code+        if c_msg == nullPtr+          then return $ "Error 0x" ++ Numeric.showHex err_code ""+          else do msg <- peekCWString c_msg+                  -- We ignore failure of freeing c_msg, given we're already failing+                  _ <- localFree c_msg+                  return msg++failIf :: (a -> Bool) -> String -> IO a -> IO a+failIf p wh act = do+    v <- act+    if p v then throwGetLastError wh else return v++failIf_ :: (a -> Bool) -> String -> IO a -> IO ()+failIf_ p wh act = do+    v <- act+    if p v then throwGetLastError wh else return ()++failIfNull :: String -> IO (Ptr a) -> IO (Ptr a)+failIfNull = failIf (== nullPtr)++failIfZero :: (Eq a, Num a) => String -> IO a -> IO a+failIfZero = failIf (== 0)++failIfFalse_ :: String -> IO Bool -> IO ()+failIfFalse_ = failIf_ not++failUnlessSuccess :: String -> IO ErrCode -> IO ()+failUnlessSuccess fn_name act = do+    r <- act+    if r == 0 then return () else failWith fn_name r++failUnlessSuccessOr :: ErrCode -> String -> IO ErrCode -> IO Bool+failUnlessSuccessOr val fn_name act = do+    r <- act+    if r == 0 then return False+        else if r == val then return True+        else failWith fn_name r++-- $errno+--+-- On Windows, @errno@ is defined by msvcrt.dll for compatibility with other+-- systems, and is distinct from the system error as returned+-- by @GetLastError@.++-- | Map the last system error to an errno value, and assign it to @errno@. foreign import ccall unsafe "maperrno"             -- in Win32Utils.c    c_maperrno :: IO () +-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@+-- or modify @errno@.+foreign import ccall unsafe "maperrno_func"        -- in Win32Utils.c+   c_maperrno_func :: ErrCode -> Errno++foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c+    c_getErrorMessage :: DWORD -> IO LPWSTR++foreign import WINDOWS_CCONV unsafe "windows.h LocalFree"+    localFree :: Ptr a -> IO (Ptr a)++-- | Get the last system error produced in the current thread.+foreign import WINDOWS_CCONV unsafe "windows.h GetLastError"+    getLastError :: IO ErrCode
GHC/Word.hs view
@@ -7,7 +7,7 @@ -- Module      :  GHC.Word -- Copyright   :  (c) The University of Glasgow, 1997-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC Extensions)@@ -19,19 +19,23 @@  #include "MachDeps.h" --- #hide module GHC.Word (     Word(..), Word8(..), Word16(..), Word32(..), Word64(..),     uncheckedShiftL64#,-    uncheckedShiftRL64#+    uncheckedShiftRL64#,+    byteSwap16,+    byteSwap32,+    byteSwap64     ) where  import Data.Bits+import Data.Maybe  #if WORD_SIZE_IN_BITS < 64 import GHC.IntWord64 #endif +-- import {-# SOURCE #-} GHC.Exception import GHC.Base import GHC.Enum import GHC.Num@@ -39,7 +43,6 @@ import GHC.Read import GHC.Arr import GHC.Show-import GHC.Err import GHC.Float ()     -- for RealFrac methods  ------------------------------------------------------------------------@@ -129,25 +132,29 @@     complement (W8# x#)       = W8# (x# `xor#` mb#)         where !(W8# mb#) = maxBound     (W8# x#) `shift` (I# i#)-        | i# >=# 0#           = W8# (narrow8Word# (x# `shiftL#` i#))+        | isTrue# (i# >=# 0#) = W8# (narrow8Word# (x# `shiftL#` i#))         | otherwise           = W8# (x# `shiftRL#` negateInt# i#)-    (W8# x#) `shiftL` (I# i#) = W8# (narrow8Word# (x# `shiftL#` i#))+    (W8# x#) `shiftL`       (I# i#) = W8# (narrow8Word# (x# `shiftL#` i#))     (W8# x#) `unsafeShiftL` (I# i#) =         W8# (narrow8Word# (x# `uncheckedShiftL#` i#))-    (W8# x#) `shiftR` (I# i#) = W8# (x# `shiftRL#` i#)+    (W8# x#) `shiftR`       (I# i#) = W8# (x# `shiftRL#` i#)     (W8# x#) `unsafeShiftR` (I# i#) = W8# (x# `uncheckedShiftRL#` i#)-    (W8# x#) `rotate` (I# i#)-        | i'# ==# 0# = W8# x#+    (W8# x#) `rotate`       (I# i#)+        | isTrue# (i'# ==# 0#) = W8# x#         | otherwise  = W8# (narrow8Word# ((x# `uncheckedShiftL#` i'#) `or#`                                           (x# `uncheckedShiftRL#` (8# -# i'#))))         where         !i'# = word2Int# (int2Word# i# `and#` 7##)-    bitSize  _                = 8+    bitSizeMaybe i            = Just (finiteBitSize i)+    bitSize i                 = finiteBitSize i     isSigned _                = False     popCount (W8# x#)         = I# (word2Int# (popCnt8# x#))     bit                       = bitDefault     testBit                   = testBitDefault +instance FiniteBits Word8 where+    finiteBitSize _ = 8+ {-# RULES "fromIntegral/Word8->Word8"   fromIntegral = id :: Word8 -> Word8 "fromIntegral/Word8->Integer" fromIntegral = toInteger :: Word8 -> Integer@@ -157,32 +164,32 @@  {-# RULES "properFraction/Float->(Word8,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Word8) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Word8) n, y :: Float) } "truncate/Float->Word8"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Word8) (truncate x)+    truncate = (fromIntegral :: Int -> Word8) . (truncate :: Float -> Int) "floor/Float->Word8"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Word8) (floor x)+    floor    = (fromIntegral :: Int -> Word8) . (floor :: Float -> Int) "ceiling/Float->Word8"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Word8) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Word8) . (ceiling :: Float -> Int) "round/Float->Word8"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Word8) (round x)+    round    = (fromIntegral :: Int -> Word8) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Word8,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Word8) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Word8) n, y :: Double) } "truncate/Double->Word8"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Word8) (truncate x)+    truncate = (fromIntegral :: Int -> Word8) . (truncate :: Double -> Int) "floor/Double->Word8"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Word8) (floor x)+    floor    = (fromIntegral :: Int -> Word8) . (floor :: Double -> Int) "ceiling/Double->Word8"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Word8) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Word8) . (ceiling :: Double -> Int) "round/Double->Word8"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Word8) (round x)+    round    = (fromIntegral :: Int -> Word8) . (round  :: Double -> Int)   #-}  ------------------------------------------------------------------------@@ -272,25 +279,35 @@     complement (W16# x#)       = W16# (x# `xor#` mb#)         where !(W16# mb#) = maxBound     (W16# x#) `shift` (I# i#)-        | i# >=# 0#            = W16# (narrow16Word# (x# `shiftL#` i#))+        | isTrue# (i# >=# 0#)  = W16# (narrow16Word# (x# `shiftL#` i#))         | otherwise            = W16# (x# `shiftRL#` negateInt# i#)-    (W16# x#) `shiftL` (I# i#) = W16# (narrow16Word# (x# `shiftL#` i#))+    (W16# x#) `shiftL` (I# i#)       = W16# (narrow16Word# (x# `shiftL#` i#))     (W16# x#) `unsafeShiftL` (I# i#) =         W16# (narrow16Word# (x# `uncheckedShiftL#` i#))-    (W16# x#) `shiftR` (I# i#) = W16# (x# `shiftRL#` i#)+    (W16# x#) `shiftR`       (I# i#) = W16# (x# `shiftRL#` i#)     (W16# x#) `unsafeShiftR` (I# i#) = W16# (x# `uncheckedShiftRL#` i#)-    (W16# x#) `rotate` (I# i#)-        | i'# ==# 0# = W16# x#+    (W16# x#) `rotate`       (I# i#)+        | isTrue# (i'# ==# 0#) = W16# x#         | otherwise  = W16# (narrow16Word# ((x# `uncheckedShiftL#` i'#) `or#`                                             (x# `uncheckedShiftRL#` (16# -# i'#))))         where         !i'# = word2Int# (int2Word# i# `and#` 15##)-    bitSize  _                = 16+    bitSizeMaybe i            = Just (finiteBitSize i)+    bitSize i                 = finiteBitSize i     isSigned _                = False     popCount (W16# x#)        = I# (word2Int# (popCnt16# x#))     bit                       = bitDefault     testBit                   = testBitDefault +instance FiniteBits Word16 where+    finiteBitSize _ = 16++-- | Swap bytes in 'Word16'.+--+-- /Since: 4.7.0.0/+byteSwap16 :: Word16 -> Word16+byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#))+ {-# RULES "fromIntegral/Word8->Word16"   fromIntegral = \(W8# x#) -> W16# x# "fromIntegral/Word16->Word16"  fromIntegral = id :: Word16 -> Word16@@ -301,32 +318,32 @@  {-# RULES "properFraction/Float->(Word16,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Word16) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Word16) n, y :: Float) } "truncate/Float->Word16"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Word16) (truncate x)+    truncate = (fromIntegral :: Int -> Word16) . (truncate :: Float -> Int) "floor/Float->Word16"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Word16) (floor x)+    floor    = (fromIntegral :: Int -> Word16) . (floor :: Float -> Int) "ceiling/Float->Word16"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Word16) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Word16) . (ceiling :: Float -> Int) "round/Float->Word16"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Word16) (round x)+    round    = (fromIntegral :: Int -> Word16) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Word16,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Word16) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Word16) n, y :: Double) } "truncate/Double->Word16"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Word16) (truncate x)+    truncate = (fromIntegral :: Int -> Word16) . (truncate :: Double -> Int) "floor/Double->Word16"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Word16) (floor x)+    floor    = (fromIntegral :: Int -> Word16) . (floor :: Double -> Int) "ceiling/Double->Word16"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Word16) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Word16) . (ceiling :: Double -> Int) "round/Double->Word16"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Word16) (round x)+    round    = (fromIntegral :: Int -> Word16) . (round  :: Double -> Int)   #-}  ------------------------------------------------------------------------@@ -342,32 +359,32 @@  {-# RULES "properFraction/Float->(Word32,Float)"-    forall x. properFraction (x :: Float) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Word32) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Word32) n, y :: Float) } "truncate/Float->Word32"-    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Word32) (truncate x)+    truncate = (fromIntegral :: Int -> Word32) . (truncate :: Float -> Int) "floor/Float->Word32"-    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Word32) (floor x)+    floor    = (fromIntegral :: Int -> Word32) . (floor :: Float -> Int) "ceiling/Float->Word32"-    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Word32) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Word32) . (ceiling :: Float -> Int) "round/Float->Word32"-    forall x. round    (x :: Float) = (fromIntegral :: Int -> Word32) (round x)+    round    = (fromIntegral :: Int -> Word32) . (round  :: Float -> Int)   #-}  {-# RULES "properFraction/Double->(Word32,Double)"-    forall x. properFraction (x :: Double) =+    properFraction = \x ->                       case properFraction x of {-                        (n, y) -> ((fromIntegral :: Int -> Word32) n, y) }+                        (n, y) -> ((fromIntegral :: Int -> Word32) n, y :: Double) } "truncate/Double->Word32"-    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Word32) (truncate x)+    truncate = (fromIntegral :: Int -> Word32) . (truncate :: Double -> Int) "floor/Double->Word32"-    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Word32) (floor x)+    floor    = (fromIntegral :: Int -> Word32) . (floor :: Double -> Int) "ceiling/Double->Word32"-    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Word32) (ceiling x)+    ceiling  = (fromIntegral :: Int -> Word32) . (ceiling :: Double -> Int) "round/Double->Word32"-    forall x. round    (x :: Double) = (fromIntegral :: Int -> Word32) (round x)+    round    = (fromIntegral :: Int -> Word32) . (round  :: Double -> Int)   #-}  #endif@@ -437,7 +454,7 @@         | otherwise                 = divZeroError     toInteger (W32# x#) #if WORD_SIZE_IN_BITS == 32-        | i# >=# 0#                 = smallInteger i#+        | isTrue# (i# >=# 0#)       = smallInteger i#         | otherwise                 = wordToInteger x#         where         !i# = word2Int# x#@@ -456,25 +473,29 @@     complement (W32# x#)       = W32# (x# `xor#` mb#)         where !(W32# mb#) = maxBound     (W32# x#) `shift` (I# i#)-        | i# >=# 0#            = W32# (narrow32Word# (x# `shiftL#` i#))+        | isTrue# (i# >=# 0#)  = W32# (narrow32Word# (x# `shiftL#` i#))         | otherwise            = W32# (x# `shiftRL#` negateInt# i#)-    (W32# x#) `shiftL` (I# i#) = W32# (narrow32Word# (x# `shiftL#` i#))+    (W32# x#) `shiftL`       (I# i#) = W32# (narrow32Word# (x# `shiftL#` i#))     (W32# x#) `unsafeShiftL` (I# i#) =         W32# (narrow32Word# (x# `uncheckedShiftL#` i#))-    (W32# x#) `shiftR` (I# i#) = W32# (x# `shiftRL#` i#)+    (W32# x#) `shiftR`       (I# i#) = W32# (x# `shiftRL#` i#)     (W32# x#) `unsafeShiftR` (I# i#) = W32# (x# `uncheckedShiftRL#` i#)-    (W32# x#) `rotate` (I# i#)-        | i'# ==# 0# = W32# x#-        | otherwise  = W32# (narrow32Word# ((x# `uncheckedShiftL#` i'#) `or#`+    (W32# x#) `rotate`       (I# i#)+        | isTrue# (i'# ==# 0#) = W32# x#+        | otherwise   = W32# (narrow32Word# ((x# `uncheckedShiftL#` i'#) `or#`                                             (x# `uncheckedShiftRL#` (32# -# i'#))))         where         !i'# = word2Int# (int2Word# i# `and#` 31##)-    bitSize  _                = 32+    bitSizeMaybe i            = Just (finiteBitSize i)+    bitSize i                 = finiteBitSize i     isSigned _                = False     popCount (W32# x#)        = I# (word2Int# (popCnt32# x#))     bit                       = bitDefault     testBit                   = testBitDefault +instance FiniteBits Word32 where+    finiteBitSize _ = 32+ {-# RULES "fromIntegral/Word8->Word32"   fromIntegral = \(W8# x#) -> W32# x# "fromIntegral/Word16->Word32"  fromIntegral = \(W16# x#) -> W32# x#@@ -504,13 +525,19 @@     unsafeIndex (m,_) i = fromIntegral (i - m)     inRange (m,n) i     = m <= i && i <= n -instance Read Word32 where  +instance Read Word32 where #if WORD_SIZE_IN_BITS < 33     readsPrec p s = [(fromInteger x, r) | (x, r) <- readsPrec p s] #else     readsPrec p s = [(fromIntegral (x::Int), r) | (x, r) <- readsPrec p s] #endif +-- | Reverse order of bytes in 'Word32'.+--+-- /Since: 4.7.0.0/+byteSwap32 :: Word32 -> Word32+byteSwap32 (W32# w#) = W32# (narrow32Word# (byteSwap32# w#))+ ------------------------------------------------------------------------ -- type Word64 ------------------------------------------------------------------------@@ -521,14 +548,14 @@ -- ^ 64-bit unsigned integer type  instance Eq Word64 where-    (W64# x#) == (W64# y#) = x# `eqWord64#` y#-    (W64# x#) /= (W64# y#) = x# `neWord64#` y#+    (W64# x#) == (W64# y#) = isTrue# (x# `eqWord64#` y#)+    (W64# x#) /= (W64# y#) = isTrue# (x# `neWord64#` y#)  instance Ord Word64 where-    (W64# x#) <  (W64# y#) = x# `ltWord64#` y#-    (W64# x#) <= (W64# y#) = x# `leWord64#` y#-    (W64# x#) >  (W64# y#) = x# `gtWord64#` y#-    (W64# x#) >= (W64# y#) = x# `geWord64#` y#+    (W64# x#) <  (W64# y#) = isTrue# (x# `ltWord64#` y#)+    (W64# x#) <= (W64# y#) = isTrue# (x# `leWord64#` y#)+    (W64# x#) >  (W64# y#) = isTrue# (x# `gtWord64#` y#)+    (W64# x#) >= (W64# y#) = isTrue# (x# `geWord64#` y#)  instance Num Word64 where     (W64# x#) + (W64# y#)  = W64# (int64ToWord64# (word64ToInt64# x# `plusInt64#` word64ToInt64# y#))@@ -590,19 +617,20 @@     (W64# x#) `xor` (W64# y#)  = W64# (x# `xor64#` y#)     complement (W64# x#)       = W64# (not64# x#)     (W64# x#) `shift` (I# i#)-        | i# >=# 0#            = W64# (x# `shiftL64#` i#)+        | isTrue# (i# >=# 0#)  = W64# (x# `shiftL64#` i#)         | otherwise            = W64# (x# `shiftRL64#` negateInt# i#)-    (W64# x#) `shiftL` (I# i#) = W64# (x# `shiftL64#` i#)+    (W64# x#) `shiftL`       (I# i#) = W64# (x# `shiftL64#` i#)     (W64# x#) `unsafeShiftL` (I# i#) = W64# (x# `uncheckedShiftL64#` i#)-    (W64# x#) `shiftR` (I# i#) = W64# (x# `shiftRL64#` i#)+    (W64# x#) `shiftR`       (I# i#) = W64# (x# `shiftRL64#` i#)     (W64# x#) `unsafeShiftR` (I# i#) = W64# (x# `uncheckedShiftRL64#` i#)     (W64# x#) `rotate` (I# i#)-        | i'# ==# 0# = W64# x#-        | otherwise  = W64# ((x# `uncheckedShiftL64#` i'#) `or64#`-                             (x# `uncheckedShiftRL64#` (64# -# i'#)))+        | isTrue# (i'# ==# 0#) = W64# x#+        | otherwise            = W64# ((x# `uncheckedShiftL64#` i'#) `or64#`+                                       (x# `uncheckedShiftRL64#` (64# -# i'#)))         where         !i'# = word2Int# (int2Word# i# `and#` 63##)-    bitSize  _                = 64+    bitSizeMaybe i            = Just (finiteBitSize i)+    bitSize i                 = finiteBitSize i     isSigned _                = False     popCount (W64# x#)        = I# (word2Int# (popCnt64# x#))     bit                       = bitDefault@@ -615,11 +643,11 @@  shiftL64#, shiftRL64# :: Word64# -> Int# -> Word64# -a `shiftL64#` b  | b >=# 64#  = wordToWord64# 0##-                 | otherwise  = a `uncheckedShiftL64#` b+a `shiftL64#` b  | isTrue# (b >=# 64#) = wordToWord64# 0##+                 | otherwise           = a `uncheckedShiftL64#` b -a `shiftRL64#` b | b >=# 64#  = wordToWord64# 0##-                 | otherwise  = a `uncheckedShiftRL64#` b+a `shiftRL64#` b | isTrue# (b >=# 64#) = wordToWord64# 0##+                 | otherwise           = a `uncheckedShiftRL64#` b  {-# RULES "fromIntegral/Int->Word64"    fromIntegral = \(I#   x#) -> W64# (int64ToWord64# (intToInt64# x#))@@ -689,7 +717,7 @@         | y /= 0                    = (W64# (x# `quotWord#` y#), W64# (x# `remWord#` y#))         | otherwise                 = divZeroError     toInteger (W64# x#)-        | i# >=# 0#                 = smallInteger i#+        | isTrue# (i# >=# 0#)       = smallInteger i#         | otherwise                 = wordToInteger x#         where         !i# = word2Int# x#@@ -705,19 +733,20 @@     complement (W64# x#)       = W64# (x# `xor#` mb#)         where !(W64# mb#) = maxBound     (W64# x#) `shift` (I# i#)-        | i# >=# 0#            = W64# (x# `shiftL#` i#)+        | isTrue# (i# >=# 0#)  = W64# (x# `shiftL#` i#)         | otherwise            = W64# (x# `shiftRL#` negateInt# i#)-    (W64# x#) `shiftL` (I# i#) = W64# (x# `shiftL#` i#)+    (W64# x#) `shiftL`       (I# i#) = W64# (x# `shiftL#` i#)     (W64# x#) `unsafeShiftL` (I# i#) = W64# (x# `uncheckedShiftL#` i#)-    (W64# x#) `shiftR` (I# i#) = W64# (x# `shiftRL#` i#)+    (W64# x#) `shiftR`       (I# i#) = W64# (x# `shiftRL#` i#)     (W64# x#) `unsafeShiftR` (I# i#) = W64# (x# `uncheckedShiftRL#` i#)     (W64# x#) `rotate` (I# i#)-        | i'# ==# 0# = W64# x#-        | otherwise  = W64# ((x# `uncheckedShiftL#` i'#) `or#`-                             (x# `uncheckedShiftRL#` (64# -# i'#)))+        | isTrue# (i'# ==# 0#) = W64# x#+        | otherwise            = W64# ((x# `uncheckedShiftL#` i'#) `or#`+                                       (x# `uncheckedShiftRL#` (64# -# i'#)))         where         !i'# = word2Int# (int2Word# i# `and#` 63##)-    bitSize  _                = 64+    bitSizeMaybe i            = Just (finiteBitSize i)+    bitSize i                 = finiteBitSize i     isSigned _                = False     popCount (W64# x#)        = I# (word2Int# (popCnt64# x#))     bit                       = bitDefault@@ -736,6 +765,9 @@  #endif +instance FiniteBits Word64 where+    finiteBitSize _ = 64+ instance Show Word64 where     showsPrec p x = showsPrec p (toInteger x) @@ -754,3 +786,13 @@ instance Read Word64 where     readsPrec p s = [(fromInteger x, r) | (x, r) <- readsPrec p s] +-- | Reverse order of bytes in 'Word64'.+--+-- /Since: 4.7.0.0/+#if WORD_SIZE_IN_BITS < 64+byteSwap64 :: Word64 -> Word64+byteSwap64 (W64# w#) = W64# (byteSwap64# w#)+#else+byteSwap64 :: Word64 -> Word64+byteSwap64 (W64# w#) = W64# (byteSwap# w#)+#endif
Numeric.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash #-}  ----------------------------------------------------------------------------- -- | -- Module      :  Numeric -- Copyright   :  (c) The University of Glasgow 2002 -- License     :  BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer  :  libraries@haskell.org -- Stability   :  provisional -- Portability :  portable@@ -20,19 +20,21 @@          -- * Showing -        showSigned,       -- :: (Real a) => (a -> ShowS) -> Int -> a -> ShowS+        showSigned, -        showIntAtBase,    -- :: Integral a => a -> (a -> Char) -> a -> ShowS-        showInt,          -- :: Integral a => a -> ShowS-        showHex,          -- :: Integral a => a -> ShowS-        showOct,          -- :: Integral a => a -> ShowS+        showIntAtBase,+        showInt,+        showHex,+        showOct, -        showEFloat,       -- :: (RealFloat a) => Maybe Int -> a -> ShowS-        showFFloat,       -- :: (RealFloat a) => Maybe Int -> a -> ShowS-        showGFloat,       -- :: (RealFloat a) => Maybe Int -> a -> ShowS-        showFloat,        -- :: (RealFloat a) => a -> ShowS+        showEFloat,+        showFFloat,+        showGFloat,+        showFFloatAlt,+        showGFloatAlt,+        showFloat, -        floatToDigits,    -- :: (RealFloat a) => Integer -> a -> ([Int], Int)+        floatToDigits,          -- * Reading @@ -40,25 +42,23 @@         -- and 'readDec' is the \`dual\' of 'showInt'.         -- The inconsistent naming is a historical accident. -        readSigned,       -- :: (Real a) => ReadS a -> ReadS a+        readSigned, -        readInt,          -- :: (Integral a) => a -> (Char -> Bool)-                          --         -> (Char -> Int) -> ReadS a-        readDec,          -- :: (Integral a) => ReadS a-        readOct,          -- :: (Integral a) => ReadS a-        readHex,          -- :: (Integral a) => ReadS a+        readInt,+        readDec,+        readOct,+        readHex, -        readFloat,        -- :: (RealFloat a) => ReadS a+        readFloat, -        lexDigits,        -- :: ReadS String+        lexDigits,          -- * Miscellaneous -        fromRat,          -- :: (RealFloat a) => Rational -> a+        fromRat,          ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Read import GHC.Real@@ -68,16 +68,7 @@ import Data.Maybe import Text.ParserCombinators.ReadP( ReadP, readP_to_S, pfail ) import qualified Text.Read.Lex as L-#else-import Data.Char-#endif -#ifdef __HUGS__-import Hugs.Prelude-import Hugs.Numeric-#endif--#ifdef __GLASGOW_HASKELL__ -- ----------------------------------------------------------------------------- -- Reading @@ -100,7 +91,7 @@ -- | Read an unsigned number in hexadecimal notation. -- Both upper or lower case letters are allowed. readHex :: (Eq a, Num a) => ReadS a-readHex = readP_to_S L.readHexP +readHex = readP_to_S L.readHexP  -- | Reads an /unsigned/ 'RealFrac' value, -- expressed in decimal scientific notation.@@ -179,7 +170,7 @@ showFFloat    :: (RealFloat a) => Maybe Int -> a -> ShowS  -- | Show a signed 'RealFloat' value--- using standard decimal notation for arguments whose absolute value lies +-- using standard decimal notation for arguments whose absolute value lies -- between @0.1@ and @9,999,999@, and scientific notation otherwise. -- -- In the call @'showGFloat' digs val@, if @digs@ is 'Nothing',@@ -190,7 +181,28 @@ showEFloat d x =  showString (formatRealFloat FFExponent d x) showFFloat d x =  showString (formatRealFloat FFFixed d x) showGFloat d x =  showString (formatRealFloat FFGeneric d x)-#endif  /* __GLASGOW_HASKELL__ */++-- | Show a signed 'RealFloat' value+-- using standard decimal notation (e.g. @245000@, @0.0015@).+--+-- This behaves as 'showFFloat', except that a decimal point+-- is always guaranteed, even if not needed.+--+-- /Since: 4.7.0.0/+showFFloatAlt    :: (RealFloat a) => Maybe Int -> a -> ShowS++-- | Show a signed 'RealFloat' value+-- using standard decimal notation for arguments whose absolute value lies+-- between @0.1@ and @9,999,999@, and scientific notation otherwise.+--+-- This behaves as 'showFFloat', except that a decimal point+-- is always guaranteed, even if not needed.+--+-- /Since: 4.7.0.0/+showGFloatAlt    :: (RealFloat a) => Maybe Int -> a -> ShowS++showFFloatAlt d x =  showString (formatRealFloatAlt FFFixed d True x)+showGFloatAlt d x =  showString (formatRealFloatAlt FFGeneric d True x)  -- --------------------------------------------------------------------------- -- Integer printing functions
Prelude.hs view
@@ -11,9 +11,9 @@ -- Stability   :  stable -- Portability :  portable ----- The Prelude: a standard module imported by default into all Haskell--- modules.  For more documentation, see the Haskell 98 Report--- <http://www.haskell.org/onlinereport/>.+-- The Prelude: a standard module. The Prelude is imported by default+-- into all Haskell modules unless either there is an explicit import+-- statement for it, or the NoImplicitPrelude extension is enabled. -- ----------------------------------------------------------------------------- @@ -37,17 +37,6 @@     -- *** Tuples     fst, snd, curry, uncurry, -#if defined(__NHC__)-    []((:), []),        -- Not legal Haskell 98;-                        -- ... available through built-in syntax-    module Data.Tuple,  -- Includes tuple types-    ()(..),             -- Not legal Haskell 98-    (->),               -- ... available through built-in syntax-#endif-#ifdef __HUGS__-    (:),                -- Not legal Haskell 98-#endif-     -- ** Basic type classes     Eq((==), (/=)),     Ord(compare, (<), (<=), (>=), (>), max, min),@@ -145,7 +134,6 @@    ) where -#ifndef __HUGS__ import Control.Monad import System.IO import System.IO.Error@@ -153,9 +141,7 @@ import Data.Either import Data.Maybe import Data.Tuple-#endif -#ifdef __GLASGOW_HASKELL__ import GHC.Base import Text.Read import GHC.Enum@@ -163,27 +149,15 @@ import GHC.Real import GHC.Float import GHC.Show-import GHC.Err   ( undefined )-#endif -#ifdef __HUGS__-import Hugs.Prelude-#endif--#ifndef __HUGS__ infixr 0 $!-#endif  -- ----------------------------------------------------------------------------- -- Miscellaneous functions  -- | Strict (call-by-value) application, defined in terms of 'seq'. ($!)    :: (a -> b) -> a -> b-#ifdef __GLASGOW_HASKELL__ f $! x  = let !vx = x in f vx  -- see #2273-#elif !defined(__HUGS__)-f $! x  = x `seq` f x-#endif  #ifdef __HADDOCK__ -- | The value of @'seq' a b@ is bottom if @a@ is bottom, and otherwise
System/CPUTime.hsc view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NondecreasingIndentation, ForeignFunctionInterface, CApiFFI #-}+{-# LANGUAGE CPP, NondecreasingIndentation, CApiFFI #-}  ----------------------------------------------------------------------------- -- |@@ -28,26 +28,9 @@  import Data.Ratio -#ifdef __HUGS__-import Hugs.Time ( getCPUTime, clockTicks )-#endif--#ifdef __NHC__-import CPUTime ( getCPUTime, cpuTimePrecision )-#endif--#ifdef __GLASGOW_HASKELL__ import Foreign.Safe import Foreign.C-#if !defined(CLK_TCK)-import System.IO.Unsafe (unsafePerformIO)-#endif --- For _SC_CLK_TCK-#if HAVE_UNISTD_H-#include <unistd.h>-#endif- -- For struct rusage #if !defined(mingw32_HOST_OS) && !defined(irix_HOST_OS) # if HAVE_SYS_RESOURCE_H@@ -60,18 +43,11 @@ #include <windows.h> #endif --- for CLK_TCK-#if HAVE_TIME_H-#include <time.h>-#endif- -- for struct tms #if HAVE_SYS_TIMES_H #include <sys/times.h> #endif -#endif- ##ifdef mingw32_HOST_OS ## if defined(i386_HOST_ARCH) ##  define WINDOWS_CCONV stdcall@@ -90,7 +66,6 @@   -- so we must convert to Double before we can round it #endif -#ifdef __GLASGOW_HASKELL__ -- ----------------------------------------------------------------------------- -- |Computation 'getCPUTime' returns the number of picoseconds CPU time -- used by the current program.  The precision of this result is@@ -173,25 +148,16 @@ foreign import WINDOWS_CCONV unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt  #endif /* not _WIN32 */-#endif /* __GLASGOW_HASKELL__ */ + -- |The 'cpuTimePrecision' constant is the smallest measurable difference -- in CPU time that the implementation can record, and is given as an -- integral number of picoseconds. -#ifndef __NHC__ cpuTimePrecision :: Integer cpuTimePrecision = round ((1000000000000::Integer) % fromIntegral (clockTicks))-#endif -#ifdef __GLASGOW_HASKELL__-clockTicks :: Int-clockTicks =-#if defined(CLK_TCK)-    (#const CLK_TCK)-#else-    unsafePerformIO (sysconf (#const _SC_CLK_TCK) >>= return . fromIntegral)-foreign import ccall unsafe sysconf :: CInt -> IO CLong-#endif-#endif /* __GLASGOW_HASKELL__ */+foreign import ccall unsafe clk_tck :: CLong +clockTicks :: Int+clockTicks = fromIntegral clk_tck
System/Console/GetOpt.hs view
@@ -98,6 +98,19 @@    | ReqArg (String       -> a) String -- ^   option requires argument    | OptArg (Maybe String -> a) String -- ^   optional argument +instance Functor ArgOrder where+    fmap _ RequireOrder      = RequireOrder+    fmap _ Permute           = Permute+    fmap f (ReturnInOrder g) = ReturnInOrder (f . g)++instance Functor OptDescr where+    fmap f (Option a b argDescr c) = Option a b (fmap f argDescr) c++instance Functor ArgDescr where+    fmap f (NoArg a)    = NoArg (f a)+    fmap f (ReqArg g s) = ReqArg (f . g) s+    fmap f (OptArg g s) = OptArg (f . g) s+ data OptKind a                -- kind of cmd line arg (internal use only):    = Opt       a                --    an option    | UnreqOpt  String           --    an un-recognized option
System/Environment.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP, ForeignFunctionInterface #-}+{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -17,49 +17,35 @@  module System.Environment     (-      getArgs,            -- :: IO [String]-      getProgName,        -- :: IO String-      getExecutablePath,  -- :: IO FilePath-      getEnv,             -- :: String -> IO String-      lookupEnv,          -- :: String -> IO (Maybe String)-#ifndef __NHC__+      getArgs,+      getProgName,+      getExecutablePath,+      getEnv,+      lookupEnv,+      setEnv,+      unsetEnv,       withArgs,       withProgName,-#endif-#ifdef __GLASGOW_HASKELL__       getEnvironment,-#endif   ) where  import Prelude -#ifdef __GLASGOW_HASKELL__ import Foreign.Safe import Foreign.C-import Control.Exception.Base   ( bracket )+import System.IO.Error (mkIOError)+import Control.Exception.Base (bracket, throwIO) -- import GHC.IO import GHC.IO.Exception import GHC.IO.Encoding (getFileSystemEncoding) import qualified GHC.Foreign as GHC import Data.List+import Control.Monad #ifdef mingw32_HOST_OS import GHC.Environment import GHC.Windows #else-import Control.Monad-#endif-#endif--#ifdef __HUGS__-import Hugs.System-#endif--#ifdef __NHC__-import System-  ( getArgs-  , getProgName-  , getEnv-  )+import System.Posix.Internals (withFilePath) #endif  import System.Environment.ExecutablePath@@ -74,7 +60,8 @@ # endif #endif -#ifdef __GLASGOW_HASKELL__+#include "HsBaseConfig.h"+ -- --------------------------------------------------------------------------- -- getArgs, getProgName, getEnv @@ -226,6 +213,8 @@ -- there is no such value. -- -- For POSIX users, this is equivalent to 'System.Posix.Env.getEnv'.+--+-- /Since: 4.6.0.0/ lookupEnv :: String -> IO (Maybe String) #ifdef mingw32_HOST_OS lookupEnv name = withCWString name $ \s -> try_size s 256@@ -238,7 +227,7 @@           | otherwise  -> peekCWString p_value >>= return . Just  foreign import WINDOWS_CCONV unsafe "windows.h GetEnvironmentVariableW"-  c_GetEnvironmentVariable :: LPTSTR -> LPTSTR -> DWORD -> IO DWORD+  c_GetEnvironmentVariable :: LPWSTR -> LPWSTR -> DWORD -> IO DWORD #else lookupEnv name =     withCString name $ \s -> do@@ -257,6 +246,95 @@ ioe_missingEnvVar name = ioException (IOError Nothing NoSuchThing "getEnv"     "no environment variable" Nothing (Just name)) +-- | @setEnv name value@ sets the specified environment variable to @value@.+--+-- On Windows setting an environment variable to the /empty string/ removes+-- that environment variable from the environment.  For the sake of+-- compatibility we adopt that behavior.  In particular+--+-- @+-- setEnv name \"\"+-- @+--+-- has the same effect as+--+-- @+-- `unsetEnv` name+-- @+--+-- If you don't care about Windows support and want to set an environment+-- variable to the empty string use @System.Posix.Env.setEnv@ from the @unix@+-- package instead.+--+-- Throws `Control.Exception.IOException` if @name@ is the empty string or+-- contains an equals sign.+--+-- /Since: 4.7.0.0/+setEnv :: String -> String -> IO ()+setEnv key_ value_+  | null key       = throwIO (mkIOError InvalidArgument "setEnv" Nothing Nothing)+  | '=' `elem` key = throwIO (mkIOError InvalidArgument "setEnv" Nothing Nothing)+  | null value     = unsetEnv key+  | otherwise      = setEnv_ key value+  where+    key   = takeWhile (/= '\NUL') key_+    value = takeWhile (/= '\NUL') value_++setEnv_ :: String -> String -> IO ()+#ifdef mingw32_HOST_OS+setEnv_ key value = withCWString key $ \k -> withCWString value $ \v -> do+  success <- c_SetEnvironmentVariable k v+  unless success (throwGetLastError "setEnv")++foreign import WINDOWS_CCONV unsafe "windows.h SetEnvironmentVariableW"+  c_SetEnvironmentVariable :: LPTSTR -> LPTSTR -> IO Bool+#else++-- NOTE: The 'setenv()' function is not available on all systems, hence we use+-- 'putenv()'.  This leaks memory, but so do common implementations of+-- 'setenv()' (AFAIK).+setEnv_ k v = putEnv (k ++ "=" ++ v)++putEnv :: String -> IO ()+putEnv keyvalue = do+  s <- getFileSystemEncoding >>= (`GHC.newCString` keyvalue)+  -- IMPORTANT: Do not free `s` after calling putenv!+  --+  -- According to SUSv2, the string passed to putenv becomes part of the+  -- enviroment.+  throwErrnoIf_ (/= 0) "putenv" (c_putenv s)++foreign import ccall unsafe "putenv" c_putenv :: CString -> IO CInt+#endif++-- | @unSet name@ removes the specified environment variable from the+-- environment of the current process.+--+-- Throws `Control.Exception.IOException` if @name@ is the empty string or+-- contains an equals sign.+--+-- /Since: 4.7.0.0/+unsetEnv :: String -> IO ()+#ifdef mingw32_HOST_OS+unsetEnv key = withCWString key $ \k -> do+  success <- c_SetEnvironmentVariable k nullPtr+  unless success $ do+    -- We consider unsetting an environment variable that does not exist not as+    -- an error, hence we ignore eRROR_ENVVAR_NOT_FOUND.+    err <- c_GetLastError+    unless (err == eRROR_ENVVAR_NOT_FOUND) $ do+      throwGetLastError "unsetEnv"+#else++#ifdef HAVE_UNSETENV+unsetEnv key = withFilePath key (throwErrnoIf_ (/= 0) "unsetEnv" . c_unsetenv)+foreign import ccall unsafe "__hsbase_unsetenv" c_unsetenv :: CString -> IO CInt+#else+unsetEnv key = setEnv_ key ""+#endif++#endif+ {-| 'withArgs' @args act@ - while executing action @act@, have 'getArgs' return @args@.@@ -371,4 +449,3 @@   case break (=='=') str of     (xs,[])        -> (xs,[]) -- don't barf (like Posix.getEnvironment)     (name,_:value) -> (name,value)-#endif  /* __GLASGOW_HASKELL__ */
System/Environment/ExecutablePath.hsc view
@@ -1,5 +1,5 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP, ForeignFunctionInterface #-}+{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -13,6 +13,7 @@ -- -- Function to retrieve the absolute filepath of the current executable. --+-- /Since: 4.6.0.0/ -----------------------------------------------------------------------------  module System.Environment.ExecutablePath ( getExecutablePath ) where@@ -52,6 +53,8 @@ -- -- Note that for scripts and interactive sessions, this is the path to -- the interpreter (e.g. ghci.)+--+-- /Since: 4.6.0.0/ getExecutablePath :: IO FilePath  --------------------------------------------------------------------------------
System/Exit.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -18,30 +17,16 @@ module System.Exit     (       ExitCode(ExitSuccess,ExitFailure)-    , exitWith      -- :: ExitCode -> IO a-    , exitFailure   -- :: IO a-    , exitSuccess   -- :: IO a+    , exitWith+    , exitFailure+    , exitSuccess   ) where  import Prelude -#ifdef __GLASGOW_HASKELL__ import GHC.IO import GHC.IO.Exception-#endif -#ifdef __HUGS__-import Hugs.Prelude (ExitCode(..))-import Control.Exception.Base-#endif--#ifdef __NHC__-import System-  ( ExitCode(..)-  , exitWith-  )-#endif- -- --------------------------------------------------------------------------- -- exitWith @@ -71,15 +56,11 @@ -- thread, 'exitWith' will throw an 'ExitException' as normal, but the -- exception will not cause the process itself to exit. ---#ifndef __NHC__ exitWith :: ExitCode -> IO a exitWith ExitSuccess = throwIO ExitSuccess exitWith code@(ExitFailure n)   | n /= 0 = throwIO code-#ifdef __GLASGOW_HASKELL__   | otherwise = ioError (IOError Nothing InvalidArgument "exitWith" "ExitFailure 0" Nothing Nothing)-#endif-#endif  /* ! __NHC__ */  -- | The computation 'exitFailure' is equivalent to -- 'exitWith' @(@'ExitFailure' /exitfail/@)@,
System/IO.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-}-{-# LANGUAGE ForeignFunctionInterface #-}  ----------------------------------------------------------------------------- -- |@@ -19,12 +18,12 @@ module System.IO (     -- * The IO monad -    IO,                        -- instance MonadFix-    fixIO,                     -- :: (a -> IO a) -> IO a+    IO,+    fixIO,      -- * Files and handles -    FilePath,                  -- :: String+    FilePath,      Handle,             -- abstract, instance of: Eq, Show. @@ -42,27 +41,27 @@     -- | Three handles are allocated during program initialisation,     -- and are initially open. -    stdin, stdout, stderr,   -- :: Handle+    stdin, stdout, stderr,      -- * Opening and closing files      -- ** Opening files      withFile,-    openFile,                  -- :: FilePath -> IOMode -> IO Handle+    openFile,     IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode),      -- ** Closing files -    hClose,                    -- :: Handle -> IO ()+    hClose,      -- ** Special cases      -- | These functions are also exported by the "Prelude". -    readFile,                  -- :: FilePath -> IO String-    writeFile,                 -- :: FilePath -> String -> IO ()-    appendFile,                -- :: FilePath -> String -> IO ()+    readFile,+    writeFile,+    appendFile,      -- ** File locking @@ -72,101 +71,91 @@      -- ** Determining and changing the size of a file -    hFileSize,                 -- :: Handle -> IO Integer-#ifdef __GLASGOW_HASKELL__-    hSetFileSize,              -- :: Handle -> Integer -> IO ()-#endif+    hFileSize,+    hSetFileSize,      -- ** Detecting the end of input -    hIsEOF,                    -- :: Handle -> IO Bool-    isEOF,                     -- :: IO Bool+    hIsEOF,+    isEOF,      -- ** Buffering operations      BufferMode(NoBuffering,LineBuffering,BlockBuffering),-    hSetBuffering,             -- :: Handle -> BufferMode -> IO ()-    hGetBuffering,             -- :: Handle -> IO BufferMode-    hFlush,                    -- :: Handle -> IO ()+    hSetBuffering,+    hGetBuffering,+    hFlush,      -- ** Repositioning handles -    hGetPosn,                  -- :: Handle -> IO HandlePosn-    hSetPosn,                  -- :: HandlePosn -> IO ()+    hGetPosn,+    hSetPosn,     HandlePosn,                -- abstract, instance of: Eq, Show. -    hSeek,                     -- :: Handle -> SeekMode -> Integer -> IO ()+    hSeek,     SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd),-#if !defined(__NHC__)-    hTell,                     -- :: Handle -> IO Integer-#endif+    hTell,      -- ** Handle properties -    hIsOpen, hIsClosed,        -- :: Handle -> IO Bool-    hIsReadable, hIsWritable,  -- :: Handle -> IO Bool-    hIsSeekable,               -- :: Handle -> IO Bool+    hIsOpen, hIsClosed,+    hIsReadable, hIsWritable,+    hIsSeekable, -    -- ** Terminal operations (not portable: GHC\/Hugs only)+    -- ** Terminal operations (not portable: GHC only) -#if !defined(__NHC__)-    hIsTerminalDevice,          -- :: Handle -> IO Bool+    hIsTerminalDevice, -    hSetEcho,                   -- :: Handle -> Bool -> IO ()-    hGetEcho,                   -- :: Handle -> IO Bool-#endif+    hSetEcho,+    hGetEcho,      -- ** Showing handle state (not portable: GHC only) -#ifdef __GLASGOW_HASKELL__-    hShow,                      -- :: Handle -> IO String-#endif+    hShow,      -- * Text input and output      -- ** Text input -    hWaitForInput,             -- :: Handle -> Int -> IO Bool-    hReady,                    -- :: Handle -> IO Bool-    hGetChar,                  -- :: Handle -> IO Char-    hGetLine,                  -- :: Handle -> IO [Char]-    hLookAhead,                -- :: Handle -> IO Char-    hGetContents,              -- :: Handle -> IO [Char]+    hWaitForInput,+    hReady,+    hGetChar,+    hGetLine,+    hLookAhead,+    hGetContents,      -- ** Text output -    hPutChar,                  -- :: Handle -> Char -> IO ()-    hPutStr,                   -- :: Handle -> [Char] -> IO ()-    hPutStrLn,                 -- :: Handle -> [Char] -> IO ()-    hPrint,                    -- :: Show a => Handle -> a -> IO ()+    hPutChar,+    hPutStr,+    hPutStrLn,+    hPrint,      -- ** Special cases for standard input and output      -- | These functions are also exported by the "Prelude". -    interact,                  -- :: (String -> String) -> IO ()-    putChar,                   -- :: Char   -> IO ()-    putStr,                    -- :: String -> IO () -    putStrLn,                  -- :: String -> IO ()-    print,                     -- :: Show a => a -> IO ()-    getChar,                   -- :: IO Char-    getLine,                   -- :: IO String-    getContents,               -- :: IO String-    readIO,                    -- :: Read a => String -> IO a-    readLn,                    -- :: Read a => IO a+    interact,+    putChar,+    putStr,+    putStrLn,+    print,+    getChar,+    getLine,+    getContents,+    readIO,+    readLn,      -- * Binary input and output      withBinaryFile,-    openBinaryFile,            -- :: FilePath -> IOMode -> IO Handle-    hSetBinaryMode,            -- :: Handle -> Bool -> IO ()-    hPutBuf,                   -- :: Handle -> Ptr a -> Int -> IO ()-    hGetBuf,                   -- :: Handle -> Ptr a -> Int -> IO Int-#if !defined(__NHC__) && !defined(__HUGS__)-    hGetBufSome,               -- :: Handle -> Ptr a -> Int -> IO Int-    hPutBufNonBlocking,        -- :: Handle -> Ptr a -> Int -> IO Int-    hGetBufNonBlocking,        -- :: Handle -> Ptr a -> Int -> IO Int-#endif+    openBinaryFile,+    hSetBinaryMode,+    hPutBuf,+    hGetBuf,+    hGetBufSome,+    hPutBufNonBlocking,+    hGetBufNonBlocking,      -- * Temporary files @@ -175,7 +164,6 @@     openTempFileWithDefaultPermissions,     openBinaryTempFileWithDefaultPermissions, -#if !defined(__NHC__) && !defined(__HUGS__)     -- * Unicode encoding\/decoding      -- | A text-mode 'Handle' has an associated 'TextEncoding', which@@ -205,9 +193,7 @@     localeEncoding,     char8,     mkTextEncoding,-#endif -#if !defined(__NHC__) && !defined(__HUGS__)     -- * Newline conversion          -- | In Haskell, a newline is always represented by the character@@ -231,12 +217,10 @@     Newline(..), nativeNewline,      NewlineMode(..),      noNewlineTranslation, universalNewlineMode, nativeNewlineMode,-#endif   ) where  import Control.Exception.Base -#ifndef __NHC__ import Data.Bits import Data.List import Data.Maybe@@ -247,9 +231,7 @@ import Foreign.C.Types import System.Posix.Internals import System.Posix.Types-#endif -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IO hiding ( bracket, onException ) import GHC.IO.IOMode@@ -263,60 +245,10 @@ import Text.Read import GHC.Show import GHC.MVar-#endif -#ifdef __HUGS__-import Hugs.IO-import Hugs.IOExts-import Hugs.IORef-import System.IO.Unsafe ( unsafeInterleaveIO )-#endif--#ifdef __NHC__-import IO-  ( Handle ()-  , HandlePosn ()-  , IOMode (ReadMode,WriteMode,AppendMode,ReadWriteMode)-  , BufferMode (NoBuffering,LineBuffering,BlockBuffering)-  , SeekMode (AbsoluteSeek,RelativeSeek,SeekFromEnd)-  , stdin, stdout, stderr-  , openFile                  -- :: FilePath -> IOMode -> IO Handle-  , hClose                    -- :: Handle -> IO ()-  , hFileSize                 -- :: Handle -> IO Integer-  , hIsEOF                    -- :: Handle -> IO Bool-  , isEOF                     -- :: IO Bool-  , hSetBuffering             -- :: Handle -> BufferMode -> IO ()-  , hGetBuffering             -- :: Handle -> IO BufferMode-  , hFlush                    -- :: Handle -> IO ()-  , hGetPosn                  -- :: Handle -> IO HandlePosn-  , hSetPosn                  -- :: HandlePosn -> IO ()-  , hSeek                     -- :: Handle -> SeekMode -> Integer -> IO ()-  , hWaitForInput             -- :: Handle -> Int -> IO Bool-  , hGetChar                  -- :: Handle -> IO Char-  , hGetLine                  -- :: Handle -> IO [Char]-  , hLookAhead                -- :: Handle -> IO Char-  , hGetContents              -- :: Handle -> IO [Char]-  , hPutChar                  -- :: Handle -> Char -> IO ()-  , hPutStr                   -- :: Handle -> [Char] -> IO ()-  , hPutStrLn                 -- :: Handle -> [Char] -> IO ()-  , hPrint                    -- :: Handle -> [Char] -> IO ()-  , hReady                    -- :: Handle -> [Char] -> IO ()-  , hIsOpen, hIsClosed        -- :: Handle -> IO Bool-  , hIsReadable, hIsWritable  -- :: Handle -> IO Bool-  , hIsSeekable               -- :: Handle -> IO Bool-  , bracket--  , IO ()-  , FilePath                  -- :: String-  )-import NHC.IOExtras (fixIO, hPutBuf, hGetBuf)-import NHC.FFI (Ptr)-#endif- -- ----------------------------------------------------------------------------- -- Standard IO -#ifdef __GLASGOW_HASKELL__ -- | Write a character to the standard output device -- (same as 'hPutChar' 'stdout'). @@ -424,9 +356,7 @@ -- 'GHC.IO.Encoding.setLocaleEncoding' this value will not reflect that change. localeEncoding :: TextEncoding localeEncoding = initLocaleEncoding-#endif  /* __GLASGOW_HASKELL__ */ -#ifndef __NHC__ -- | Computation 'hReady' @hdl@ indicates whether at least one item is -- available for input from handle @hdl@. -- @@ -449,7 +379,6 @@  hPrint          :: Show a => Handle -> a -> IO () hPrint hdl      =  hPutStrLn hdl . show-#endif /* !__NHC__ */  -- | @'withFile' name mode act@ opens a file using 'openFile' and passes -- the resulting handle to the computation @act@.  The handle will be@@ -470,7 +399,6 @@ -- --------------------------------------------------------------------------- -- fixIO -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) fixIO :: (a -> IO a) -> IO a fixIO k = do     m <- newEmptyMVar@@ -493,16 +421,7 @@ -- -- See also System.IO.Unsafe.unsafeFixIO. ---#endif -#if defined(__NHC__)--- Assume a unix platform, where text and binary I/O are identical.-openBinaryFile = openFile-hSetBinaryMode _ _ = return ()--type CMode = Int-#endif- -- | The function creates a temporary file in ReadWrite mode. -- The created file isn\'t deleted automatically, so you need to delete it manually. --@@ -566,13 +485,6 @@          -- beginning with '.' as the second component.          _                      -> error "bug in System.IO.openTempFile" -#ifndef __NHC__-#endif--#if defined(__NHC__)-    findTempName x = do h <- openFile filepath ReadWriteMode-                        return (filepath, h)-#elif defined(__GLASGOW_HASKELL__)     findTempName x = do       r <- openNewFile filepath binary mode       case r of@@ -587,10 +499,6 @@           h <- mkHandleFromFD fD fd_type filepath ReadWriteMode False{-set non-block-} (Just enc)            return (filepath, h)-#else-         h <- fdToHandle fd `onException` c_close fd-         return (filepath, h)-#endif        where         filename        = prefix ++ show x ++ suffix@@ -603,11 +511,6 @@                   | last a == pathSeparator = a ++ b                   | otherwise = a ++ [pathSeparator] ++ b -#if __HUGS__-        fdToHandle fd   = openFd (fromIntegral fd) False ReadWriteMode binary-#endif--#if defined(__GLASGOW_HASKELL__) data OpenNewFileResult   = NewFileCreated CInt   | FileExists@@ -629,28 +532,27 @@       errno <- getErrno       case errno of         _ | errno == eEXIST -> return FileExists-# ifdef mingw32_HOST_OS+#ifdef mingw32_HOST_OS         -- If c_open throws EACCES on windows, it could mean that filepath is a         -- directory. In this case, we want to return FileExists so that the         -- enclosing openTempFile can try again instead of failing outright.         -- See bug #4968.         _ | errno == eACCES -> do           withCString filepath $ \path -> do-          -- There is a race here: the directory might have been moved or-          -- deleted between the c_open call and the next line, but there-          -- doesn't seem to be any direct way to detect that the c_open call-          -- failed because of an existing directory.-          exists <- c_fileExists path-          return $ if exists-            then FileExists-            else OpenNewError errno-# endif+            -- There is a race here: the directory might have been moved or+            -- deleted between the c_open call and the next line, but there+            -- doesn't seem to be any direct way to detect that the c_open call+            -- failed because of an existing directory.+            exists <- c_fileExists path+            return $ if exists+              then FileExists+              else OpenNewError errno+#endif         _ -> return (OpenNewError errno)     else return (NewFileCreated fd) -# ifdef mingw32_HOST_OS+#ifdef mingw32_HOST_OS foreign import ccall "file_exists" c_fileExists :: CString -> IO Bool-# endif #endif  -- XXX Should use filepath library@@ -661,17 +563,11 @@ pathSeparator = '/' #endif -#ifndef __NHC__ -- XXX Copied from GHC.Handle std_flags, output_flags, rw_flags :: CInt std_flags    = o_NONBLOCK   .|. o_NOCTTY output_flags = std_flags    .|. o_CREAT rw_flags     = output_flags .|. o_RDWR-#endif--#ifdef __NHC__-foreign import ccall "getpid" c_getpid :: IO Int-#endif  -- $locking -- Implementations should enforce as far as possible, at least locally to the
System/IO/Error.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -18,18 +18,16 @@ module System.IO.Error (      -- * I\/O errors-    IOError,                    -- = IOException+    IOError, -    userError,                  -- :: String  -> IOError+    userError, -    mkIOError,                  -- :: IOErrorType -> String -> Maybe Handle-                                --    -> Maybe FilePath -> IOError+    mkIOError, -    annotateIOError,            -- :: IOError -> String -> Maybe Handle-                                --    -> Maybe FilePath -> IOError+    annotateIOError,      -- ** Classifying I\/O errors-    isAlreadyExistsError,       -- :: IOError -> Bool+    isAlreadyExistsError,     isDoesNotExistError,     isAlreadyInUseError,     isFullError, @@ -39,22 +37,22 @@     isUserError,      -- ** Attributes of I\/O errors-    ioeGetErrorType,            -- :: IOError -> IOErrorType-    ioeGetLocation,             -- :: IOError -> String-    ioeGetErrorString,          -- :: IOError -> String-    ioeGetHandle,               -- :: IOError -> Maybe Handle-    ioeGetFileName,             -- :: IOError -> Maybe FilePath+    ioeGetErrorType,+    ioeGetLocation,+    ioeGetErrorString,+    ioeGetHandle,+    ioeGetFileName, -    ioeSetErrorType,            -- :: IOError -> IOErrorType -> IOError-    ioeSetErrorString,          -- :: IOError -> String -> IOError-    ioeSetLocation,             -- :: IOError -> String -> IOError-    ioeSetHandle,               -- :: IOError -> Handle -> IOError-    ioeSetFileName,             -- :: IOError -> FilePath -> IOError+    ioeSetErrorType,+    ioeSetErrorString,+    ioeSetLocation,+    ioeSetHandle,+    ioeSetFileName,      -- * Types of I\/O error     IOErrorType,                -- abstract -    alreadyExistsErrorType,     -- :: IOErrorType+    alreadyExistsErrorType,     doesNotExistErrorType,     alreadyInUseErrorType,     fullErrorType,@@ -64,7 +62,7 @@     userErrorType,      -- ** 'IOErrorType' predicates-    isAlreadyExistsErrorType,   -- :: IOErrorType -> Bool+    isAlreadyExistsErrorType,     isDoesNotExistErrorType,     isAlreadyInUseErrorType,     isFullErrorType, @@ -75,71 +73,37 @@      -- * Throwing and catching I\/O errors -    ioError,                    -- :: IOError -> IO a+    ioError, -    catchIOError,               -- :: IO a -> (IOError -> IO a) -> IO a-    tryIOError,                 -- :: IO a -> IO (Either IOError a)+    catchIOError,+    tryIOError, -    modifyIOError,              -- :: (IOError -> IOError) -> IO a -> IO a+    modifyIOError,   ) where -#ifndef __HUGS__ import Control.Exception.Base-#endif -#ifndef __HUGS__ import Data.Either-#endif import Data.Maybe -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IO import GHC.IO.Exception import GHC.IO.Handle.Types import Text.Show-#endif -#ifdef __HUGS__-import Hugs.Prelude(Handle, IOException(..), IOErrorType(..), IO)-#endif--#ifdef __NHC__-import IO-  ( IOError ()-  , Handle ()-  , try-  , ioError-  , userError-  , isAlreadyExistsError        -- :: IOError -> Bool-  , isDoesNotExistError-  , isAlreadyInUseError-  , isFullError-  , isEOFError-  , isIllegalOperation-  , isPermissionError-  , isUserError-  , ioeGetErrorString           -- :: IOError -> String-  , ioeGetHandle                -- :: IOError -> Maybe Handle-  , ioeGetFileName              -- :: IOError -> Maybe FilePath-  )-import qualified NHC.Internal as NHC (IOError(..))-import qualified NHC.DErrNo as NHC (ErrNo(..))-import Data.Maybe (fromJust)-import Control.Monad (MonadPlus(mplus))-#endif- -- | The construct 'tryIOError' @comp@ exposes IO errors which occur within a -- computation, and which are not fully handled. -- -- Non-I\/O exceptions are not caught by this variant; to catch all -- exceptions, use 'Control.Exception.try' from "Control.Exception".+--+-- /Since: 4.4.0.0/ tryIOError     :: IO a -> IO (Either IOError a) tryIOError f   =  catch (do r <- f                             return (Right r))                         (return . Left) -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) -- ----------------------------------------------------------------------------- -- Constructing an IOError @@ -152,30 +116,11 @@                IOError{ ioe_type = t,                          ioe_location = location,                         ioe_description = "",-#if defined(__GLASGOW_HASKELL__)                         ioe_errno = Nothing,-#endif                         ioe_handle = maybe_hdl,                          ioe_filename = maybe_filename                         }-#endif /* __GLASGOW_HASKELL__ || __HUGS__ */-#ifdef __NHC__-mkIOError EOF       location maybe_hdl maybe_filename =-    NHC.EOFError location (fromJust maybe_hdl)-mkIOError UserError location maybe_hdl maybe_filename =-    NHC.UserError location ""-mkIOError t         location maybe_hdl maybe_filename =-    NHC.IOError location maybe_filename maybe_hdl (ioeTypeToErrNo t)-  where-    ioeTypeToErrNo AlreadyExists     = NHC.EEXIST-    ioeTypeToErrNo NoSuchThing       = NHC.ENOENT-    ioeTypeToErrNo ResourceBusy      = NHC.EBUSY-    ioeTypeToErrNo ResourceExhausted = NHC.ENOSPC-    ioeTypeToErrNo IllegalOperation  = NHC.EPERM-    ioeTypeToErrNo PermissionDenied  = NHC.EACCES-#endif /* __NHC__ */ -#ifndef __NHC__ -- ----------------------------------------------------------------------------- -- IOErrorType @@ -224,17 +169,10 @@ -- | A programmer-defined error value constructed using 'userError'. isUserError         :: IOError -> Bool isUserError          = isUserErrorType             . ioeGetErrorType-#endif /* __NHC__ */  -- ----------------------------------------------------------------------------- -- IOErrorTypes -#ifdef __NHC__-data IOErrorType = AlreadyExists | NoSuchThing | ResourceBusy-                 | ResourceExhausted | EOF | IllegalOperation-                 | PermissionDenied | UserError-#endif- -- | I\/O error where the operation failed because one of its arguments -- already exists. alreadyExistsErrorType   :: IOErrorType@@ -323,7 +261,6 @@ -- ----------------------------------------------------------------------------- -- Miscellaneous -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) ioeGetErrorType       :: IOError -> IOErrorType ioeGetErrorString     :: IOError -> String ioeGetLocation        :: IOError -> String@@ -354,47 +291,6 @@ ioeSetHandle      ioe hdl      = ioe{ ioe_handle = Just hdl } ioeSetFileName    ioe filename = ioe{ ioe_filename = Just filename } -#elif defined(__NHC__)-ioeGetErrorType       :: IOError -> IOErrorType-ioeGetLocation        :: IOError -> String--ioeGetErrorType e | isAlreadyExistsError e = AlreadyExists-                  | isDoesNotExistError e  = NoSuchThing-                  | isAlreadyInUseError e  = ResourceBusy-                  | isFullError e          = ResourceExhausted-                  | isEOFError e           = EOF-                  | isIllegalOperation e   = IllegalOperation-                  | isPermissionError e    = PermissionDenied-                  | isUserError e          = UserError--ioeGetLocation (NHC.IOError _ _ _ _)  = "unknown location"-ioeGetLocation (NHC.EOFError _ _ )    = "unknown location"-ioeGetLocation (NHC.PatternError loc) = loc-ioeGetLocation (NHC.UserError loc _)  = loc--ioeSetErrorType   :: IOError -> IOErrorType -> IOError-ioeSetErrorString :: IOError -> String      -> IOError-ioeSetLocation    :: IOError -> String      -> IOError-ioeSetHandle      :: IOError -> Handle      -> IOError-ioeSetFileName    :: IOError -> FilePath    -> IOError--ioeSetErrorType e _ = e-ioeSetErrorString   (NHC.IOError _ f h e) s = NHC.IOError s f h e-ioeSetErrorString   (NHC.EOFError _ f)    s = NHC.EOFError s f-ioeSetErrorString e@(NHC.PatternError _)  _ = e-ioeSetErrorString   (NHC.UserError l _)   s = NHC.UserError l s-ioeSetLocation e@(NHC.IOError _ _ _ _) _ = e-ioeSetLocation e@(NHC.EOFError _ _)    _ = e-ioeSetLocation   (NHC.PatternError _)  l = NHC.PatternError l-ioeSetLocation   (NHC.UserError _ m)   l = NHC.UserError l m-ioeSetHandle   (NHC.IOError o f _ e) h = NHC.IOError o f (Just h) e-ioeSetHandle   (NHC.EOFError o _)    h = NHC.EOFError o h-ioeSetHandle e@(NHC.PatternError _)  _ = e-ioeSetHandle e@(NHC.UserError _ _)   _ = e-ioeSetFileName (NHC.IOError o _ h e) f = NHC.IOError o (Just f) h e-ioeSetFileName e _ = e-#endif- -- | Catch any 'IOError' that occurs in the computation and throw a -- modified version. modifyIOError :: (IOError -> IOError) -> IO a -> IO a@@ -411,8 +307,6 @@               -> Maybe Handle                -> Maybe FilePath                -> IOError --#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) annotateIOError ioe loc hdl path =    ioe{ ioe_handle = hdl `mplus` ioe_handle ioe,        ioe_location = loc, ioe_filename = path `mplus` ioe_filename ioe }@@ -420,20 +314,7 @@     mplus :: Maybe a -> Maybe a -> Maybe a     Nothing `mplus` ys = ys     xs      `mplus` _  = xs-#endif /* __GLASGOW_HASKELL__ || __HUGS__ */ -#if defined(__NHC__)-annotateIOError (NHC.IOError msg file hdl code) msg' hdl' file' =-    NHC.IOError (msg++'\n':msg') (file`mplus`file') (hdl`mplus`hdl') code-annotateIOError (NHC.EOFError msg hdl) msg' _ _ =-    NHC.EOFError (msg++'\n':msg') hdl-annotateIOError (NHC.UserError loc msg) msg' _ _ =-    NHC.UserError loc (msg++'\n':msg')-annotateIOError (NHC.PatternError loc) msg' _ _ =-    NHC.PatternError (loc++'\n':msg')-#endif--#ifndef __HUGS__ -- | The 'catchIOError' function establishes a handler that receives any -- 'IOError' raised in the action protected by 'catchIOError'. -- An 'IOError' is caught by@@ -454,7 +335,7 @@ -- -- Non-I\/O exceptions are not caught by this variant; to catch all -- exceptions, use 'Control.Exception.catch' from "Control.Exception".+--+-- /Since: 4.4.0.0/ catchIOError :: IO a -> (IOError -> IO a) -> IO a catchIOError = catch-#endif /* !__HUGS__ */-
System/IO/Unsafe.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -17,41 +17,30 @@  module System.IO.Unsafe (    -- * Unsafe 'System.IO.IO' operations-   unsafePerformIO,     -- :: IO a -> a-   unsafeDupablePerformIO, -- :: IO a -> a-   unsafeInterleaveIO,  -- :: IO a -> IO a+   unsafePerformIO,+   unsafeDupablePerformIO,+   unsafeInterleaveIO,    unsafeFixIO,   ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IO import GHC.IORef import GHC.Exception import Control.Exception-#endif -#ifdef __HUGS__-import Hugs.IOExts (unsafePerformIO, unsafeInterleaveIO)-unsafeDupablePerformIO = unsafePerformIO-#endif--#ifdef __NHC__-import NHC.Internal (unsafePerformIO, unsafeInterleaveIO)-unsafeDupablePerformIO = unsafePerformIO-#endif- -- | A slightly faster version of `System.IO.fixIO` that may not be -- safe to use with multiple threads.  The unsafety arises when used -- like this: ----- >  unsafeFixIO $ \r ->+-- >  unsafeFixIO $ \r -> do -- >     forkIO (print r) -- >     return (...) -- -- In this case, the child thread will receive a @NonTermination@ -- exception instead of waiting for the value of @r@ to be computed. --+-- /Since: 4.5.0.0/ unsafeFixIO :: (a -> IO a) -> IO a unsafeFixIO k = do   ref <- newIORef (throw NonTermination)
System/Info.hs view
@@ -18,10 +18,10 @@  module System.Info    (-       os,		    -- :: String-       arch,		    -- :: String-       compilerName,	    -- :: String-       compilerVersion	    -- :: Version+       os,+       arch,+       compilerName,+       compilerVersion    ) where  import Prelude@@ -33,38 +33,20 @@ compilerVersion = Version {versionBranch=[major, minor], versionTags=[]}   where (major, minor) = compilerVersionRaw `divMod` 100 +#include "ghcplatform.h"+ -- | The operating system on which the program is running. os :: String+os = HOST_OS  -- | The machine architecture on which the program is running. arch :: String+arch = HOST_ARCH  -- | The Haskell implementation with which the program was compiled -- or is being interpreted. compilerName :: String+compilerName = "ghc"  compilerVersionRaw :: Int--#if defined(__NHC__)-#include "OSInfo.hs"-compilerName = "nhc98"-compilerVersionRaw = __NHC__--#elif defined(__GLASGOW_HASKELL__)-#include "ghcplatform.h"-os = HOST_OS-arch = HOST_ARCH-compilerName = "ghc" compilerVersionRaw = __GLASGOW_HASKELL__--#elif defined(__HUGS__)-#include "platform.h"-os = HOST_OS-arch = HOST_ARCH-compilerName = "hugs"-compilerVersionRaw = 0  -- ToDo--#else-#error Unknown compiler name-#endif-
System/Mem.hs view
@@ -1,8 +1,4 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__-{-# LANGUAGE ForeignFunctionInterface #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -18,22 +14,23 @@ -- ----------------------------------------------------------------------------- -module System.Mem (- 	performGC	-- :: IO ()-  ) where- +module System.Mem+       ( performGC+       , performMajorGC+       , performMinorGC+       ) where import Prelude -#ifdef __HUGS__-import Hugs.IOExts-#endif--#ifdef __GLASGOW_HASKELL__--- | Triggers an immediate garbage collection-foreign import ccall {-safe-} "performMajorGC" performGC :: IO ()-#endif+-- | Triggers an immediate garbage collection.+performGC :: IO ()+performGC = performMajorGC -#ifdef __NHC__-import NHC.IOExtras (performGC)-#endif+-- | Triggers an immediate garbage collection.+--+-- /Since: 4.7.0.0/+foreign import ccall "performMajorGC" performMajorGC :: IO () +-- | Triggers an immediate minor garbage collection.+--+-- /Since: 4.7.0.0/+foreign import ccall "performGC" performMinorGC :: IO ()
System/Mem/StableName.hs view
@@ -1,12 +1,10 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} {-# LANGUAGE MagicHash #-} #if !defined(__PARALLEL_HASKELL__) {-# LANGUAGE UnboxedTuples #-} #endif-#endif  ----------------------------------------------------------------------------- -- |@@ -37,17 +35,13 @@   StableName,   makeStableName,   hashStableName,+  eqStableName   ) where  import Prelude  import Data.Typeable -#ifdef __HUGS__-import Hugs.Stable-#endif--#ifdef __GLASGOW_HASKELL__ import GHC.IO           ( IO(..) ) import GHC.Base		( Int(..), StableName#, makeStableName# 			, eqStableName#, stableNameToInt# )@@ -84,7 +78,7 @@ -}  data StableName a = StableName (StableName# a)-+                    deriving Typeable  -- | Makes a 'StableName' for an arbitrary object.  The object passed as -- the first argument is not evaluated by 'makeStableName'.@@ -120,8 +114,15 @@ 	 _  -> True #endif -#endif /* __GLASGOW_HASKELL__ */--#include "Typeable.h"-INSTANCE_TYPEABLE1(StableName,stableNameTc,"StableName")+-- | Equality on 'StableName' that does not require that the types of+-- the arguments match.+--+-- /Since: 4.7.0.0/+eqStableName :: StableName a -> StableName b -> Bool+eqStableName (StableName sn1) (StableName sn2) =+       case eqStableName# sn1 sn2 of+	 0# -> False+	 _  -> True+  -- Requested by Emil Axelsson on glasgow-haskell-users, who wants to+  -- use it for implementing observable sharing. 
System/Mem/Weak.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP #-}  ----------------------------------------------------------------------------- -- |@@ -55,29 +54,22 @@ 	Weak,	    		-- abstract  	-- * The general interface-	mkWeak,      		-- :: k -> v -> Maybe (IO ()) -> IO (Weak v)-	deRefWeak, 		-- :: Weak v -> IO (Maybe v)-	finalize,		-- :: Weak v -> IO ()+	mkWeak,+	deRefWeak,+	finalize,  	-- * Specialised versions-	mkWeakPtr, 		-- :: k -> Maybe (IO ()) -> IO (Weak k)-	addFinalizer, 		-- :: key -> IO () -> IO ()-	mkWeakPair, 		-- :: k -> v -> Maybe (IO ()) -> IO (Weak (k,v))-	-- replaceFinaliser	-- :: Weak v -> IO () -> IO ()+	mkWeakPtr,+	addFinalizer,+	mkWeakPair,+	-- replaceFinaliser  	-- * A precise semantics 	 	-- $precise    ) where -#ifdef __HUGS__-import Hugs.Weak-import Prelude-#endif--#ifdef __GLASGOW_HASKELL__ import GHC.Weak-#endif  -- | A specialised version of 'mkWeak', where the key and the value are -- the same object:
System/Posix/Internals.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface, CApiFFI,-             EmptyDataDecls #-}+{-# LANGUAGE CPP, NoImplicitPrelude, CApiFFI #-} {-# OPTIONS_HADDOCK hide #-}  -----------------------------------------------------------------------------@@ -21,14 +20,9 @@ -- ----------------------------------------------------------------------------- --- #hide module System.Posix.Internals where -#ifdef __NHC__-#define HTYPE_TCFLAG_T-#else-# include "HsBaseConfig.h"-#endif+#include "HsBaseConfig.h"  #if ! (defined(mingw32_HOST_OS) || defined(__MINGW32__)) import Control.Monad@@ -45,7 +39,6 @@ import System.IO.Error #endif -#if __GLASGOW_HASKELL__ import GHC.Base import GHC.Num import GHC.Real@@ -57,21 +50,7 @@ import {-# SOURCE #-} GHC.IO.Encoding (getFileSystemEncoding) import qualified GHC.Foreign as GHC #endif-#elif __HUGS__-import Hugs.Prelude (IOException(..), IOErrorType(..))-import Hugs.IO (IOMode(..))-#elif __NHC__-import GHC.IO.Device	-- yes, I know, but its portable, really!-import System.IO-import Control.Exception-import DIOError-#endif -#ifdef __HUGS__-{-# CFILES cbits/PrelIOUtils.c cbits/consUtils.c #-}-#endif-- -- --------------------------------------------------------------------------- -- Debugging the base package @@ -152,16 +131,10 @@         | otherwise             -> ioError ioe_unknownfiletype      ioe_unknownfiletype :: IOException-#ifndef __NHC__ ioe_unknownfiletype = IOError Nothing UnsupportedOperation "fdType"                         "unknown file type"-#  if __GLASGOW_HASKELL__                         Nothing-#  endif                         Nothing-#else-ioe_unknownfiletype = UserError "fdType" "unknown file type"-#endif  fdGetMode :: FD -> IO IOMode #if defined(mingw32_HOST_OS) || defined(__MINGW32__)@@ -191,23 +164,22 @@ withFilePath :: FilePath -> (CWString -> IO a) -> IO a withFilePath = withCWString +newFilePath :: FilePath -> IO CWString+newFilePath = newCWString+ peekFilePath :: CWString -> IO FilePath peekFilePath = peekCWString #else  withFilePath :: FilePath -> (CString -> IO a) -> IO a+newFilePath :: FilePath -> IO CString peekFilePath :: CString -> IO FilePath peekFilePathLen :: CStringLen -> IO FilePath -#if __GLASGOW_HASKELL__ withFilePath fp f = getFileSystemEncoding >>= \enc -> GHC.withCString enc fp f+newFilePath fp = getFileSystemEncoding >>= \enc -> GHC.newCString enc fp peekFilePath fp = getFileSystemEncoding >>= \enc -> GHC.peekCString enc fp peekFilePathLen fp = getFileSystemEncoding >>= \enc -> GHC.peekCStringLen enc fp-#else-withFilePath = withCString-peekFilePath = peekCString-peekFilePathLen = peekCStringLen-#endif  #endif @@ -255,7 +227,6 @@         throwErrnoIfMinus1Retry_ "tcSetAttr"            (c_tcgetattr fd p_tios) -#ifdef __GLASGOW_HASKELL__         -- Save a copy of termios, if this is a standard file descriptor.         -- These terminal settings are restored in hs_exit().         when (fd <= 2) $ do@@ -264,7 +235,6 @@              saved_tios <- mallocBytes sizeof_termios              copyBytes saved_tios p_tios sizeof_termios              set_saved_termios fd saved_tios-#endif          -- tcsetattr() when invoked by a background process causes the process         -- to be sent SIGTTOU regardless of whether the process has TOSTOP set@@ -286,13 +256,11 @@                  c_sigprocmask const_sig_setmask p_old_sigset nullPtr              return r -#ifdef __GLASGOW_HASKELL__ foreign import ccall unsafe "HsBase.h __hscore_get_saved_termios"    get_saved_termios :: CInt -> IO (Ptr CTermios)  foreign import ccall unsafe "HsBase.h __hscore_set_saved_termios"    set_saved_termios :: CInt -> (Ptr CTermios) -> IO ()-#endif  #else @@ -313,11 +281,7 @@  ioe_unk_error :: String -> String -> IOException ioe_unk_error loc msg -#ifndef __NHC__  = ioeSetErrorString (mkIOError OtherError loc Nothing Nothing) msg-#else- = UserError loc msg-#endif  -- Note: echoing goes hand in hand with enabling 'line input' / raw-ness -- for Win32 consoles, hence setEcho ends up being the inverse of setCooked.@@ -482,7 +446,8 @@ foreign import ccall unsafe "HsBase.h link"    c_link :: CString -> CString -> IO CInt -foreign import ccall unsafe "HsBase.h mkfifo"+-- capi is required at least on Android+foreign import capi unsafe "HsBase.h mkfifo"    c_mkfifo :: CString -> CMode -> IO CInt  foreign import ccall unsafe "HsBase.h pipe"@@ -497,10 +462,12 @@ foreign import capi unsafe "signal.h sigprocmask"    c_sigprocmask :: CInt -> Ptr CSigset -> Ptr CSigset -> IO CInt -foreign import ccall unsafe "HsBase.h tcgetattr"+-- capi is required at least on Android+foreign import capi unsafe "HsBase.h tcgetattr"    c_tcgetattr :: CInt -> Ptr CTermios -> IO CInt -foreign import ccall unsafe "HsBase.h tcsetattr"+-- capi is required at least on Android+foreign import capi unsafe "HsBase.h tcsetattr"    c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt  foreign import capi unsafe "HsBase.h utime"
− System/Posix/Internals.hs-boot
@@ -1,9 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude #-}-module System.Posix.Internals where--import GHC.IO-import GHC.Base--puts :: String -> IO ()-
System/Posix/Types.hs view
@@ -4,9 +4,7 @@            , MagicHash            , GeneralizedNewtypeDeriving   #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -22,26 +20,7 @@ -- @\<sys\/types.h>@ C header on a POSIX system. -- ------------------------------------------------------------------------------#ifdef __NHC__-#define HTYPE_DEV_T-#define HTYPE_INO_T-#define HTYPE_MODE_T-#define HTYPE_OFF_T-#define HTYPE_PID_T-#define HTYPE_SSIZE_T-#define HTYPE_GID_T-#define HTYPE_NLINK_T-#define HTYPE_UID_T-#define HTYPE_CC_T-#define HTYPE_SPEED_T-#define HTYPE_TCFLAG_T-#define HTYPE_RLIM_T-#define HTYPE_NLINK_T-#define HTYPE_UID_T-#define HTYPE_GID_T-#else #include "HsBaseConfig.h"-#endif  module System.Posix.Types ( @@ -111,17 +90,11 @@   Limit  ) where -#ifdef __NHC__-import NHC.PosixTypes-import Foreign.C-#else- import Foreign import Foreign.C import Data.Typeable -- import Data.Bits -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Enum import GHC.Num@@ -129,60 +102,57 @@ -- import GHC.Prim import GHC.Read import GHC.Show-#else-import Control.Monad-#endif  #include "CTypes.h"  #if defined(HTYPE_DEV_T)-INTEGRAL_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)+INTEGRAL_TYPE(CDev,HTYPE_DEV_T) #endif #if defined(HTYPE_INO_T)-INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)+INTEGRAL_TYPE(CIno,HTYPE_INO_T) #endif #if defined(HTYPE_MODE_T)-INTEGRAL_TYPE_WITH_CTYPE(CMode,mode_t,tyConCMode,"CMode",HTYPE_MODE_T)+INTEGRAL_TYPE_WITH_CTYPE(CMode,mode_t,HTYPE_MODE_T) #endif #if defined(HTYPE_OFF_T)-INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)+INTEGRAL_TYPE(COff,HTYPE_OFF_T) #endif #if defined(HTYPE_PID_T)-INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)+INTEGRAL_TYPE(CPid,HTYPE_PID_T) #endif  #if defined(HTYPE_SSIZE_T)-INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)+INTEGRAL_TYPE(CSsize,HTYPE_SSIZE_T) #endif  #if defined(HTYPE_GID_T)-INTEGRAL_TYPE(CGid,tyConCGid,"CGid",HTYPE_GID_T)+INTEGRAL_TYPE(CGid,HTYPE_GID_T) #endif #if defined(HTYPE_NLINK_T)-INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)+INTEGRAL_TYPE(CNlink,HTYPE_NLINK_T) #endif  #if defined(HTYPE_UID_T)-INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)+INTEGRAL_TYPE(CUid,HTYPE_UID_T) #endif #if defined(HTYPE_CC_T)-ARITHMETIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)+ARITHMETIC_TYPE(CCc,HTYPE_CC_T) #endif #if defined(HTYPE_SPEED_T)-ARITHMETIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)+ARITHMETIC_TYPE(CSpeed,HTYPE_SPEED_T) #endif #if defined(HTYPE_TCFLAG_T)-INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)+INTEGRAL_TYPE(CTcflag,HTYPE_TCFLAG_T) #endif #if defined(HTYPE_RLIM_T)-INTEGRAL_TYPE(CRLim,tyConCRlim,"CRLim",HTYPE_RLIM_T)+INTEGRAL_TYPE(CRLim,HTYPE_RLIM_T) #endif  -- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t -- suseconds_t, timer_t, useconds_t  -- Make an Fd type rather than using CInt everywhere-INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)+INTEGRAL_TYPE(Fd,CInt)  -- nicer names, and backwards compatibility with POSIX library: #if defined(HTYPE_NLINK_T)@@ -194,8 +164,6 @@ #if defined(HTYPE_GID_T) type GroupID        = CGid #endif--#endif /* !__NHC__ */  type ByteCount      = CSize type ClockTick      = CClock
System/Timeout.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-}-#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}-#endif  ------------------------------------------------------------------------------- -- |@@ -18,15 +16,19 @@ -- ------------------------------------------------------------------------------- -#ifdef __GLASGOW_HASKELL__-#include "Typeable.h"-#endif- module System.Timeout ( timeout ) where -#ifdef __GLASGOW_HASKELL__+#ifndef mingw32_HOST_OS+import Control.Monad+import GHC.Event           (getSystemTimerManager,+                            registerTimeout, unregisterTimeout)+#endif+ import Control.Concurrent-import Control.Exception   (Exception, handleJust, bracket)+import Control.Exception   (Exception(..), handleJust, bracket,+                            uninterruptibleMask_,+                            asyncExceptionToException,+                            asyncExceptionFromException) import Data.Typeable import Data.Unique         (Unique, newUnique) @@ -34,14 +36,15 @@ -- interrupt the running IO computation when the timeout has -- expired. -newtype Timeout = Timeout Unique deriving Eq-INSTANCE_TYPEABLE0(Timeout,timeoutTc,"Timeout")+newtype Timeout = Timeout Unique deriving (Eq, Typeable)  instance Show Timeout where     show _ = "<<timeout>>" -instance Exception Timeout-#endif /* !__GLASGOW_HASKELL__ */+-- Timeout is a child of SomeAsyncException+instance Exception Timeout where+  toException = asyncExceptionToException+  fromException = asyncExceptionFromException  -- |Wrap an 'IO' computation to time out and return @Nothing@ in case no result -- is available within @n@ microseconds (@1\/10^6@ seconds). In case a result@@ -73,10 +76,40 @@ -- I\/O or file I\/O using this combinator.  timeout :: Int -> IO a -> IO (Maybe a)-#ifdef __GLASGOW_HASKELL__ timeout n f     | n <  0    = fmap Just f     | n == 0    = return Nothing+#ifndef mingw32_HOST_OS+    | rtsSupportsBoundThreads = do+        -- In the threaded RTS, we use the Timer Manager to delay the+        -- (fairly expensive) 'forkIO' call until the timeout has expired.+        --+        -- An additional thread is required for the actual delivery of+        -- the Timeout exception because killThread (or another throwTo)+        -- is the only way to reliably interrupt a throwTo in flight.+        pid <- myThreadId+        ex  <- fmap Timeout newUnique+        tm  <- getSystemTimerManager+        -- 'lock' synchronizes the timeout handler and the main thread:+        --  * the main thread can disable the handler by writing to 'lock';+        --  * the handler communicates the spawned thread's id through 'lock'.+        -- These two cases are mutually exclusive.+        lock <- newEmptyMVar+        let handleTimeout = do+                v <- isEmptyMVar lock+                when v $ void $ forkIOWithUnmask $ \unmask -> unmask $ do+                    v2 <- tryPutMVar lock =<< myThreadId+                    when v2 $ throwTo pid ex+            cleanupTimeout key = uninterruptibleMask_ $ do+                v <- tryPutMVar lock undefined+                if v then unregisterTimeout tm key+                     else takeMVar lock >>= killThread+        handleJust (\e -> if e == ex then Just () else Nothing)+                   (\_ -> return Nothing)+                   (bracket (registerTimeout tm n handleTimeout)+                            cleanupTimeout+                            (\_ -> fmap Just f))+#endif     | otherwise = do         pid <- myThreadId         ex  <- fmap Timeout newUnique@@ -84,9 +117,6 @@                    (\_ -> return Nothing)                    (bracket (forkIOWithUnmask $ \unmask ->                                  unmask $ threadDelay n >> throwTo pid ex)-                            (killThread)+                            (uninterruptibleMask_ . killThread)                             (\_ -> fmap Just f))-#else-timeout n f = fmap Just f-#endif /* !__GLASGOW_HASKELL__ */-+        -- #7719 explains why we need uninterruptibleMask_ above.
Text/ParserCombinators/ReadP.hs view
@@ -1,11 +1,7 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}-#ifndef __NHC__-{-# LANGUAGE Rank2Types #-}-#endif-#ifdef __GLASGOW_HASKELL__+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE RankNTypes #-} {-# LANGUAGE MagicHash #-}-#endif  ----------------------------------------------------------------------------- -- |@@ -28,51 +24,47 @@ module Text.ParserCombinators.ReadP   (    -- * The 'ReadP' type-#ifndef __NHC__-  ReadP,      -- :: * -> *; instance Functor, Monad, MonadPlus-#else-  ReadPN,     -- :: * -> * -> *; instance Functor, Monad, MonadPlus-#endif+  ReadP,      -- * Primitive operations-  get,        -- :: ReadP Char-  look,       -- :: ReadP String-  (+++),      -- :: ReadP a -> ReadP a -> ReadP a-  (<++),      -- :: ReadP a -> ReadP a -> ReadP a-  gather,     -- :: ReadP a -> ReadP (String, a)+  get,+  look,+  (+++),+  (<++),+  gather,      -- * Other operations-  pfail,      -- :: ReadP a-  eof,        -- :: ReadP ()-  satisfy,    -- :: (Char -> Bool) -> ReadP Char-  char,       -- :: Char -> ReadP Char-  string,     -- :: String -> ReadP String-  munch,      -- :: (Char -> Bool) -> ReadP String-  munch1,     -- :: (Char -> Bool) -> ReadP String-  skipSpaces, -- :: ReadP ()-  choice,     -- :: [ReadP a] -> ReadP a-  count,      -- :: Int -> ReadP a -> ReadP [a]-  between,    -- :: ReadP open -> ReadP close -> ReadP a -> ReadP a-  option,     -- :: a -> ReadP a -> ReadP a-  optional,   -- :: ReadP a -> ReadP ()-  many,       -- :: ReadP a -> ReadP [a]-  many1,      -- :: ReadP a -> ReadP [a]-  skipMany,   -- :: ReadP a -> ReadP ()-  skipMany1,  -- :: ReadP a -> ReadP ()-  sepBy,      -- :: ReadP a -> ReadP sep -> ReadP [a]-  sepBy1,     -- :: ReadP a -> ReadP sep -> ReadP [a]-  endBy,      -- :: ReadP a -> ReadP sep -> ReadP [a]-  endBy1,     -- :: ReadP a -> ReadP sep -> ReadP [a]-  chainr,     -- :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a-  chainl,     -- :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a-  chainl1,    -- :: ReadP a -> ReadP (a -> a -> a) -> ReadP a-  chainr1,    -- :: ReadP a -> ReadP (a -> a -> a) -> ReadP a-  manyTill,   -- :: ReadP a -> ReadP end -> ReadP [a]+  pfail,+  eof,+  satisfy,+  char,+  string,+  munch,+  munch1,+  skipSpaces,+  choice,+  count,+  between,+  option,+  optional,+  many,+  many1,+  skipMany,+  skipMany1,+  sepBy,+  sepBy1,+  endBy,+  endBy1,+  chainr,+  chainl,+  chainl1,+  chainr1,+  manyTill,      -- * Running a parser-  ReadS,      -- :: *; = String -> [(a,String)]-  readP_to_S, -- :: ReadP a -> ReadS a-  readS_to_P, -- :: ReadS a -> ReadP a+  ReadS,+  readP_to_S,+  readS_to_P,      -- * Properties   -- $properties@@ -81,17 +73,12 @@  import Control.Monad( MonadPlus(..), sequence, liftM2 ) -#ifdef __GLASGOW_HASKELL__ import {-# SOURCE #-} GHC.Unicode ( isSpace  ) import GHC.List ( replicate, null ) import GHC.Base-#else-import Data.Char( isSpace )-#endif  infixr 5 +++, <++ -#ifdef __GLASGOW_HASKELL__ ------------------------------------------------------------------------ -- ReadS @@ -101,7 +88,6 @@ -- Note that this kind of backtracking parser is very inefficient; -- reading a large structure may be quite slow (cf 'ReadP'). type ReadS a = String -> [(a,String)]-#endif  -- --------------------------------------------------------------------------- -- The P type@@ -159,12 +145,7 @@ -- --------------------------------------------------------------------------- -- The ReadP type -#ifndef __NHC__ newtype ReadP a = R (forall b . (a -> P b) -> P b)-#else-#define ReadP  (ReadPN b)-newtype ReadPN b a = R ((a -> P b) -> P b)-#endif  -- Functor, Monad, MonadPlus @@ -216,15 +197,10 @@ -- ^ Symmetric choice. R f1 +++ R f2 = R (\k -> f1 k `mplus` f2 k) -#ifndef __NHC__ (<++) :: ReadP a -> ReadP a -> ReadP a-#else-(<++) :: ReadPN a a -> ReadPN a a -> ReadPN a a-#endif -- ^ Local, exclusive, left-biased choice: If left parser --   locally produces any result at all, then right parser is --   not used.-#ifdef __GLASGOW_HASKELL__ R f0 <++ q =   do s <- look      probe (f0 return) s 0#@@ -237,26 +213,8 @@    discard 0# = return ()   discard n  = get >> discard (n-#1#)-#else-R f <++ q =-  do s <- look-     probe (f return) s 0- where-  probe (Get f)        (c:s) n = probe (f c) s (n+1)-  probe (Look f)       s     n = probe (f s) s n-  probe p@(Result _ _) _     n = discard n >> R (p >>=)-  probe (Final r)      _     _ = R (Final r >>=)-  probe _              _     _ = q -  discard 0 = return ()-  discard n  = get >> discard (n-1)-#endif--#ifndef __NHC__ gather :: ReadP a -> ReadP (String, a)-#else--- gather :: ReadPN (String->P b) a -> ReadPN (String->P b) (String, a)-#endif -- ^ Transforms a parser into one that does the same, but --   in addition returns the exact characters read. --   IMPORTANT NOTE: 'gather' gives a runtime error if its first argument@@ -421,11 +379,7 @@                     rest (f x y)                  +++ return x -#ifndef __NHC__ manyTill :: ReadP a -> ReadP end -> ReadP [a]-#else-manyTill :: ReadPN [a] a -> ReadPN [a] end -> ReadPN [a] [a]-#endif -- ^ @manyTill p end@ parses zero or more occurrences of @p@, until @end@ --   succeeds. Returns a list of values returned by @p@. manyTill p end = scan@@ -434,11 +388,7 @@ -- --------------------------------------------------------------------------- -- Converting between ReadP and Read -#ifndef __NHC__ readP_to_S :: ReadP a -> ReadS a-#else-readP_to_S :: ReadPN a a -> ReadS a-#endif -- ^ Converts a parser into a Haskell ReadS-style function. --   This is the main way in which you can \"run\" a 'ReadP' parser: --   the expanded type is
Text/ParserCombinators/ReadPrec.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -17,32 +17,32 @@  module Text.ParserCombinators.ReadPrec   ( -  ReadPrec,      -- :: * -> *; instance Functor, Monad, MonadPlus+  ReadPrec,      -- * Precedences-  Prec,          -- :: *; = Int-  minPrec,       -- :: Prec; = 0+  Prec,+  minPrec,    -- * Precedence operations-  lift,          -- :: ReadP a -> ReadPrec a-  prec,          -- :: Prec -> ReadPrec a -> ReadPrec a-  step,          -- :: ReadPrec a -> ReadPrec a-  reset,         -- :: ReadPrec a -> ReadPrec a+  lift,+  prec,+  step,+  reset,    -- * Other operations   -- | All are based directly on their similarly-named 'ReadP' counterparts.-  get,           -- :: ReadPrec Char-  look,          -- :: ReadPrec String-  (+++),         -- :: ReadPrec a -> ReadPrec a -> ReadPrec a-  (<++),         -- :: ReadPrec a -> ReadPrec a -> ReadPrec a-  pfail,         -- :: ReadPrec a-  choice,        -- :: [ReadPrec a] -> ReadPrec a+  get,+  look,+  (+++),+  (<++),+  pfail,+  choice,    -- * Converters-  readPrec_to_P, -- :: ReadPrec a       -> (Int -> ReadP a)-  readP_to_Prec, -- :: (Int -> ReadP a) -> ReadPrec a-  readPrec_to_S, -- :: ReadPrec a       -> (Int -> ReadS a)-  readS_to_Prec, -- :: (Int -> ReadS a) -> ReadPrec a+  readPrec_to_P,+  readP_to_Prec,+  readPrec_to_S,+  readS_to_Prec,   )  where @@ -62,10 +62,8 @@   )  import Control.Monad( MonadPlus(..) )-#ifdef __GLASGOW_HASKELL__ import GHC.Num( Num(..) ) import GHC.Base-#endif  -- --------------------------------------------------------------------------- -- The readPrec type
Text/Printf.hs view
@@ -1,75 +1,255 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE CPP #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >=  700+{-# LANGUAGE GADTs #-}+#endif  ----------------------------------------------------------------------------- -- | -- Module      :  Text.Printf--- Copyright   :  (c) Lennart Augustsson, 2004-2008--- License     :  BSD-style (see the file libraries/base/LICENSE)--- --- Maintainer  :  lennart@augustsson.net+-- Copyright   :  (c) Lennart Augustsson and Bart Massey 2013+-- License     :  BSD-style (see the file LICENSE in this distribution)+--+-- Maintainer  :  Bart Massey <bart@cs.pdx.edu> -- Stability   :  provisional -- Portability :  portable ----- A C printf like formatter.---+-- A C @printf(3)@-like formatter. This version has been+-- extended by Bart Massey as per the recommendations of+-- John Meacham and Simon Marlow+-- \<<http://comments.gmane.org/gmane.comp.lang.haskell.libraries/4726>\>+-- to support extensible formatting for new datatypes.  It+-- has also been extended to support almost all C+-- @printf(3)@ syntax. ----------------------------------------------------------------------------- -{-# Language CPP #-}- module Text.Printf(+-- * Printing Functions    printf, hPrintf,-   PrintfType, HPrintfType, PrintfArg, IsChar+-- * Extending To New Types+--+-- | This 'printf' can be extended to format types+-- other than those provided for by default. This+-- is done by instancing 'PrintfArg' and providing+-- a 'formatArg' for the type. It is possible to+-- provide a 'parseFormat' to process type-specific+-- modifiers, but the default instance is usually+-- the best choice.+--+-- For example:+--+-- > instance PrintfArg () where+-- >   formatArg x fmt | fmtChar (vFmt 'U' fmt) == 'U' =+-- >     formatString "()" (fmt { fmtChar = 's', fmtPrecision = Nothing })+-- >   formatArg _ fmt = errorBadFormat $ fmtChar fmt+-- >+-- > main :: IO ()+-- > main = printf "[%-3.1U]\n" ()+--+-- prints \"@[() ]@\". Note the use of 'formatString' to+-- take care of field formatting specifications in a convenient+-- way.+   PrintfArg(..),+   FieldFormatter,+   FieldFormat(..),+   FormatAdjustment(..), FormatSign(..),+   vFmt,+-- ** Handling Type-specific Modifiers+--+-- | In the unlikely case that modifier characters of+-- some kind are desirable for a user-provided type,+-- a 'ModifierParser' can be provided to process these+-- characters. The resulting modifiers will appear in+-- the 'FieldFormat' for use by the type-specific formatter.+   ModifierParser, FormatParse(..),+-- ** Standard Formatters+--+-- | These formatters for standard types are provided for+-- convenience in writting new type-specific formatters:+-- a common pattern is to throw to 'formatString' or+-- 'formatInteger' to do most of the format handling for+-- a new type.+   formatString, formatChar, formatInt,+   formatInteger, formatRealFloat,+-- ** Raising Errors+--+-- | These functions are used internally to raise various+-- errors, and are exported for use by new type-specific+-- formatters.+  errorBadFormat, errorShortFormat, errorMissingArgument,+  errorBadArgument,+  perror,+-- * Implementation Internals+-- | These types are needed for implementing processing+-- variable numbers of arguments to 'printf' and 'hPrintf'.+-- Their implementation is intentionally not visible from+-- this module. If you attempt to pass an argument of a type+-- which is not an instance of the appropriate class to+-- 'printf' or 'hPrintf', then the compiler will report it+-- as a missing instance of 'PrintfArg'.  (All 'PrintfArg'+-- instances are 'PrintfType' instances.)+  PrintfType, HPrintfType,+-- | This class is needed as a Haskell98 compatibility+-- workaround for the lack of FlexibleInstances.+  IsChar(..) ) where  import Prelude import Data.Char import Data.Int+import Data.List import Data.Word-import Numeric(showEFloat, showFFloat, showGFloat)+import Numeric import System.IO  -------------------  -- | Format a variable number of arguments with the C-style formatting string.--- The return value is either 'String' or @('IO' a)@.+-- The return value is either 'String' or @('IO' a)@ (which+-- should be @('IO' '()')@, but Haskell's type system+-- makes this hard). ----- The format string consists of ordinary characters and /conversion--- specifications/, which specify how to format one of the arguments--- to printf in the output string.  A conversion specification begins with the--- character @%@, followed by one or more of the following flags:+-- The format string consists of ordinary characters and+-- /conversion specifications/, which specify how to format+-- one of the arguments to 'printf' in the output string. A+-- format specification is introduced by the @%@ character;+-- this character can be self-escaped into the format string+-- using @%%@. A format specification ends with a /format+-- character/ that provides the primary information about+-- how to format the value. The rest of the conversion+-- specification is optional.  In order, one may have flag+-- characters, a width specifier, a precision specifier, and+-- type-specific modifier characters. --+-- Unlike C @printf(3)@, the formatting of this 'printf'+-- is driven by the argument type; formatting is type specific. The+-- types formatted by 'printf' \"out of the box\" are:+--+--   * 'Integral' types, including 'Char'+--+--   * 'String'+--+--   * 'RealFloat' types+--+-- 'printf' is also extensible to support other types: see below.+--+-- A conversion specification begins with the+-- character @%@, followed by zero or more of the following flags:+-- -- >    -      left adjust (default is right adjust) -- >    +      always use a sign (+ or -) for signed conversions--- >    0      pad with zeroes rather than spaces+-- >    space  leading space for positive numbers in signed conversions+-- >    0      pad with zeros rather than spaces+-- >    #      use an \"alternate form\": see below ----- followed optionally by a field width:--- +-- When both flags are given, @-@ overrides @0@ and @+@ overrides space.+-- A negative width specifier in a @*@ conversion is treated as+-- positive but implies the left adjust flag.+--+-- The \"alternate form\" for unsigned radix conversions is+-- as in C @printf(3)@:+--+-- >    %o           prefix with a leading 0 if needed+-- >    %x           prefix with a leading 0x if nonzero+-- >    %X           prefix with a leading 0X if nonzero+-- >    %b           prefix with a leading 0b if nonzero+-- >    %[eEfFgG]    ensure that the number contains a decimal point+--+-- Any flags are followed optionally by a field width:+-- -- >    num    field width -- >    *      as num, but taken from argument list ----- followed optionally by a precision:+-- The field width is a minimum, not a maximum: it will be+-- expanded as needed to avoid mutilating a value. ----- >    .num   precision (number of decimal places)+-- Any field width is followed optionally by a precision: ----- and finally, a format character:+-- >    .num   precision+-- >    .      same as .0+-- >    .*     as num, but taken from argument list ----- >    c      character               Char, Int, Integer, ...--- >    d      decimal                 Char, Int, Integer, ...--- >    o      octal                   Char, Int, Integer, ...--- >    x      hexadecimal             Char, Int, Integer, ...--- >    X      hexadecimal             Char, Int, Integer, ...--- >    u      unsigned decimal        Char, Int, Integer, ...--- >    f      floating point          Float, Double--- >    g      general format float    Float, Double--- >    G      general format float    Float, Double--- >    e      exponent format float   Float, Double--- >    E      exponent format float   Float, Double+-- Negative precision is taken as 0. The meaning of the+-- precision depends on the conversion type.+--+-- >    Integral    minimum number of digits to show+-- >    RealFloat   number of digits after the decimal point+-- >    String      maximum number of characters+--+-- The precision for Integral types is accomplished by zero-padding.+-- If both precision and zero-pad are given for an Integral field,+-- the zero-pad is ignored.+--+-- Any precision is followed optionally for Integral types+-- by a width modifier; the only use of this modifier being+-- to set the implicit size of the operand for conversion of+-- a negative operand to unsigned:+--+-- >    hh     Int8+-- >    h      Int16+-- >    l      Int32+-- >    ll     Int64+-- >    L      Int64+--+-- The specification ends with a format character:+--+-- >    c      character               Integral+-- >    d      decimal                 Integral+-- >    o      octal                   Integral+-- >    x      hexadecimal             Integral+-- >    X      hexadecimal             Integral+-- >    b      binary                  Integral+-- >    u      unsigned decimal        Integral+-- >    f      floating point          RealFloat+-- >    F      floating point          RealFloat+-- >    g      general format float    RealFloat+-- >    G      general format float    RealFloat+-- >    e      exponent format float   RealFloat+-- >    E      exponent format float   RealFloat -- >    s      string                  String+-- >    v      default format          any type ----- Mismatch between the argument types and the format string will cause--- an exception to be thrown at runtime.+-- The \"%v\" specifier is provided for all built-in types,+-- and should be provided for user-defined type formatters+-- as well. It picks a \"best\" representation for the given+-- type. For the built-in types the \"%v\" specifier is+-- converted as follows: --+-- >    c      Char+-- >    u      other unsigned Integral+-- >    d      other signed Integral+-- >    g      RealFloat+-- >    s      String+--+-- Mismatch between the argument types and the format+-- string, as well as any other syntactic or semantic errors+-- in the format string, will cause an exception to be+-- thrown at runtime.+--+-- Note that the formatting for 'RealFloat' types is+-- currently a bit different from that of C @printf(3)@,+-- conforming instead to 'Numeric.showEFloat',+-- 'Numeric.showFFloat' and 'Numeric.showGFloat' (and their+-- alternate versions 'Numeric.showFFloatAlt' and+-- 'Numeric.showGFloatAlt'). This is hard to fix: the fixed+-- versions would format in a backward-incompatible way.+-- In any case the Haskell behavior is generally more+-- sensible than the C behavior.  A brief summary of some+-- key differences:+--+-- * Haskell 'printf' never uses the default \"6-digit\" precision+--   used by C printf.+--+-- * Haskell 'printf' treats the \"precision\" specifier as+--   indicating the number of digits after the decimal point.+--+-- * Haskell 'printf' prints the exponent of e-format+--   numbers without a gratuitous plus sign, and with the+--   minimum possible number of digits.+--+-- * Haskell 'printf' will place a zero after a decimal point when+--   possible.+-- -- Examples: -- -- >   > printf "%d\n" (23::Int)@@ -101,88 +281,128 @@ class HPrintfType t where     hspr :: Handle -> String -> [UPrintf] -> t -{- not allowed in Haskell 98+{- not allowed in Haskell 2010 instance PrintfType String where     spr fmt args = uprintf fmt (reverse args) -} instance (IsChar c) => PrintfType [c] where     spr fmts args = map fromChar (uprintf fmts (reverse args)) +-- Note that this should really be (IO ()), but GHC's+-- type system won't readily let us say that without+-- bringing the GADTs. So we go conditional for these defs.++#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >=  700++instance (a ~ ()) => PrintfType (IO a) where+    spr fmts args =+        putStr $ map fromChar $ uprintf fmts $ reverse args++instance (a ~ ()) => HPrintfType (IO a) where+    hspr hdl fmts args = do+        hPutStr hdl (uprintf fmts (reverse args))++#else+ instance PrintfType (IO a) where     spr fmts args = do-	putStr (uprintf fmts (reverse args))-	return (error "PrintfType (IO a): result should not be used.")+        putStr $ map fromChar $ uprintf fmts $ reverse args+        return (error "PrintfType (IO a): result should not be used.")  instance HPrintfType (IO a) where     hspr hdl fmts args = do-	hPutStr hdl (uprintf fmts (reverse args))-	return (error "HPrintfType (IO a): result should not be used.")+        hPutStr hdl (uprintf fmts (reverse args))+        return (error "HPrintfType (IO a): result should not be used.") +#endif++ instance (PrintfArg a, PrintfType r) => PrintfType (a -> r) where-    spr fmts args = \ a -> spr fmts (toUPrintf a : args)+    spr fmts args = \ a -> spr fmts+                             ((parseFormat a, formatArg a) : args)  instance (PrintfArg a, HPrintfType r) => HPrintfType (a -> r) where-    hspr hdl fmts args = \ a -> hspr hdl fmts (toUPrintf a : args)+    hspr hdl fmts args = \ a -> hspr hdl fmts+                                  ((parseFormat a, formatArg a) : args) +-- | Typeclass of 'printf'-formattable values. The 'formatArg' method+-- takes a value and a field format descriptor and either fails due+-- to a bad descriptor or produces a 'ShowS' as the result. The+-- default 'parseFormat' expects no modifiers: this is the normal+-- case. Minimal instance: 'formatArg'. class PrintfArg a where-    toUPrintf :: a -> UPrintf+    -- | /Since: 4.7.0.0/+    formatArg :: a -> FieldFormatter+    -- | /Since: 4.7.0.0/+    parseFormat :: a -> ModifierParser+    parseFormat _ (c : cs) = FormatParse "" c cs+    parseFormat _ "" = errorShortFormat  instance PrintfArg Char where-    toUPrintf c = UChar c+    formatArg = formatChar+    parseFormat _ cf = parseIntFormat (undefined :: Int) cf -{- not allowed in Haskell 98-instance PrintfArg String where-    toUPrintf s = UString s--} instance (IsChar c) => PrintfArg [c] where-    toUPrintf = UString . map toChar+    formatArg = formatString  instance PrintfArg Int where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Int8 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Int16 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Int32 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Int64 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat -#ifndef __NHC__ instance PrintfArg Word where-    toUPrintf = uInteger-#endif+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Word8 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Word16 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Word32 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Word64 where-    toUPrintf = uInteger+    formatArg = formatInt+    parseFormat = parseIntFormat  instance PrintfArg Integer where-    toUPrintf = UInteger 0+    formatArg = formatInteger+    parseFormat = parseIntFormat  instance PrintfArg Float where-    toUPrintf = UFloat+    formatArg = formatRealFloat  instance PrintfArg Double where-    toUPrintf = UDouble--uInteger :: (Integral a, Bounded a) => a -> UPrintf-uInteger x = UInteger (toInteger $ minBound `asTypeOf` x) (toInteger x)+    formatArg = formatRealFloat +-- | This class, with only the one instance, is used as+-- a workaround for the fact that 'String', as a concrete+-- type, is not allowable as a typeclass instance. 'IsChar'+-- is exported for backward-compatibility. class IsChar c where+    -- | /Since: 4.7.0.0/     toChar :: c -> Char+    -- | /Since: 4.7.0.0/     fromChar :: Char -> c  instance IsChar Char where@@ -191,141 +411,504 @@  ------------------- -data UPrintf = UChar Char | UString String | UInteger Integer Integer | UFloat Float | UDouble Double+-- | Whether to left-adjust or zero-pad a field. These are+-- mutually exclusive, with 'LeftAdjust' taking precedence.+--+-- /Since: 4.7.0.0/+data FormatAdjustment = LeftAdjust | ZeroPad +-- | How to handle the sign of a numeric field.  These are+-- mutually exclusive, with 'SignPlus' taking precedence.+--+-- /Since: 4.7.0.0/+data FormatSign = SignPlus | SignSpace++-- | Description of field formatting for 'formatArg'. See UNIX `printf`(3)+-- for a description of how field formatting works.+--+-- /Since: 4.7.0.0/+data FieldFormat = FieldFormat {+  fmtWidth :: Maybe Int,       -- ^ Total width of the field.+  fmtPrecision :: Maybe Int,   -- ^ Secondary field width specifier.+  fmtAdjust :: Maybe FormatAdjustment,  -- ^ Kind of filling or padding+                                        --   to be done.+  fmtSign :: Maybe FormatSign, -- ^ Whether to insist on a+                               -- plus sign for positive+                               -- numbers.+  fmtAlternate :: Bool,        -- ^ Indicates an "alternate+                               -- format".  See printf(3)+                               -- for the details, which+                               -- vary by argument spec.+  fmtModifiers :: String,      -- ^ Characters that appeared+                               -- immediately to the left of+                               -- 'fmtChar' in the format+                               -- and were accepted by the+                               -- type's 'parseFormat'.+                               -- Normally the empty string.+  fmtChar :: Char              -- ^ The format character+                               -- 'printf' was invoked+                               -- with. 'formatArg' should+                               -- fail unless this character+                               -- matches the type. It is+                               -- normal to handle many+                               -- different format+                               -- characters for a single+                               -- type.+  }++-- | The \"format parser\" walks over argument-type-specific+-- modifier characters to find the primary format character.+-- This is the type of its result.+--+-- /Since: 4.7.0.0/+data FormatParse = FormatParse {+  fpModifiers :: String,   -- ^ Any modifiers found.+  fpChar :: Char,          -- ^ Primary format character.+  fpRest :: String         -- ^ Rest of the format string.+  }++-- Contains the "modifier letters" that can precede an+-- integer type.+intModifierMap :: [(String, Integer)]+intModifierMap = [+  ("hh", toInteger (minBound :: Int8)),+  ("h", toInteger (minBound :: Int16)),+  ("l", toInteger (minBound :: Int32)),+  ("ll", toInteger (minBound :: Int64)),+  ("L", toInteger (minBound :: Int64)) ]++parseIntFormat :: Integral a => a -> String -> FormatParse+parseIntFormat _ s =+  case foldr matchPrefix Nothing intModifierMap of+    Just m -> m+    Nothing ->+      case s of+        c : cs -> FormatParse "" c cs+        "" -> errorShortFormat+  where+    matchPrefix (p, _) m@(Just (FormatParse p0 _ _))+      | length p0 >= length p = m+      | otherwise = case getFormat p of+          Nothing -> m+          Just fp -> Just fp+    matchPrefix (p, _) Nothing =+      getFormat p+    getFormat p =+      stripPrefix p s >>= fp+      where+        fp (c : cs) = Just $ FormatParse p c cs+        fp "" = errorShortFormat++-- | This is the type of a field formatter reified over its+-- argument.+--+-- /Since: 4.7.0.0/+type FieldFormatter = FieldFormat -> ShowS++-- | Type of a function that will parse modifier characters+-- from the format string.+--+-- /Since: 4.7.0.0/+type ModifierParser = String -> FormatParse++-- | Substitute a \'v\' format character with the given+-- default format character in the 'FieldFormat'. A+-- convenience for user-implemented types, which should+-- support \"%v\".+--+-- /Since: 4.7.0.0/+vFmt :: Char -> FieldFormat -> FieldFormat+vFmt c ufmt@(FieldFormat {fmtChar = 'v'}) = ufmt {fmtChar = c}+vFmt _ ufmt = ufmt++-- | Formatter for 'Char' values.+--+-- /Since: 4.7.0.0/+formatChar :: Char -> FieldFormatter+formatChar x ufmt =+  formatIntegral (Just 0) (toInteger $ ord x) $ vFmt 'c' ufmt++-- | Formatter for 'String' values.+--+-- /Since: 4.7.0.0/+formatString :: IsChar a => [a] -> FieldFormatter+formatString x ufmt =+  case fmtChar $ vFmt 's' ufmt of+    's' -> map toChar . (adjust ufmt ("", ts) ++)+           where+             ts = map toChar $ trunc $ fmtPrecision ufmt+               where+                 trunc Nothing = x+                 trunc (Just n) = take n x+    c   -> errorBadFormat c++-- Possibly apply the int modifiers to get a new+-- int width for conversion.+fixupMods :: FieldFormat -> Maybe Integer -> Maybe Integer+fixupMods ufmt m =+  let mods = fmtModifiers ufmt in+  case mods of+    "" -> m+    _ -> case lookup mods intModifierMap of+      Just m0 -> Just m0+      Nothing -> perror "unknown format modifier"++-- | Formatter for 'Int' values.+--+-- /Since: 4.7.0.0/+formatInt :: (Integral a, Bounded a) => a -> FieldFormatter+formatInt x ufmt =+  let lb = toInteger $ minBound `asTypeOf` x+      m = fixupMods ufmt (Just lb)+      ufmt' = case lb of+        0 -> vFmt 'u' ufmt+        _ -> ufmt+  in+  formatIntegral m (toInteger x) ufmt'++-- | Formatter for 'Integer' values.+--+-- /Since: 4.7.0.0/+formatInteger :: Integer -> FieldFormatter+formatInteger x ufmt =+  let m = fixupMods ufmt Nothing in+  formatIntegral m x ufmt++-- All formatting for integral types is handled+-- consistently.  The only difference is between Integer and+-- bounded types; this difference is handled by the 'm'+-- argument containing the lower bound.+formatIntegral :: Maybe Integer -> Integer -> FieldFormatter+formatIntegral m x ufmt0 =+  let prec = fmtPrecision ufmt0 in+  case fmtChar ufmt of+    'd' -> (adjustSigned ufmt (fmti prec x) ++)+    'i' -> (adjustSigned ufmt (fmti prec x) ++)+    'x' -> (adjust ufmt (fmtu 16 (alt "0x" x) prec m x) ++)+    'X' -> (adjust ufmt (upcase $ fmtu 16 (alt "0X" x) prec m x) ++)+    'b' -> (adjust ufmt (fmtu 2 (alt "0b" x) prec m x) ++)+    'o' -> (adjust ufmt (fmtu 8 (alt "0" x) prec m x) ++)+    'u' -> (adjust ufmt (fmtu 10 Nothing prec m x) ++)+    'c' | x >= fromIntegral (ord (minBound :: Char)) &&+          x <= fromIntegral (ord (maxBound :: Char)) &&+          fmtPrecision ufmt == Nothing &&+          fmtModifiers ufmt == "" ->+            formatString [chr $ fromIntegral x] (ufmt { fmtChar = 's' })+    'c' -> perror "illegal char conversion"+    c   -> errorBadFormat c+  where+    ufmt = vFmt 'd' $ case ufmt0 of+      FieldFormat { fmtPrecision = Just _, fmtAdjust = Just ZeroPad } ->+        ufmt0 { fmtAdjust = Nothing }+      _ -> ufmt0+    alt _ 0 = Nothing+    alt p _ = case fmtAlternate ufmt of+      True -> Just p+      False -> Nothing+    upcase (s1, s2) = (s1, map toUpper s2)++-- | Formatter for 'RealFloat' values.+--+-- /Since: 4.7.0.0/+formatRealFloat :: RealFloat a => a -> FieldFormatter+formatRealFloat x ufmt =+  let c = fmtChar $ vFmt 'g' ufmt+      prec = fmtPrecision ufmt+      alt = fmtAlternate ufmt+  in+   case c of+     'e' -> (adjustSigned ufmt (dfmt c prec alt x) ++)+     'E' -> (adjustSigned ufmt (dfmt c prec alt x) ++)+     'f' -> (adjustSigned ufmt (dfmt c prec alt x) ++)+     'F' -> (adjustSigned ufmt (dfmt c prec alt x) ++)+     'g' -> (adjustSigned ufmt (dfmt c prec alt x) ++)+     'G' -> (adjustSigned ufmt (dfmt c prec alt x) ++)+     _   -> errorBadFormat c++-- This is the type carried around for arguments in+-- the varargs code.+type UPrintf = (ModifierParser, FieldFormatter)++-- Given a format string and a list of formatting functions+-- (the actual argument value having already been baked into+-- each of these functions before delivery), return the+-- actual formatted text string. uprintf :: String -> [UPrintf] -> String-uprintf ""       []       = ""-uprintf ""       (_:_)    = fmterr-uprintf ('%':'%':cs) us   = '%':uprintf cs us-uprintf ('%':_)  []       = argerr-uprintf ('%':cs) us@(_:_) = fmt cs us-uprintf (c:cs)   us       = c:uprintf cs us+uprintf s us = uprintfs s us "" -fmt :: String -> [UPrintf] -> String-fmt cs us =-	let (width, prec, ladj, zero, plus, cs', us') = getSpecs False False False cs us-	    adjust (pre, str) = -		let lstr = length str-		    lpre = length pre-		    fill = if lstr+lpre < width then take (width-(lstr+lpre)) (repeat (if zero then '0' else ' ')) else ""-		in  if ladj then pre ++ str ++ fill else if zero then pre ++ fill ++ str else fill ++ pre ++ str-            adjust' ("", str) | plus = adjust ("+", str)-            adjust' ps = adjust ps-        in-	case cs' of-	[]     -> fmterr-	c:cs'' ->-	    case us' of-	    []     -> argerr-	    u:us'' ->-		(case c of-		'c' -> adjust  ("", [toEnum (toint u)])-		'd' -> adjust' (fmti prec u)-		'i' -> adjust' (fmti prec u)-		'x' -> adjust  ("", fmtu 16 prec u)-		'X' -> adjust  ("", map toUpper $ fmtu 16 prec u)-		'o' -> adjust  ("", fmtu 8  prec u)-		'u' -> adjust  ("", fmtu 10 prec u)-		'e' -> adjust' (dfmt' c prec u)-		'E' -> adjust' (dfmt' c prec u)-		'f' -> adjust' (dfmt' c prec u)-		'g' -> adjust' (dfmt' c prec u)-		'G' -> adjust' (dfmt' c prec u)-		's' -> adjust  ("", tostr prec u)-		_   -> perror ("bad formatting char " ++ [c])-		 ) ++ uprintf cs'' us''+-- This function does the actual work, producing a ShowS+-- instead of a string, for future expansion and for+-- misguided efficiency.+uprintfs :: String -> [UPrintf] -> ShowS+uprintfs ""       []       = id+uprintfs ""       (_:_)    = errorShortFormat+uprintfs ('%':'%':cs) us   = ('%' :) . uprintfs cs us+uprintfs ('%':_)  []       = errorMissingArgument+uprintfs ('%':cs) us@(_:_) = fmt cs us+uprintfs (c:cs)   us       = (c :) . uprintfs cs us -fmti :: Int -> UPrintf -> (String, String)-fmti prec (UInteger _ i) = if i < 0 then ("-", integral_prec prec (show (-i))) else ("", integral_prec prec (show i))-fmti _ (UChar c)         = fmti 0 (uInteger (fromEnum c))-fmti _ _                 = baderr+-- Given a suffix of the format string starting just after+-- the percent sign, and the list of remaining unprocessed+-- arguments in the form described above, format the portion+-- of the output described by this field description, and+-- then continue with 'uprintfs'.+fmt :: String -> [UPrintf] -> ShowS+fmt cs0 us0 =+  case getSpecs False False Nothing False cs0 us0 of+    (_, _, []) -> errorMissingArgument+    (ufmt, cs, (_, u) : us) -> u ufmt . uprintfs cs us -fmtu :: Integer -> Int -> UPrintf -> String-fmtu b prec (UInteger l i) = integral_prec prec (itosb b (if i < 0 then -2*l + i else i))-fmtu b _    (UChar c)      = itosb b (toInteger (fromEnum c))-fmtu _ _ _                 = baderr+-- Given field formatting information, and a tuple+-- consisting of a prefix (for example, a minus sign) that+-- is supposed to go before the argument value and a string+-- representing the value, return the properly padded and+-- formatted result.+adjust :: FieldFormat -> (String, String) -> String+adjust ufmt (pre, str) =+  let naturalWidth = length pre + length str+      zero = case fmtAdjust ufmt of+        Just ZeroPad -> True+        _ -> False+      left = case fmtAdjust ufmt of+        Just LeftAdjust -> True+        _ -> False+      fill = case fmtWidth ufmt of+        Just width | naturalWidth < width ->+          let fillchar = if zero then '0' else ' ' in+          replicate (width - naturalWidth) fillchar+        _ -> ""+  in+   if left+   then pre ++ str ++ fill+   else if zero+        then pre ++ fill ++ str+        else fill ++ pre ++ str -integral_prec :: Int -> String -> String-integral_prec prec integral = (replicate (prec - (length integral)) '0') ++ integral+-- For positive numbers with an explicit sign field ("+" or+-- " "), adjust accordingly.+adjustSigned :: FieldFormat -> (String, String) -> String+adjustSigned ufmt@(FieldFormat {fmtSign = Just SignPlus}) ("", str) =+  adjust ufmt ("+", str)+adjustSigned ufmt@(FieldFormat {fmtSign = Just SignSpace}) ("", str) =+  adjust ufmt (" ", str)+adjustSigned ufmt ps =+  adjust ufmt ps -toint :: UPrintf -> Int-toint (UInteger _ i) = fromInteger i-toint (UChar c)      = fromEnum c-toint _		     = baderr+-- Format a signed integer in the "default" fashion.+-- This will be subjected to adjust subsequently.+fmti :: Maybe Int -> Integer -> (String, String)+fmti prec i+  | i < 0 = ("-", integral_prec prec (show (-i)))+  | otherwise = ("", integral_prec prec (show i)) -tostr :: Int -> UPrintf -> String-tostr n (UString s) = if n >= 0 then take n s else s-tostr _ _		  = baderr+-- Format an unsigned integer in the "default" fashion.+-- This will be subjected to adjust subsequently.  The 'b'+-- argument is the base, the 'pre' argument is the prefix,+-- and the '(Just m)' argument is the implicit lower-bound+-- size of the operand for conversion from signed to+-- unsigned. Thus, this function will refuse to convert an+-- unbounded negative integer to an unsigned string.+fmtu :: Integer -> Maybe String -> Maybe Int -> Maybe Integer -> Integer+     -> (String, String)+fmtu b (Just pre) prec m i =+  let ("", s) = fmtu b Nothing prec m i in+  case pre of+    "0" -> case s of+      '0' : _ -> ("", s)+      _ -> (pre, s)+    _ -> (pre, s)+fmtu b Nothing prec0 m0 i0 =+  case fmtu' prec0 m0 i0 of+    Just s -> ("", s)+    Nothing -> errorBadArgument+  where+    fmtu' :: Maybe Int -> Maybe Integer -> Integer -> Maybe String+    fmtu' prec (Just m) i | i < 0 =+      fmtu' prec Nothing (-2 * m + i)+    fmtu' (Just prec) _ i | i >= 0 =+      fmap (integral_prec (Just prec)) $ fmtu' Nothing Nothing i+    fmtu' Nothing _ i | i >= 0 =+      Just $ showIntAtBase b intToDigit i ""+    fmtu' _ _ _ = Nothing -itosb :: Integer -> Integer -> String-itosb b n = -	if n < b then -	    [intToDigit $ fromInteger n]-	else-	    let (q, r) = quotRem n b in-	    itosb b q ++ [intToDigit $ fromInteger r] -stoi :: Int -> String -> (Int, String)-stoi a (c:cs) | isDigit c = stoi (a*10 + digitToInt c) cs-stoi a cs                 = (a, cs)+-- This is used by 'fmtu' and 'fmti' to zero-pad an+-- int-string to a required precision.+integral_prec :: Maybe Int -> String -> String+integral_prec Nothing integral = integral+integral_prec (Just 0) "0" = ""+integral_prec (Just prec) integral =+  replicate (prec - length integral) '0' ++ integral -getSpecs :: Bool -> Bool -> Bool -> String -> [UPrintf] -> (Int, Int, Bool, Bool, Bool, String, [UPrintf])-getSpecs _ z s ('-':cs) us = getSpecs True z s cs us-getSpecs l z _ ('+':cs) us = getSpecs l z True cs us-getSpecs l _ s ('0':cs) us = getSpecs l True s cs us-getSpecs l z s ('*':cs) us =-	let (us', n) = getStar us-	    ((p, cs''), us'') =-		    case cs of-                    '.':'*':r -> let (us''', p') = getStar us'-		    	      	 in  ((p', r), us''')-		    '.':r     -> (stoi 0 r, us')-		    _         -> ((-1, cs), us')-	in  (n, p, l, z, s, cs'', us'')-getSpecs l z s ('.':cs) us =-	let ((p, cs'), us') = -	        case cs of-		'*':cs'' -> let (us'', p') = getStar us in ((p', cs''), us'')-                _ ->        (stoi 0 cs, us)-	in  (0, p, l, z, s, cs', us')-getSpecs l z s cs@(c:_) us | isDigit c =-	let (n, cs') = stoi 0 cs-	    ((p, cs''), us') = case cs' of-	    	 	       '.':'*':r -> let (us'', p') = getStar us in ((p', r), us'')-		               '.':r -> (stoi 0 r, us)-			       _     -> ((-1, cs'), us)-	in  (n, p, l, z, s, cs'', us')-getSpecs l z s cs       us = (0, -1, l, z, s, cs, us)+stoi :: String -> (Int, String)+stoi cs =+  let (as, cs') = span isDigit cs in+  case as of+    "" -> (0, cs')+    _ -> (read as, cs') +-- Figure out the FormatAdjustment, given:+--   width, precision, left-adjust, zero-fill+adjustment :: Maybe Int -> Maybe a -> Bool -> Bool+           -> Maybe FormatAdjustment+adjustment w p l z =+  case w of+    Just n | n < 0 -> adjl p True z+    _ -> adjl p l z+  where+    adjl _ True _ = Just LeftAdjust+    adjl _ False True = Just ZeroPad+    adjl _ _ _ = Nothing++-- Parse the various format controls to get a format specification.+getSpecs :: Bool -> Bool -> Maybe FormatSign -> Bool -> String -> [UPrintf]+         -> (FieldFormat, String, [UPrintf])+getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us+getSpecs l z _ a ('+' : cs0) us = getSpecs l z (Just SignPlus) a cs0 us+getSpecs l z s a (' ' : cs0) us =+  getSpecs l z ss a cs0 us+  where+    ss = case s of+      Just SignPlus -> Just SignPlus+      _ -> Just SignSpace+getSpecs l _ s a ('0' : cs0) us = getSpecs l True s a cs0 us+getSpecs l z s _ ('#' : cs0) us = getSpecs l z s True cs0 us+getSpecs l z s a ('*' : cs0) us =+  let (us', n) = getStar us+      ((p, cs''), us'') = case cs0 of+        '.':'*':r ->+          let (us''', p') = getStar us' in ((Just p', r), us''')+        '.':r ->+          let (p', r') = stoi r in ((Just p', r'), us')+        _ ->+          ((Nothing, cs0), us')+      FormatParse ms c cs =+        case us'' of+          (ufmt, _) : _ -> ufmt cs''+          [] -> errorMissingArgument+  in+   (FieldFormat {+       fmtWidth = Just (abs n),+       fmtPrecision = p,+       fmtAdjust = adjustment (Just n) p l z,+       fmtSign = s,+       fmtAlternate = a,+       fmtModifiers = ms,+       fmtChar = c}, cs, us'')+getSpecs l z s a ('.' : cs0) us =+  let ((p, cs'), us') = case cs0 of+        '*':cs'' -> let (us'', p') = getStar us in ((p', cs''), us'')+        _ ->        (stoi cs0, us)+      FormatParse ms c cs =+        case us' of+          (ufmt, _) : _ -> ufmt cs'+          [] -> errorMissingArgument+  in+   (FieldFormat {+       fmtWidth = Nothing,+       fmtPrecision = Just p,+       fmtAdjust = adjustment Nothing (Just p) l z,+       fmtSign = s,+       fmtAlternate = a,+       fmtModifiers = ms,+       fmtChar = c}, cs, us')+getSpecs l z s a cs0@(c0 : _) us | isDigit c0 =+  let (n, cs') = stoi cs0+      ((p, cs''), us') = case cs' of+        '.' : '*' : r ->+          let (us'', p') = getStar us in ((Just p', r), us'')+        '.' : r ->+          let (p', r') = stoi r in ((Just p', r'), us)+        _ ->+          ((Nothing, cs'), us)+      FormatParse ms c cs =+        case us' of+          (ufmt, _) : _ -> ufmt cs''+          [] -> errorMissingArgument+  in+   (FieldFormat {+       fmtWidth = Just (abs n),+       fmtPrecision = p,+       fmtAdjust = adjustment (Just n) p l z,+       fmtSign = s,+       fmtAlternate = a,+       fmtModifiers = ms,+       fmtChar = c}, cs, us')+getSpecs l z s a cs0@(_ : _) us =+  let FormatParse ms c cs =+        case us of+          (ufmt, _) : _ -> ufmt cs0+          [] -> errorMissingArgument+  in+   (FieldFormat {+       fmtWidth = Nothing,+       fmtPrecision = Nothing,+       fmtAdjust = adjustment Nothing Nothing l z,+       fmtSign = s,+       fmtAlternate = a,+       fmtModifiers = ms,+       fmtChar = c}, cs, us)+getSpecs _ _ _ _ ""       _  =+  errorShortFormat++-- Process a star argument in a format specification. getStar :: [UPrintf] -> ([UPrintf], Int) getStar us =-    case us of-    [] -> argerr-    nu : us' -> (us', toint nu)+  let ufmt = FieldFormat {+        fmtWidth = Nothing,+        fmtPrecision = Nothing,+        fmtAdjust = Nothing,+        fmtSign = Nothing,+        fmtAlternate = False,+        fmtModifiers = "",+        fmtChar = 'd' } in+  case us of+    [] -> errorMissingArgument+    (_, nu) : us' -> (us', read (nu ufmt "")) +-- Format a RealFloat value.+dfmt :: (RealFloat a) => Char -> Maybe Int -> Bool -> a -> (String, String)+dfmt c p a d =+  let caseConvert = if isUpper c then map toUpper else id+      showFunction = case toLower c of+        'e' -> showEFloat+        'f' -> if a then showFFloatAlt else showFFloat+        'g' -> if a then showGFloatAlt else showGFloat+        _   -> perror "internal error: impossible dfmt"+      result = caseConvert $ showFunction p d ""+  in+   case result of+     '-' : cs -> ("-", cs)+     cs       -> ("" , cs) -dfmt' :: Char -> Int -> UPrintf -> (String, String)-dfmt' c p (UDouble d) = dfmt c p d-dfmt' c p (UFloat f)  = dfmt c p f-dfmt' _ _ _           = baderr -dfmt :: (RealFloat a) => Char -> Int -> a -> (String, String)-dfmt c p d =-	case (if isUpper c then map toUpper else id) $-             (case toLower c of-                  'e' -> showEFloat-                  'f' -> showFFloat-                  'g' -> showGFloat-                  _   -> error "Printf.dfmt: impossible"-             )-               (if p < 0 then Nothing else Just p) d "" of-	'-':cs -> ("-", cs)-	cs     -> ("" , cs)-+-- | Raises an 'error' with a printf-specific prefix on the+-- message string.+--+-- /Since: 4.7.0.0/ perror :: String -> a-perror s = error ("Printf.printf: "++s)-fmterr, argerr, baderr :: a-fmterr = perror "formatting string ended prematurely"-argerr = perror "argument list ended prematurely"-baderr = perror "bad argument"+perror s = error $ "printf: " ++ s +-- | Calls 'perror' to indicate an unknown format letter for+-- a given type.+--+-- /Since: 4.7.0.0/+errorBadFormat :: Char -> a+errorBadFormat c = perror $ "bad formatting char " ++ show c++errorShortFormat, errorMissingArgument, errorBadArgument :: a+-- | Calls 'perror' to indicate that the format string ended+-- early.+--+-- /Since: 4.7.0.0/+errorShortFormat = perror "formatting string ended prematurely"+-- | Calls 'perror' to indicate that there is a missing+-- argument in the argument list.+--+-- /Since: 4.7.0.0/+errorMissingArgument = perror "argument list ended prematurely"+-- | Calls 'perror' to indicate that there is a type+-- error or similar in the given argument.+--+-- /Since: 4.7.0.0/+errorBadArgument = perror "bad argument"
Text/Read.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -16,68 +16,42 @@ -- The "Text.Read" library is the canonical library to import for -- 'Read'-class facilities.  For GHC only, it offers an extended and much -- improved 'Read' class, which constitutes a proposed alternative to the --- Haskell 98 'Read'.  In particular, writing parsers is easier, and+-- Haskell 2010 'Read'.  In particular, writing parsers is easier, and -- the parsers are much more efficient. -- -----------------------------------------------------------------------------  module Text.Read (    -- * The 'Read' class-   Read(..),            -- The Read class-   ReadS,               -- String -> Maybe (a,String)+   Read(..),+   ReadS, -   -- * Haskell 98 functions-   reads,               -- :: (Read a) => ReadS a-   read,                -- :: (Read a) => String -> a-   readParen,           -- :: Bool -> ReadS a -> ReadS a-   lex,                 -- :: ReadS String+   -- * Haskell 2010 functions+   reads,+   read,+   readParen,+   lex, -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)    -- * New parsing functions    module Text.ParserCombinators.ReadPrec,    L.Lexeme(..),-   lexP,                -- :: ReadPrec Lexeme-   parens,              -- :: ReadPrec a -> ReadPrec a-#endif-#ifdef __GLASGOW_HASKELL__-   readListDefault,     -- :: Read a => ReadS [a]-   readListPrecDefault, -- :: Read a => ReadPrec [a]-   readEither,          -- :: Read a => String -> Either String a-   readMaybe            -- :: Read a => String -> Maybe a-#endif+   lexP,+   parens,+   readListDefault,+   readListPrecDefault,+   readEither,+   readMaybe   ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Read import Data.Either import Data.Maybe import Text.ParserCombinators.ReadP as P-#endif-#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) import Text.ParserCombinators.ReadPrec import qualified Text.Read.Lex as L-#endif -#ifdef __HUGS__--- copied from GHC.Read--lexP :: ReadPrec L.Lexeme-lexP = lift L.lex--parens :: ReadPrec a -> ReadPrec a-parens p = optional- where-  optional  = p +++ mandatory-  mandatory = do-    L.Punc "(" <- lexP-    x          <- reset optional-    L.Punc ")" <- lexP-    return x-#endif--#ifdef __GLASGOW_HASKELL__ ------------------------------------------------------------------------ -- utility functions @@ -88,6 +62,8 @@ -- | Parse a string using the 'Read' instance. -- Succeeds if there is exactly one valid result. -- A 'Left' value indicates a parse error.+--+-- /Since: 4.6.0.0/ readEither :: Read a => String -> Either String a readEither s =   case [ x | (x,"") <- readPrec_to_S read' minPrec s ] of@@ -102,6 +78,8 @@  -- | Parse a string using the 'Read' instance. -- Succeeds if there is exactly one valid result.+--+-- /Since: 4.6.0.0/ readMaybe :: Read a => String -> Maybe a readMaybe s = case readEither s of                 Left _  -> Nothing@@ -111,5 +89,3 @@ -- completely consumed by the input process. read :: Read a => String -> a read s = either error id (readEither s)-#endif-
Text/Read/Lex.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -17,42 +17,33 @@  module Text.Read.Lex   -- lexing types-  ( Lexeme(..)  -- :: *; Show, Eq+  ( Lexeme(..), Number -  , numberToInteger, numberToRational, numberToRangedRational+  , numberToInteger, numberToFixed, numberToRational, numberToRangedRational    -- lexer-  , lex         -- :: ReadP Lexeme      Skips leading spaces-  , hsLex       -- :: ReadP String-  , lexChar     -- :: ReadP Char        Reads just one char, with H98 escapes+  , lex, expect+  , hsLex+  , lexChar -  , readIntP    -- :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP a-  , readOctP    -- :: Num a => ReadP a-  , readDecP    -- :: Num a => ReadP a-  , readHexP    -- :: Num a => ReadP a+  , readIntP+  , readOctP+  , readDecP+  , readHexP   )  where  import Text.ParserCombinators.ReadP -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Char import GHC.Num( Num(..), Integer ) import GHC.Show( Show(..) ) import {-# SOURCE #-} GHC.Unicode ( isSpace, isAlpha, isAlphaNum )-import GHC.Real( Integral, Rational, (%), fromIntegral,+import GHC.Real( Rational, (%), fromIntegral,                  toInteger, (^) ) import GHC.List import GHC.Enum( minBound, maxBound )-#else-import Prelude hiding ( lex )-import Data.Char( chr, ord, isSpace, isAlpha, isAlphaNum )-import Data.Ratio( Ratio, (%) )-#endif-#ifdef __HUGS__-import Hugs.Prelude( Ratio(..) )-#endif import Data.Maybe import Control.Monad @@ -66,10 +57,11 @@   | Punc   String       -- ^ Punctuation or reserved symbol, e.g. @(@, @::@   | Ident  String       -- ^ Haskell identifier, e.g. @foo@, @Baz@   | Symbol String       -- ^ Haskell symbol, e.g. @>>@, @:%@-  | Number Number+  | Number Number       -- ^ /Since: 4.6.0.0/   | EOF  deriving (Eq, Show) +-- | /Since: 4.7.0.0/ data Number = MkNumber Int              -- Base                        Digits           -- Integral part             | MkDecimal Digits          -- Integral part@@ -77,11 +69,29 @@                         (Maybe Integer) -- Exponent  deriving (Eq, Show) +-- | /Since: 4.5.1.0/ numberToInteger :: Number -> Maybe Integer numberToInteger (MkNumber base iPart) = Just (val (fromIntegral base) 0 iPart) numberToInteger (MkDecimal iPart Nothing Nothing) = Just (val 10 0 iPart) numberToInteger _ = Nothing +-- | /Since: 4.7.0.0/+numberToFixed :: Integer -> Number -> Maybe (Integer, Integer)+numberToFixed _ (MkNumber base iPart) = Just (val (fromIntegral base) 0 iPart, 0)+numberToFixed _ (MkDecimal iPart Nothing Nothing) = Just (val 10 0 iPart, 0)+numberToFixed p (MkDecimal iPart (Just fPart) Nothing)+    = let i = val 10 0 iPart+          f = val 10 0 (integerTake p (fPart ++ repeat 0))+          -- Sigh, we really want genericTake, but that's above us in+          -- the hierarchy, so we define our own version here (actually+          -- specialised to Integer)+          integerTake             :: Integer -> [a] -> [a]+          integerTake n _ | n <= 0 = []+          integerTake _ []        =  []+          integerTake n (x:xs)    =  x : integerTake (n-1) xs+      in Just (i, f)+numberToFixed _ _ = Nothing+ -- This takes a floatRange, and if the Rational would be outside of -- the floatRange then it may return Nothing. Not that it will not -- /necessarily/ return Nothing, but it is good enough to fix the@@ -93,6 +103,7 @@ -- * We only worry about numbers that have an exponent. If they don't --   have an exponent then the Rational won't be much larger than the --   Number, so there is no problem+-- | /Since: 4.5.1.0/ numberToRangedRational :: (Int, Int) -> Number                        -> Maybe Rational -- Nothing = Inf numberToRangedRational (neg, pos) n@(MkDecimal iPart mFPart (Just exp))@@ -122,6 +133,7 @@                 else Just (numberToRational n) numberToRangedRational _ n = Just (numberToRational n) +-- | /Since: 4.6.0.0/ numberToRational :: Number -> Rational numberToRational (MkNumber base iPart) = val (fromIntegral base) 0 iPart % 1 numberToRational (MkDecimal iPart mFPart mExp)@@ -143,6 +155,12 @@  lex :: ReadP Lexeme lex = skipSpaces >> lexToken++-- | /Since: 4.7.0.0/+expect :: Lexeme -> ReadP ()+expect lexeme = do { skipSpaces +                   ; thing <- lexToken+                   ; if thing == lexeme then return () else pfail }  hsLex :: ReadP String -- ^ Haskell lexer: returns the lexed string, rather than the lexeme
Text/Show.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP, NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude #-}  ----------------------------------------------------------------------------- -- |@@ -17,34 +17,18 @@ -----------------------------------------------------------------------------  module Text.Show (-   ShowS,               -- String -> String-   Show(-      showsPrec,        -- :: Int -> a -> ShowS-      show,             -- :: a   -> String-      showList          -- :: [a] -> ShowS -    ),-   shows,               -- :: (Show a) => a -> ShowS-   showChar,            -- :: Char -> ShowS-   showString,          -- :: String -> ShowS-   showParen,           -- :: Bool -> ShowS -> ShowS-   showListWith,        -- :: (a -> ShowS) -> [a] -> ShowS +   ShowS,+   Show(showsPrec, show, showList),+   shows,+   showChar,+   showString,+   showParen,+   showListWith,  ) where -#ifdef __GLASGOW_HASKELL__ import GHC.Show-#endif  -- | Show a list (using square brackets and commas), given a function -- for showing elements. showListWith :: (a -> ShowS) -> [a] -> ShowS showListWith = showList__--#ifndef __GLASGOW_HASKELL__-showList__ :: (a -> ShowS) ->  [a] -> ShowS-showList__ _     []     s = "[]" ++ s-showList__ showx (x:xs) s = '[' : showx x (showl xs)-  where-    showl []     = ']' : s-    showl (y:ys) = ',' : showx y (showl ys)-#endif-
Text/Show/Functions.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP #-} -- This module deliberately declares orphan instances: {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -24,16 +23,6 @@  import Prelude -#ifndef __NHC__ instance Show (a -> b) where 	showsPrec _ _ = showString "<function>"-#else-instance (Show a,Show b) => Show (a->b) where-  showsPrec d a = showString "<<function>>"--  showsType a = showChar '(' . showsType value  . showString " -> " .-                               showsType result . showChar ')'-                where (value,result) = getTypes undefined-                      getTypes x = (x,a x)-#endif 
Unsafe/Coerce.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash #-}  ----------------------------------------------------------------------------- -- |@@ -31,20 +31,32 @@  module Unsafe.Coerce (unsafeCoerce) where -#if defined(__GLASGOW_HASKELL__)+import GHC.Integer () -- for build ordering import GHC.Prim (unsafeCoerce#)++local_id :: a -> a+local_id x = x   -- See Note [Mega-hack for coerce]++{- Note [Mega-hack for coerce]++If we just say+  unsafeCoerce x = unsafeCoerce# x+then the simple-optimiser that the desugarer runs will eta-reduce to+  unsafeCoerce :: forall (a:*) (b:*). a -> b+  unsafeCoerce = unsafeCoerce#+And that, sadly, is ill-typed because unsafeCoerce# has OpenKind type variables+And rightly so, because we shouldn't be calling unsafeCoerce# in a higher+order way; it has a compulsory unfolding +   unsafeCoerce# a b x = x |> UnsafeCo a b+and we really rely on it being inlined pronto. But the simple-optimiser doesn't.+The identity function local_id delays the eta reduction just long enough+for unsafeCoerce# to get inlined.++Sigh. This is horrible, but then so is unsafeCoerce.+-}+ unsafeCoerce :: a -> b-unsafeCoerce x = unsafeCoerce# x+unsafeCoerce x = local_id (unsafeCoerce# x)   -- See Note [Unsafe coerce magic] in basicTypes/MkId   -- NB: Do not eta-reduce this definition, else the type checker    -- give usafeCoerce the same (dangerous) type as unsafeCoerce#-#endif--#if defined(__NHC__)-import NonStdUnsafeCoerce (unsafeCoerce)-#endif--#if defined(__HUGS__)-import Hugs.IOExts (unsafeCoerce)-#endif-
aclocal.m4 view
@@ -126,49 +126,47 @@     AC_CACHE_VAL(AC_CV_NAME,[         AC_CV_NAME_supported=yes         FP_COMPUTE_INT([HTYPE_IS_INTEGRAL],-                       [(($1)((int)(($1)1.4))) == (($1)1.4)],-                       [FPTOOLS_HTYPE_INCLUDES],[AC_CV_NAME_supported=no])-        if test "$AC_CV_NAME_supported" = "yes"+                       [($1)0.2 - ($1)0.4 < 0 ? 0 : 1],+                       [FPTOOLS_HTYPE_INCLUDES],[HTYPE_IS_INTEGRAL=0])++        if test "$HTYPE_IS_INTEGRAL" -eq 0         then-            if test "$HTYPE_IS_INTEGRAL" -eq 0+            FP_COMPUTE_INT([HTYPE_IS_FLOAT],[sizeof($1) == sizeof(float)],+                           [FPTOOLS_HTYPE_INCLUDES],+                           [AC_CV_NAME_supported=no])+            FP_COMPUTE_INT([HTYPE_IS_DOUBLE],[sizeof($1) == sizeof(double)],+                           [FPTOOLS_HTYPE_INCLUDES],+                           [AC_CV_NAME_supported=no])+            FP_COMPUTE_INT([HTYPE_IS_LDOUBLE],[sizeof($1) == sizeof(long double)],+                           [FPTOOLS_HTYPE_INCLUDES],+                           [AC_CV_NAME_supported=no])+            if test "$HTYPE_IS_FLOAT" -eq 1             then-                FP_COMPUTE_INT([HTYPE_IS_FLOAT],[sizeof($1) == sizeof(float)],-                               [FPTOOLS_HTYPE_INCLUDES],-                               [AC_CV_NAME_supported=no])-                FP_COMPUTE_INT([HTYPE_IS_DOUBLE],[sizeof($1) == sizeof(double)],-                               [FPTOOLS_HTYPE_INCLUDES],-                               [AC_CV_NAME_supported=no])-                FP_COMPUTE_INT([HTYPE_IS_LDOUBLE],[sizeof($1) == sizeof(long double)],-                               [FPTOOLS_HTYPE_INCLUDES],-                               [AC_CV_NAME_supported=no])-                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    AC_CV_NAME=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    AC_CV_NAME=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    AC_CV_NAME=LDouble-                else-                    AC_CV_NAME_supported=no-                fi+                AC_CV_NAME=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                AC_CV_NAME=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                AC_CV_NAME=LDouble             else-                FP_COMPUTE_INT([HTYPE_IS_SIGNED],[(($1)(-1)) < (($1)0)],-                               [FPTOOLS_HTYPE_INCLUDES],-                               [AC_CV_NAME_supported=no])-                FP_COMPUTE_INT([HTYPE_SIZE],[sizeof($1) * 8],-                               [FPTOOLS_HTYPE_INCLUDES],-                               [AC_CV_NAME_supported=no])-                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    AC_CV_NAME="Word$HTYPE_SIZE"-                else-                    AC_CV_NAME="Int$HTYPE_SIZE"-                fi+                AC_CV_NAME_supported=no             fi+        else+            FP_COMPUTE_INT([HTYPE_IS_SIGNED],[(($1)(-1)) < (($1)0)],+                           [FPTOOLS_HTYPE_INCLUDES],+                           [AC_CV_NAME_supported=no])+            FP_COMPUTE_INT([HTYPE_SIZE],[sizeof($1) * 8],+                           [FPTOOLS_HTYPE_INCLUDES],+                           [AC_CV_NAME_supported=no])+            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                AC_CV_NAME="Word$HTYPE_SIZE"+            else+                AC_CV_NAME="Int$HTYPE_SIZE"+            fi         fi-        ])+    ])     if test "$AC_CV_NAME_supported" = no     then         $2
+ base.buildinfo.in view
@@ -0,0 +1,4 @@+extra-lib-dirs: @ICONV_LIB_DIRS@+extra-libraries: @EXTRA_LIBS@+include-dirs: @ICONV_INCLUDE_DIRS@+install-includes: HsBaseConfig.h EventConfig.h
base.cabal view
@@ -1,258 +1,331 @@ name:           base-version:        4.6.0.1+version:        4.7.0.0+-- GHC 7.6.1 released with 4.6.0.0 license:        BSD3 license-file:   LICENSE maintainer:     libraries@haskell.org-bug-reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries/base+bug-reports:    http://ghc.haskell.org/trac/ghc/newticket?component=libraries/base synopsis:       Basic libraries+category:       Prelude description:-    This package contains the Prelude and its support libraries,+    This package contains the "Prelude" and its support libraries,     and a large collection of useful libraries ranging from data     structures to parsing combinators and debugging utilities.-cabal-version:  >=1.6-build-type: Configure+cabal-version:  >=1.10+build-type:     Configure+ extra-tmp-files:-                config.log config.status autom4te.cache-                include/HsBaseConfig.h include/EventConfig.h+    autom4te.cache+    base.buildinfo+    config.log+    config.status+    include/EventConfig.h+    include/HsBaseConfig.h+ extra-source-files:-                config.guess config.sub install-sh-                aclocal.m4 configure.ac configure-                include/CTypes.h include/md5.h+    aclocal.m4+    base.buildinfo.in+    changelog.md+    config.guess+    config.sub+    configure+    configure.ac+    include/CTypes.h+    include/EventConfig.h.in+    include/HsBaseConfig.h.in+    include/ieee-flpt.h+    include/md5.h+    install-sh  source-repository head     type:     git-    location: http://darcs.haskell.org/packages/base.git/+    location: http://git.haskell.org/packages/base.git  Flag integer-simple     Description: Use integer-simple -Library {-    if impl(ghc) {-        if flag(integer-simple)-            build-depends: integer-simple-        else-            build-depends: integer-gmp-            cpp-options: -DOPTIMISE_INTEGER_GCD_LCM-        build-depends: rts, ghc-prim-        exposed-modules:-            Foreign.Concurrent,-            GHC.Arr,-            GHC.Base,-            GHC.Char,-            GHC.Conc,-            GHC.Conc.IO,-            GHC.Conc.Signal,-            GHC.Conc.Sync,-            GHC.ConsoleHandler,-            GHC.Constants,-            GHC.Desugar,-            GHC.Enum,-            GHC.Environment,-            GHC.Err,-            GHC.Exception,-            GHC.Exts,-            GHC.Fingerprint,-            GHC.Fingerprint.Type,-            GHC.Float,-            GHC.Float.ConversionUtils,-            GHC.Float.RealFracMethods,-            GHC.Foreign,-            GHC.ForeignPtr,-            GHC.Generics,-            GHC.GHCi,-            GHC.Handle,-            GHC.IO,-            GHC.IO.Buffer,-            GHC.IO.BufferedIO,-            GHC.IO.Device,-            GHC.IO.Encoding,-            GHC.IO.Encoding.CodePage,-            GHC.IO.Encoding.Failure,-            GHC.IO.Encoding.Iconv,-            GHC.IO.Encoding.Latin1,-            GHC.IO.Encoding.Types,-            GHC.IO.Encoding.UTF16,-            GHC.IO.Encoding.UTF32,-            GHC.IO.Encoding.UTF8,-            GHC.IO.Exception,-            GHC.IO.FD,-            GHC.IO.Handle,-            GHC.IO.Handle.FD,-            GHC.IO.Handle.Internals,-            GHC.IO.Handle.Text,-            GHC.IO.Handle.Types,-            GHC.IO.IOMode,-            GHC.IOArray,-            GHC.IOBase,-            GHC.IORef,-            GHC.IP,-            GHC.Int,-            GHC.List,-            GHC.MVar,-            GHC.Num,-            GHC.PArr,-            GHC.Pack,-            GHC.Ptr,-            GHC.Read,-            GHC.Real,-            GHC.ST,-            GHC.Stack,-            GHC.Stats,-            GHC.Show,-            GHC.Stable,-            GHC.Storable,-            GHC.STRef,-            GHC.TypeLits,-            GHC.TopHandler,-            GHC.Unicode,-            GHC.Weak,-            GHC.Word,-            System.Timeout-        if os(windows)-            exposed-modules: GHC.IO.Encoding.CodePage.Table-                             GHC.Conc.Windows-                             GHC.Windows-    }+Library+    default-language: Haskell2010+    other-extensions:+        BangPatterns+        CApiFFI+        CPP+        ConstraintKinds+        DataKinds+        DeriveDataTypeable+        DeriveGeneric+        ExistentialQuantification+        ExplicitForAll+        FlexibleContexts+        FlexibleInstances+        FunctionalDependencies+        GADTs+        GeneralizedNewtypeDeriving+        KindSignatures+        MagicHash+        MultiParamTypeClasses+        NegativeLiterals+        NoImplicitPrelude+        NondecreasingIndentation+        OverlappingInstances+        OverloadedStrings+        ParallelArrays+        PolyKinds+        RankNTypes+        RecordWildCards+        RoleAnnotations+        Safe+        ScopedTypeVariables+        StandaloneDeriving+        Trustworthy+        TypeFamilies+        TypeOperators+        TypeSynonymInstances+        UnboxedTuples+        UndecidableInstances+        UnliftedFFITypes+        Unsafe++    build-depends: rts == 1.0.*, ghc-prim >= 0.3.1 && < 0.4+    if flag(integer-simple)+        build-depends: integer-simple >= 0.1.1 && < 0.2+    else+        build-depends: integer-gmp >= 0.5.1 && < 0.6+        cpp-options: -DOPTIMISE_INTEGER_GCD_LCM+     exposed-modules:-        Control.Applicative,-        Control.Arrow,-        Control.Category,-        Control.Concurrent,-        Control.Concurrent.Chan,-        Control.Concurrent.MVar,-        Control.Concurrent.QSem,-        Control.Concurrent.QSemN,-        Control.Concurrent.SampleVar,-        Control.Exception,+        Control.Applicative+        Control.Arrow+        Control.Category+        Control.Concurrent+        Control.Concurrent.Chan+        Control.Concurrent.MVar+        Control.Concurrent.QSem+        Control.Concurrent.QSemN+        Control.Exception         Control.Exception.Base-        Control.Monad,-        Control.Monad.Fix,-        Control.Monad.Instances,-        Control.Monad.ST,-        Control.Monad.ST.Safe,-        Control.Monad.ST.Unsafe,-        Control.Monad.ST.Lazy,-        Control.Monad.ST.Lazy.Safe,-        Control.Monad.ST.Lazy.Unsafe,-        Control.Monad.ST.Strict,+        Control.Monad+        Control.Monad.Fix+        Control.Monad.Instances+        Control.Monad.ST+        Control.Monad.ST.Lazy+        Control.Monad.ST.Lazy.Safe+        Control.Monad.ST.Lazy.Unsafe+        Control.Monad.ST.Safe+        Control.Monad.ST.Strict+        Control.Monad.ST.Unsafe         Control.Monad.Zip-        Data.Bits,-        Data.Bool,-        Data.Char,-        Data.Complex,-        Data.Dynamic,-        Data.Either,-        Data.Eq,-        Data.Data,-        Data.Fixed,+        Data.Bits+        Data.Bool+        Data.Char+        Data.Coerce+        Data.Complex+        Data.Data+        Data.Dynamic+        Data.Either+        Data.Eq+        Data.Fixed         Data.Foldable-        Data.Function,-        Data.Functor,-        Data.HashTable,-        Data.IORef,-        Data.Int,-        Data.Ix,-        Data.List,-        Data.Maybe,-        Data.Monoid,-        Data.Ord,-        Data.Ratio,+        Data.Function+        Data.Functor+        Data.IORef+        Data.Int+        Data.Ix+        Data.List+        Data.Maybe+        Data.Monoid+        Data.OldTypeable+        Data.OldTypeable.Internal+        Data.Ord+        Data.Proxy+        Data.Ratio         Data.STRef         Data.STRef.Lazy         Data.STRef.Strict-        Data.String,+        Data.String         Data.Traversable-        Data.Tuple,-        Data.Typeable,-        Data.Typeable.Internal,-        Data.Unique,-        Data.Version,-        Data.Word,-        Debug.Trace,-        Foreign,-        Foreign.C,-        Foreign.C.Error,-        Foreign.C.String,-        Foreign.C.Types,-        Foreign.ForeignPtr,-        Foreign.ForeignPtr.Safe,-        Foreign.ForeignPtr.Unsafe,-        Foreign.Marshal,-        Foreign.Marshal.Alloc,-        Foreign.Marshal.Array,-        Foreign.Marshal.Error,-        Foreign.Marshal.Pool,-        Foreign.Marshal.Safe,-        Foreign.Marshal.Utils,-        Foreign.Marshal.Unsafe,-        Foreign.Ptr,-        Foreign.Safe,-        Foreign.StablePtr,-        Foreign.Storable,-        Numeric,-        Prelude,+        Data.Tuple+        Data.Type.Bool+        Data.Type.Coercion+        Data.Type.Equality+        Data.Typeable+        Data.Typeable.Internal+        Data.Unique+        Data.Version+        Data.Word+        Debug.Trace+        Foreign+        Foreign.C+        Foreign.C.Error+        Foreign.C.String+        Foreign.C.Types+        Foreign.Concurrent+        Foreign.ForeignPtr+        Foreign.ForeignPtr.Safe+        Foreign.ForeignPtr.Unsafe+        Foreign.Marshal+        Foreign.Marshal.Alloc+        Foreign.Marshal.Array+        Foreign.Marshal.Error+        Foreign.Marshal.Pool+        Foreign.Marshal.Safe+        Foreign.Marshal.Unsafe+        Foreign.Marshal.Utils+        Foreign.Ptr+        Foreign.Safe+        Foreign.StablePtr+        Foreign.Storable+        GHC.Arr+        GHC.Base+        GHC.Char+        GHC.Conc+        GHC.Conc.IO+        GHC.Conc.Signal+        GHC.Conc.Sync+        GHC.ConsoleHandler+        GHC.Constants+        GHC.Desugar+        GHC.Enum+        GHC.Environment+        GHC.Err+        GHC.Exception+        GHC.Exts+        GHC.Fingerprint+        GHC.Fingerprint.Type+        GHC.Float+        GHC.Float.ConversionUtils+        GHC.Float.RealFracMethods+        GHC.Foreign+        GHC.ForeignPtr+        GHC.GHCi+        GHC.Generics+        GHC.IO+        GHC.IO.Buffer+        GHC.IO.BufferedIO+        GHC.IO.Device+        GHC.IO.Encoding+        GHC.IO.Encoding.CodePage+        GHC.IO.Encoding.Failure+        GHC.IO.Encoding.Iconv+        GHC.IO.Encoding.Latin1+        GHC.IO.Encoding.Types+        GHC.IO.Encoding.UTF16+        GHC.IO.Encoding.UTF32+        GHC.IO.Encoding.UTF8+        GHC.IO.Exception+        GHC.IO.FD+        GHC.IO.Handle+        GHC.IO.Handle.FD+        GHC.IO.Handle.Internals+        GHC.IO.Handle.Text+        GHC.IO.Handle.Types+        GHC.IO.IOMode+        GHC.IOArray+        GHC.IORef+        GHC.IP+        GHC.Int+        GHC.List+        GHC.MVar+        GHC.Num+        GHC.PArr+        GHC.Pack+        GHC.Profiling+        GHC.Ptr+        GHC.Read+        GHC.Real+        GHC.ST+        GHC.STRef+        GHC.Show+        GHC.Stable+        GHC.Stack+        GHC.Stats+        GHC.Storable+        GHC.TopHandler+        GHC.TypeLits+        GHC.Unicode+        GHC.Weak+        GHC.Word+        Numeric+        Prelude+        System.CPUTime         System.Console.GetOpt-        System.CPUTime,-        System.Environment,-        System.Exit,-        System.IO,-        System.IO.Error,-        System.IO.Unsafe,-        System.Info,-        System.Mem,-        System.Mem.StableName,-        System.Mem.Weak,-        System.Posix.Internals,-        System.Posix.Types,-        Text.ParserCombinators.ReadP,-        Text.ParserCombinators.ReadPrec,-        Text.Printf,-        Text.Read,-        Text.Read.Lex,-        Text.Show,+        System.Environment+        System.Exit+        System.IO+        System.IO.Error+        System.IO.Unsafe+        System.Info+        System.Mem+        System.Mem.StableName+        System.Mem.Weak+        System.Posix.Internals+        System.Posix.Types+        System.Timeout+        Text.ParserCombinators.ReadP+        Text.ParserCombinators.ReadPrec+        Text.Printf+        Text.Read+        Text.Read.Lex+        Text.Show         Text.Show.Functions         Unsafe.Coerce+     other-modules:         Control.Monad.ST.Imp         Control.Monad.ST.Lazy.Imp         Foreign.ForeignPtr.Imp         System.Environment.ExecutablePath+     c-sources:+        cbits/DarwinUtils.c         cbits/PrelIOUtils.c+        cbits/SetEnv.c         cbits/WCsubst.c         cbits/Win32Utils.c-        cbits/DarwinUtils.c         cbits/consUtils.c         cbits/iconv.c         cbits/inputReady.c-        cbits/primFloat.c         cbits/md5.c+        cbits/primFloat.c+        cbits/sysconf.c+     include-dirs: include-    includes:    HsBase.h-    install-includes:    HsBase.h HsBaseConfig.h EventConfig.h WCsubst.h consUtils.h Typeable.h-    if os(windows) {+    includes:+        HsBase.h+    install-includes:+        HsBase.h+        WCsubst.h+        consUtils.h+        Typeable.h+        OldTypeable.h++    -- OS Specific+    if os(windows)         extra-libraries: wsock32, user32, shell32-    }-    if !os(windows) {         exposed-modules:+            GHC.IO.Encoding.CodePage.API+            GHC.IO.Encoding.CodePage.Table+            GHC.Conc.Windows+            GHC.Windows+    else+        exposed-modules:             GHC.Event         other-modules:+            GHC.Event.Arr             GHC.Event.Array             GHC.Event.Clock             GHC.Event.Control             GHC.Event.EPoll-            GHC.Event.IntMap+            GHC.Event.IntTable             GHC.Event.Internal             GHC.Event.KQueue             GHC.Event.Manager             GHC.Event.PSQ             GHC.Event.Poll             GHC.Event.Thread+            GHC.Event.TimerManager             GHC.Event.Unique-    }+     -- We need to set the package name to base (without a version number)     -- as it's magic.     ghc-options: -package-name base-    nhc98-options: -H4M -K3M-    extensions: CPP-}
cbits/DarwinUtils.c view
@@ -1,6 +1,7 @@ #include "HsBase.h" -#ifdef darwin_HOST_OS+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)+#include <mach/mach_time.h>  static double scaling_factor = 0.0; 
+ cbits/SetEnv.c view
@@ -0,0 +1,11 @@+#include "HsBase.h"+#ifdef HAVE_UNSETENV+int __hsbase_unsetenv(const char *name) {+#ifdef UNSETENV_RETURNS_VOID+    unsetenv(name);+    return 0;+#else+    return unsetenv(name);+#endif+}+#endif
cbits/Win32Utils.c view
@@ -80,34 +80,49 @@ #define MIN_EACCES_RANGE ERROR_WRITE_PROTECT #define MAX_EACCES_RANGE ERROR_SHARING_BUFFER_EXCEEDED -void maperrno (void)+void maperrno(void) {-	int i;-	DWORD dwErrorCode;+    errno = maperrno_func(GetLastError());+} -	dwErrorCode = GetLastError();+int maperrno_func(DWORD dwErrorCode)+{+    int i; -	/* check the table for the OS error code */-	for (i = 0; i < ERRTABLESIZE; ++i)-	{-		if (dwErrorCode == errtable[i].oscode)-		{-			errno = errtable[i].errnocode;-			return;-		}-	}+    /* check the table for the OS error code */+    for (i = 0; i < ERRTABLESIZE; ++i)+        if (dwErrorCode == errtable[i].oscode)+            return errtable[i].errnocode; -	/* The error code wasn't in the table.  We check for a range of */-	/* EACCES errors or exec failure errors (ENOEXEC).  Otherwise   */-	/* EINVAL is returned.                                          */+    /* The error code wasn't in the table.  We check for a range of */+    /* EACCES errors or exec failure errors (ENOEXEC).  Otherwise   */+    /* EINVAL is returned.                                          */ -	if (dwErrorCode >= MIN_EACCES_RANGE && dwErrorCode <= MAX_EACCES_RANGE)-		errno = EACCES;-	else-		if (dwErrorCode >= MIN_EXEC_ERROR && dwErrorCode <= MAX_EXEC_ERROR)-			errno = ENOEXEC;-		else-			errno = EINVAL;+    if (dwErrorCode >= MIN_EACCES_RANGE && dwErrorCode <= MAX_EACCES_RANGE)+        return EACCES;+    else if (dwErrorCode >= MIN_EXEC_ERROR && dwErrorCode <= MAX_EXEC_ERROR)+        return ENOEXEC;+    else+        return EINVAL;+}++LPWSTR base_getErrorMessage(DWORD err)+{+    LPWSTR what;+    DWORD res;++    res = FormatMessageW(+              (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER),+              NULL,+              err,+              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */+              (LPWSTR) &what,+              0,+              NULL+          );+    if (res == 0)+        return NULL;+    return what; }  int get_unique_file_info(int fd, HsWord64 *dev, HsWord64 *ino)
cbits/md5.c view
@@ -19,17 +19,17 @@ #include "md5.h" #include <string.h> -void MD5Init(struct MD5Context *context);-void MD5Update(struct MD5Context *context, byte const *buf, int len);-void MD5Final(byte digest[16], struct MD5Context *context);-void MD5Transform(word32 buf[4], word32 const in[16]);+void __hsbase_MD5Init(struct MD5Context *context);+void __hsbase_MD5Update(struct MD5Context *context, byte const *buf, int len);+void __hsbase_MD5Final(byte digest[16], struct MD5Context *context);+void __hsbase_MD5Transform(word32 buf[4], word32 const in[16]);   /*  * Shuffle the bytes into little-endian order within words, as per the  * MD5 spec.  Note: this code works regardless of the byte order.  */-void+static void byteSwap(word32 *buf, unsigned words) { 	byte *p = (byte *)buf;@@ -46,7 +46,7 @@  * initialization constants.  */ void-MD5Init(struct MD5Context *ctx)+__hsbase_MD5Init(struct MD5Context *ctx) { 	ctx->buf[0] = 0x67452301; 	ctx->buf[1] = 0xefcdab89;@@ -62,7 +62,7 @@  * of bytes.  */ void-MD5Update(struct MD5Context *ctx, byte const *buf, int len)+__hsbase_MD5Update(struct MD5Context *ctx, byte const *buf, int len) { 	word32 t; @@ -80,7 +80,7 @@ 	/* First chunk is an odd size */ 	memcpy((byte *)ctx->in + 64 - (unsigned)t, buf, (unsigned)t); 	byteSwap(ctx->in, 16);-	MD5Transform(ctx->buf, ctx->in);+        __hsbase_MD5Transform(ctx->buf, ctx->in); 	buf += (unsigned)t; 	len -= (unsigned)t; @@ -88,7 +88,7 @@ 	while (len >= 64) { 		memcpy(ctx->in, buf, 64); 		byteSwap(ctx->in, 16);-		MD5Transform(ctx->buf, ctx->in);+                __hsbase_MD5Transform(ctx->buf, ctx->in); 		buf += 64; 		len -= 64; 	}@@ -102,7 +102,7 @@  * 1 0* (64-bit count of bits processed, MSB-first)  */ void-MD5Final(byte digest[16], struct MD5Context *ctx)+__hsbase_MD5Final(byte digest[16], struct MD5Context *ctx) { 	int count = (int)(ctx->bytes[0] & 0x3f); /* Bytes in ctx->in */ 	byte *p = (byte *)ctx->in + count;	/* First unused byte */@@ -116,7 +116,7 @@ 	if (count < 0) {	/* Padding forces an extra block */ 		memset(p, 0, count+8); 		byteSwap(ctx->in, 16);-		MD5Transform(ctx->buf, ctx->in);+                __hsbase_MD5Transform(ctx->buf, ctx->in); 		p = (byte *)ctx->in; 		count = 56; 	}@@ -126,11 +126,11 @@ 	/* Append length in bits and transform */ 	ctx->in[14] = ctx->bytes[0] << 3; 	ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29;-	MD5Transform(ctx->buf, ctx->in);+        __hsbase_MD5Transform(ctx->buf, ctx->in);  	byteSwap(ctx->buf, 4); 	memcpy(digest, ctx->buf, 16);-	memset(ctx,0,sizeof(ctx));+	memset(ctx, 0, sizeof(*ctx)); }  @@ -153,7 +153,7 @@  */  void-MD5Transform(word32 buf[4], word32 const in[16])+__hsbase_MD5Transform(word32 buf[4], word32 const in[16]) { 	register word32 a, b, c, d; 
+ cbits/sysconf.c view
@@ -0,0 +1,19 @@+#include "HsBaseConfig.h"++/* For _SC_CLK_TCK */+#if HAVE_UNISTD_H+#include <unistd.h>+#endif++/* for CLK_TCK */+#if HAVE_TIME_H+#include <time.h>+#endif++long clk_tck(void) {+#if defined(CLK_TCK)+    return (CLK_TCK);+#else+    return sysconf(_SC_CLK_TCK);+#endif+}
+ changelog.md view
@@ -0,0 +1,145 @@+# Changelog for [`base` package](http://hackage.haskell.org/package/base)++## 4.7.0.0  *Mar 2014*++  * Bundled with GHC 7.8.1++  * Add `/Since: 4.[4567].0.0/` Haddock annotations to entities+    denoting the package version, when the given entity was introduced+    (or its type signature changed in a non-compatible way)++  * The `Control.Category` module now has the `PolyKinds` extension+    enabled, meaning that instances of `Category` no longer need be of+    kind `* -> * -> *`.++  * There are now `Foldable` and `Traversable` instances for `Either a`,+   `Const r`, and `(,) a`.++  * There is now a `Monoid`, `Generic`, and `Generic1` instance for `Const`.++  * There is now a `Data` instance for `Data.Version`.++  * A new `Data.Bits.FiniteBits` class has been added to represent+    types with fixed bit-count. The existing `Bits` class is extended+    with a `bitSizeMaybe` method to replace the now obsolete+    `bitsize` method.++  * `Data.Bits.Bits` gained a new `zeroBits` method which completes the+    `Bits` API with a direct way to introduce a value with all bits cleared.++  * There are now `Bits` and `FiniteBits` instances for `Bool`.++  * There are now `Eq`, `Ord`, `Show`, `Read`, `Generic`. and `Generic1`+    instances for `ZipList`.++  * There are now `Eq`, `Ord`, `Show` and `Read` instances for `Down`.++  * There are now `Eq`, `Ord`, `Show`, `Read` and `Generic` instances+    for types in GHC.Generics (`U1`, `Par1`, `Rec1`, `K1`, `M1`,+    `(:+:)`, `(:*:)`, `(:.:)`).++  * `Data.Monoid`: There are now `Generic` instances for `Dual`, `Endo`,+    `All`, `Any`, `Sum`, `Product`, `First`, and `Last`; as well as+    `Generic1` instances for `Dual`, `Sum`, `Product`, `First`, and `Last`.++  * The `Data.Monoid.{Product,Sum}` newtype wrappers now have `Num` instances.++  * There are now `Functor` instances for `System.Console.GetOpt`'s+    `ArgOrder`, `OptDescr`, and `ArgDescr`.++  * A zero-width unboxed poly-kinded `Proxy#` was added to+    `GHC.Prim`. It can be used to make it so that there is no the+    operational overhead for passing around proxy arguments to model+    type application.++  * New `Data.Proxy` module providing a concrete, poly-kinded proxy type.++  * New `Data.Coerce` module which exports the new `Coercible` class+    together with the `coerce` primitive which provide safe coercion+    (wrt role checking) between types with same representation.++  * `Control.Concurrent.MVar` has a new implementation of `readMVar`,+    which fixes a long-standing bug where `readMVar` is only atomic if+    there are no other threads running `putMVar`.  `readMVar` now is+    atomic, and is guaranteed to return the value from the first+    `putMVar`.  There is also a new `tryReadMVar` which is a+    non-blocking version.++  * New `Control.Concurrent.MVar.withMVarMasked` which executes+    `IO` action with asynchronous exceptions masked in the same style+    as the existing `modifyMVarMasked` and `modifyMVarMasked_`.++  * New `threadWait{Read,Write}STM :: Fd -> IO (STM (), IO ())`+    functions added to `Control.Concurrent` for waiting on FD+    readiness with STM actions.++  * Expose `Data.Fixed.Fixed`'s constructor.++  * There are now byte endian-swapping primitives+    `byteSwap{16,32,64}` available in `Data.Word`, which use+    optimized machine instructions when available.++  * `Data.Bool` now exports `bool :: a -> a -> Bool -> a`, analogously+    to `maybe` and `either` in their respective modules.++  * `Data.Either` now exports `isLeft, isRight :: Either a b -> Bool`.++  * `Debug.Trace` now exports `traceId`, `traceShowId`, `traceM`,+    and `traceShowM`.++  * `Data.Functor` now exports `($>)` and `void`.++  * Rewrote portions of `Text.Printf`, and made changes to `Numeric`+    (added `Numeric.showFFloatAlt` and `Numeric.showGFloatAlt`) and+    `GHC.Float` (added `formatRealFloatAlt`) to support it.  The+    rewritten version is extensible to user types, adds a "generic"+    format specifier "`%v`", extends the `printf` spec to support much+    of C's `printf(3)` functionality, and fixes the spurious warnings+    about using `Text.Printf.printf` at `(IO a)` while ignoring the+    return value.  These changes were contributed by Bart Massey.++  * The minimal complete definitions for all type-classes with cyclic+    default implementations have been explicitly annotated with the+    new `{-# MINIMAL #-}` pragma.++  * `Control.Applicative.WrappedMonad`, which can be used to convert a+    `Monad` to an `Applicative`, has now a+    `Monad m => Monad (WrappedMonad m)` instance.++  * There is now a `Generic` and a `Generic1` instance for `WrappedMonad`+    and `WrappedArrow`.++  * Handle `ExitFailure (-sig)` on Unix by killing process with signal `sig`.++  * New module `Data.Type.Bool` providing operations on type-level booleans.++  * Expose `System.Mem.performMinorGC` for triggering minor GCs.++  * New `System.Environment.{set,unset}Env` for manipulating+    environment variables.++  * Add `Typeable` instance for `(->)` and `RealWorld`.++  * Declare CPP header `<Typeable.h>` officially obsolete as GHC 7.8++    does not support hand-written `Typeable` instances anymore.++  * Remove (unmaintained) Hugs98 and NHC98 specific code.++  * Optimize `System.Timeout.timeout` for the threaded RTS.++  * Remove deprecated functions `unsafeInterleaveST`, `unsafeIOToST`,+    and `unsafeSTToIO` from `Control.Monad.ST`.++  * Add a new superclass `SomeAsyncException` for all asynchronous exceptions+    and makes the existing `AsyncException` and `Timeout` exception children+    of `SomeAsyncException` in the hierarchy.++  * Remove deprecated functions `blocked`, `unblock`, and `block` from+    `Control.Exception`.++  * Remove deprecated function `forkIOUnmasked` from `Control.Concurrent`.++  * Remove deprecated function `unsafePerformIO` export from `Foreign`+    (still available via `System.IO.Unsafe.unsafePerformIO`).++  * Various fixes and other improvements (see Git history for full details).
config.guess view
@@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name.-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,-#   Inc.+#   Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2006-07-02'+timestamp='2013-06-10'  # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by-# the Free Software Foundation; either version 2 of the License, or+# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but@@ -17,27 +15,23 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License-# along with this program; if not, write to the Free Software-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA-# 02110-1301, USA.+# along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under-# the same distribution terms that you use for the rest of that program.---# Originally written by Per Bothner <per@bothner.com>.-# Please send patches to <config-patches@gnu.org>.  Submit a context-# diff and a properly formatted ChangeLog entry.+# the same distribution terms that you use for the rest of that+# program.  This Exception is an additional permission under section 7+# of the GNU General Public License, version 3 ("GPLv3"). #-# This script attempts to guess a canonical system name similar to-# config.sub.  If it succeeds, it prints the system name on stdout, and-# exits with 0.  Otherwise, it exits with 1.+# Originally written by Per Bothner. #-# The plan is that this can be called by configure scripts if you-# don't specify an explicit build system type.+# You can get the latest version of this script from:+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD+#+# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'`  usage="\@@ -56,8 +50,7 @@ GNU config.guess ($timestamp)  Originally written by Per Bothner.-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005-Free Software Foundation, Inc.+Copyright 1992-2013 Free Software Foundation, Inc.  This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."@@ -139,12 +132,33 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in+Linux|GNU|GNU/*)+	# If the system lacks a compiler, then just pick glibc.+	# We could probably try harder.+	LIBC=gnu++	eval $set_cc_for_build+	cat <<-EOF > $dummy.c+	#include <features.h>+	#if defined(__UCLIBC__)+	LIBC=uclibc+	#elif defined(__dietlibc__)+	LIBC=dietlibc+	#else+	LIBC=gnu+	#endif+	EOF+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`+	;;+esac+ # Note: order is significant - the case branches are not exclusive.  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in     *:NetBSD:*:*) 	# NetBSD (nbsd) targets should (where applicable) match one or-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently 	# switched to ELF, *-*-netbsd* would select the old 	# object file format.  This provides both forward@@ -161,6 +175,7 @@ 	    arm*) machine=arm-unknown ;; 	    sh3el) machine=shl-unknown ;; 	    sh3eb) machine=sh-unknown ;;+	    sh5el) machine=sh5le-unknown ;; 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 	esac 	# The Operating System including object format, if it has switched@@ -169,7 +184,7 @@ 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax) 		eval $set_cc_for_build 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \-			| grep __ELF__ >/dev/null+			| grep -q __ELF__ 		then 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 		    # Return netbsd for either.  FIX?@@ -179,7 +194,7 @@ 		fi 		;; 	    *)-	        os=netbsd+		os=netbsd 		;; 	esac 	# The OS release@@ -200,6 +215,10 @@ 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 	echo "${machine}-${os}${release}" 	exit ;;+    *:Bitrig:*:*)+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}+	exit ;;     *:OpenBSD:*:*) 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}@@ -222,7 +241,7 @@ 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 		;; 	*5.*)-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 		;; 	esac 	# According to Compaq, /usr/sbin/psrinfo has been available on@@ -268,7 +287,10 @@ 	# A Xn.n version is an unreleased experimental baselevel. 	# 1.2 uses "1.2" for uname -r. 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`-	exit ;;+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.+	exitcode=$?+	trap '' 0+	exit $exitcode ;;     Alpha\ *:Windows_NT*:*) 	# How do we know it's Interix rather than the generic POSIX subsystem? 	# Should we change UNAME_MACHINE based on the output of uname instead@@ -294,12 +316,12 @@ 	echo s390-ibm-zvmoe 	exit ;;     *:OS400:*:*)-        echo powerpc-ibm-os400+	echo powerpc-ibm-os400 	exit ;;     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 	echo arm-acorn-riscix${UNAME_RELEASE} 	exit ;;-    arm:riscos:*:*|arm:RISCOS:*:*)+    arm*:riscos:*:*|arm*:RISCOS:*:*) 	echo arm-unknown-riscos 	exit ;;     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)@@ -323,15 +345,34 @@ 	case `/usr/bin/uname -p` in 	    sparc) echo sparc-icl-nx7; exit ;; 	esac ;;+    s390x:SunOS:*:*)+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`+	exit ;;     sun4H:SunOS:5.*:*) 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 	exit ;;     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 	exit ;;-    i86pc:SunOS:5.*:*)-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)+	echo i386-pc-auroraux${UNAME_RELEASE} 	exit ;;+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)+	eval $set_cc_for_build+	SUN_ARCH="i386"+	# If there is a compiler, see if it is configured for 64-bit objects.+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.+	# This test works for both compilers.+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \+		grep IS_64BIT_ARCH >/dev/null+	    then+		SUN_ARCH="x86_64"+	    fi+	fi+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`+	exit ;;     sun4*:SunOS:6*:*) 	# According to config.sub, this is the proper way to canonicalize 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but@@ -374,23 +415,23 @@     # MiNT.  But MiNT is downward compatible to TOS, so this should     # be no problem.     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)-        echo m68k-atari-mint${UNAME_RELEASE}+	echo m68k-atari-mint${UNAME_RELEASE} 	exit ;;     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 	echo m68k-atari-mint${UNAME_RELEASE}-        exit ;;+	exit ;;     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)-        echo m68k-atari-mint${UNAME_RELEASE}+	echo m68k-atari-mint${UNAME_RELEASE} 	exit ;;     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)-        echo m68k-milan-mint${UNAME_RELEASE}-        exit ;;+	echo m68k-milan-mint${UNAME_RELEASE}+	exit ;;     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)-        echo m68k-hades-mint${UNAME_RELEASE}-        exit ;;+	echo m68k-hades-mint${UNAME_RELEASE}+	exit ;;     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)-        echo m68k-unknown-mint${UNAME_RELEASE}-        exit ;;+	echo m68k-unknown-mint${UNAME_RELEASE}+	exit ;;     m68k:machten:*:*) 	echo m68k-apple-machten${UNAME_RELEASE} 	exit ;;@@ -460,8 +501,8 @@ 	echo m88k-motorola-sysv3 	exit ;;     AViiON:dgux:*:*)-        # DG/UX returns AViiON for all architectures-        UNAME_PROCESSOR=`/usr/bin/uname -p`+	# DG/UX returns AViiON for all architectures+	UNAME_PROCESSOR=`/usr/bin/uname -p` 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 	then 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \@@ -474,7 +515,7 @@ 	else 	    echo i586-dg-dgux${UNAME_RELEASE} 	fi- 	exit ;;+	exit ;;     M88*:DolphinOS:*:*)	# DolphinOS (SVR3) 	echo m88k-dolphin-sysv3 	exit ;;@@ -531,7 +572,7 @@ 		echo rs6000-ibm-aix3.2 	fi 	exit ;;-    *:AIX:*:[45])+    *:AIX:*:[4567]) 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 		IBM_ARCH=rs6000@@ -574,52 +615,52 @@ 	    9000/[678][0-9][0-9]) 		if [ -x /usr/bin/getconf ]; then 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`-                    case "${sc_cpu_version}" in-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1-                      532)                      # CPU_PA_RISC2_0-                        case "${sc_kernel_bits}" in-                          32) HP_ARCH="hppa2.0n" ;;-                          64) HP_ARCH="hppa2.0w" ;;+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`+		    case "${sc_cpu_version}" in+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1+		      532)                      # CPU_PA_RISC2_0+			case "${sc_kernel_bits}" in+			  32) HP_ARCH="hppa2.0n" ;;+			  64) HP_ARCH="hppa2.0w" ;; 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20-                        esac ;;-                    esac+			esac ;;+		    esac 		fi 		if [ "${HP_ARCH}" = "" ]; then 		    eval $set_cc_for_build-		    sed 's/^              //' << EOF >$dummy.c+		    sed 's/^		//' << EOF >$dummy.c -              #define _HPUX_SOURCE-              #include <stdlib.h>-              #include <unistd.h>+		#define _HPUX_SOURCE+		#include <stdlib.h>+		#include <unistd.h> -              int main ()-              {-              #if defined(_SC_KERNEL_BITS)-                  long bits = sysconf(_SC_KERNEL_BITS);-              #endif-                  long cpu  = sysconf (_SC_CPU_VERSION);+		int main ()+		{+		#if defined(_SC_KERNEL_BITS)+		    long bits = sysconf(_SC_KERNEL_BITS);+		#endif+		    long cpu  = sysconf (_SC_CPU_VERSION); -                  switch (cpu)-              	{-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;-              	case CPU_PA_RISC2_0:-              #if defined(_SC_KERNEL_BITS)-              	    switch (bits)-              		{-              		case 64: puts ("hppa2.0w"); break;-              		case 32: puts ("hppa2.0n"); break;-              		default: puts ("hppa2.0"); break;-              		} break;-              #else  /* !defined(_SC_KERNEL_BITS) */-              	    puts ("hppa2.0"); break;-              #endif-              	default: puts ("hppa1.0"); break;-              	}-                  exit (0);-              }+		    switch (cpu)+			{+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;+			case CPU_PA_RISC2_0:+		#if defined(_SC_KERNEL_BITS)+			    switch (bits)+				{+				case 64: puts ("hppa2.0w"); break;+				case 32: puts ("hppa2.0n"); break;+				default: puts ("hppa2.0"); break;+				} break;+		#else  /* !defined(_SC_KERNEL_BITS) */+			    puts ("hppa2.0"); break;+		#endif+			default: puts ("hppa1.0"); break;+			}+		    exit (0);+		} EOF 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 		    test -z "$HP_ARCH" && HP_ARCH=hppa@@ -639,7 +680,7 @@ 	    # => hppa64-hp-hpux11.23  	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |-		grep __LP64__ >/dev/null+		grep -q __LP64__ 	    then 		HP_ARCH="hppa2.0w" 	    else@@ -710,22 +751,22 @@ 	exit ;;     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 	echo c1-convex-bsd-        exit ;;+	exit ;;     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 	if getsysinfo -f scalar_acc 	then echo c32-convex-bsd 	else echo c2-convex-bsd 	fi-        exit ;;+	exit ;;     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 	echo c34-convex-bsd-        exit ;;+	exit ;;     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 	echo c38-convex-bsd-        exit ;;+	exit ;;     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 	echo c4-convex-bsd-        exit ;;+	exit ;;     CRAY*Y-MP:*:*:*) 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 	exit ;;@@ -749,14 +790,14 @@ 	exit ;;     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"-        exit ;;+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"+	exit ;;     5000:UNIX_System_V:4.*:*)-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 	exit ;;     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}@@ -768,37 +809,51 @@ 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 	exit ;;     *:FreeBSD:*:*)-	case ${UNAME_MACHINE} in-	    pc98)-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;+	UNAME_PROCESSOR=`/usr/bin/uname -p`+	case ${UNAME_PROCESSOR} in 	    amd64) 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 	    *)-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 	esac 	exit ;;     i*:CYGWIN*:*) 	echo ${UNAME_MACHINE}-pc-cygwin 	exit ;;-    i*:MINGW*:*)+    *:MINGW64*:*)+	echo ${UNAME_MACHINE}-pc-mingw64+	exit ;;+    *:MINGW*:*) 	echo ${UNAME_MACHINE}-pc-mingw32 	exit ;;+    i*:MSYS*:*)+	echo ${UNAME_MACHINE}-pc-msys+	exit ;;     i*:windows32*:*)-    	# uname -m includes "-pc" on this system.-    	echo ${UNAME_MACHINE}-mingw32+	# uname -m includes "-pc" on this system.+	echo ${UNAME_MACHINE}-mingw32 	exit ;;     i*:PW*:*) 	echo ${UNAME_MACHINE}-pc-pw32 	exit ;;-    x86:Interix*:[3456]*)-	echo i586-pc-interix${UNAME_RELEASE}-	exit ;;-    EM64T:Interix*:[3456]*)-	echo x86_64-unknown-interix${UNAME_RELEASE}-	exit ;;+    *:Interix*:*)+	case ${UNAME_MACHINE} in+	    x86)+		echo i586-pc-interix${UNAME_RELEASE}+		exit ;;+	    authenticamd | genuineintel | EM64T)+		echo x86_64-unknown-interix${UNAME_RELEASE}+		exit ;;+	    IA64)+		echo ia64-unknown-interix${UNAME_RELEASE}+		exit ;;+	esac ;;     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 	echo i${UNAME_MACHINE}-pc-mks 	exit ;;+    8664:Windows_NT:*)+	echo x86_64-pc-mks+	exit ;;     i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 	# How do we know it's Interix rather than the generic POSIX subsystem? 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we@@ -819,200 +874,157 @@ 	exit ;;     *:GNU:*:*) 	# the GNU system-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 	exit ;;     *:GNU/*:*:*) 	# other systems with GNU libc and userland-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 	exit ;;     i*86:Minix:*:*) 	echo ${UNAME_MACHINE}-pc-minix 	exit ;;+    aarch64:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;+    aarch64_be:Linux:*:*)+	UNAME_MACHINE=aarch64_be+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;+    alpha:Linux:*:*)+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in+	  EV5)   UNAME_MACHINE=alphaev5 ;;+	  EV56)  UNAME_MACHINE=alphaev56 ;;+	  PCA56) UNAME_MACHINE=alphapca56 ;;+	  PCA57) UNAME_MACHINE=alphapca56 ;;+	  EV6)   UNAME_MACHINE=alphaev6 ;;+	  EV67)  UNAME_MACHINE=alphaev67 ;;+	  EV68*) UNAME_MACHINE=alphaev68 ;;+	esac+	objdump --private-headers /bin/sh | grep -q ld.so.1+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;+    arc:Linux:*:* | arceb:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;     arm*:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	eval $set_cc_for_build+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \+	    | grep -q __ARM_EABI__+	then+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	else+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \+		| grep -q __ARM_PCS_VFP+	    then+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi+	    else+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf+	    fi+	fi 	exit ;;     avr32*:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;     cris:Linux:*:*)-	echo cris-axis-linux-gnu+	echo ${UNAME_MACHINE}-axis-linux-${LIBC} 	exit ;;     crisv32:Linux:*:*)-	echo crisv32-axis-linux-gnu+	echo ${UNAME_MACHINE}-axis-linux-${LIBC} 	exit ;;     frv:Linux:*:*)-    	echo frv-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;+    hexagon:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;+    i*86:Linux:*:*)+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}+	exit ;;     ia64:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;     m32r*:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;     m68*:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;-    mips:Linux:*:*)-	eval $set_cc_for_build-	sed 's/^	//' << EOF >$dummy.c-	#undef CPU-	#undef mips-	#undef mipsel-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)-	CPU=mipsel-	#else-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)-	CPU=mips-	#else-	CPU=-	#endif-	#endif-EOF-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '-	    /^CPU/{-		s: ::g-		p-	    }'`"-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }-	;;-    mips64:Linux:*:*)+    mips:Linux:*:* | mips64:Linux:*:*) 	eval $set_cc_for_build 	sed 's/^	//' << EOF >$dummy.c 	#undef CPU-	#undef mips64-	#undef mips64el+	#undef ${UNAME_MACHINE}+	#undef ${UNAME_MACHINE}el 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)-	CPU=mips64el+	CPU=${UNAME_MACHINE}el 	#else 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)-	CPU=mips64+	CPU=${UNAME_MACHINE} 	#else 	CPU= 	#endif 	#endif EOF-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '-	    /^CPU/{-		s: ::g-		p-	    }'`"-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 	;;-    or32:Linux:*:*)-	echo or32-unknown-linux-gnu+    or1k:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;-    ppc:Linux:*:*)-	echo powerpc-unknown-linux-gnu+    or32:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;-    ppc64:Linux:*:*)-	echo powerpc64-unknown-linux-gnu+    padre:Linux:*:*)+	echo sparc-unknown-linux-${LIBC} 	exit ;;-    alpha:Linux:*:*)-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in-	  EV5)   UNAME_MACHINE=alphaev5 ;;-	  EV56)  UNAME_MACHINE=alphaev56 ;;-	  PCA56) UNAME_MACHINE=alphapca56 ;;-	  PCA57) UNAME_MACHINE=alphapca56 ;;-	  EV6)   UNAME_MACHINE=alphaev6 ;;-	  EV67)  UNAME_MACHINE=alphaev67 ;;-	  EV68*) UNAME_MACHINE=alphaev68 ;;-        esac-	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}+    parisc64:Linux:*:* | hppa64:Linux:*:*)+	echo hppa64-unknown-linux-${LIBC} 	exit ;;     parisc:Linux:*:* | hppa:Linux:*:*) 	# Look for CPU level 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;-	  *)    echo hppa-unknown-linux-gnu ;;+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;+	  *)    echo hppa-unknown-linux-${LIBC} ;; 	esac 	exit ;;-    parisc64:Linux:*:* | hppa64:Linux:*:*)-	echo hppa64-unknown-linux-gnu+    ppc64:Linux:*:*)+	echo powerpc64-unknown-linux-${LIBC} 	exit ;;+    ppc:Linux:*:*)+	echo powerpc-unknown-linux-${LIBC}+	exit ;;+    ppc64le:Linux:*:*)+	echo powerpc64le-unknown-linux-${LIBC}+	exit ;;+    ppcle:Linux:*:*)+	echo powerpcle-unknown-linux-${LIBC}+	exit ;;     s390:Linux:*:* | s390x:Linux:*:*)-	echo ${UNAME_MACHINE}-ibm-linux+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 	exit ;;     sh64*:Linux:*:*)-    	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;     sh*:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;     sparc:Linux:*:* | sparc64:Linux:*:*)-	echo ${UNAME_MACHINE}-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;+    tile*:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;     vax:Linux:*:*)-	echo ${UNAME_MACHINE}-dec-linux-gnu+	echo ${UNAME_MACHINE}-dec-linux-${LIBC} 	exit ;;     x86_64:Linux:*:*)-	echo x86_64-unknown-linux-gnu+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 	exit ;;-    i*86:Linux:*:*)-	# The BFD linker knows what the default object file format is, so-	# first see if it will tell us. cd to the root directory to prevent-	# problems with other programs or directories called `ld' in the path.-	# Set LC_ALL=C to ensure ld outputs messages in English.-	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \-			 | sed -ne '/supported targets:/!d-				    s/[ 	][ 	]*/ /g-				    s/.*supported targets: *//-				    s/ .*//-				    p'`-        case "$ld_supported_targets" in-	  elf32-i386)-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"-		;;-	  a.out-i386-linux)-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"-		exit ;;-	  coff-i386)-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"-		exit ;;-	  "")-		# Either a pre-BFD a.out linker (linux-gnuoldld) or-		# one that does not give us useful --help.-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"-		exit ;;-	esac-	# Determine whether the default compiler is a.out or elf-	eval $set_cc_for_build-	sed 's/^	//' << EOF >$dummy.c-	#include <features.h>-	#ifdef __ELF__-	# ifdef __GLIBC__-	#  if __GLIBC__ >= 2-	LIBC=gnu-	#  else-	LIBC=gnulibc1-	#  endif-	# else-	LIBC=gnulibc1-	# endif-	#else-	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)-	LIBC=gnu-	#else-	LIBC=gnuaout-	#endif-	#endif-	#ifdef __dietlibc__-	LIBC=dietlibc-	#endif-EOF-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '-	    /^LIBC/{-		s: ::g-		p-	    }'`"-	test x"${LIBC}" != x && {-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"-		exit-	}-	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }-	;;+    xtensa*:Linux:*:*)+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+	exit ;;     i*86:DYNIX/ptx:4*:*) 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 	# earlier versions are messed up and put the nodename in both@@ -1020,11 +1032,11 @@ 	echo i386-sequent-sysv4 	exit ;;     i*86:UNIX_SV:4.2MP:2.*)-        # Unixware is an offshoot of SVR4, but it has its own version-        # number series starting with 2...-        # I am not positive that other SVR4 systems won't match this,+	# Unixware is an offshoot of SVR4, but it has its own version+	# number series starting with 2...+	# I am not positive that other SVR4 systems won't match this, 	# I just have to hope.  -- rms.-        # Use sysv4.2uw... so that sysv4* matches it.+	# Use sysv4.2uw... so that sysv4* matches it. 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 	exit ;;     i*86:OS/2:*:*)@@ -1041,7 +1053,7 @@     i*86:syllable:*:*) 	echo ${UNAME_MACHINE}-pc-syllable 	exit ;;-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 	echo i386-unknown-lynxos${UNAME_RELEASE} 	exit ;;     i*86:*DOS:*:*)@@ -1056,7 +1068,7 @@ 	fi 	exit ;;     i*86:*:5:[678]*)-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.+	# UnixWare 7.x, OpenUNIX and OpenServer 6. 	case `/bin/uname -X | grep "^Machine"` in 	    *486*)	     UNAME_MACHINE=i486 ;; 	    *Pentium)	     UNAME_MACHINE=i586 ;;@@ -1084,10 +1096,13 @@ 	exit ;;     pc:*:*:*) 	# Left here for compatibility:-        # uname -m prints for DJGPP always 'pc', but it prints nothing about-        # the processor, so we play safe by assuming i386.-	echo i386-pc-msdosdjgpp-        exit ;;+	# uname -m prints for DJGPP always 'pc', but it prints nothing about+	# the processor, so we play safe by assuming i586.+	# Note: whatever this is, it MUST be the same as what config.sub+	# prints for the "djgpp" host, or else GDB configury will decide that+	# this is a cross-build.+	echo i586-pc-msdosdjgpp+	exit ;;     Intel:Mach:3*:*) 	echo i386-pc-mach3 	exit ;;@@ -1122,8 +1137,18 @@ 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \-          && { echo i486-ncr-sysv4; exit; } ;;+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \+	  && { echo i486-ncr-sysv4; exit; } ;;+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)+	OS_REL='.3'+	test -r /etc/.relid \+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 	echo m68k-unknown-lynxos${UNAME_RELEASE} 	exit ;;@@ -1136,7 +1161,7 @@     rs6000:LynxOS:2.*:*) 	echo rs6000-unknown-lynxos${UNAME_RELEASE} 	exit ;;-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 	echo powerpc-unknown-lynxos${UNAME_RELEASE} 	exit ;;     SM[BE]S:UNIX_SV:*:*)@@ -1156,10 +1181,10 @@ 		echo ns32k-sni-sysv 	fi 	exit ;;-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort-                      # says <Richard.M.Bartel@ccMail.Census.GOV>-        echo i586-unisys-sysv4-        exit ;;+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort+			# says <Richard.M.Bartel@ccMail.Census.GOV>+	echo i586-unisys-sysv4+	exit ;;     *:UNIX_System_V:4*:FTX*) 	# From Gerald Hewes <hewes@openmarket.com>. 	# How about differentiating between stratus architectures? -djm@@ -1185,11 +1210,11 @@ 	exit ;;     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 	if [ -d /usr/nec ]; then-	        echo mips-nec-sysv${UNAME_RELEASE}+		echo mips-nec-sysv${UNAME_RELEASE} 	else-	        echo mips-unknown-sysv${UNAME_RELEASE}+		echo mips-unknown-sysv${UNAME_RELEASE} 	fi-        exit ;;+	exit ;;     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only. 	echo powerpc-be-beos 	exit ;;@@ -1199,6 +1224,12 @@     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible. 	echo i586-pc-beos 	exit ;;+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.+	echo i586-pc-haiku+	exit ;;+    x86_64:Haiku:*:*)+	echo x86_64-unknown-haiku+	exit ;;     SX-4:SUPER-UX:*:*) 	echo sx4-nec-superux${UNAME_RELEASE} 	exit ;;@@ -1208,6 +1239,15 @@     SX-6:SUPER-UX:*:*) 	echo sx6-nec-superux${UNAME_RELEASE} 	exit ;;+    SX-7:SUPER-UX:*:*)+	echo sx7-nec-superux${UNAME_RELEASE}+	exit ;;+    SX-8:SUPER-UX:*:*)+	echo sx8-nec-superux${UNAME_RELEASE}+	exit ;;+    SX-8R:SUPER-UX:*:*)+	echo sx8r-nec-superux${UNAME_RELEASE}+	exit ;;     Power*:Rhapsody:*:*) 	echo powerpc-apple-rhapsody${UNAME_RELEASE} 	exit ;;@@ -1216,9 +1256,21 @@ 	exit ;;     *:Darwin:*:*) 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown-	case $UNAME_PROCESSOR in-	    unknown) UNAME_PROCESSOR=powerpc ;;-	esac+	eval $set_cc_for_build+	if test "$UNAME_PROCESSOR" = unknown ; then+	    UNAME_PROCESSOR=powerpc+	fi+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \+		grep IS_64BIT_ARCH >/dev/null+	    then+		case $UNAME_PROCESSOR in+		    i386) UNAME_PROCESSOR=x86_64 ;;+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;+		esac+	    fi+	fi 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 	exit ;;     *:procnto*:*:* | *:QNX:[0123456789]*:*)@@ -1232,7 +1284,10 @@     *:QNX:*:4*) 	echo i386-pc-qnx 	exit ;;-    NSE-?:NONSTOP_KERNEL:*:*)+    NEO-?:NONSTOP_KERNEL:*:*)+	echo neo-tandem-nsk${UNAME_RELEASE}+	exit ;;+    NSE-*:NONSTOP_KERNEL:*:*) 	echo nse-tandem-nsk${UNAME_RELEASE} 	exit ;;     NSR-?:NONSTOP_KERNEL:*:*)@@ -1277,13 +1332,13 @@ 	echo pdp10-unknown-its 	exit ;;     SEI:*:*:SEIUX)-        echo mips-sei-seiux${UNAME_RELEASE}+	echo mips-sei-seiux${UNAME_RELEASE} 	exit ;;     *:DragonFly:*:*) 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 	exit ;;     *:*VMS:*:*)-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`+	UNAME_MACHINE=`(uname -p) 2>/dev/null` 	case "${UNAME_MACHINE}" in 	    A*) echo alpha-dec-vms ; exit ;; 	    I*) echo ia64-dec-vms ; exit ;;@@ -1298,11 +1353,14 @@     i*86:rdos:*:*) 	echo ${UNAME_MACHINE}-pc-rdos 	exit ;;+    i*86:AROS:*:*)+	echo ${UNAME_MACHINE}-pc-aros+	exit ;;+    x86_64:VMkernel:*:*)+	echo ${UNAME_MACHINE}-unknown-esx+	exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2- eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_@@ -1320,11 +1378,11 @@ #include <sys/param.h>   printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4-          "4"+	"4" #else-	  ""+	"" #endif-         ); exit (0);+	); exit (0); #endif #endif @@ -1458,9 +1516,9 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from -  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD  If the version you run ($0) is already up to date, please send the following data and any information you think might be
config.sub view
@@ -1,44 +1,40 @@ #! /bin/sh # Configuration validation subroutine script.-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,-#   Inc.+#   Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2006-07-02'+timestamp='2013-08-10' -# This file is (in principle) common to ALL GNU software.-# The presence of a machine in this file suggests that SOME GNU software-# can handle that machine.  It does not imply ALL GNU software can.-#-# This file is free software; you can redistribute it and/or modify-# it under the terms of the GNU General Public License as published by-# the Free Software Foundation; either version 2 of the License, or+# This file is free software; you can redistribute it and/or modify it+# under the terms of the GNU General Public License as published by+# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. #-# This program is distributed in the hope that it will be useful,-# but WITHOUT ANY WARRANTY; without even the implied warranty of-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-# GNU General Public License for more details.+# This program is distributed in the hope that it will be useful, but+# WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU+# General Public License for more details. # # You should have received a copy of the GNU General Public License-# along with this program; if not, write to the Free Software-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA-# 02110-1301, USA.+# along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under-# the same distribution terms that you use for the rest of that program.+# the same distribution terms that you use for the rest of that+# program.  This Exception is an additional permission under section 7+# of the GNU General Public License, version 3 ("GPLv3").  -# Please send patches to <config-patches@gnu.org>.  Submit a context-# diff and a properly formatted ChangeLog entry.+# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from:+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD+ # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software.@@ -72,8 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005-Free Software Foundation, Inc.+Copyright 1992-2013 Free Software Foundation, Inc.  This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."@@ -120,12 +115,18 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \+  knetbsd*-gnu* | netbsd*-gnu* | \+  kopensolaris*-gnu* | \   storm-chaos* | os2-emx* | rtmk-nova*)     os=-$maybe_os     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`     ;;+  android-linux)+    os=-linux-android+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown+    ;;   *)     basic_machine=`echo $1 | sed 's/-[^-]*$//'`     if [ $basic_machine != $1 ]@@ -148,10 +149,13 @@ 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \-	-apple | -axis | -knuth | -cray)+	-apple | -axis | -knuth | -cray | -microblaze*) 		os= 		basic_machine=$1 		;;+	-bluegene*)+		os=-cnk+		;; 	-sim | -cisco | -oki | -wec | -winbond) 		os= 		basic_machine=$1@@ -166,10 +170,10 @@ 		os=-chorusos 		basic_machine=$1 		;;- 	-chorusrdb)- 		os=-chorusrdb+	-chorusrdb)+		os=-chorusrdb 		basic_machine=$1- 		;;+		;; 	-hiux*) 		os=-hiuxwe2 		;;@@ -214,6 +218,12 @@ 	-isc*) 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 		;;+	-lynx*178)+		os=-lynxos178+		;;+	-lynx*5)+		os=-lynxos5+		;; 	-lynx*) 		os=-lynxos 		;;@@ -238,24 +248,34 @@ 	# Some are omitted here because they have special meanings below. 	1750a | 580 \ 	| a29k \+	| aarch64 | aarch64_be \ 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ 	| am33_2.0 \-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \+	| arc | arceb \+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \+	| avr | avr32 \+	| be32 | be64 \ 	| bfin \-	| c4x | clipper \+	| c4x | c8051 | clipper \ 	| d10v | d30v | dlx | dsp16xx \-	| fr30 | frv \+	| epiphany \+	| fido | fr30 | frv \ 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \+	| hexagon \ 	| i370 | i860 | i960 | ia64 \ 	| ip2k | iq2000 \+	| le32 | le64 \+	| lm32 \ 	| m32c | m32r | m32rle | m68000 | m68k | m88k \-	| maxq | mb | microblaze | mcore \+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \ 	| mips | mipsbe | mipseb | mipsel | mipsle \ 	| mips16 \ 	| mips64 | mips64el \-	| mips64vr | mips64vrel \+	| mips64octeon | mips64octeonel \ 	| mips64orion | mips64orionel \+	| mips64r5900 | mips64r5900el \+	| mips64vr | mips64vrel \ 	| mips64vr4100 | mips64vr4100el \ 	| mips64vr4300 | mips64vr4300el \ 	| mips64vr5000 | mips64vr5000el \@@ -266,30 +286,45 @@ 	| mipsisa64r2 | mipsisa64r2el \ 	| mipsisa64sb1 | mipsisa64sb1el \ 	| mipsisa64sr71k | mipsisa64sr71kel \+	| mipsr5900 | mipsr5900el \ 	| mipstx39 | mipstx39el \ 	| mn10200 | mn10300 \+	| moxie \ 	| mt \ 	| msp430 \-	| nios | nios2 \+	| nds32 | nds32le | nds32be \+	| nios | nios2 | nios2eb | nios2el \ 	| ns16k | ns32k \-	| or32 \+	| open8 \+	| or1k | or32 \ 	| pdp10 | pdp11 | pj | pjl \-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \+	| powerpc | powerpc64 | powerpc64le | powerpcle \ 	| pyramid \-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \+	| rl78 | rx \+	| score \+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ 	| sh64 | sh64le \ 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \-	| spu | strongarm \-	| tahoe | thumb | tic4x | tic80 | tron \-	| v850 | v850e \+	| spu \+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \+	| ubicom32 \+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ 	| we32k \-	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \-	| z8k)+	| x86 | xc16x | xstormy16 | xtensa \+	| z8k | z80) 		basic_machine=$basic_machine-unknown 		;;-	m6811 | m68hc11 | m6812 | m68hc12)-		# Motorola 68HC11/12.+	c54x)+		basic_machine=tic54x-unknown+		;;+	c55x)+		basic_machine=tic55x-unknown+		;;+	c6x)+		basic_machine=tic6x-unknown+		;;+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) 		basic_machine=$basic_machine-unknown 		os=-none 		;;@@ -299,6 +334,21 @@ 		basic_machine=mt-unknown 		;; +	strongarm | thumb | xscale)+		basic_machine=arm-unknown+		;;+	xgate)+		basic_machine=$basic_machine-unknown+		os=-none+		;;+	xscaleeb)+		basic_machine=armeb-unknown+		;;++	xscaleel)+		basic_machine=armel-unknown+		;;+ 	# We use `pc' rather than `unknown' 	# because (1) that's what they normally are, and 	# (2) the word "unknown" tends to confuse beginning users.@@ -313,29 +363,37 @@ 	# Recognize the basic CPU types with company name. 	580-* \ 	| a29k-* \+	| aarch64-* | aarch64_be-* \ 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \ 	| avr-* | avr32-* \+	| be32-* | be64-* \ 	| bfin-* | bs2000-* \-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \-	| clipper-* | craynv-* | cydra-* \+	| c[123]* | c30-* | [cjt]90-* | c4x-* \+	| c8051-* | clipper-* | craynv-* | cydra-* \ 	| d10v-* | d30v-* | dlx-* \ 	| elxsi-* \-	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ 	| h8300-* | h8500-* \ 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \+	| hexagon-* \ 	| i*86-* | i860-* | i960-* | ia64-* \ 	| ip2k-* | iq2000-* \+	| le32-* | le64-* \+	| lm32-* \ 	| m32c-* | m32r-* | m32rle-* \ 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \-	| m88110-* | m88k-* | maxq-* | mcore-* \+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \+	| microblaze-* | microblazeel-* \ 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ 	| mips16-* \ 	| mips64-* | mips64el-* \-	| mips64vr-* | mips64vrel-* \+	| mips64octeon-* | mips64octeonel-* \ 	| mips64orion-* | mips64orionel-* \+	| mips64r5900-* | mips64r5900el-* \+	| mips64vr-* | mips64vrel-* \ 	| mips64vr4100-* | mips64vr4100el-* \ 	| mips64vr4300-* | mips64vr4300el-* \ 	| mips64vr5000-* | mips64vr5000el-* \@@ -346,32 +404,42 @@ 	| mipsisa64r2-* | mipsisa64r2el-* \ 	| mipsisa64sb1-* | mipsisa64sb1el-* \ 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \+	| mipsr5900-* | mipsr5900el-* \ 	| mipstx39-* | mipstx39el-* \ 	| mmix-* \ 	| mt-* \ 	| msp430-* \-	| nios-* | nios2-* \+	| nds32-* | nds32le-* | nds32be-* \+	| nios-* | nios2-* | nios2eb-* | nios2el-* \ 	| none-* | np1-* | ns16k-* | ns32k-* \+	| open8-* \ 	| orion-* \ 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ 	| pyramid-* \-	| romp-* | rs6000-* \-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \+	| rl78-* | romp-* | rs6000-* | rx-* \+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ 	| sparclite-* \-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \-	| tahoe-* | thumb-* \+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \+	| tahoe-* \ 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \+	| tile*-* \ 	| tron-* \-	| v850-* | v850e-* | vax-* \+	| ubicom32-* \+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \+	| vax-* \ 	| we32k-* \-	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \-	| xstormy16-* | xtensa-* \+	| x86-* | x86_64-* | xc16x-* | xps100-* \+	| xstormy16-* | xtensa*-* \ 	| ymp-* \-	| z8k-*)+	| z8k-* | z80-*) 		;;+	# Recognize the basic CPU types without company name, with glob match.+	xtensa*)+		basic_machine=$basic_machine-unknown+		;; 	# Recognize the various machine names and aliases which stand 	# for a CPU type and a company and sometimes even an OS. 	386bsd)@@ -388,7 +456,7 @@ 		basic_machine=a29k-amd 		os=-udi 		;;-    	abacus)+	abacus) 		basic_machine=abacus-unknown 		;; 	adobe68k)@@ -434,6 +502,10 @@ 		basic_machine=m68k-apollo 		os=-bsd 		;;+	aros)+		basic_machine=i386-pc+		os=-aros+		;; 	aux) 		basic_machine=m68k-apple 		os=-aux@@ -442,10 +514,35 @@ 		basic_machine=ns32k-sequent 		os=-dynix 		;;+	blackfin)+		basic_machine=bfin-unknown+		os=-linux+		;;+	blackfin-*)+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`+		os=-linux+		;;+	bluegene*)+		basic_machine=powerpc-ibm+		os=-cnk+		;;+	c54x-*)+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`+		;;+	c55x-*)+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`+		;;+	c6x-*)+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`+		;; 	c90) 		basic_machine=c90-cray 		os=-unicos 		;;+	cegcc)+		basic_machine=arm-unknown+		os=-cegcc+		;; 	convex-c1) 		basic_machine=c1-convex 		os=-bsd@@ -474,8 +571,8 @@ 		basic_machine=craynv-cray 		os=-unicosmp 		;;-	cr16c)-		basic_machine=cr16c-unknown+	cr16 | cr16-*)+		basic_machine=cr16-unknown 		os=-elf 		;; 	crds | unos)@@ -513,6 +610,10 @@ 		basic_machine=m88k-motorola 		os=-sysv3 		;;+	dicos)+		basic_machine=i686-pc+		os=-dicos+		;; 	djgpp) 		basic_machine=i586-pc 		os=-msdosdjgpp@@ -628,7 +729,6 @@ 	i370-ibm* | ibm*) 		basic_machine=i370-ibm 		;;-# I'm not sure what "Sysv32" means.  Should this be sysv3.2? 	i*86v32) 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 		os=-sysv32@@ -667,6 +767,14 @@ 		basic_machine=m68k-isi 		os=-sysv 		;;+	m68knommu)+		basic_machine=m68k-unknown+		os=-linux+		;;+	m68knommu-*)+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`+		os=-linux+		;; 	m88k-omron*) 		basic_machine=m88k-omron 		;;@@ -678,10 +786,21 @@ 		basic_machine=ns32k-utek 		os=-sysv 		;;+	microblaze*)+		basic_machine=microblaze-xilinx+		;;+	mingw64)+		basic_machine=x86_64-pc+		os=-mingw64+		;; 	mingw32)-		basic_machine=i386-pc+		basic_machine=i686-pc 		os=-mingw32 		;;+	mingw32ce)+		basic_machine=arm-unknown+		os=-mingw32ce+		;; 	miniframe) 		basic_machine=m68000-convergent 		;;@@ -710,10 +829,18 @@ 	ms1-*) 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` 		;;+	msys)+		basic_machine=i686-pc+		os=-msys+		;; 	mvs) 		basic_machine=i370-ibm 		os=-mvs 		;;+	nacl)+		basic_machine=le32-unknown+		os=-nacl+		;; 	ncr3000) 		basic_machine=i486-ncr 		os=-sysv4@@ -778,6 +905,12 @@ 	np1) 		basic_machine=np1-gould 		;;+	neo-tandem)+		basic_machine=neo-tandem+		;;+	nse-tandem)+		basic_machine=nse-tandem+		;; 	nsr-tandem) 		basic_machine=nsr-tandem 		;;@@ -808,6 +941,14 @@ 		basic_machine=i860-intel 		os=-osf 		;;+	parisc)+		basic_machine=hppa-unknown+		os=-linux+		;;+	parisc-*)+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`+		os=-linux+		;; 	pbd) 		basic_machine=sparc-tti 		;;@@ -852,9 +993,10 @@ 		;; 	power)	basic_machine=power-ibm 		;;-	ppc)	basic_machine=powerpc-unknown+	ppc | ppcbe)	basic_machine=powerpc-unknown 		;;-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`+	ppc-* | ppcbe-*)+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` 		;; 	ppcle | powerpclittle | ppc-le | powerpc-little) 		basic_machine=powerpcle-unknown@@ -879,7 +1021,11 @@ 		basic_machine=i586-unknown 		os=-pw32 		;;-	rdos)+	rdos | rdos64)+		basic_machine=x86_64-pc+		os=-rdos+		;;+	rdos32) 		basic_machine=i386-pc 		os=-rdos 		;;@@ -909,6 +1055,10 @@ 	sb1el) 		basic_machine=mipsisa64sb1el-unknown 		;;+	sde)+		basic_machine=mipsisa32-sde+		os=-elf+		;; 	sei) 		basic_machine=mips-sei 		os=-seiux@@ -920,6 +1070,9 @@ 		basic_machine=sh-hitachi 		os=-hms 		;;+	sh5el)+		basic_machine=sh5le-unknown+		;; 	sh64) 		basic_machine=sh64-unknown 		;;@@ -941,6 +1094,9 @@ 		basic_machine=i860-stratus 		os=-sysv4 		;;+	strongarm-* | thumb-*)+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`+		;; 	sun2) 		basic_machine=m68000-sun 		;;@@ -997,17 +1153,9 @@ 		basic_machine=t90-cray 		os=-unicos 		;;-	tic54x | c54x*)-		basic_machine=tic54x-unknown-		os=-coff-		;;-	tic55x | c55x*)-		basic_machine=tic55x-unknown-		os=-coff-		;;-	tic6x | c6x*)-		basic_machine=tic6x-unknown-		os=-coff+	tile*)+		basic_machine=$basic_machine-unknown+		os=-linux-gnu 		;; 	tx39) 		basic_machine=mipstx39-unknown@@ -1076,6 +1224,9 @@ 	xps | xps100) 		basic_machine=xps100-honeywell 		;;+	xscale-* | xscalee[bl]-*)+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`+		;; 	ymp) 		basic_machine=ymp-cray 		os=-unicos@@ -1084,6 +1235,10 @@ 		basic_machine=z8k-unknown 		os=-sim 		;;+	z80-*-coff)+		basic_machine=z80-unknown+		os=-sim+		;; 	none) 		basic_machine=none-none 		os=-none@@ -1122,7 +1277,7 @@ 	we32k) 		basic_machine=we32k-att 		;;-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) 		basic_machine=sh-unknown 		;; 	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)@@ -1169,9 +1324,12 @@ if [ x"$os" != x"" ] then case $os in-        # First match some system type aliases-        # that might get confused with valid system types.+	# First match some system type aliases+	# that might get confused with valid system types. 	# -solaris* is a basic system type, with this one exception.+	-auroraux)+		os=-auroraux+		;; 	-solaris1 | -solaris1.*) 		os=`echo $os | sed -e 's|solaris1|sunos4|'` 		;;@@ -1192,21 +1350,23 @@ 	# Each alternative MUST END IN A *, to match a version number. 	# -sysv* is not here because it comes later, after sysvr4. 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \+	      | -sym* | -kopensolaris* | -plan9* \ 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \-	      | -aos* \+	      | -aos* | -aros* \ 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \-	      | -openbsd* | -solidbsd* \+	      | -bitrig* | -openbsd* | -solidbsd* \ 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \-	      | -chorusos* | -chorusrdb* \-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \+	      | -chorusos* | -chorusrdb* | -cegcc* \+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \ 	      | -uxpv* | -beos* | -mpeix* | -udk* \ 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \@@ -1214,7 +1374,7 @@ 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \-	      | -skyos* | -haiku* | -rdos* | -toppers*)+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) 	# Remember, each alternative MUST END IN *, to match a version number. 		;; 	-qnx*)@@ -1253,7 +1413,7 @@ 	-opened*) 		os=-openedition 		;;-        -os400*)+	-os400*) 		os=-os400 		;; 	-wince*)@@ -1302,7 +1462,7 @@ 	-sinix*) 		os=-sysv4 		;;-        -tpf*)+	-tpf*) 		os=-tpf 		;; 	-triton*)@@ -1338,12 +1498,14 @@ 	-aros*) 		os=-aros 		;;-	-kaos*)-		os=-kaos-		;; 	-zvmoe) 		os=-zvmoe 		;;+	-dicos*)+		os=-dicos+		;;+	-nacl*)+		;; 	-none) 		;; 	*)@@ -1366,9 +1528,12 @@ # system, and we'll never get to this point.  case $basic_machine in-        spu-*)+	score-*) 		os=-elf 		;;+	spu-*)+		os=-elf+		;; 	*-acorn) 		os=-riscix1.2 		;;@@ -1378,9 +1543,24 @@ 	arm*-semi) 		os=-aout 		;;-        c4x-* | tic4x-*)-        	os=-coff+	c4x-* | tic4x-*)+		os=-coff 		;;+	c8051-*)+		os=-elf+		;;+	hexagon-*)+		os=-elf+		;;+	tic54x-*)+		os=-coff+		;;+	tic55x-*)+		os=-coff+		;;+	tic6x-*)+		os=-coff+		;; 	# This must come before the *-dec entry. 	pdp10-*) 		os=-tops20@@ -1399,19 +1579,22 @@ 		;; 	m68000-sun) 		os=-sunos3-		# This also exists in the configure program, but was not the-		# default.-		# os=-sunos4 		;; 	m68*-cisco) 		os=-aout 		;;+	mep-*)+		os=-elf+		;; 	mips*-cisco) 		os=-elf 		;; 	mips*-*) 		os=-elf 		;;+	or1k-*)+		os=-elf+		;; 	or32-*) 		os=-coff 		;;@@ -1430,7 +1613,7 @@ 	*-ibm) 		os=-aix 		;;-    	*-knuth)+	*-knuth) 		os=-mmixware 		;; 	*-wec)@@ -1535,7 +1718,7 @@ 			-sunos*) 				vendor=sun 				;;-			-aix*)+			-cnk*|-aix*) 				vendor=ibm 				;; 			-beos*)
configure view
@@ -1,21661 +1,21825 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.67 for Haskell base package 1.0.-#-# Report bugs to <libraries@haskell.org>.-#-#-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software-# Foundation, Inc.-#-#-# This configure script is free software; the Free Software Foundation-# gives unlimited permission to copy, distribute and modify it.-## -------------------- ##-## M4sh Initialization. ##-## -------------------- ##--# Be more Bourne compatible-DUALCASE=1; export DUALCASE # for MKS sh-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :-  emulate sh-  NULLCMD=:-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '${1+"$@"}'='"$@"'-  setopt NO_GLOB_SUBST-else-  case `(set -o) 2>/dev/null` in #(-  *posix*) :-    set -o posix ;; #(-  *) :-     ;;-esac-fi---as_nl='-'-export as_nl-# Printing a long string crashes Solaris 7 /usr/bin/printf.-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo-# Prefer a ksh shell builtin over an external printf program on Solaris,-# but without wasting forks for bash or zsh.-if test -z "$BASH_VERSION$ZSH_VERSION" \-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then-  as_echo='print -r --'-  as_echo_n='print -rn --'-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then-  as_echo='printf %s\n'-  as_echo_n='printf %s'-else-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'-    as_echo_n='/usr/ucb/echo -n'-  else-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'-    as_echo_n_body='eval-      arg=$1;-      case $arg in #(-      *"$as_nl"*)-	expr "X$arg" : "X\\(.*\\)$as_nl";-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;-      esac;-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"-    '-    export as_echo_n_body-    as_echo_n='sh -c $as_echo_n_body as_echo'-  fi-  export as_echo_body-  as_echo='sh -c $as_echo_body as_echo'-fi--# The user is always right.-if test "${PATH_SEPARATOR+set}" != set; then-  PATH_SEPARATOR=:-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||-      PATH_SEPARATOR=';'-  }-fi---# IFS-# We need space, tab and new line, in precisely that order.  Quoting is-# there to prevent editors from complaining about space-tab.-# (If _AS_PATH_WALK were called with IFS unset, it would disable word-# splitting by setting IFS to empty value.)-IFS=" ""	$as_nl"--# Find who we are.  Look in the path if we contain no directory separator.-case $0 in #((-  *[\\/]* ) as_myself=$0 ;;-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break-  done-IFS=$as_save_IFS--     ;;-esac-# We did not find ourselves, most probably we were run as `sh COMMAND'-# in which case we are not to be found in the path.-if test "x$as_myself" = x; then-  as_myself=$0-fi-if test ! -f "$as_myself"; then-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2-  exit 1-fi--# Unset variables that we do not need and which cause bugs (e.g. in-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"-# suppresses any "Segmentation fault" message there.  '((' could-# trigger a bug in pdksh 5.2.14.-for as_var in BASH_ENV ENV MAIL MAILPATH-do eval test x\${$as_var+set} = xset \-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :-done-PS1='$ '-PS2='> '-PS4='+ '--# NLS nuisances.-LC_ALL=C-export LC_ALL-LANGUAGE=C-export LANGUAGE--# CDPATH.-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH--if test "x$CONFIG_SHELL" = x; then-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :-  emulate sh-  NULLCMD=:-  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '\${1+\"\$@\"}'='\"\$@\"'-  setopt NO_GLOB_SUBST-else-  case \`(set -o) 2>/dev/null\` in #(-  *posix*) :-    set -o posix ;; #(-  *) :-     ;;-esac-fi-"-  as_required="as_fn_return () { (exit \$1); }-as_fn_success () { as_fn_return 0; }-as_fn_failure () { as_fn_return 1; }-as_fn_ret_success () { return 0; }-as_fn_ret_failure () { return 1; }--exitcode=0-as_fn_success || { exitcode=1; echo as_fn_success failed.; }-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :--else-  exitcode=1; echo positional parameters were not saved.-fi-test x\$exitcode = x0 || exit 1"-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1-test \$(( 1 + 1 )) = 2 || exit 1"-  if (eval "$as_required") 2>/dev/null; then :-  as_have_required=yes-else-  as_have_required=no-fi-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :--else-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-as_found=false-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  as_found=:-  case $as_dir in #(-	 /*)-	   for as_base in sh bash ksh sh5; do-	     # Try only shells that exist, to save several forks.-	     as_shell=$as_dir/$as_base-	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&-		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :-  CONFIG_SHELL=$as_shell as_have_required=yes-		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :-  break 2-fi-fi-	   done;;-       esac-  as_found=false-done-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&-	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :-  CONFIG_SHELL=$SHELL as_have_required=yes-fi; }-IFS=$as_save_IFS---      if test "x$CONFIG_SHELL" != x; then :-  # We cannot yet assume a decent shell, so we have to provide a-	# neutralization value for shells without unset; and this also-	# works around shells that cannot unset nonexistent variables.-	BASH_ENV=/dev/null-	ENV=/dev/null-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV-	export CONFIG_SHELL-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}-fi--    if test x$as_have_required = xno; then :-  $as_echo "$0: This script requires a shell more modern than all"-  $as_echo "$0: the shells that I found on your system."-  if test x${ZSH_VERSION+set} = xset ; then-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."-  else-    $as_echo "$0: Please tell bug-autoconf@gnu.org and-$0: libraries@haskell.org about your system, including any-$0: error possibly output before this message. Then install-$0: a modern shell, or manually run the script under such a-$0: shell if you do have one."-  fi-  exit 1-fi-fi-fi-SHELL=${CONFIG_SHELL-/bin/sh}-export SHELL-# Unset more variables known to interfere with behavior of common tools.-CLICOLOR_FORCE= GREP_OPTIONS=-unset CLICOLOR_FORCE GREP_OPTIONS--## --------------------- ##-## M4sh Shell Functions. ##-## --------------------- ##-# as_fn_unset VAR-# ----------------# Portably unset VAR.-as_fn_unset ()-{-  { eval $1=; unset $1;}-}-as_unset=as_fn_unset--# as_fn_set_status STATUS-# ------------------------# Set $? to STATUS, without forking.-as_fn_set_status ()-{-  return $1-} # as_fn_set_status--# as_fn_exit STATUS-# ------------------# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.-as_fn_exit ()-{-  set +e-  as_fn_set_status $1-  exit $1-} # as_fn_exit--# as_fn_mkdir_p-# --------------# Create "$as_dir" as a directory, including parents if necessary.-as_fn_mkdir_p ()-{--  case $as_dir in #(-  -*) as_dir=./$as_dir;;-  esac-  test -d "$as_dir" || eval $as_mkdir_p || {-    as_dirs=-    while :; do-      case $as_dir in #(-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(-      *) as_qdir=$as_dir;;-      esac-      as_dirs="'$as_qdir' $as_dirs"-      as_dir=`$as_dirname -- "$as_dir" ||-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$as_dir" : 'X\(//\)[^/]' \| \-	 X"$as_dir" : 'X\(//\)$' \| \-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||-$as_echo X"$as_dir" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-      test -d "$as_dir" && break-    done-    test -z "$as_dirs" || eval "mkdir $as_dirs"-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"---} # as_fn_mkdir_p-# as_fn_append VAR VALUE-# -----------------------# Append the text in VALUE to the end of the definition contained in VAR. Take-# advantage of any shell optimizations that allow amortized linear growth over-# repeated appends, instead of the typical quadratic growth present in naive-# implementations.-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :-  eval 'as_fn_append ()-  {-    eval $1+=\$2-  }'-else-  as_fn_append ()-  {-    eval $1=\$$1\$2-  }-fi # as_fn_append--# as_fn_arith ARG...-# -------------------# Perform arithmetic evaluation on the ARGs, and store the result in the-# global $as_val. Take advantage of shells that can avoid forks. The arguments-# must be portable across $(()) and expr.-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :-  eval 'as_fn_arith ()-  {-    as_val=$(( $* ))-  }'-else-  as_fn_arith ()-  {-    as_val=`expr "$@" || test $? -eq 1`-  }-fi # as_fn_arith---# as_fn_error STATUS ERROR [LINENO LOG_FD]-# -----------------------------------------# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the-# script with STATUS, using 1 if that was 0.-as_fn_error ()-{-  as_status=$1; test $as_status -eq 0 && as_status=1-  if test "$4"; then-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4-  fi-  $as_echo "$as_me: error: $2" >&2-  as_fn_exit $as_status-} # as_fn_error--if expr a : '\(a\)' >/dev/null 2>&1 &&-   test "X`expr 00001 : '.*\(...\)'`" = X001; then-  as_expr=expr-else-  as_expr=false-fi--if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then-  as_basename=basename-else-  as_basename=false-fi--if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then-  as_dirname=dirname-else-  as_dirname=false-fi--as_me=`$as_basename -- "$0" ||-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \-	 X"$0" : 'X\(//\)$' \| \-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||-$as_echo X/"$0" |-    sed '/^.*\/\([^/][^/]*\)\/*$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`--# Avoid depending upon Character Ranges.-as_cr_letters='abcdefghijklmnopqrstuvwxyz'-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'-as_cr_Letters=$as_cr_letters$as_cr_LETTERS-as_cr_digits='0123456789'-as_cr_alnum=$as_cr_Letters$as_cr_digits---  as_lineno_1=$LINENO as_lineno_1a=$LINENO-  as_lineno_2=$LINENO as_lineno_2a=$LINENO-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)-  sed -n '-    p-    /[$]LINENO/=-  ' <$as_myself |-    sed '-      s/[$]LINENO.*/&-/-      t lineno-      b-      :lineno-      N-      :loop-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/-      t loop-      s/-\n.*//-    ' >$as_me.lineno &&-  chmod +x "$as_me.lineno" ||-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }--  # Don't try to exec as it changes $[0], causing all sort of problems-  # (the dirname of $[0] is not the place where we might find the-  # original and so on.  Autoconf is especially sensitive to this).-  . "./$as_me.lineno"-  # Exit status is that of the last command.-  exit-}--ECHO_C= ECHO_N= ECHO_T=-case `echo -n x` in #(((((--n*)-  case `echo 'xy\c'` in-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.-  xy)  ECHO_C='\c';;-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null-       ECHO_T='	';;-  esac;;-*)-  ECHO_N='-n';;-esac--rm -f conf$$ conf$$.exe conf$$.file-if test -d conf$$.dir; then-  rm -f conf$$.dir/conf$$.file-else-  rm -f conf$$.dir-  mkdir conf$$.dir 2>/dev/null-fi-if (echo >conf$$.file) 2>/dev/null; then-  if ln -s conf$$.file conf$$ 2>/dev/null; then-    as_ln_s='ln -s'-    # ... but there are two gotchas:-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.-    # In both cases, we have to default to `cp -p'.-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||-      as_ln_s='cp -p'-  elif ln conf$$.file conf$$ 2>/dev/null; then-    as_ln_s=ln-  else-    as_ln_s='cp -p'-  fi-else-  as_ln_s='cp -p'-fi-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file-rmdir conf$$.dir 2>/dev/null--if mkdir -p . 2>/dev/null; then-  as_mkdir_p='mkdir -p "$as_dir"'-else-  test -d ./-p && rmdir ./-p-  as_mkdir_p=false-fi--if test -x / >/dev/null 2>&1; then-  as_test_x='test -x'-else-  if ls -dL / >/dev/null 2>&1; then-    as_ls_L_option=L-  else-    as_ls_L_option=-  fi-  as_test_x='-    eval sh -c '\''-      if test -d "$1"; then-	test -d "$1/.";-      else-	case $1 in #(-	-*)set "./$1";;-	esac;-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((-	???[sx]*):;;*)false;;esac;fi-    '\'' sh-  '-fi-as_executable_p=$as_test_x--# Sed expression to map a string onto a valid CPP name.-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"--# Sed expression to map a string onto a valid variable name.-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"---test -n "$DJDIR" || exec 7<&0 </dev/null-exec 6>&1--# Name of the host.-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,-# so uname gets run too.-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`--#-# Initializations.-#-ac_default_prefix=/usr/local-ac_clean_files=-ac_config_libobj_dir=.-LIBOBJS=-cross_compiling=no-subdirs=-MFLAGS=-MAKEFLAGS=--# Identity of this package.-PACKAGE_NAME='Haskell base package'-PACKAGE_TARNAME='base'-PACKAGE_VERSION='1.0'-PACKAGE_STRING='Haskell base package 1.0'-PACKAGE_BUGREPORT='libraries@haskell.org'-PACKAGE_URL=''--ac_unique_file="include/HsBase.h"-# Factoring default headers for most tests.-ac_includes_default="\-#include <stdio.h>-#ifdef HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif-#ifdef HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif-#ifdef STDC_HEADERS-# include <stdlib.h>-# include <stddef.h>-#else-# ifdef HAVE_STDLIB_H-#  include <stdlib.h>-# endif-#endif-#ifdef HAVE_STRING_H-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H-#  include <memory.h>-# endif-# include <string.h>-#endif-#ifdef HAVE_STRINGS_H-# include <strings.h>-#endif-#ifdef HAVE_INTTYPES_H-# include <inttypes.h>-#endif-#ifdef HAVE_STDINT_H-# include <stdint.h>-#endif-#ifdef HAVE_UNISTD_H-# include <unistd.h>-#endif"--ac_subst_vars='LTLIBOBJS-LIBOBJS-EXTRA_LIBS-ICONV_LIB_DIRS-ICONV_INCLUDE_DIRS-EGREP-GREP-CPP-OBJEXT-EXEEXT-ac_ct_CC-CPPFLAGS-LDFLAGS-CFLAGS-CC-target_alias-host_alias-build_alias-LIBS-ECHO_T-ECHO_N-ECHO_C-DEFS-mandir-localedir-libdir-psdir-pdfdir-dvidir-htmldir-infodir-docdir-oldincludedir-includedir-localstatedir-sharedstatedir-sysconfdir-datadir-datarootdir-libexecdir-sbindir-bindir-program_transform_name-prefix-exec_prefix-PACKAGE_URL-PACKAGE_BUGREPORT-PACKAGE_STRING-PACKAGE_VERSION-PACKAGE_TARNAME-PACKAGE_NAME-PATH_SEPARATOR-SHELL'-ac_subst_files=''-ac_user_opts='-enable_option_checking-with_cc-enable_largefile-with_iconv_includes-with_iconv_libraries-'-      ac_precious_vars='build_alias-host_alias-target_alias-CC-CFLAGS-LDFLAGS-LIBS-CPPFLAGS-CPP'---# Initialize some variables set by options.-ac_init_help=-ac_init_version=false-ac_unrecognized_opts=-ac_unrecognized_sep=-# The variables have the same names as the options, with-# dashes changed to underlines.-cache_file=/dev/null-exec_prefix=NONE-no_create=-no_recursion=-prefix=NONE-program_prefix=NONE-program_suffix=NONE-program_transform_name=s,x,x,-silent=-site=-srcdir=-verbose=-x_includes=NONE-x_libraries=NONE--# Installation directory options.-# These are left unexpanded so users can "make install exec_prefix=/foo"-# and all the variables that are supposed to be based on exec_prefix-# by default will actually change.-# Use braces instead of parens because sh, perl, etc. also accept them.-# (The list follows the same order as the GNU Coding Standards.)-bindir='${exec_prefix}/bin'-sbindir='${exec_prefix}/sbin'-libexecdir='${exec_prefix}/libexec'-datarootdir='${prefix}/share'-datadir='${datarootdir}'-sysconfdir='${prefix}/etc'-sharedstatedir='${prefix}/com'-localstatedir='${prefix}/var'-includedir='${prefix}/include'-oldincludedir='/usr/include'-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'-infodir='${datarootdir}/info'-htmldir='${docdir}'-dvidir='${docdir}'-pdfdir='${docdir}'-psdir='${docdir}'-libdir='${exec_prefix}/lib'-localedir='${datarootdir}/locale'-mandir='${datarootdir}/man'--ac_prev=-ac_dashdash=-for ac_option-do-  # If the previous option needs an argument, assign it.-  if test -n "$ac_prev"; then-    eval $ac_prev=\$ac_option-    ac_prev=-    continue-  fi--  case $ac_option in-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;-  *=)   ac_optarg= ;;-  *)    ac_optarg=yes ;;-  esac--  # Accept the important Cygnus configure options, so we can diagnose typos.--  case $ac_dashdash$ac_option in-  --)-    ac_dashdash=yes ;;--  -bindir | --bindir | --bindi | --bind | --bin | --bi)-    ac_prev=bindir ;;-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)-    bindir=$ac_optarg ;;--  -build | --build | --buil | --bui | --bu)-    ac_prev=build_alias ;;-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)-    build_alias=$ac_optarg ;;--  -cache-file | --cache-file | --cache-fil | --cache-fi \-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)-    ac_prev=cache_file ;;-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)-    cache_file=$ac_optarg ;;--  --config-cache | -C)-    cache_file=config.cache ;;--  -datadir | --datadir | --datadi | --datad)-    ac_prev=datadir ;;-  -datadir=* | --datadir=* | --datadi=* | --datad=*)-    datadir=$ac_optarg ;;--  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \-  | --dataroo | --dataro | --datar)-    ac_prev=datarootdir ;;-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)-    datarootdir=$ac_optarg ;;--  -disable-* | --disable-*)-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&-      as_fn_error $? "invalid feature name: $ac_useropt"-    ac_useropt_orig=$ac_useropt-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`-    case $ac_user_opts in-      *"-"enable_$ac_useropt"-"*) ;;-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"-	 ac_unrecognized_sep=', ';;-    esac-    eval enable_$ac_useropt=no ;;--  -docdir | --docdir | --docdi | --doc | --do)-    ac_prev=docdir ;;-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)-    docdir=$ac_optarg ;;--  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)-    ac_prev=dvidir ;;-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)-    dvidir=$ac_optarg ;;--  -enable-* | --enable-*)-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&-      as_fn_error $? "invalid feature name: $ac_useropt"-    ac_useropt_orig=$ac_useropt-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`-    case $ac_user_opts in-      *"-"enable_$ac_useropt"-"*) ;;-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"-	 ac_unrecognized_sep=', ';;-    esac-    eval enable_$ac_useropt=\$ac_optarg ;;--  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \-  | --exec | --exe | --ex)-    ac_prev=exec_prefix ;;-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \-  | --exec=* | --exe=* | --ex=*)-    exec_prefix=$ac_optarg ;;--  -gas | --gas | --ga | --g)-    # Obsolete; use --with-gas.-    with_gas=yes ;;--  -help | --help | --hel | --he | -h)-    ac_init_help=long ;;-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)-    ac_init_help=recursive ;;-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)-    ac_init_help=short ;;--  -host | --host | --hos | --ho)-    ac_prev=host_alias ;;-  -host=* | --host=* | --hos=* | --ho=*)-    host_alias=$ac_optarg ;;--  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)-    ac_prev=htmldir ;;-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \-  | --ht=*)-    htmldir=$ac_optarg ;;--  -includedir | --includedir | --includedi | --included | --include \-  | --includ | --inclu | --incl | --inc)-    ac_prev=includedir ;;-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \-  | --includ=* | --inclu=* | --incl=* | --inc=*)-    includedir=$ac_optarg ;;--  -infodir | --infodir | --infodi | --infod | --info | --inf)-    ac_prev=infodir ;;-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)-    infodir=$ac_optarg ;;--  -libdir | --libdir | --libdi | --libd)-    ac_prev=libdir ;;-  -libdir=* | --libdir=* | --libdi=* | --libd=*)-    libdir=$ac_optarg ;;--  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \-  | --libexe | --libex | --libe)-    ac_prev=libexecdir ;;-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \-  | --libexe=* | --libex=* | --libe=*)-    libexecdir=$ac_optarg ;;--  -localedir | --localedir | --localedi | --localed | --locale)-    ac_prev=localedir ;;-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)-    localedir=$ac_optarg ;;--  -localstatedir | --localstatedir | --localstatedi | --localstated \-  | --localstate | --localstat | --localsta | --localst | --locals)-    ac_prev=localstatedir ;;-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)-    localstatedir=$ac_optarg ;;--  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)-    ac_prev=mandir ;;-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)-    mandir=$ac_optarg ;;--  -nfp | --nfp | --nf)-    # Obsolete; use --without-fp.-    with_fp=no ;;--  -no-create | --no-create | --no-creat | --no-crea | --no-cre \-  | --no-cr | --no-c | -n)-    no_create=yes ;;--  -no-recursion | --no-recursion | --no-recursio | --no-recursi \-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)-    no_recursion=yes ;;--  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \-  | --oldin | --oldi | --old | --ol | --o)-    ac_prev=oldincludedir ;;-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)-    oldincludedir=$ac_optarg ;;--  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)-    ac_prev=prefix ;;-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)-    prefix=$ac_optarg ;;--  -program-prefix | --program-prefix | --program-prefi | --program-pref \-  | --program-pre | --program-pr | --program-p)-    ac_prev=program_prefix ;;-  -program-prefix=* | --program-prefix=* | --program-prefi=* \-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)-    program_prefix=$ac_optarg ;;--  -program-suffix | --program-suffix | --program-suffi | --program-suff \-  | --program-suf | --program-su | --program-s)-    ac_prev=program_suffix ;;-  -program-suffix=* | --program-suffix=* | --program-suffi=* \-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)-    program_suffix=$ac_optarg ;;--  -program-transform-name | --program-transform-name \-  | --program-transform-nam | --program-transform-na \-  | --program-transform-n | --program-transform- \-  | --program-transform | --program-transfor \-  | --program-transfo | --program-transf \-  | --program-trans | --program-tran \-  | --progr-tra | --program-tr | --program-t)-    ac_prev=program_transform_name ;;-  -program-transform-name=* | --program-transform-name=* \-  | --program-transform-nam=* | --program-transform-na=* \-  | --program-transform-n=* | --program-transform-=* \-  | --program-transform=* | --program-transfor=* \-  | --program-transfo=* | --program-transf=* \-  | --program-trans=* | --program-tran=* \-  | --progr-tra=* | --program-tr=* | --program-t=*)-    program_transform_name=$ac_optarg ;;--  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)-    ac_prev=pdfdir ;;-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)-    pdfdir=$ac_optarg ;;--  -psdir | --psdir | --psdi | --psd | --ps)-    ac_prev=psdir ;;-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)-    psdir=$ac_optarg ;;--  -q | -quiet | --quiet | --quie | --qui | --qu | --q \-  | -silent | --silent | --silen | --sile | --sil)-    silent=yes ;;--  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)-    ac_prev=sbindir ;;-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \-  | --sbi=* | --sb=*)-    sbindir=$ac_optarg ;;--  -sharedstatedir | --sharedstatedir | --sharedstatedi \-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \-  | --sharedst | --shareds | --shared | --share | --shar \-  | --sha | --sh)-    ac_prev=sharedstatedir ;;-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \-  | --sha=* | --sh=*)-    sharedstatedir=$ac_optarg ;;--  -site | --site | --sit)-    ac_prev=site ;;-  -site=* | --site=* | --sit=*)-    site=$ac_optarg ;;--  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)-    ac_prev=srcdir ;;-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)-    srcdir=$ac_optarg ;;--  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \-  | --syscon | --sysco | --sysc | --sys | --sy)-    ac_prev=sysconfdir ;;-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)-    sysconfdir=$ac_optarg ;;--  -target | --target | --targe | --targ | --tar | --ta | --t)-    ac_prev=target_alias ;;-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)-    target_alias=$ac_optarg ;;--  -v | -verbose | --verbose | --verbos | --verbo | --verb)-    verbose=yes ;;--  -version | --version | --versio | --versi | --vers | -V)-    ac_init_version=: ;;--  -with-* | --with-*)-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&-      as_fn_error $? "invalid package name: $ac_useropt"-    ac_useropt_orig=$ac_useropt-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`-    case $ac_user_opts in-      *"-"with_$ac_useropt"-"*) ;;-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"-	 ac_unrecognized_sep=', ';;-    esac-    eval with_$ac_useropt=\$ac_optarg ;;--  -without-* | --without-*)-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&-      as_fn_error $? "invalid package name: $ac_useropt"-    ac_useropt_orig=$ac_useropt-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`-    case $ac_user_opts in-      *"-"with_$ac_useropt"-"*) ;;-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"-	 ac_unrecognized_sep=', ';;-    esac-    eval with_$ac_useropt=no ;;--  --x)-    # Obsolete; use --with-x.-    with_x=yes ;;--  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \-  | --x-incl | --x-inc | --x-in | --x-i)-    ac_prev=x_includes ;;-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)-    x_includes=$ac_optarg ;;--  -x-libraries | --x-libraries | --x-librarie | --x-librari \-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)-    ac_prev=x_libraries ;;-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)-    x_libraries=$ac_optarg ;;--  -*) as_fn_error $? "unrecognized option: \`$ac_option'-Try \`$0 --help' for more information"-    ;;--  *=*)-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`-    # Reject names that are not valid shell variable names.-    case $ac_envvar in #(-      '' | [0-9]* | *[!_$as_cr_alnum]* )-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;-    esac-    eval $ac_envvar=\$ac_optarg-    export $ac_envvar ;;--  *)-    # FIXME: should be removed in autoconf 3.0.-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}-    ;;--  esac-done--if test -n "$ac_prev"; then-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`-  as_fn_error $? "missing argument to $ac_option"-fi--if test -n "$ac_unrecognized_opts"; then-  case $enable_option_checking in-    no) ;;-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;-  esac-fi--# Check all directory arguments for consistency.-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \-		datadir sysconfdir sharedstatedir localstatedir includedir \-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \-		libdir localedir mandir-do-  eval ac_val=\$$ac_var-  # Remove trailing slashes.-  case $ac_val in-    */ )-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`-      eval $ac_var=\$ac_val;;-  esac-  # Be sure to have absolute directory names.-  case $ac_val in-    [\\/$]* | ?:[\\/]* )  continue;;-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;-  esac-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"-done--# There might be people who depend on the old broken behavior: `$host'-# used to hold the argument of --host etc.-# FIXME: To remove some day.-build=$build_alias-host=$host_alias-target=$target_alias--# FIXME: To remove some day.-if test "x$host_alias" != x; then-  if test "x$build_alias" = x; then-    cross_compiling=maybe-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.-    If a cross compiler is detected then cross compile mode will be used" >&2-  elif test "x$build_alias" != "x$host_alias"; then-    cross_compiling=yes-  fi-fi--ac_tool_prefix=-test -n "$host_alias" && ac_tool_prefix=$host_alias---test "$silent" = yes && exec 6>/dev/null---ac_pwd=`pwd` && test -n "$ac_pwd" &&-ac_ls_di=`ls -di .` &&-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||-  as_fn_error $? "working directory cannot be determined"-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||-  as_fn_error $? "pwd does not report name of working directory"---# Find the source files, if location was not specified.-if test -z "$srcdir"; then-  ac_srcdir_defaulted=yes-  # Try the directory containing this script, then the parent directory.-  ac_confdir=`$as_dirname -- "$as_myself" ||-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$as_myself" : 'X\(//\)[^/]' \| \-	 X"$as_myself" : 'X\(//\)$' \| \-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||-$as_echo X"$as_myself" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-  srcdir=$ac_confdir-  if test ! -r "$srcdir/$ac_unique_file"; then-    srcdir=..-  fi-else-  ac_srcdir_defaulted=no-fi-if test ! -r "$srcdir/$ac_unique_file"; then-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"-fi-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"-ac_abs_confdir=`(-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"-	pwd)`-# When building in place, set srcdir=.-if test "$ac_abs_confdir" = "$ac_pwd"; then-  srcdir=.-fi-# Remove unnecessary trailing slashes from srcdir.-# Double slashes in file names in object file debugging info-# mess up M-x gdb in Emacs.-case $srcdir in-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;-esac-for ac_var in $ac_precious_vars; do-  eval ac_env_${ac_var}_set=\${${ac_var}+set}-  eval ac_env_${ac_var}_value=\$${ac_var}-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}-  eval ac_cv_env_${ac_var}_value=\$${ac_var}-done--#-# Report the --help message.-#-if test "$ac_init_help" = "long"; then-  # Omit some internal or obsolete options to make the list less imposing.-  # This message is too long to be a string in the A/UX 3.1 sh.-  cat <<_ACEOF-\`configure' configures Haskell base package 1.0 to adapt to many kinds of systems.--Usage: $0 [OPTION]... [VAR=VALUE]...--To assign environment variables (e.g., CC, CFLAGS...), specify them as-VAR=VALUE.  See below for descriptions of some of the useful variables.--Defaults for the options are specified in brackets.--Configuration:-  -h, --help              display this help and exit-      --help=short        display options specific to this package-      --help=recursive    display the short help of all the included packages-  -V, --version           display version information and exit-  -q, --quiet, --silent   do not print \`checking ...' messages-      --cache-file=FILE   cache test results in FILE [disabled]-  -C, --config-cache      alias for \`--cache-file=config.cache'-  -n, --no-create         do not create output files-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']--Installation directories:-  --prefix=PREFIX         install architecture-independent files in PREFIX-                          [$ac_default_prefix]-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX-                          [PREFIX]--By default, \`make install' will install all the files in-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify-an installation prefix other than \`$ac_default_prefix' using \`--prefix',-for instance \`--prefix=\$HOME'.--For better control, use the options below.--Fine tuning of the installation directories:-  --bindir=DIR            user executables [EPREFIX/bin]-  --sbindir=DIR           system admin executables [EPREFIX/sbin]-  --libexecdir=DIR        program executables [EPREFIX/libexec]-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]-  --libdir=DIR            object code libraries [EPREFIX/lib]-  --includedir=DIR        C header files [PREFIX/include]-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]-  --infodir=DIR           info documentation [DATAROOTDIR/info]-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]-  --mandir=DIR            man documentation [DATAROOTDIR/man]-  --docdir=DIR            documentation root [DATAROOTDIR/doc/base]-  --htmldir=DIR           html documentation [DOCDIR]-  --dvidir=DIR            dvi documentation [DOCDIR]-  --pdfdir=DIR            pdf documentation [DOCDIR]-  --psdir=DIR             ps documentation [DOCDIR]-_ACEOF--  cat <<\_ACEOF-_ACEOF-fi--if test -n "$ac_init_help"; then-  case $ac_init_help in-     short | recursive ) echo "Configuration of Haskell base package 1.0:";;-   esac-  cat <<\_ACEOF--Optional Features:-  --disable-option-checking  ignore unrecognized --enable/--with options-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]-  --disable-largefile     omit support for large files--Optional Packages:-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)-C compiler-  --with-iconv-includes   directory containing iconv.h-  --with-iconv-libraries  directory containing iconv library--Some influential environment variables:-  CC          C compiler command-  CFLAGS      C compiler flags-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a-              nonstandard directory <lib dir>-  LIBS        libraries to pass to the linker, e.g. -l<library>-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if-              you have headers in a nonstandard directory <include dir>-  CPP         C preprocessor--Use these variables to override the choices made by `configure' or to help-it to find libraries and programs with nonstandard names/locations.--Report bugs to <libraries@haskell.org>.-_ACEOF-ac_status=$?-fi--if test "$ac_init_help" = "recursive"; then-  # If there are subdirs, report their specific --help.-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue-    test -d "$ac_dir" ||-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||-      continue-    ac_builddir=.--case "$ac_dir" in-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;-*)-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`-  # A ".." for each directory in $ac_dir_suffix.-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`-  case $ac_top_builddir_sub in-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;-  esac ;;-esac-ac_abs_top_builddir=$ac_pwd-ac_abs_builddir=$ac_pwd$ac_dir_suffix-# for backward compatibility:-ac_top_builddir=$ac_top_build_prefix--case $srcdir in-  .)  # We are building in place.-    ac_srcdir=.-    ac_top_srcdir=$ac_top_builddir_sub-    ac_abs_top_srcdir=$ac_pwd ;;-  [\\/]* | ?:[\\/]* )  # Absolute name.-    ac_srcdir=$srcdir$ac_dir_suffix;-    ac_top_srcdir=$srcdir-    ac_abs_top_srcdir=$srcdir ;;-  *) # Relative name.-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix-    ac_top_srcdir=$ac_top_build_prefix$srcdir-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;-esac-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix--    cd "$ac_dir" || { ac_status=$?; continue; }-    # Check for guested configure.-    if test -f "$ac_srcdir/configure.gnu"; then-      echo &&-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive-    elif test -f "$ac_srcdir/configure"; then-      echo &&-      $SHELL "$ac_srcdir/configure" --help=recursive-    else-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2-    fi || ac_status=$?-    cd "$ac_pwd" || { ac_status=$?; break; }-  done-fi--test -n "$ac_init_help" && exit $ac_status-if $ac_init_version; then-  cat <<\_ACEOF-Haskell base package configure 1.0-generated by GNU Autoconf 2.67--Copyright (C) 2010 Free Software Foundation, Inc.-This configure script is free software; the Free Software Foundation-gives unlimited permission to copy, distribute and modify it.-_ACEOF-  exit-fi--## ------------------------ ##-## Autoconf initialization. ##-## ------------------------ ##--# ac_fn_c_try_compile LINENO-# ---------------------------# Try to compile conftest.$ac_ext, and return whether this succeeded.-ac_fn_c_try_compile ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  rm -f conftest.$ac_objext-  if { { ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_compile") 2>conftest.err-  ac_status=$?-  if test -s conftest.err; then-    grep -v '^ *+' conftest.err >conftest.er1-    cat conftest.er1 >&5-    mv -f conftest.er1 conftest.err-  fi-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then :-  ac_retval=0-else-  $as_echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_retval=1-fi-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}-  as_fn_set_status $ac_retval--} # ac_fn_c_try_compile--# ac_fn_c_check_type LINENO TYPE VAR INCLUDES-# --------------------------------------------# Tests whether TYPE exists after having included INCLUDES, setting cache-# variable VAR accordingly.-ac_fn_c_check_type ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-$as_echo_n "checking for $2... " >&6; }-if eval "test \"\${$3+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-else-  eval "$3=no"-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-if (sizeof ($2))-	 return 0;-  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-if (sizeof (($2)))-	    return 0;-  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :--else-  eval "$3=yes"-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-eval ac_res=\$$3-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}--} # ac_fn_c_check_type--# ac_fn_c_try_cpp LINENO-# -----------------------# Try to preprocess conftest.$ac_ext, and return whether this succeeded.-ac_fn_c_try_cpp ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  if { { ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err-  ac_status=$?-  if test -s conftest.err; then-    grep -v '^ *+' conftest.err >conftest.er1-    cat conftest.er1 >&5-    mv -f conftest.er1 conftest.err-  fi-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; } > conftest.i && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then :-  ac_retval=0-else-  $as_echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--    ac_retval=1-fi-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}-  as_fn_set_status $ac_retval--} # ac_fn_c_try_cpp--# ac_fn_c_try_run LINENO-# -----------------------# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes-# that executables *can* be run.-ac_fn_c_try_run ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  if { { ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'-  { { case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }; }; then :-  ac_retval=0-else-  $as_echo "$as_me: program exited with status $ac_status" >&5-       $as_echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--       ac_retval=$ac_status-fi-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}-  as_fn_set_status $ac_retval--} # ac_fn_c_try_run--# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES-# --------------------------------------------------------# Tests whether HEADER exists and can be compiled using the include files in-# INCLUDES, setting the cache variable VAR accordingly.-ac_fn_c_check_header_compile ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-$as_echo_n "checking for $2... " >&6; }-if eval "test \"\${$3+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-#include <$2>-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  eval "$3=yes"-else-  eval "$3=no"-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-eval ac_res=\$$3-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}--} # ac_fn_c_check_header_compile--# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES-# --------------------------------------------------------# Tests whether HEADER exists, giving a warning if it cannot be compiled using-# the include files in INCLUDES and setting the cache variable VAR-# accordingly.-ac_fn_c_check_header_mongrel ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  if eval "test \"\${$3+set}\"" = set; then :-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-$as_echo_n "checking for $2... " >&6; }-if eval "test \"\${$3+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-fi-eval ac_res=\$$3-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-else-  # Is the header compilable?-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5-$as_echo_n "checking $2 usability... " >&6; }-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-#include <$2>-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_header_compiler=yes-else-  ac_header_compiler=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5-$as_echo "$ac_header_compiler" >&6; }--# Is the header present?-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5-$as_echo_n "checking $2 presence... " >&6; }-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <$2>-_ACEOF-if ac_fn_c_try_cpp "$LINENO"; then :-  ac_header_preproc=yes-else-  ac_header_preproc=no-fi-rm -f conftest.err conftest.i conftest.$ac_ext-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5-$as_echo "$ac_header_preproc" >&6; }--# So?  What about this header?-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((-  yes:no: )-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}-    ;;-  no:yes:* )-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}-( $as_echo "## ------------------------------------ ##-## Report this to libraries@haskell.org ##-## ------------------------------------ ##"-     ) | sed "s/^/$as_me: WARNING:     /" >&2-    ;;-esac-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-$as_echo_n "checking for $2... " >&6; }-if eval "test \"\${$3+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-else-  eval "$3=\$ac_header_compiler"-fi-eval ac_res=\$$3-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-fi-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}--} # ac_fn_c_check_header_mongrel--# ac_fn_c_try_link LINENO-# ------------------------# Try to link conftest.$ac_ext, and return whether this succeeded.-ac_fn_c_try_link ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  rm -f conftest.$ac_objext conftest$ac_exeext-  if { { ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_link") 2>conftest.err-  ac_status=$?-  if test -s conftest.err; then-    grep -v '^ *+' conftest.err >conftest.er1-    cat conftest.er1 >&5-    mv -f conftest.er1 conftest.err-  fi-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest$ac_exeext && {-	 test "$cross_compiling" = yes ||-	 $as_test_x conftest$ac_exeext-       }; then :-  ac_retval=0-else-  $as_echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_retval=1-fi-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would-  # interfere with the next link command; also delete a directory that is-  # left behind by Apple's compiler.  We do this before executing the actions.-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}-  as_fn_set_status $ac_retval--} # ac_fn_c_try_link--# ac_fn_c_check_func LINENO FUNC VAR-# -----------------------------------# Tests whether FUNC exists, setting the cache variable VAR accordingly-ac_fn_c_check_func ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-$as_echo_n "checking for $2... " >&6; }-if eval "test \"\${$3+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */-#define $2 innocuous_$2--/* System header to define __stub macros and hopefully few prototypes,-    which can conflict with char $2 (); below.-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-    <limits.h> exists even on freestanding compilers.  */--#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif--#undef $2--/* Override any GCC internal prototype to avoid an error.-   Use char because int might match the return type of a GCC-   builtin and then its argument prototype would still apply.  */-#ifdef __cplusplus-extern "C"-#endif-char $2 ();-/* The GNU C library defines this for functions which it implements-    to always fail with ENOSYS.  Some functions are actually named-    something starting with __ and the normal name is an alias.  */-#if defined __stub_$2 || defined __stub___$2-choke me-#endif--int-main ()-{-return $2 ();-  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_link "$LINENO"; then :-  eval "$3=yes"-else-  eval "$3=no"-fi-rm -f core conftest.err conftest.$ac_objext \-    conftest$ac_exeext conftest.$ac_ext-fi-eval ac_res=\$$3-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}--} # ac_fn_c_check_func--# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES-# ---------------------------------------------# Tries to find the compile-time value of EXPR in a program that includes-# INCLUDES, setting VAR accordingly. Returns whether the value could be-# computed-ac_fn_c_compute_int ()-{-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-  if test "$cross_compiling" = yes; then-    # Depending upon the size, compute the lo and hi bounds.-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-static int test_array [1 - 2 * !(($2) >= 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_lo=0 ac_mid=0-  while :; do-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-static int test_array [1 - 2 * !(($2) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_hi=$ac_mid; break-else-  as_fn_arith $ac_mid + 1 && ac_lo=$as_val-			if test $ac_lo -le $ac_mid; then-			  ac_lo= ac_hi=-			  break-			fi-			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-static int test_array [1 - 2 * !(($2) < 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_hi=-1 ac_mid=-1-  while :; do-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-static int test_array [1 - 2 * !(($2) >= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_lo=$ac_mid; break-else-  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val-			if test $ac_mid -le $ac_hi; then-			  ac_lo= ac_hi=-			  break-			fi-			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  ac_lo= ac_hi=-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-# Binary search between lo and hi bounds.-while test "x$ac_lo" != "x$ac_hi"; do-  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-int-main ()-{-static int test_array [1 - 2 * !(($2) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_hi=$ac_mid-else-  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-done-case $ac_lo in #((-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;-'') ac_retval=1 ;;-esac-  else-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-$4-static long int longval () { return $2; }-static unsigned long int ulongval () { return $2; }-#include <stdio.h>-#include <stdlib.h>-int-main ()-{--  FILE *f = fopen ("conftest.val", "w");-  if (! f)-    return 1;-  if (($2) < 0)-    {-      long int i = longval ();-      if (i != ($2))-	return 1;-      fprintf (f, "%ld", i);-    }-  else-    {-      unsigned long int i = ulongval ();-      if (i != ($2))-	return 1;-      fprintf (f, "%lu", i);-    }-  /* Do not output a trailing newline, as this causes \r\n confusion-     on some platforms.  */-  return ferror (f) || fclose (f) != 0;--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_run "$LINENO"; then :-  echo >>conftest.val; read $3 <conftest.val; ac_retval=0-else-  ac_retval=1-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \-  conftest.$ac_objext conftest.beam conftest.$ac_ext-rm -f conftest.val--  fi-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}-  as_fn_set_status $ac_retval--} # ac_fn_c_compute_int-cat >config.log <<_ACEOF-This file contains any messages produced by compilers while-running configure, to aid debugging if configure makes a mistake.--It was created by Haskell base package $as_me 1.0, which was-generated by GNU Autoconf 2.67.  Invocation command line was--  $ $0 $@--_ACEOF-exec 5>>config.log-{-cat <<_ASUNAME-## --------- ##-## Platform. ##-## --------- ##--hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`-uname -m = `(uname -m) 2>/dev/null || echo unknown`-uname -r = `(uname -r) 2>/dev/null || echo unknown`-uname -s = `(uname -s) 2>/dev/null || echo unknown`-uname -v = `(uname -v) 2>/dev/null || echo unknown`--/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`--/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`--_ASUNAME--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    $as_echo "PATH: $as_dir"-  done-IFS=$as_save_IFS--} >&5--cat >&5 <<_ACEOF---## ----------- ##-## Core tests. ##-## ----------- ##--_ACEOF---# Keep a trace of the command line.-# Strip out --no-create and --no-recursion so they do not pile up.-# Strip out --silent because we don't want to record it for future runs.-# Also quote any args containing shell meta-characters.-# Make two passes to allow for proper duplicate-argument suppression.-ac_configure_args=-ac_configure_args0=-ac_configure_args1=-ac_must_keep_next=false-for ac_pass in 1 2-do-  for ac_arg-  do-    case $ac_arg in-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \-    | -silent | --silent | --silen | --sile | --sil)-      continue ;;-    *\'*)-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;-    esac-    case $ac_pass in-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;-    2)-      as_fn_append ac_configure_args1 " '$ac_arg'"-      if test $ac_must_keep_next = true; then-	ac_must_keep_next=false # Got value, back to normal.-      else-	case $ac_arg in-	  *=* | --config-cache | -C | -disable-* | --disable-* \-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \-	  | -with-* | --with-* | -without-* | --without-* | --x)-	    case "$ac_configure_args0 " in-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;-	    esac-	    ;;-	  -* ) ac_must_keep_next=true ;;-	esac-      fi-      as_fn_append ac_configure_args " '$ac_arg'"-      ;;-    esac-  done-done-{ ac_configure_args0=; unset ac_configure_args0;}-{ ac_configure_args1=; unset ac_configure_args1;}--# When interrupted or exit'd, cleanup temporary files, and complete-# config.log.  We remove comments because anyway the quotes in there-# would cause problems or look ugly.-# WARNING: Use '\'' to represent an apostrophe within the trap.-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.-trap 'exit_status=$?-  # Save into config.log some information that might help in debugging.-  {-    echo--    $as_echo "## ---------------- ##-## Cache variables. ##-## ---------------- ##"-    echo-    # The following way of writing the cache mishandles newlines in values,-(-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do-    eval ac_val=\$$ac_var-    case $ac_val in #(-    *${as_nl}*)-      case $ac_var in #(-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;-      esac-      case $ac_var in #(-      _ | IFS | as_nl) ;; #(-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(-      *) { eval $ac_var=; unset $ac_var;} ;;-      esac ;;-    esac-  done-  (set) 2>&1 |-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(-    *${as_nl}ac_space=\ *)-      sed -n \-	"s/'\''/'\''\\\\'\'''\''/g;-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"-      ;; #(-    *)-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"-      ;;-    esac |-    sort-)-    echo--    $as_echo "## ----------------- ##-## Output variables. ##-## ----------------- ##"-    echo-    for ac_var in $ac_subst_vars-    do-      eval ac_val=\$$ac_var-      case $ac_val in-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;-      esac-      $as_echo "$ac_var='\''$ac_val'\''"-    done | sort-    echo--    if test -n "$ac_subst_files"; then-      $as_echo "## ------------------- ##-## File substitutions. ##-## ------------------- ##"-      echo-      for ac_var in $ac_subst_files-      do-	eval ac_val=\$$ac_var-	case $ac_val in-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;-	esac-	$as_echo "$ac_var='\''$ac_val'\''"-      done | sort-      echo-    fi--    if test -s confdefs.h; then-      $as_echo "## ----------- ##-## confdefs.h. ##-## ----------- ##"-      echo-      cat confdefs.h-      echo-    fi-    test "$ac_signal" != 0 &&-      $as_echo "$as_me: caught signal $ac_signal"-    $as_echo "$as_me: exit $exit_status"-  } >&5-  rm -f core *.core core.conftest.* &&-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&-    exit $exit_status-' 0-for ac_signal in 1 2 13 15; do-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal-done-ac_signal=0--# confdefs.h avoids OS command line length limits that DEFS can exceed.-rm -f -r conftest* confdefs.h--$as_echo "/* confdefs.h */" > confdefs.h--# Predefined preprocessor variables.--cat >>confdefs.h <<_ACEOF-#define PACKAGE_NAME "$PACKAGE_NAME"-_ACEOF--cat >>confdefs.h <<_ACEOF-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"-_ACEOF--cat >>confdefs.h <<_ACEOF-#define PACKAGE_VERSION "$PACKAGE_VERSION"-_ACEOF--cat >>confdefs.h <<_ACEOF-#define PACKAGE_STRING "$PACKAGE_STRING"-_ACEOF--cat >>confdefs.h <<_ACEOF-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"-_ACEOF--cat >>confdefs.h <<_ACEOF-#define PACKAGE_URL "$PACKAGE_URL"-_ACEOF---# Let the site file select an alternate cache file if it wants to.-# Prefer an explicitly selected file to automatically selected ones.-ac_site_file1=NONE-ac_site_file2=NONE-if test -n "$CONFIG_SITE"; then-  # We do not want a PATH search for config.site.-  case $CONFIG_SITE in #((-    -*)  ac_site_file1=./$CONFIG_SITE;;-    */*) ac_site_file1=$CONFIG_SITE;;-    *)   ac_site_file1=./$CONFIG_SITE;;-  esac-elif test "x$prefix" != xNONE; then-  ac_site_file1=$prefix/share/config.site-  ac_site_file2=$prefix/etc/config.site-else-  ac_site_file1=$ac_default_prefix/share/config.site-  ac_site_file2=$ac_default_prefix/etc/config.site-fi-for ac_site_file in "$ac_site_file1" "$ac_site_file2"-do-  test "x$ac_site_file" = xNONE && continue-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5-$as_echo "$as_me: loading site script $ac_site_file" >&6;}-    sed 's/^/| /' "$ac_site_file" >&5-    . "$ac_site_file" \-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "failed to load site script $ac_site_file-See \`config.log' for more details" "$LINENO" 5 ; }-  fi-done--if test -r "$cache_file"; then-  # Some versions of bash will fail to source /dev/null (special files-  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.-  if test /dev/null != "$cache_file" && test -f "$cache_file"; then-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5-$as_echo "$as_me: loading cache $cache_file" >&6;}-    case $cache_file in-      [\\/]* | ?:[\\/]* ) . "$cache_file";;-      *)                      . "./$cache_file";;-    esac-  fi-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5-$as_echo "$as_me: creating cache $cache_file" >&6;}-  >$cache_file-fi--# Check that the precious variables saved in the cache have kept the same-# value.-ac_cache_corrupted=false-for ac_var in $ac_precious_vars; do-  eval ac_old_set=\$ac_cv_env_${ac_var}_set-  eval ac_new_set=\$ac_env_${ac_var}_set-  eval ac_old_val=\$ac_cv_env_${ac_var}_value-  eval ac_new_val=\$ac_env_${ac_var}_value-  case $ac_old_set,$ac_new_set in-    set,)-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}-      ac_cache_corrupted=: ;;-    ,set)-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}-      ac_cache_corrupted=: ;;-    ,);;-    *)-      if test "x$ac_old_val" != "x$ac_new_val"; then-	# differences in whitespace do not lead to failure.-	ac_old_val_w=`echo x $ac_old_val`-	ac_new_val_w=`echo x $ac_new_val`-	if test "$ac_old_val_w" != "$ac_new_val_w"; then-	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}-	  ac_cache_corrupted=:-	else-	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}-	  eval $ac_var=\$ac_old_val-	fi-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}-      fi;;-  esac-  # Pass precious variables to config.status.-  if test "$ac_new_set" = set; then-    case $ac_new_val in-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;-    *) ac_arg=$ac_var=$ac_new_val ;;-    esac-    case " $ac_configure_args " in-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;-    esac-  fi-done-if $ac_cache_corrupted; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5-fi-## -------------------- ##-## Main body of script. ##-## -------------------- ##--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu----# Safety check: Ensure that we are in the correct source directory.---ac_config_headers="$ac_config_headers include/HsBaseConfig.h include/EventConfig.h"----# Check whether --with-cc was given.-if test "${with_cc+set}" = set; then :-  withval=$with_cc; CC=$withval-fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu-if test -n "$ac_tool_prefix"; then-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.-set dummy ${ac_tool_prefix}gcc; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if test "${ac_cv_prog_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_CC="${ac_tool_prefix}gcc"-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-  done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-$as_echo "$CC" >&6; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi---fi-if test -z "$ac_cv_prog_CC"; then-  ac_ct_CC=$CC-  # Extract the first word of "gcc", so it can be a program name with args.-set dummy gcc; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -n "$ac_ct_CC"; then-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_ac_ct_CC="gcc"-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-  done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5-$as_echo "$ac_ct_CC" >&6; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi--  if test "x$ac_ct_CC" = x; then-    CC=""-  else-    case $cross_compiling:$ac_tool_warned in-yes:)-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}-ac_tool_warned=yes ;;-esac-    CC=$ac_ct_CC-  fi-else-  CC="$ac_cv_prog_CC"-fi--if test -z "$CC"; then-          if test -n "$ac_tool_prefix"; then-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.-set dummy ${ac_tool_prefix}cc; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if test "${ac_cv_prog_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_CC="${ac_tool_prefix}cc"-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-  done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-$as_echo "$CC" >&6; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi---  fi-fi-if test -z "$CC"; then-  # Extract the first word of "cc", so it can be a program name with args.-set dummy cc; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if test "${ac_cv_prog_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-  ac_prog_rejected=no-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then-       ac_prog_rejected=yes-       continue-     fi-    ac_cv_prog_CC="cc"-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-  done-IFS=$as_save_IFS--if test $ac_prog_rejected = yes; then-  # We found a bogon in the path, so make sure we never use it.-  set dummy $ac_cv_prog_CC-  shift-  if test $# != 0; then-    # We chose a different compiler from the bogus one.-    # However, it has the same basename, so the bogon will be chosen-    # first if we set CC to just the basename; use the full file name.-    shift-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"-  fi-fi-fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-$as_echo "$CC" >&6; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi---fi-if test -z "$CC"; then-  if test -n "$ac_tool_prefix"; then-  for ac_prog in cl.exe-  do-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.-set dummy $ac_tool_prefix$ac_prog; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if test "${ac_cv_prog_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-  done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-$as_echo "$CC" >&6; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi---    test -n "$CC" && break-  done-fi-if test -z "$CC"; then-  ac_ct_CC=$CC-  for ac_prog in cl.exe-do-  # Extract the first word of "$ac_prog", so it can be a program name with args.-set dummy $ac_prog; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -n "$ac_ct_CC"; then-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_ac_ct_CC="$ac_prog"-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-  done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5-$as_echo "$ac_ct_CC" >&6; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi---  test -n "$ac_ct_CC" && break-done--  if test "x$ac_ct_CC" = x; then-    CC=""-  else-    case $cross_compiling:$ac_tool_warned in-yes:)-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}-ac_tool_warned=yes ;;-esac-    CC=$ac_ct_CC-  fi-fi--fi---test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "no acceptable C compiler found in \$PATH-See \`config.log' for more details" "$LINENO" 5 ; }--# Provide some information about the compiler.-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5-set X $ac_compile-ac_compiler=$2-for ac_option in --version -v -V -qversion; do-  { { ac_try="$ac_compiler $ac_option >&5"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err-  ac_status=$?-  if test -s conftest.err; then-    sed '10a\-... rest of stderr output deleted ...-         10q' conftest.err >conftest.er1-    cat conftest.er1 >&5-  fi-  rm -f conftest.er1 conftest.err-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }-done--cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-ac_clean_files_save=$ac_clean_files-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"-# Try to create an executable without -o first, disregard a.out.-# It will help us diagnose broken compilers, and finding out an intuition-# of exeext.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5-$as_echo_n "checking whether the C compiler works... " >&6; }-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`--# The possible output files:-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"--ac_rmfiles=-for ac_file in $ac_files-do-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;-  esac-done-rm -f $ac_rmfiles--if { { ac_try="$ac_link_default"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_link_default") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }; then :-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'-# in a Makefile.  We should not override ac_cv_exeext if it was cached,-# so that the user can short-circuit this test for compilers unknown to-# Autoconf.-for ac_file in $ac_files ''-do-  test -f "$ac_file" || continue-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )-	;;-    [ab].out )-	# We found the default executable, but exeext='' is most-	# certainly right.-	break;;-    *.* )-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;-	then :; else-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`-	fi-	# We set ac_cv_exeext here because the later test for it is not-	# safe: cross compilers may not add the suffix if given an `-o'-	# argument, so we may need to know it at that point already.-	# Even if this section looks crufty: it has the advantage of-	# actually working.-	break;;-    * )-	break;;-  esac-done-test "$ac_cv_exeext" = no && ac_cv_exeext=--else-  ac_file=''-fi-if test -z "$ac_file"; then :-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-$as_echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "C compiler cannot create executables-See \`config.log' for more details" "$LINENO" 5 ; }-else-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5-$as_echo "yes" >&6; }-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5-$as_echo_n "checking for C compiler default output file name... " >&6; }-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5-$as_echo "$ac_file" >&6; }-ac_exeext=$ac_cv_exeext--rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out-ac_clean_files=$ac_clean_files_save-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5-$as_echo_n "checking for suffix of executables... " >&6; }-if { { ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }; then :-  # If both `conftest.exe' and `conftest' are `present' (well, observable)-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will-# work properly (i.e., refer to `conftest.exe'), while it won't with-# `rm'.-for ac_file in conftest.exe conftest conftest.*; do-  test -f "$ac_file" || continue-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`-	  break;;-    * ) break;;-  esac-done-else-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "cannot compute suffix of executables: cannot compile and link-See \`config.log' for more details" "$LINENO" 5 ; }-fi-rm -f conftest conftest$ac_cv_exeext-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5-$as_echo "$ac_cv_exeext" >&6; }--rm -f conftest.$ac_ext-EXEEXT=$ac_cv_exeext-ac_exeext=$EXEEXT-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <stdio.h>-int-main ()-{-FILE *f = fopen ("conftest.out", "w");- return ferror (f) || fclose (f) != 0;--  ;-  return 0;-}-_ACEOF-ac_clean_files="$ac_clean_files conftest.out"-# Check that the compiler produces executables we can run.  If not, either-# the compiler is broken, or we cross compile.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5-$as_echo_n "checking whether we are cross compiling... " >&6; }-if test "$cross_compiling" != yes; then-  { { ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }-  if { ac_try='./conftest$ac_cv_exeext'-  { { case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }; }; then-    cross_compiling=no-  else-    if test "$cross_compiling" = maybe; then-	cross_compiling=yes-    else-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "cannot run C compiled programs.-If you meant to cross compile, use \`--host'.-See \`config.log' for more details" "$LINENO" 5 ; }-    fi-  fi-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5-$as_echo "$cross_compiling" >&6; }--rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out-ac_clean_files=$ac_clean_files_save-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5-$as_echo_n "checking for suffix of object files... " >&6; }-if test "${ac_cv_objext+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.o conftest.obj-if { { ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-$as_echo "$ac_try_echo"; } >&5-  (eval "$ac_compile") 2>&5-  ac_status=$?-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5-  test $ac_status = 0; }; then :-  for ac_file in conftest.o conftest.obj conftest.*; do-  test -f "$ac_file" || continue;-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`-       break;;-  esac-done-else-  $as_echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "cannot compute suffix of object files: cannot compile-See \`config.log' for more details" "$LINENO" 5 ; }-fi-rm -f conftest.$ac_cv_objext conftest.$ac_ext-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5-$as_echo "$ac_cv_objext" >&6; }-OBJEXT=$ac_cv_objext-ac_objext=$OBJEXT-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }-if test "${ac_cv_c_compiler_gnu+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--int-main ()-{-#ifndef __GNUC__-       choke me-#endif--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_compiler_gnu=yes-else-  ac_compiler_gnu=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-ac_cv_c_compiler_gnu=$ac_compiler_gnu--fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5-$as_echo "$ac_cv_c_compiler_gnu" >&6; }-if test $ac_compiler_gnu = yes; then-  GCC=yes-else-  GCC=-fi-ac_test_CFLAGS=${CFLAGS+set}-ac_save_CFLAGS=$CFLAGS-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5-$as_echo_n "checking whether $CC accepts -g... " >&6; }-if test "${ac_cv_prog_cc_g+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  ac_save_c_werror_flag=$ac_c_werror_flag-   ac_c_werror_flag=yes-   ac_cv_prog_cc_g=no-   CFLAGS="-g"-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_prog_cc_g=yes-else-  CFLAGS=""-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :--else-  ac_c_werror_flag=$ac_save_c_werror_flag-	 CFLAGS="-g"-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_prog_cc_g=yes-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-   ac_c_werror_flag=$ac_save_c_werror_flag-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5-$as_echo "$ac_cv_prog_cc_g" >&6; }-if test "$ac_test_CFLAGS" = set; then-  CFLAGS=$ac_save_CFLAGS-elif test $ac_cv_prog_cc_g = yes; then-  if test "$GCC" = yes; then-    CFLAGS="-g -O2"-  else-    CFLAGS="-g"-  fi-else-  if test "$GCC" = yes; then-    CFLAGS="-O2"-  else-    CFLAGS=-  fi-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }-if test "${ac_cv_prog_cc_c89+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  ac_cv_prog_cc_c89=no-ac_save_CC=$CC-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <stdarg.h>-#include <stdio.h>-#include <sys/types.h>-#include <sys/stat.h>-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */-struct buf { int x; };-FILE * (*rcsopen) (struct buf *, struct stat *, int);-static char *e (p, i)-     char **p;-     int i;-{-  return p[i];-}-static char *f (char * (*g) (char **, int), char **p, ...)-{-  char *s;-  va_list v;-  va_start (v,p);-  s = g (p, va_arg (v,int));-  va_end (v);-  return s;-}--/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has-   function prototypes and stuff, but not '\xHH' hex character constants.-   These don't provoke an error unfortunately, instead are silently treated-   as 'x'.  The following induces an error, until -std is added to get-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an-   array size at least.  It's necessary to write '\x00'==0 to get something-   that's true only with -std.  */-int osf4_cc_array ['\x00' == 0 ? 1 : -1];--/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters-   inside strings and character constants.  */-#define FOO(x) 'x'-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];--int test (int i, double x);-struct s1 {int (*f) (int a);};-struct s2 {int (*f) (double a);};-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);-int argc;-char **argv;-int-main ()-{-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];-  ;-  return 0;-}-_ACEOF-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"-do-  CC="$ac_save_CC $ac_arg"-  if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_prog_cc_c89=$ac_arg-fi-rm -f core conftest.err conftest.$ac_objext-  test "x$ac_cv_prog_cc_c89" != "xno" && break-done-rm -f conftest.$ac_ext-CC=$ac_save_CC--fi-# AC_CACHE_VAL-case "x$ac_cv_prog_cc_c89" in-  x)-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5-$as_echo "none needed" >&6; } ;;-  xno)-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5-$as_echo "unsupported" >&6; } ;;-  *)-    CC="$CC $ac_cv_prog_cc_c89"-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;-esac-if test "x$ac_cv_prog_cc_c89" != xno; then :--fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu---case `uname -s` in-    MINGW*|CYGWIN*)-        WINDOWS=YES;;-    *)-        WINDOWS=NO;;-esac--# do we have long longs?--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5-$as_echo_n "checking how to run the C preprocessor... " >&6; }-# On Suns, sometimes $CPP names a directory.-if test -n "$CPP" && test -d "$CPP"; then-  CPP=-fi-if test -z "$CPP"; then-  if test "${ac_cv_prog_CPP+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-      # Double quotes because CPP needs to be expanded-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"-    do-      ac_preproc_ok=false-for ac_c_preproc_warn_flag in '' yes-do-  # Use a header file that comes with gcc, so configuring glibc-  # with a fresh cross-compiler works.-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-  # <limits.h> exists even on freestanding compilers.-  # On the NeXT, cc -E runs the code through the compiler's parser,-  # not just through cpp. "Syntax error" is here to catch this case.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif-		     Syntax error-_ACEOF-if ac_fn_c_try_cpp "$LINENO"; then :--else-  # Broken: fails on valid input.-continue-fi-rm -f conftest.err conftest.i conftest.$ac_ext--  # OK, works on sane cases.  Now check whether nonexistent headers-  # can be detected and how.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <ac_nonexistent.h>-_ACEOF-if ac_fn_c_try_cpp "$LINENO"; then :-  # Broken: success on invalid input.-continue-else-  # Passes both tests.-ac_preproc_ok=:-break-fi-rm -f conftest.err conftest.i conftest.$ac_ext--done-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.-rm -f conftest.i conftest.err conftest.$ac_ext-if $ac_preproc_ok; then :-  break-fi--    done-    ac_cv_prog_CPP=$CPP--fi-  CPP=$ac_cv_prog_CPP-else-  ac_cv_prog_CPP=$CPP-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5-$as_echo "$CPP" >&6; }-ac_preproc_ok=false-for ac_c_preproc_warn_flag in '' yes-do-  # Use a header file that comes with gcc, so configuring glibc-  # with a fresh cross-compiler works.-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-  # <limits.h> exists even on freestanding compilers.-  # On the NeXT, cc -E runs the code through the compiler's parser,-  # not just through cpp. "Syntax error" is here to catch this case.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif-		     Syntax error-_ACEOF-if ac_fn_c_try_cpp "$LINENO"; then :--else-  # Broken: fails on valid input.-continue-fi-rm -f conftest.err conftest.i conftest.$ac_ext--  # OK, works on sane cases.  Now check whether nonexistent headers-  # can be detected and how.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <ac_nonexistent.h>-_ACEOF-if ac_fn_c_try_cpp "$LINENO"; then :-  # Broken: success on invalid input.-continue-else-  # Passes both tests.-ac_preproc_ok=:-break-fi-rm -f conftest.err conftest.i conftest.$ac_ext--done-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.-rm -f conftest.i conftest.err conftest.$ac_ext-if $ac_preproc_ok; then :--else-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check-See \`config.log' for more details" "$LINENO" 5 ; }-fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu---{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }-if test "${ac_cv_path_GREP+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if test -z "$GREP"; then-  ac_path_GREP_found=false-  # Loop through the user's path and test for each of PROGNAME-LIST-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_prog in grep ggrep; do-    for ac_exec_ext in '' $ac_executable_extensions; do-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue-# Check for GNU ac_path_GREP and select it if it is found.-  # Check for GNU $ac_path_GREP-case `"$ac_path_GREP" --version 2>&1` in-*GNU*)-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;-*)-  ac_count=0-  $as_echo_n 0123456789 >"conftest.in"-  while :-  do-    cat "conftest.in" "conftest.in" >"conftest.tmp"-    mv "conftest.tmp" "conftest.in"-    cp "conftest.in" "conftest.nl"-    $as_echo 'GREP' >> "conftest.nl"-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break-    as_fn_arith $ac_count + 1 && ac_count=$as_val-    if test $ac_count -gt ${ac_path_GREP_max-0}; then-      # Best one so far, save it but keep looking for a better one-      ac_cv_path_GREP="$ac_path_GREP"-      ac_path_GREP_max=$ac_count-    fi-    # 10*(2^10) chars as input seems more than enough-    test $ac_count -gt 10 && break-  done-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;-esac--      $ac_path_GREP_found && break 3-    done-  done-  done-IFS=$as_save_IFS-  if test -z "$ac_cv_path_GREP"; then-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5-  fi-else-  ac_cv_path_GREP=$GREP-fi--fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5-$as_echo "$ac_cv_path_GREP" >&6; }- GREP="$ac_cv_path_GREP"---{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5-$as_echo_n "checking for egrep... " >&6; }-if test "${ac_cv_path_EGREP+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1-   then ac_cv_path_EGREP="$GREP -E"-   else-     if test -z "$EGREP"; then-  ac_path_EGREP_found=false-  # Loop through the user's path and test for each of PROGNAME-LIST-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    for ac_prog in egrep; do-    for ac_exec_ext in '' $ac_executable_extensions; do-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue-# Check for GNU ac_path_EGREP and select it if it is found.-  # Check for GNU $ac_path_EGREP-case `"$ac_path_EGREP" --version 2>&1` in-*GNU*)-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;-*)-  ac_count=0-  $as_echo_n 0123456789 >"conftest.in"-  while :-  do-    cat "conftest.in" "conftest.in" >"conftest.tmp"-    mv "conftest.tmp" "conftest.in"-    cp "conftest.in" "conftest.nl"-    $as_echo 'EGREP' >> "conftest.nl"-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break-    as_fn_arith $ac_count + 1 && ac_count=$as_val-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then-      # Best one so far, save it but keep looking for a better one-      ac_cv_path_EGREP="$ac_path_EGREP"-      ac_path_EGREP_max=$ac_count-    fi-    # 10*(2^10) chars as input seems more than enough-    test $ac_count -gt 10 && break-  done-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;-esac--      $ac_path_EGREP_found && break 3-    done-  done-  done-IFS=$as_save_IFS-  if test -z "$ac_cv_path_EGREP"; then-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5-  fi-else-  ac_cv_path_EGREP=$EGREP-fi--   fi-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5-$as_echo "$ac_cv_path_EGREP" >&6; }- EGREP="$ac_cv_path_EGREP"---{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5-$as_echo_n "checking for ANSI C header files... " >&6; }-if test "${ac_cv_header_stdc+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <stdlib.h>-#include <stdarg.h>-#include <string.h>-#include <float.h>--int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_header_stdc=yes-else-  ac_cv_header_stdc=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext--if test $ac_cv_header_stdc = yes; then-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <string.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "memchr" >/dev/null 2>&1; then :--else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <stdlib.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "free" >/dev/null 2>&1; then :--else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.-  if test "$cross_compiling" = yes; then :-  :-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <ctype.h>-#include <stdlib.h>-#if ((' ' & 0x0FF) == 0x020)-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))-#else-# define ISLOWER(c) \-		   (('a' <= (c) && (c) <= 'i') \-		     || ('j' <= (c) && (c) <= 'r') \-		     || ('s' <= (c) && (c) <= 'z'))-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))-#endif--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))-int-main ()-{-  int i;-  for (i = 0; i < 256; i++)-    if (XOR (islower (i), ISLOWER (i))-	|| toupper (i) != TOUPPER (i))-      return 2;-  return 0;-}-_ACEOF-if ac_fn_c_try_run "$LINENO"; then :--else-  ac_cv_header_stdc=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \-  conftest.$ac_objext conftest.beam conftest.$ac_ext-fi--fi-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5-$as_echo "$ac_cv_header_stdc" >&6; }-if test $ac_cv_header_stdc = yes; then--$as_echo "#define STDC_HEADERS 1" >>confdefs.h--fi--# On IRIX 5.3, sys/types and inttypes.h are conflicting.-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \-		  inttypes.h stdint.h unistd.h-do :-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default-"-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :-  cat >>confdefs.h <<_ACEOF-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1-_ACEOF--fi--done---ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"-if test "x$ac_cv_type_long_long" = x""yes; then :--cat >>confdefs.h <<_ACEOF-#define HAVE_LONG_LONG 1-_ACEOF---fi---{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5-$as_echo_n "checking for ANSI C header files... " >&6; }-if test "${ac_cv_header_stdc+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <stdlib.h>-#include <stdarg.h>-#include <string.h>-#include <float.h>--int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_header_stdc=yes-else-  ac_cv_header_stdc=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext--if test $ac_cv_header_stdc = yes; then-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <string.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "memchr" >/dev/null 2>&1; then :--else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <stdlib.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "free" >/dev/null 2>&1; then :--else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.-  if test "$cross_compiling" = yes; then :-  :-else-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <ctype.h>-#include <stdlib.h>-#if ((' ' & 0x0FF) == 0x020)-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))-#else-# define ISLOWER(c) \-		   (('a' <= (c) && (c) <= 'i') \-		     || ('j' <= (c) && (c) <= 'r') \-		     || ('s' <= (c) && (c) <= 'z'))-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))-#endif--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))-int-main ()-{-  int i;-  for (i = 0; i < 256; i++)-    if (XOR (islower (i), ISLOWER (i))-	|| toupper (i) != TOUPPER (i))-      return 2;-  return 0;-}-_ACEOF-if ac_fn_c_try_run "$LINENO"; then :--else-  ac_cv_header_stdc=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \-  conftest.$ac_objext conftest.beam conftest.$ac_ext-fi--fi-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5-$as_echo "$ac_cv_header_stdc" >&6; }-if test $ac_cv_header_stdc = yes; then--$as_echo "#define STDC_HEADERS 1" >>confdefs.h--fi---# check for specific header (.h) files that we are interested in-for ac_header in ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h-do :-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :-  cat >>confdefs.h <<_ACEOF-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1-_ACEOF--fi--done---# Enable large file support. Do this before testing the types ino_t, off_t, and-# rlim_t, because it will affect the result of that test.-# Check whether --enable-largefile was given.-if test "${enable_largefile+set}" = set; then :-  enableval=$enable_largefile;-fi--if test "$enable_largefile" != no; then--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }-if test "${ac_cv_sys_largefile_CC+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  ac_cv_sys_largefile_CC=no-     if test "$GCC" != yes; then-       ac_save_CC=$CC-       while :; do-	 # IRIX 6.2 and later do not support large files by default,-	 # so use the C compiler's -n32 option if that helps.-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-	 if ac_fn_c_try_compile "$LINENO"; then :-  break-fi-rm -f core conftest.err conftest.$ac_objext-	 CC="$CC -n32"-	 if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_sys_largefile_CC=' -n32'; break-fi-rm -f core conftest.err conftest.$ac_objext-	 break-       done-       CC=$ac_save_CC-       rm -f conftest.$ac_ext-    fi-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5-$as_echo "$ac_cv_sys_largefile_CC" >&6; }-  if test "$ac_cv_sys_largefile_CC" != no; then-    CC=$CC$ac_cv_sys_largefile_CC-  fi--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }-if test "${ac_cv_sys_file_offset_bits+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  while :; do-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_sys_file_offset_bits=no; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#define _FILE_OFFSET_BITS 64-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_sys_file_offset_bits=64; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  ac_cv_sys_file_offset_bits=unknown-  break-done-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }-case $ac_cv_sys_file_offset_bits in #(-  no | unknown) ;;-  *)-cat >>confdefs.h <<_ACEOF-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits-_ACEOF-;;-esac-rm -rf conftest*-  if test $ac_cv_sys_file_offset_bits = unknown; then-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }-if test "${ac_cv_sys_large_files+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  while :; do-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_sys_large_files=no; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#define _LARGE_FILES 1-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"; then :-  ac_cv_sys_large_files=1; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  ac_cv_sys_large_files=unknown-  break-done-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5-$as_echo "$ac_cv_sys_large_files" >&6; }-case $ac_cv_sys_large_files in #(-  no | unknown) ;;-  *)-cat >>confdefs.h <<_ACEOF-#define _LARGE_FILES $ac_cv_sys_large_files-_ACEOF-;;-esac-rm -rf conftest*-  fi-fi---for ac_header in wctype.h-do :-  ac_fn_c_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default"-if test "x$ac_cv_header_wctype_h" = x""yes; then :-  cat >>confdefs.h <<_ACEOF-#define HAVE_WCTYPE_H 1-_ACEOF- for ac_func in iswspace-do :-  ac_fn_c_check_func "$LINENO" "iswspace" "ac_cv_func_iswspace"-if test "x$ac_cv_func_iswspace" = x""yes; then :-  cat >>confdefs.h <<_ACEOF-#define HAVE_ISWSPACE 1-_ACEOF--fi-done--fi--done---for ac_func in lstat-do :-  ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat"-if test "x$ac_cv_func_lstat" = x""yes; then :-  cat >>confdefs.h <<_ACEOF-#define HAVE_LSTAT 1-_ACEOF--fi-done--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }-if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  ac_check_lib_save_LIBS=$LIBS-LIBS="-lrt  $LIBS"-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--/* Override any GCC internal prototype to avoid an error.-   Use char because int might match the return type of a GCC-   builtin and then its argument prototype would still apply.  */-#ifdef __cplusplus-extern "C"-#endif-char clock_gettime ();-int-main ()-{-return clock_gettime ();-  ;-  return 0;-}-_ACEOF-if ac_fn_c_try_link "$LINENO"; then :-  ac_cv_lib_rt_clock_gettime=yes-else-  ac_cv_lib_rt_clock_gettime=no-fi-rm -f core conftest.err conftest.$ac_objext \-    conftest$ac_exeext conftest.$ac_ext-LIBS=$ac_check_lib_save_LIBS-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }-if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :-  cat >>confdefs.h <<_ACEOF-#define HAVE_LIBRT 1-_ACEOF--  LIBS="-lrt $LIBS"--fi--for ac_func in clock_gettime-do :-  ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"-if test "x$ac_cv_func_clock_gettime" = x""yes; then :-  cat >>confdefs.h <<_ACEOF-#define HAVE_CLOCK_GETTIME 1-_ACEOF--fi-done--for ac_func in getclock getrusage times-do :-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :-  cat >>confdefs.h <<_ACEOF-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done--for ac_func in _chsize ftruncate-do :-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :-  cat >>confdefs.h <<_ACEOF-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done---for ac_func in epoll_ctl eventfd kevent kevent64 kqueue poll-do :-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :-  cat >>confdefs.h <<_ACEOF-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done---# event-related fun--if test "$ac_cv_header_sys_epoll_h" = yes -a "$ac_cv_func_epoll_ctl" = yes; then--$as_echo "#define HAVE_EPOLL 1" >>confdefs.h--fi--if test "$ac_cv_header_sys_event_h" = yes -a "$ac_cv_func_kqueue" = yes; then--$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h---  # The cast to long int works around a bug in the HP C Compiler-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.-# This bug is HP SR number 8606223364.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kev.filter" >&5-$as_echo_n "checking size of kev.filter... " >&6; }-if test "${ac_cv_sizeof_kev_filter+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.filter))" "ac_cv_sizeof_kev_filter"        "#include <sys/event.h>-struct kevent kev;-"; then :--else-  if test "$ac_cv_type_kev_filter" = yes; then-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot compute sizeof (kev.filter)-See \`config.log' for more details" "$LINENO" 5 ; }-   else-     ac_cv_sizeof_kev_filter=0-   fi-fi--fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_filter" >&5-$as_echo "$ac_cv_sizeof_kev_filter" >&6; }----cat >>confdefs.h <<_ACEOF-#define SIZEOF_KEV_FILTER $ac_cv_sizeof_kev_filter-_ACEOF----  # The cast to long int works around a bug in the HP C Compiler-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.-# This bug is HP SR number 8606223364.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kev.flags" >&5-$as_echo_n "checking size of kev.flags... " >&6; }-if test "${ac_cv_sizeof_kev_flags+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.flags))" "ac_cv_sizeof_kev_flags"        "#include <sys/event.h>-struct kevent kev;-"; then :--else-  if test "$ac_cv_type_kev_flags" = yes; then-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot compute sizeof (kev.flags)-See \`config.log' for more details" "$LINENO" 5 ; }-   else-     ac_cv_sizeof_kev_flags=0-   fi-fi--fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_flags" >&5-$as_echo "$ac_cv_sizeof_kev_flags" >&6; }----cat >>confdefs.h <<_ACEOF-#define SIZEOF_KEV_FLAGS $ac_cv_sizeof_kev_flags-_ACEOF---fi--if test "$ac_cv_header_poll_h" = yes -a "$ac_cv_func_poll" = yes; then--$as_echo "#define HAVE_POLL 1" >>confdefs.h--fi----# Check whether --with-iconv-includes was given.-if test "${with_iconv_includes+set}" = set; then :-  withval=$with_iconv_includes; ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval"-else-  ICONV_INCLUDE_DIRS=-fi----# Check whether --with-iconv-libraries was given.-if test "${with_iconv_libraries+set}" = set; then :-  withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval"-else-  ICONV_LIB_DIRS=-fi------# map standard C types and ISO types to Haskell types---------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for char" >&5-$as_echo_n "checking Haskell type for char... " >&6; }-    if test "${fptools_cv_htype_char+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_char=yes-        if ac_fn_c_compute_int "$LINENO" "((char)((int)((char)1.4))) == ((char)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_char=no-fi---        if test "$fptools_cv_htype_sup_char" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_char=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_char=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_char=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_char=LDouble-                else-                    fptools_cv_htype_sup_char=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((char)(-1)) < ((char)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(char) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_char=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_char="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_char="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_char" = no-    then--        fptools_cv_htype_char=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_char" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_char" >&5-$as_echo "$fptools_cv_htype_char" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_CHAR $fptools_cv_htype_char-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for signed char" >&5-$as_echo_n "checking Haskell type for signed char... " >&6; }-    if test "${fptools_cv_htype_signed_char+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_signed_char=yes-        if ac_fn_c_compute_int "$LINENO" "((signed char)((int)((signed char)1.4))) == ((signed char)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_signed_char=no-fi---        if test "$fptools_cv_htype_sup_signed_char" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_signed_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_signed_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_signed_char=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_signed_char=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_signed_char=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_signed_char=LDouble-                else-                    fptools_cv_htype_sup_signed_char=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((signed char)(-1)) < ((signed char)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_signed_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_signed_char=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_signed_char="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_signed_char="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_signed_char" = no-    then--        fptools_cv_htype_signed_char=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_signed_char" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_signed_char" >&5-$as_echo "$fptools_cv_htype_signed_char" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SIGNED_CHAR $fptools_cv_htype_signed_char-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned char" >&5-$as_echo_n "checking Haskell type for unsigned char... " >&6; }-    if test "${fptools_cv_htype_unsigned_char+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_unsigned_char=yes-        if ac_fn_c_compute_int "$LINENO" "((unsigned char)((int)((unsigned char)1.4))) == ((unsigned char)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_char=no-fi---        if test "$fptools_cv_htype_sup_unsigned_char" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_char=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_unsigned_char=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_char=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_char=LDouble-                else-                    fptools_cv_htype_sup_unsigned_char=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((unsigned char)(-1)) < ((unsigned char)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_char=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_char=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_unsigned_char="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_unsigned_char="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_unsigned_char" = no-    then--        fptools_cv_htype_unsigned_char=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_unsigned_char" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_char" >&5-$as_echo "$fptools_cv_htype_unsigned_char" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_CHAR $fptools_cv_htype_unsigned_char-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for short" >&5-$as_echo_n "checking Haskell type for short... " >&6; }-    if test "${fptools_cv_htype_short+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_short=yes-        if ac_fn_c_compute_int "$LINENO" "((short)((int)((short)1.4))) == ((short)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_short=no-fi---        if test "$fptools_cv_htype_sup_short" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_short=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_short=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_short=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_short=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_short=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_short=LDouble-                else-                    fptools_cv_htype_sup_short=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((short)(-1)) < ((short)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_short=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(short) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_short=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_short="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_short="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_short" = no-    then--        fptools_cv_htype_short=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_short" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_short" >&5-$as_echo "$fptools_cv_htype_short" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SHORT $fptools_cv_htype_short-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned short" >&5-$as_echo_n "checking Haskell type for unsigned short... " >&6; }-    if test "${fptools_cv_htype_unsigned_short+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_unsigned_short=yes-        if ac_fn_c_compute_int "$LINENO" "((unsigned short)((int)((unsigned short)1.4))) == ((unsigned short)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_short=no-fi---        if test "$fptools_cv_htype_sup_unsigned_short" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_short=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_short=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_short=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_unsigned_short=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_short=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_short=LDouble-                else-                    fptools_cv_htype_sup_unsigned_short=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((unsigned short)(-1)) < ((unsigned short)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_short=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_short=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_unsigned_short="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_unsigned_short="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_unsigned_short" = no-    then--        fptools_cv_htype_unsigned_short=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_unsigned_short" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_short" >&5-$as_echo "$fptools_cv_htype_unsigned_short" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_SHORT $fptools_cv_htype_unsigned_short-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for int" >&5-$as_echo_n "checking Haskell type for int... " >&6; }-    if test "${fptools_cv_htype_int+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_int=yes-        if ac_fn_c_compute_int "$LINENO" "((int)((int)((int)1.4))) == ((int)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_int=no-fi---        if test "$fptools_cv_htype_sup_int" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_int=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_int=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_int=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_int=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_int=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_int=LDouble-                else-                    fptools_cv_htype_sup_int=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((int)(-1)) < ((int)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_int=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(int) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_int=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_int="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_int="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_int" = no-    then--        fptools_cv_htype_int=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_int" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_int" >&5-$as_echo "$fptools_cv_htype_int" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INT $fptools_cv_htype_int-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned int" >&5-$as_echo_n "checking Haskell type for unsigned int... " >&6; }-    if test "${fptools_cv_htype_unsigned_int+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_unsigned_int=yes-        if ac_fn_c_compute_int "$LINENO" "((unsigned int)((int)((unsigned int)1.4))) == ((unsigned int)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_int=no-fi---        if test "$fptools_cv_htype_sup_unsigned_int" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_int=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_int=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_int=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_unsigned_int=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_int=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_int=LDouble-                else-                    fptools_cv_htype_sup_unsigned_int=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((unsigned int)(-1)) < ((unsigned int)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_int=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_int=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_unsigned_int="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_unsigned_int="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_unsigned_int" = no-    then--        fptools_cv_htype_unsigned_int=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_unsigned_int" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_int" >&5-$as_echo "$fptools_cv_htype_unsigned_int" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_INT $fptools_cv_htype_unsigned_int-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long" >&5-$as_echo_n "checking Haskell type for long... " >&6; }-    if test "${fptools_cv_htype_long+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_long=yes-        if ac_fn_c_compute_int "$LINENO" "((long)((int)((long)1.4))) == ((long)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long=no-fi---        if test "$fptools_cv_htype_sup_long" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_long=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_long=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_long=LDouble-                else-                    fptools_cv_htype_sup_long=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((long)(-1)) < ((long)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(long) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_long="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_long="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_long" = no-    then--        fptools_cv_htype_long=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_long" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long" >&5-$as_echo "$fptools_cv_htype_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_LONG $fptools_cv_htype_long-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long" >&5-$as_echo_n "checking Haskell type for unsigned long... " >&6; }-    if test "${fptools_cv_htype_unsigned_long+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_unsigned_long=yes-        if ac_fn_c_compute_int "$LINENO" "((unsigned long)((int)((unsigned long)1.4))) == ((unsigned long)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long=no-fi---        if test "$fptools_cv_htype_sup_unsigned_long" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_unsigned_long=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_long=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_long=LDouble-                else-                    fptools_cv_htype_sup_unsigned_long=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((unsigned long)(-1)) < ((unsigned long)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_unsigned_long="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_unsigned_long="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_unsigned_long" = no-    then--        fptools_cv_htype_unsigned_long=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_unsigned_long" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long" >&5-$as_echo "$fptools_cv_htype_unsigned_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_LONG $fptools_cv_htype_unsigned_long-_ACEOF--    fi---if test "$ac_cv_type_long_long" = yes; then---------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long long" >&5-$as_echo_n "checking Haskell type for long long... " >&6; }-    if test "${fptools_cv_htype_long_long+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_long_long=yes-        if ac_fn_c_compute_int "$LINENO" "((long long)((int)((long long)1.4))) == ((long long)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long_long=no-fi---        if test "$fptools_cv_htype_sup_long_long" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long_long=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_long_long=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_long_long=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_long_long=LDouble-                else-                    fptools_cv_htype_sup_long_long=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((long long)(-1)) < ((long long)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(long long) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_long_long=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_long_long="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_long_long="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_long_long" = no-    then--        fptools_cv_htype_long_long=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_long_long" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long_long" >&5-$as_echo "$fptools_cv_htype_long_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_LONG_LONG $fptools_cv_htype_long_long-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long long" >&5-$as_echo_n "checking Haskell type for unsigned long long... " >&6; }-    if test "${fptools_cv_htype_unsigned_long_long+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_unsigned_long_long=yes-        if ac_fn_c_compute_int "$LINENO" "((unsigned long long)((int)((unsigned long long)1.4))) == ((unsigned long long)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long_long=no-fi---        if test "$fptools_cv_htype_sup_unsigned_long_long" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long_long=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_unsigned_long_long=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_long_long=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_unsigned_long_long=LDouble-                else-                    fptools_cv_htype_sup_unsigned_long_long=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((unsigned long long)(-1)) < ((unsigned long long)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long_long=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_unsigned_long_long=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_unsigned_long_long="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_unsigned_long_long="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_unsigned_long_long" = no-    then--        fptools_cv_htype_unsigned_long_long=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_unsigned_long_long" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long_long" >&5-$as_echo "$fptools_cv_htype_unsigned_long_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_LONG_LONG $fptools_cv_htype_unsigned_long_long-_ACEOF--    fi---fi---------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for float" >&5-$as_echo_n "checking Haskell type for float... " >&6; }-    if test "${fptools_cv_htype_float+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_float=yes-        if ac_fn_c_compute_int "$LINENO" "((float)((int)((float)1.4))) == ((float)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_float=no-fi---        if test "$fptools_cv_htype_sup_float" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_float=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_float=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_float=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_float=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_float=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_float=LDouble-                else-                    fptools_cv_htype_sup_float=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((float)(-1)) < ((float)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_float=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(float) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_float=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_float="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_float="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_float" = no-    then--        fptools_cv_htype_float=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_float" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_float" >&5-$as_echo "$fptools_cv_htype_float" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_FLOAT $fptools_cv_htype_float-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for double" >&5-$as_echo_n "checking Haskell type for double... " >&6; }-    if test "${fptools_cv_htype_double+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_double=yes-        if ac_fn_c_compute_int "$LINENO" "((double)((int)((double)1.4))) == ((double)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_double=no-fi---        if test "$fptools_cv_htype_sup_double" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_double=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_double=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_double=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_double=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_double=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_double=LDouble-                else-                    fptools_cv_htype_sup_double=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((double)(-1)) < ((double)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_double=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(double) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_double=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_double="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_double="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_double" = no-    then--        fptools_cv_htype_double=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_double" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_double" >&5-$as_echo "$fptools_cv_htype_double" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_DOUBLE $fptools_cv_htype_double-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ptrdiff_t" >&5-$as_echo_n "checking Haskell type for ptrdiff_t... " >&6; }-    if test "${fptools_cv_htype_ptrdiff_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_ptrdiff_t=yes-        if ac_fn_c_compute_int "$LINENO" "((ptrdiff_t)((int)((ptrdiff_t)1.4))) == ((ptrdiff_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ptrdiff_t=no-fi---        if test "$fptools_cv_htype_sup_ptrdiff_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ptrdiff_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ptrdiff_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ptrdiff_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_ptrdiff_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_ptrdiff_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_ptrdiff_t=LDouble-                else-                    fptools_cv_htype_sup_ptrdiff_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((ptrdiff_t)(-1)) < ((ptrdiff_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ptrdiff_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ptrdiff_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_ptrdiff_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_ptrdiff_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_ptrdiff_t" = no-    then--        fptools_cv_htype_ptrdiff_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_ptrdiff_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ptrdiff_t" >&5-$as_echo "$fptools_cv_htype_ptrdiff_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_PTRDIFF_T $fptools_cv_htype_ptrdiff_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for size_t" >&5-$as_echo_n "checking Haskell type for size_t... " >&6; }-    if test "${fptools_cv_htype_size_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_size_t=yes-        if ac_fn_c_compute_int "$LINENO" "((size_t)((int)((size_t)1.4))) == ((size_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_size_t=no-fi---        if test "$fptools_cv_htype_sup_size_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_size_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_size_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_size_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_size_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_size_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_size_t=LDouble-                else-                    fptools_cv_htype_sup_size_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((size_t)(-1)) < ((size_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_size_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_size_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_size_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_size_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_size_t" = no-    then--        fptools_cv_htype_size_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_size_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_size_t" >&5-$as_echo "$fptools_cv_htype_size_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SIZE_T $fptools_cv_htype_size_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for wchar_t" >&5-$as_echo_n "checking Haskell type for wchar_t... " >&6; }-    if test "${fptools_cv_htype_wchar_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_wchar_t=yes-        if ac_fn_c_compute_int "$LINENO" "((wchar_t)((int)((wchar_t)1.4))) == ((wchar_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_wchar_t=no-fi---        if test "$fptools_cv_htype_sup_wchar_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_wchar_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_wchar_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_wchar_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_wchar_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_wchar_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_wchar_t=LDouble-                else-                    fptools_cv_htype_sup_wchar_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((wchar_t)(-1)) < ((wchar_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_wchar_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_wchar_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_wchar_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_wchar_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_wchar_t" = no-    then--        fptools_cv_htype_wchar_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_wchar_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_wchar_t" >&5-$as_echo "$fptools_cv_htype_wchar_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_WCHAR_T $fptools_cv_htype_wchar_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for sig_atomic_t" >&5-$as_echo_n "checking Haskell type for sig_atomic_t... " >&6; }-    if test "${fptools_cv_htype_sig_atomic_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_sig_atomic_t=yes-        if ac_fn_c_compute_int "$LINENO" "((sig_atomic_t)((int)((sig_atomic_t)1.4))) == ((sig_atomic_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_sig_atomic_t=no-fi---        if test "$fptools_cv_htype_sup_sig_atomic_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_sig_atomic_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_sig_atomic_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_sig_atomic_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_sig_atomic_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_sig_atomic_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_sig_atomic_t=LDouble-                else-                    fptools_cv_htype_sup_sig_atomic_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((sig_atomic_t)(-1)) < ((sig_atomic_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_sig_atomic_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_sig_atomic_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_sig_atomic_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_sig_atomic_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_sig_atomic_t" = no-    then--        fptools_cv_htype_sig_atomic_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_sig_atomic_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_sig_atomic_t" >&5-$as_echo "$fptools_cv_htype_sig_atomic_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SIG_ATOMIC_T $fptools_cv_htype_sig_atomic_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for clock_t" >&5-$as_echo_n "checking Haskell type for clock_t... " >&6; }-    if test "${fptools_cv_htype_clock_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_clock_t=yes-        if ac_fn_c_compute_int "$LINENO" "((clock_t)((int)((clock_t)1.4))) == ((clock_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_clock_t=no-fi---        if test "$fptools_cv_htype_sup_clock_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_clock_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_clock_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_clock_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_clock_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_clock_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_clock_t=LDouble-                else-                    fptools_cv_htype_sup_clock_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((clock_t)(-1)) < ((clock_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_clock_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_clock_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_clock_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_clock_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_clock_t" = no-    then--        fptools_cv_htype_clock_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_clock_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clock_t" >&5-$as_echo "$fptools_cv_htype_clock_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_CLOCK_T $fptools_cv_htype_clock_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for time_t" >&5-$as_echo_n "checking Haskell type for time_t... " >&6; }-    if test "${fptools_cv_htype_time_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_time_t=yes-        if ac_fn_c_compute_int "$LINENO" "((time_t)((int)((time_t)1.4))) == ((time_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_time_t=no-fi---        if test "$fptools_cv_htype_sup_time_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_time_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_time_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_time_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_time_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_time_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_time_t=LDouble-                else-                    fptools_cv_htype_sup_time_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((time_t)(-1)) < ((time_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_time_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_time_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_time_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_time_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_time_t" = no-    then--        fptools_cv_htype_time_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_time_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_time_t" >&5-$as_echo "$fptools_cv_htype_time_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_TIME_T $fptools_cv_htype_time_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for useconds_t" >&5-$as_echo_n "checking Haskell type for useconds_t... " >&6; }-    if test "${fptools_cv_htype_useconds_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_useconds_t=yes-        if ac_fn_c_compute_int "$LINENO" "((useconds_t)((int)((useconds_t)1.4))) == ((useconds_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_useconds_t=no-fi---        if test "$fptools_cv_htype_sup_useconds_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_useconds_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_useconds_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_useconds_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_useconds_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_useconds_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_useconds_t=LDouble-                else-                    fptools_cv_htype_sup_useconds_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((useconds_t)(-1)) < ((useconds_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_useconds_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_useconds_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_useconds_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_useconds_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_useconds_t" = no-    then--        fptools_cv_htype_useconds_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_useconds_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_useconds_t" >&5-$as_echo "$fptools_cv_htype_useconds_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_USECONDS_T $fptools_cv_htype_useconds_t-_ACEOF--    fi----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for suseconds_t" >&5-$as_echo_n "checking Haskell type for suseconds_t... " >&6; }-    if test "${fptools_cv_htype_suseconds_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_suseconds_t=yes-        if ac_fn_c_compute_int "$LINENO" "((suseconds_t)((int)((suseconds_t)1.4))) == ((suseconds_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_suseconds_t=no-fi---        if test "$fptools_cv_htype_sup_suseconds_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_suseconds_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_suseconds_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_suseconds_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_suseconds_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_suseconds_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_suseconds_t=LDouble-                else-                    fptools_cv_htype_sup_suseconds_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((suseconds_t)(-1)) < ((suseconds_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_suseconds_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_suseconds_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_suseconds_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_suseconds_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_suseconds_t" = no-    then-        if test "$WINDOWS" = "YES"-                          then-                              fptools_cv_htype_suseconds_t=Int32-                              fptools_cv_htype_sup_suseconds_t=yes-                          else-                              as_fn_error $? "type not found" "$LINENO" 5-                          fi-    fi--            if test "$fptools_cv_htype_sup_suseconds_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_suseconds_t" >&5-$as_echo "$fptools_cv_htype_suseconds_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SUSECONDS_T $fptools_cv_htype_suseconds_t-_ACEOF--    fi----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for dev_t" >&5-$as_echo_n "checking Haskell type for dev_t... " >&6; }-    if test "${fptools_cv_htype_dev_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_dev_t=yes-        if ac_fn_c_compute_int "$LINENO" "((dev_t)((int)((dev_t)1.4))) == ((dev_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_dev_t=no-fi---        if test "$fptools_cv_htype_sup_dev_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_dev_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_dev_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_dev_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_dev_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_dev_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_dev_t=LDouble-                else-                    fptools_cv_htype_sup_dev_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((dev_t)(-1)) < ((dev_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_dev_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_dev_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_dev_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_dev_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_dev_t" = no-    then--        fptools_cv_htype_dev_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_dev_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_dev_t" >&5-$as_echo "$fptools_cv_htype_dev_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_DEV_T $fptools_cv_htype_dev_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ino_t" >&5-$as_echo_n "checking Haskell type for ino_t... " >&6; }-    if test "${fptools_cv_htype_ino_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_ino_t=yes-        if ac_fn_c_compute_int "$LINENO" "((ino_t)((int)((ino_t)1.4))) == ((ino_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ino_t=no-fi---        if test "$fptools_cv_htype_sup_ino_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ino_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ino_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ino_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_ino_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_ino_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_ino_t=LDouble-                else-                    fptools_cv_htype_sup_ino_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((ino_t)(-1)) < ((ino_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ino_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ino_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_ino_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_ino_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_ino_t" = no-    then--        fptools_cv_htype_ino_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_ino_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ino_t" >&5-$as_echo "$fptools_cv_htype_ino_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INO_T $fptools_cv_htype_ino_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for mode_t" >&5-$as_echo_n "checking Haskell type for mode_t... " >&6; }-    if test "${fptools_cv_htype_mode_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_mode_t=yes-        if ac_fn_c_compute_int "$LINENO" "((mode_t)((int)((mode_t)1.4))) == ((mode_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_mode_t=no-fi---        if test "$fptools_cv_htype_sup_mode_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_mode_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_mode_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_mode_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_mode_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_mode_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_mode_t=LDouble-                else-                    fptools_cv_htype_sup_mode_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((mode_t)(-1)) < ((mode_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_mode_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_mode_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_mode_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_mode_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_mode_t" = no-    then--        fptools_cv_htype_mode_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_mode_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_mode_t" >&5-$as_echo "$fptools_cv_htype_mode_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_MODE_T $fptools_cv_htype_mode_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for off_t" >&5-$as_echo_n "checking Haskell type for off_t... " >&6; }-    if test "${fptools_cv_htype_off_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_off_t=yes-        if ac_fn_c_compute_int "$LINENO" "((off_t)((int)((off_t)1.4))) == ((off_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_off_t=no-fi---        if test "$fptools_cv_htype_sup_off_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_off_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_off_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_off_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_off_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_off_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_off_t=LDouble-                else-                    fptools_cv_htype_sup_off_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((off_t)(-1)) < ((off_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_off_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_off_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_off_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_off_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_off_t" = no-    then--        fptools_cv_htype_off_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_off_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_off_t" >&5-$as_echo "$fptools_cv_htype_off_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_OFF_T $fptools_cv_htype_off_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for pid_t" >&5-$as_echo_n "checking Haskell type for pid_t... " >&6; }-    if test "${fptools_cv_htype_pid_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_pid_t=yes-        if ac_fn_c_compute_int "$LINENO" "((pid_t)((int)((pid_t)1.4))) == ((pid_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_pid_t=no-fi---        if test "$fptools_cv_htype_sup_pid_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_pid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_pid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_pid_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_pid_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_pid_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_pid_t=LDouble-                else-                    fptools_cv_htype_sup_pid_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((pid_t)(-1)) < ((pid_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_pid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_pid_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_pid_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_pid_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_pid_t" = no-    then--        fptools_cv_htype_pid_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_pid_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_pid_t" >&5-$as_echo "$fptools_cv_htype_pid_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_PID_T $fptools_cv_htype_pid_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for gid_t" >&5-$as_echo_n "checking Haskell type for gid_t... " >&6; }-    if test "${fptools_cv_htype_gid_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_gid_t=yes-        if ac_fn_c_compute_int "$LINENO" "((gid_t)((int)((gid_t)1.4))) == ((gid_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_gid_t=no-fi---        if test "$fptools_cv_htype_sup_gid_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_gid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_gid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_gid_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_gid_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_gid_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_gid_t=LDouble-                else-                    fptools_cv_htype_sup_gid_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((gid_t)(-1)) < ((gid_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_gid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_gid_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_gid_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_gid_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_gid_t" = no-    then--        fptools_cv_htype_gid_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_gid_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_gid_t" >&5-$as_echo "$fptools_cv_htype_gid_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_GID_T $fptools_cv_htype_gid_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uid_t" >&5-$as_echo_n "checking Haskell type for uid_t... " >&6; }-    if test "${fptools_cv_htype_uid_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_uid_t=yes-        if ac_fn_c_compute_int "$LINENO" "((uid_t)((int)((uid_t)1.4))) == ((uid_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uid_t=no-fi---        if test "$fptools_cv_htype_sup_uid_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uid_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_uid_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_uid_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_uid_t=LDouble-                else-                    fptools_cv_htype_sup_uid_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((uid_t)(-1)) < ((uid_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uid_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uid_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_uid_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_uid_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_uid_t" = no-    then--        fptools_cv_htype_uid_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_uid_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uid_t" >&5-$as_echo "$fptools_cv_htype_uid_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UID_T $fptools_cv_htype_uid_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for cc_t" >&5-$as_echo_n "checking Haskell type for cc_t... " >&6; }-    if test "${fptools_cv_htype_cc_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_cc_t=yes-        if ac_fn_c_compute_int "$LINENO" "((cc_t)((int)((cc_t)1.4))) == ((cc_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_cc_t=no-fi---        if test "$fptools_cv_htype_sup_cc_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_cc_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_cc_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_cc_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_cc_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_cc_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_cc_t=LDouble-                else-                    fptools_cv_htype_sup_cc_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((cc_t)(-1)) < ((cc_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_cc_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_cc_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_cc_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_cc_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_cc_t" = no-    then--        fptools_cv_htype_cc_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_cc_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_cc_t" >&5-$as_echo "$fptools_cv_htype_cc_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_CC_T $fptools_cv_htype_cc_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for speed_t" >&5-$as_echo_n "checking Haskell type for speed_t... " >&6; }-    if test "${fptools_cv_htype_speed_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_speed_t=yes-        if ac_fn_c_compute_int "$LINENO" "((speed_t)((int)((speed_t)1.4))) == ((speed_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_speed_t=no-fi---        if test "$fptools_cv_htype_sup_speed_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_speed_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_speed_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_speed_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_speed_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_speed_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_speed_t=LDouble-                else-                    fptools_cv_htype_sup_speed_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((speed_t)(-1)) < ((speed_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_speed_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_speed_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_speed_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_speed_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_speed_t" = no-    then--        fptools_cv_htype_speed_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_speed_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_speed_t" >&5-$as_echo "$fptools_cv_htype_speed_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SPEED_T $fptools_cv_htype_speed_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for tcflag_t" >&5-$as_echo_n "checking Haskell type for tcflag_t... " >&6; }-    if test "${fptools_cv_htype_tcflag_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_tcflag_t=yes-        if ac_fn_c_compute_int "$LINENO" "((tcflag_t)((int)((tcflag_t)1.4))) == ((tcflag_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_tcflag_t=no-fi---        if test "$fptools_cv_htype_sup_tcflag_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_tcflag_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_tcflag_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_tcflag_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_tcflag_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_tcflag_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_tcflag_t=LDouble-                else-                    fptools_cv_htype_sup_tcflag_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((tcflag_t)(-1)) < ((tcflag_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_tcflag_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_tcflag_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_tcflag_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_tcflag_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_tcflag_t" = no-    then--        fptools_cv_htype_tcflag_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_tcflag_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_tcflag_t" >&5-$as_echo "$fptools_cv_htype_tcflag_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_TCFLAG_T $fptools_cv_htype_tcflag_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for nlink_t" >&5-$as_echo_n "checking Haskell type for nlink_t... " >&6; }-    if test "${fptools_cv_htype_nlink_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_nlink_t=yes-        if ac_fn_c_compute_int "$LINENO" "((nlink_t)((int)((nlink_t)1.4))) == ((nlink_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_nlink_t=no-fi---        if test "$fptools_cv_htype_sup_nlink_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_nlink_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_nlink_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_nlink_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_nlink_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_nlink_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_nlink_t=LDouble-                else-                    fptools_cv_htype_sup_nlink_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((nlink_t)(-1)) < ((nlink_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_nlink_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_nlink_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_nlink_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_nlink_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_nlink_t" = no-    then--        fptools_cv_htype_nlink_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_nlink_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nlink_t" >&5-$as_echo "$fptools_cv_htype_nlink_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_NLINK_T $fptools_cv_htype_nlink_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ssize_t" >&5-$as_echo_n "checking Haskell type for ssize_t... " >&6; }-    if test "${fptools_cv_htype_ssize_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_ssize_t=yes-        if ac_fn_c_compute_int "$LINENO" "((ssize_t)((int)((ssize_t)1.4))) == ((ssize_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ssize_t=no-fi---        if test "$fptools_cv_htype_sup_ssize_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ssize_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ssize_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ssize_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_ssize_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_ssize_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_ssize_t=LDouble-                else-                    fptools_cv_htype_sup_ssize_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((ssize_t)(-1)) < ((ssize_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ssize_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_ssize_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_ssize_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_ssize_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_ssize_t" = no-    then--        fptools_cv_htype_ssize_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_ssize_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ssize_t" >&5-$as_echo "$fptools_cv_htype_ssize_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SSIZE_T $fptools_cv_htype_ssize_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for rlim_t" >&5-$as_echo_n "checking Haskell type for rlim_t... " >&6; }-    if test "${fptools_cv_htype_rlim_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_rlim_t=yes-        if ac_fn_c_compute_int "$LINENO" "((rlim_t)((int)((rlim_t)1.4))) == ((rlim_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_rlim_t=no-fi---        if test "$fptools_cv_htype_sup_rlim_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_rlim_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_rlim_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_rlim_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_rlim_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_rlim_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_rlim_t=LDouble-                else-                    fptools_cv_htype_sup_rlim_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((rlim_t)(-1)) < ((rlim_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_rlim_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_rlim_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_rlim_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_rlim_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_rlim_t" = no-    then--        fptools_cv_htype_rlim_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_rlim_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_rlim_t" >&5-$as_echo "$fptools_cv_htype_rlim_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_RLIM_T $fptools_cv_htype_rlim_t-_ACEOF--    fi------------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intptr_t" >&5-$as_echo_n "checking Haskell type for intptr_t... " >&6; }-    if test "${fptools_cv_htype_intptr_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_intptr_t=yes-        if ac_fn_c_compute_int "$LINENO" "((intptr_t)((int)((intptr_t)1.4))) == ((intptr_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intptr_t=no-fi---        if test "$fptools_cv_htype_sup_intptr_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intptr_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intptr_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intptr_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_intptr_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_intptr_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_intptr_t=LDouble-                else-                    fptools_cv_htype_sup_intptr_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((intptr_t)(-1)) < ((intptr_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intptr_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intptr_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_intptr_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_intptr_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_intptr_t" = no-    then--        fptools_cv_htype_intptr_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_intptr_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intptr_t" >&5-$as_echo "$fptools_cv_htype_intptr_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INTPTR_T $fptools_cv_htype_intptr_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintptr_t" >&5-$as_echo_n "checking Haskell type for uintptr_t... " >&6; }-    if test "${fptools_cv_htype_uintptr_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_uintptr_t=yes-        if ac_fn_c_compute_int "$LINENO" "((uintptr_t)((int)((uintptr_t)1.4))) == ((uintptr_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintptr_t=no-fi---        if test "$fptools_cv_htype_sup_uintptr_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintptr_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintptr_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintptr_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_uintptr_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_uintptr_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_uintptr_t=LDouble-                else-                    fptools_cv_htype_sup_uintptr_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((uintptr_t)(-1)) < ((uintptr_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintptr_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintptr_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_uintptr_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_uintptr_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_uintptr_t" = no-    then--        fptools_cv_htype_uintptr_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_uintptr_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintptr_t" >&5-$as_echo "$fptools_cv_htype_uintptr_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UINTPTR_T $fptools_cv_htype_uintptr_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intmax_t" >&5-$as_echo_n "checking Haskell type for intmax_t... " >&6; }-    if test "${fptools_cv_htype_intmax_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_intmax_t=yes-        if ac_fn_c_compute_int "$LINENO" "((intmax_t)((int)((intmax_t)1.4))) == ((intmax_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intmax_t=no-fi---        if test "$fptools_cv_htype_sup_intmax_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intmax_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intmax_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intmax_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_intmax_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_intmax_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_intmax_t=LDouble-                else-                    fptools_cv_htype_sup_intmax_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((intmax_t)(-1)) < ((intmax_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intmax_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_intmax_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_intmax_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_intmax_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_intmax_t" = no-    then--        fptools_cv_htype_intmax_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_intmax_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intmax_t" >&5-$as_echo "$fptools_cv_htype_intmax_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INTMAX_T $fptools_cv_htype_intmax_t-_ACEOF--    fi-----------    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintmax_t" >&5-$as_echo_n "checking Haskell type for uintmax_t... " >&6; }-    if test "${fptools_cv_htype_uintmax_t+set}" = set; then :-  $as_echo_n "(cached) " >&6-else--        fptools_cv_htype_sup_uintmax_t=yes-        if ac_fn_c_compute_int "$LINENO" "((uintmax_t)((int)((uintmax_t)1.4))) == ((uintmax_t)1.4)" "HTYPE_IS_INTEGRAL"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintmax_t=no-fi---        if test "$fptools_cv_htype_sup_uintmax_t" = "yes"-        then-            if test "$HTYPE_IS_INTEGRAL" -eq 0-            then-                if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintmax_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintmax_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintmax_t=no-fi---                if test "$HTYPE_IS_FLOAT" -eq 1-                then-                    fptools_cv_htype_uintmax_t=Float-                elif test "$HTYPE_IS_DOUBLE" -eq 1-                then-                    fptools_cv_htype_uintmax_t=Double-                elif test "$HTYPE_IS_LDOUBLE" -eq 1-                then-                    fptools_cv_htype_uintmax_t=LDouble-                else-                    fptools_cv_htype_sup_uintmax_t=no-                fi-            else-                if ac_fn_c_compute_int "$LINENO" "((uintmax_t)(-1)) < ((uintmax_t)0)" "HTYPE_IS_SIGNED"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintmax_t=no-fi---                if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) * 8" "HTYPE_SIZE"        "-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>-"; then :--else-  fptools_cv_htype_sup_uintmax_t=no-fi---                if test "$HTYPE_IS_SIGNED" -eq 0-                then-                    fptools_cv_htype_uintmax_t="Word$HTYPE_SIZE"-                else-                    fptools_cv_htype_uintmax_t="Int$HTYPE_SIZE"-                fi-            fi-        fi--fi--    if test "$fptools_cv_htype_sup_uintmax_t" = no-    then--        fptools_cv_htype_uintmax_t=NotReallyAType-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-$as_echo "not supported" >&6; }--    fi--            if test "$fptools_cv_htype_sup_uintmax_t" = yes; then-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintmax_t" >&5-$as_echo "$fptools_cv_htype_uintmax_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UINTMAX_T $fptools_cv_htype_uintmax_t-_ACEOF--    fi----# test errno values-for fp_const_name in E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR-do-as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5-$as_echo_n "checking value of $fp_const_name... " >&6; }-if eval "test \"\${$as_fp_Cache+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-else-  if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result"        "#include <stdio.h>-#include <errno.h>-"; then :--else-  fp_check_const_result='-1'-fi---eval "$as_fp_Cache=\$fp_check_const_result"-fi-eval ac_res=\$$as_fp_Cache-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-cat >>confdefs.h <<_ACEOF-#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`-_ACEOF--done---# we need SIGINT in TopHandler.lhs-for fp_const_name in SIGINT-do-as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5-$as_echo_n "checking value of $fp_const_name... " >&6; }-if eval "test \"\${$as_fp_Cache+set}\"" = set; then :-  $as_echo_n "(cached) " >&6-else-  if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result"        "-#if HAVE_SIGNAL_H-#include <signal.h>-#endif-"; then :--else-  fp_check_const_result='-1'-fi---eval "$as_fp_Cache=\$fp_check_const_result"-fi-eval ac_res=\$$as_fp_Cache-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-$as_echo "$ac_res" >&6; }-cat >>confdefs.h <<_ACEOF-#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`-_ACEOF--done---{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of O_BINARY" >&5-$as_echo_n "checking value of O_BINARY... " >&6; }-if test "${fp_cv_const_O_BINARY+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if ac_fn_c_compute_int "$LINENO" "O_BINARY" "fp_check_const_result"        "#include <fcntl.h>-"; then :--else-  fp_check_const_result=0-fi---fp_cv_const_O_BINARY=$fp_check_const_result-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fp_cv_const_O_BINARY" >&5-$as_echo "$fp_cv_const_O_BINARY" >&6; }-cat >>confdefs.h <<_ACEOF-#define CONST_O_BINARY $fp_cv_const_O_BINARY-_ACEOF---# We don't use iconv or libcharset on Windows, but if configure finds-# them then it can cause problems. So we don't even try looking if-# we are on Windows.-# See http://www.haskell.org/pipermail/cvs-ghc/2011-September/065980.html-if test "$WINDOWS" = "NO"-then--# We can't just use AC_SEARCH_LIBS for this, as on OpenBSD the iconv.h-# header needs to be included as iconv_open is #define'd to something-# else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us-# to give prototype text.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv" >&5-$as_echo_n "checking for library containing iconv... " >&6; }-if test "${ac_cv_search_iconv+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  ac_func_search_save_LIBS=$LIBS-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */--#include <stddef.h>-#include <iconv.h>--int-main ()-{-iconv_t cd;-                      cd = iconv_open("", "");-                      iconv(cd,NULL,NULL,NULL,NULL);-                      iconv_close(cd);-  ;-  return 0;-}-_ACEOF-for ac_lib in '' iconv; do-  if test -z "$ac_lib"; then-    ac_res="none required"-  else-    ac_res=-l$ac_lib-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"-  fi-  if ac_fn_c_try_link "$LINENO"; then :-  ac_cv_search_iconv=$ac_res-fi-rm -f core conftest.err conftest.$ac_objext \-    conftest$ac_exeext-  if test "${ac_cv_search_iconv+set}" = set; then :-  break-fi-done-if test "${ac_cv_search_iconv+set}" = set; then :--else-  ac_cv_search_iconv=no-fi-rm conftest.$ac_ext-LIBS=$ac_func_search_save_LIBS-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv" >&5-$as_echo "$ac_cv_search_iconv" >&6; }-ac_res=$ac_cv_search_iconv-if test "$ac_res" != no; then :-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"-  EXTRA_LIBS="$EXTRA_LIBS $ac_lib"-else-  as_fn_error $? "iconv is required on non-Windows platforms" "$LINENO" 5-fi--# If possible, we use libcharset instead of nl_langinfo(CODESET) to-# determine the current locale's character encoding.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing locale_charset" >&5-$as_echo_n "checking for library containing locale_charset... " >&6; }-if test "${ac_cv_search_locale_charset+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  ac_func_search_save_LIBS=$LIBS-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h.  */-#include <libcharset.h>-int-main ()-{-const char* charset = locale_charset();-  ;-  return 0;-}-_ACEOF-for ac_lib in '' charset; do-  if test -z "$ac_lib"; then-    ac_res="none required"-  else-    ac_res=-l$ac_lib-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"-  fi-  if ac_fn_c_try_link "$LINENO"; then :-  ac_cv_search_locale_charset=$ac_res-fi-rm -f core conftest.err conftest.$ac_objext \-    conftest$ac_exeext-  if test "${ac_cv_search_locale_charset+set}" = set; then :-  break-fi-done-if test "${ac_cv_search_locale_charset+set}" = set; then :--else-  ac_cv_search_locale_charset=no-fi-rm conftest.$ac_ext-LIBS=$ac_func_search_save_LIBS-fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_locale_charset" >&5-$as_echo "$ac_cv_search_locale_charset" >&6; }-ac_res=$ac_cv_search_locale_charset-if test "$ac_res" != no; then :-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"--$as_echo "#define HAVE_LIBCHARSET 1" >>confdefs.h--     EXTRA_LIBS="$EXTRA_LIBS $ac_lib"-fi--fi--# Hack - md5.h needs HsFFI.h.  Is there a better way to do this?-CFLAGS="-I../../includes $CFLAGS"-# The cast to long int works around a bug in the HP C Compiler-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.-# This bug is HP SR number 8606223364.-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct MD5Context" >&5-$as_echo_n "checking size of struct MD5Context... " >&6; }-if test "${ac_cv_sizeof_struct_MD5Context+set}" = set; then :-  $as_echo_n "(cached) " >&6-else-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct MD5Context))" "ac_cv_sizeof_struct_MD5Context"        "#include \"include/md5.h\"-"; then :--else-  if test "$ac_cv_type_struct_MD5Context" = yes; then-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot compute sizeof (struct MD5Context)-See \`config.log' for more details" "$LINENO" 5 ; }-   else-     ac_cv_sizeof_struct_MD5Context=0-   fi-fi--fi-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_MD5Context" >&5-$as_echo "$ac_cv_sizeof_struct_MD5Context" >&6; }----cat >>confdefs.h <<_ACEOF-#define SIZEOF_STRUCT_MD5CONTEXT $ac_cv_sizeof_struct_MD5Context-_ACEOF-----ac_config_files="$ac_config_files base.buildinfo"---cat >confcache <<\_ACEOF-# This file is a shell script that caches the results of configure-# tests run on this system so they can be shared between configure-# scripts and configure runs, see configure's option --config-cache.-# It is not useful on other systems.  If it contains results you don't-# want to keep, you may remove or edit it.-#-# config.status only pays attention to the cache file if you give it-# the --recheck option to rerun configure.-#-# `ac_cv_env_foo' variables (set or unset) will be overridden when-# loading this file, other *unset* `ac_cv_foo' will be assigned the-# following values.--_ACEOF--# The following way of writing the cache mishandles newlines in values,-# but we know of no workaround that is simple, portable, and efficient.-# So, we kill variables containing newlines.-# Ultrix sh set writes to stderr and can't be redirected directly,-# and sets the high bit in the cache file unless we assign to the vars.-(-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do-    eval ac_val=\$$ac_var-    case $ac_val in #(-    *${as_nl}*)-      case $ac_var in #(-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;-      esac-      case $ac_var in #(-      _ | IFS | as_nl) ;; #(-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(-      *) { eval $ac_var=; unset $ac_var;} ;;-      esac ;;-    esac-  done--  (set) 2>&1 |-    case $as_nl`(ac_space=' '; set) 2>&1` in #(-    *${as_nl}ac_space=\ *)-      # `set' does not quote correctly, so add quotes: double-quote-      # substitution turns \\\\ into \\, and sed turns \\ into \.-      sed -n \-	"s/'/'\\\\''/g;-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"-      ;; #(-    *)-      # `set' quotes correctly as required by POSIX, so do not add quotes.-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"-      ;;-    esac |-    sort-) |-  sed '-     /^ac_cv_env_/b end-     t clear-     :clear-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/-     t end-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/-     :end' >>confcache-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else-  if test -w "$cache_file"; then-    test "x$cache_file" != "x/dev/null" &&-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5-$as_echo "$as_me: updating cache $cache_file" >&6;}-    cat confcache >$cache_file-  else-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}-  fi-fi-rm -f confcache--test "x$prefix" = xNONE && prefix=$ac_default_prefix-# Let make expand exec_prefix.-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'--DEFS=-DHAVE_CONFIG_H--ac_libobjs=-ac_ltlibobjs=-U=-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue-  # 1. Remove the extension, and $U if already installed.-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR-  #    will be set to the directory where LIBOBJS objects are built.-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'-done-LIBOBJS=$ac_libobjs--LTLIBOBJS=$ac_ltlibobjs----: ${CONFIG_STATUS=./config.status}-ac_write_fail=0-ac_clean_files_save=$ac_clean_files-ac_clean_files="$ac_clean_files $CONFIG_STATUS"-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}-as_write_fail=0-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1-#! $SHELL-# Generated by $as_me.-# Run this file to recreate the current configuration.-# Compiler output produced by configure, useful for debugging-# configure, is in config.log if it exists.--debug=false-ac_cs_recheck=false-ac_cs_silent=false--SHELL=\${CONFIG_SHELL-$SHELL}-export SHELL-_ASEOF-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1-## -------------------- ##-## M4sh Initialization. ##-## -------------------- ##--# Be more Bourne compatible-DUALCASE=1; export DUALCASE # for MKS sh-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :-  emulate sh-  NULLCMD=:-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '${1+"$@"}'='"$@"'-  setopt NO_GLOB_SUBST-else-  case `(set -o) 2>/dev/null` in #(-  *posix*) :-    set -o posix ;; #(-  *) :-     ;;-esac-fi---as_nl='-'-export as_nl-# Printing a long string crashes Solaris 7 /usr/bin/printf.-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo-# Prefer a ksh shell builtin over an external printf program on Solaris,-# but without wasting forks for bash or zsh.-if test -z "$BASH_VERSION$ZSH_VERSION" \-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then-  as_echo='print -r --'-  as_echo_n='print -rn --'-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then-  as_echo='printf %s\n'-  as_echo_n='printf %s'-else-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'-    as_echo_n='/usr/ucb/echo -n'-  else-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'-    as_echo_n_body='eval-      arg=$1;-      case $arg in #(-      *"$as_nl"*)-	expr "X$arg" : "X\\(.*\\)$as_nl";-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;-      esac;-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"-    '-    export as_echo_n_body-    as_echo_n='sh -c $as_echo_n_body as_echo'-  fi-  export as_echo_body-  as_echo='sh -c $as_echo_body as_echo'-fi--# The user is always right.-if test "${PATH_SEPARATOR+set}" != set; then-  PATH_SEPARATOR=:-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||-      PATH_SEPARATOR=';'-  }-fi---# IFS-# We need space, tab and new line, in precisely that order.  Quoting is-# there to prevent editors from complaining about space-tab.-# (If _AS_PATH_WALK were called with IFS unset, it would disable word-# splitting by setting IFS to empty value.)-IFS=" ""	$as_nl"--# Find who we are.  Look in the path if we contain no directory separator.-case $0 in #((-  *[\\/]* ) as_myself=$0 ;;-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break-  done-IFS=$as_save_IFS--     ;;-esac-# We did not find ourselves, most probably we were run as `sh COMMAND'-# in which case we are not to be found in the path.-if test "x$as_myself" = x; then-  as_myself=$0-fi-if test ! -f "$as_myself"; then-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2-  exit 1-fi--# Unset variables that we do not need and which cause bugs (e.g. in-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"-# suppresses any "Segmentation fault" message there.  '((' could-# trigger a bug in pdksh 5.2.14.-for as_var in BASH_ENV ENV MAIL MAILPATH-do eval test x\${$as_var+set} = xset \-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :-done-PS1='$ '-PS2='> '-PS4='+ '--# NLS nuisances.-LC_ALL=C-export LC_ALL-LANGUAGE=C-export LANGUAGE--# CDPATH.-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH---# as_fn_error STATUS ERROR [LINENO LOG_FD]-# -----------------------------------------# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the-# script with STATUS, using 1 if that was 0.-as_fn_error ()-{-  as_status=$1; test $as_status -eq 0 && as_status=1-  if test "$4"; then-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4-  fi-  $as_echo "$as_me: error: $2" >&2-  as_fn_exit $as_status-} # as_fn_error---# as_fn_set_status STATUS-# ------------------------# Set $? to STATUS, without forking.-as_fn_set_status ()-{-  return $1-} # as_fn_set_status--# as_fn_exit STATUS-# ------------------# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.-as_fn_exit ()-{-  set +e-  as_fn_set_status $1-  exit $1-} # as_fn_exit--# as_fn_unset VAR-# ----------------# Portably unset VAR.-as_fn_unset ()-{-  { eval $1=; unset $1;}-}-as_unset=as_fn_unset-# as_fn_append VAR VALUE-# -----------------------# Append the text in VALUE to the end of the definition contained in VAR. Take-# advantage of any shell optimizations that allow amortized linear growth over-# repeated appends, instead of the typical quadratic growth present in naive-# implementations.-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :-  eval 'as_fn_append ()-  {-    eval $1+=\$2-  }'-else-  as_fn_append ()-  {-    eval $1=\$$1\$2-  }-fi # as_fn_append--# as_fn_arith ARG...-# -------------------# Perform arithmetic evaluation on the ARGs, and store the result in the-# global $as_val. Take advantage of shells that can avoid forks. The arguments-# must be portable across $(()) and expr.-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :-  eval 'as_fn_arith ()-  {-    as_val=$(( $* ))-  }'-else-  as_fn_arith ()-  {-    as_val=`expr "$@" || test $? -eq 1`-  }-fi # as_fn_arith---if expr a : '\(a\)' >/dev/null 2>&1 &&-   test "X`expr 00001 : '.*\(...\)'`" = X001; then-  as_expr=expr-else-  as_expr=false-fi--if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then-  as_basename=basename-else-  as_basename=false-fi--if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then-  as_dirname=dirname-else-  as_dirname=false-fi--as_me=`$as_basename -- "$0" ||-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \-	 X"$0" : 'X\(//\)$' \| \-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||-$as_echo X/"$0" |-    sed '/^.*\/\([^/][^/]*\)\/*$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`--# Avoid depending upon Character Ranges.-as_cr_letters='abcdefghijklmnopqrstuvwxyz'-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'-as_cr_Letters=$as_cr_letters$as_cr_LETTERS-as_cr_digits='0123456789'-as_cr_alnum=$as_cr_Letters$as_cr_digits--ECHO_C= ECHO_N= ECHO_T=-case `echo -n x` in #(((((--n*)-  case `echo 'xy\c'` in-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.-  xy)  ECHO_C='\c';;-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null-       ECHO_T='	';;-  esac;;-*)-  ECHO_N='-n';;-esac--rm -f conf$$ conf$$.exe conf$$.file-if test -d conf$$.dir; then-  rm -f conf$$.dir/conf$$.file-else-  rm -f conf$$.dir-  mkdir conf$$.dir 2>/dev/null-fi-if (echo >conf$$.file) 2>/dev/null; then-  if ln -s conf$$.file conf$$ 2>/dev/null; then-    as_ln_s='ln -s'-    # ... but there are two gotchas:-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.-    # In both cases, we have to default to `cp -p'.-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||-      as_ln_s='cp -p'-  elif ln conf$$.file conf$$ 2>/dev/null; then-    as_ln_s=ln-  else-    as_ln_s='cp -p'-  fi-else-  as_ln_s='cp -p'-fi-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file-rmdir conf$$.dir 2>/dev/null---# as_fn_mkdir_p-# --------------# Create "$as_dir" as a directory, including parents if necessary.-as_fn_mkdir_p ()-{--  case $as_dir in #(-  -*) as_dir=./$as_dir;;-  esac-  test -d "$as_dir" || eval $as_mkdir_p || {-    as_dirs=-    while :; do-      case $as_dir in #(-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(-      *) as_qdir=$as_dir;;-      esac-      as_dirs="'$as_qdir' $as_dirs"-      as_dir=`$as_dirname -- "$as_dir" ||-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$as_dir" : 'X\(//\)[^/]' \| \-	 X"$as_dir" : 'X\(//\)$' \| \-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||-$as_echo X"$as_dir" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-      test -d "$as_dir" && break-    done-    test -z "$as_dirs" || eval "mkdir $as_dirs"-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"---} # as_fn_mkdir_p-if mkdir -p . 2>/dev/null; then-  as_mkdir_p='mkdir -p "$as_dir"'-else-  test -d ./-p && rmdir ./-p-  as_mkdir_p=false-fi--if test -x / >/dev/null 2>&1; then-  as_test_x='test -x'-else-  if ls -dL / >/dev/null 2>&1; then-    as_ls_L_option=L-  else-    as_ls_L_option=-  fi-  as_test_x='-    eval sh -c '\''-      if test -d "$1"; then-	test -d "$1/.";-      else-	case $1 in #(-	-*)set "./$1";;-	esac;-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((-	???[sx]*):;;*)false;;esac;fi-    '\'' sh-  '-fi-as_executable_p=$as_test_x--# Sed expression to map a string onto a valid CPP name.-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"--# Sed expression to map a string onto a valid variable name.-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"---exec 6>&1-## ----------------------------------- ##-## Main body of $CONFIG_STATUS script. ##-## ----------------------------------- ##-_ASEOF-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-# Save the log message, to keep $0 and so on meaningful, and to-# report actual input values of CONFIG_FILES etc. instead of their-# values after options handling.-ac_log="-This file was extended by Haskell base package $as_me 1.0, which was-generated by GNU Autoconf 2.67.  Invocation command line was--  CONFIG_FILES    = $CONFIG_FILES-  CONFIG_HEADERS  = $CONFIG_HEADERS-  CONFIG_LINKS    = $CONFIG_LINKS-  CONFIG_COMMANDS = $CONFIG_COMMANDS-  $ $0 $@--on `(hostname || uname -n) 2>/dev/null | sed 1q`-"--_ACEOF--case $ac_config_files in *"-"*) set x $ac_config_files; shift; ac_config_files=$*;;-esac--case $ac_config_headers in *"-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;-esac---cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-# Files that config.status was made for.-config_files="$ac_config_files"-config_headers="$ac_config_headers"--_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-ac_cs_usage="\-\`$as_me' instantiates files and other configuration actions-from templates according to the current configuration.  Unless the files-and actions are specified as TAGs, all are instantiated by default.--Usage: $0 [OPTION]... [TAG]...--  -h, --help       print this help, then exit-  -V, --version    print version number and configuration settings, then exit-      --config     print configuration, then exit-  -q, --quiet, --silent-                   do not print progress messages-  -d, --debug      don't remove temporary files-      --recheck    update $as_me by reconfiguring in the same conditions-      --file=FILE[:TEMPLATE]-                   instantiate the configuration file FILE-      --header=FILE[:TEMPLATE]-                   instantiate the configuration header FILE--Configuration files:-$config_files--Configuration headers:-$config_headers--Report bugs to <libraries@haskell.org>."--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"-ac_cs_version="\\-Haskell base package config.status 1.0-configured by $0, generated by GNU Autoconf 2.67,-  with options \\"\$ac_cs_config\\"--Copyright (C) 2010 Free Software Foundation, Inc.-This config.status script is free software; the Free Software Foundation-gives unlimited permission to copy, distribute and modify it."--ac_pwd='$ac_pwd'-srcdir='$srcdir'-test -n "\$AWK" || AWK=awk-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-# The default lists apply if the user does not specify any file.-ac_need_defaults=:-while test $# != 0-do-  case $1 in-  --*=?*)-    ac_option=`expr "X$1" : 'X\([^=]*\)='`-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`-    ac_shift=:-    ;;-  --*=)-    ac_option=`expr "X$1" : 'X\([^=]*\)='`-    ac_optarg=-    ac_shift=:-    ;;-  *)-    ac_option=$1-    ac_optarg=$2-    ac_shift=shift-    ;;-  esac--  case $ac_option in-  # Handling of the options.-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)-    ac_cs_recheck=: ;;-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )-    $as_echo "$ac_cs_version"; exit ;;-  --config | --confi | --conf | --con | --co | --c )-    $as_echo "$ac_cs_config"; exit ;;-  --debug | --debu | --deb | --de | --d | -d )-    debug=: ;;-  --file | --fil | --fi | --f )-    $ac_shift-    case $ac_optarg in-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;-    '') as_fn_error $? "missing file argument" ;;-    esac-    as_fn_append CONFIG_FILES " '$ac_optarg'"-    ac_need_defaults=false;;-  --header | --heade | --head | --hea )-    $ac_shift-    case $ac_optarg in-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;-    esac-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"-    ac_need_defaults=false;;-  --he | --h)-    # Conflict between --help and --header-    as_fn_error $? "ambiguous option: \`$1'-Try \`$0 --help' for more information.";;-  --help | --hel | -h )-    $as_echo "$ac_cs_usage"; exit ;;-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \-  | -silent | --silent | --silen | --sile | --sil | --si | --s)-    ac_cs_silent=: ;;--  # This is an error.-  -*) as_fn_error $? "unrecognized option: \`$1'-Try \`$0 --help' for more information." ;;--  *) as_fn_append ac_config_targets " $1"-     ac_need_defaults=false ;;--  esac-  shift-done--ac_configure_extra_args=--if $ac_cs_silent; then-  exec 6>/dev/null-  ac_configure_extra_args="$ac_configure_extra_args --silent"-fi--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-if \$ac_cs_recheck; then-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion-  shift-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6-  CONFIG_SHELL='$SHELL'-  export CONFIG_SHELL-  exec "\$@"-fi--_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-exec 5>>config.log-{-  echo-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX-## Running $as_me. ##-_ASBOX-  $as_echo "$ac_log"-} >&5--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1--# Handling of arguments.-for ac_config_target in $ac_config_targets-do-  case $ac_config_target in-    "include/HsBaseConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/HsBaseConfig.h" ;;-    "include/EventConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/EventConfig.h" ;;-    "base.buildinfo") CONFIG_FILES="$CONFIG_FILES base.buildinfo" ;;--  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;-  esac-done---# If the user did not use the arguments to specify the items to instantiate,-# then the envvar interface is used.  Set only those that are not.-# We use the long form for the default assignment because of an extremely-# bizarre bug on SunOS 4.1.3.-if $ac_need_defaults; then-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers-fi--# Have a temporary directory for convenience.  Make it in the build tree-# simply because there is no reason against having it here, and in addition,-# creating and moving files from /tmp can sometimes cause problems.-# Hook for its removal unless debugging.-# Note that there is a small window in which the directory will not be cleaned:-# after its creation but before its name has been assigned to `$tmp'.-$debug ||-{-  tmp=-  trap 'exit_status=$?-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status-' 0-  trap 'as_fn_exit 1' 1 2 13 15-}-# Create a (secure) tmp directory for tmp files.--{-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&-  test -n "$tmp" && test -d "$tmp"-}  ||-{-  tmp=./conf$$-$RANDOM-  (umask 077 && mkdir "$tmp")-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5--# Set up the scripts for CONFIG_FILES section.-# No need to generate them if there are no CONFIG_FILES.-# This happens for instance with `./config.status config.h'.-if test -n "$CONFIG_FILES"; then---ac_cr=`echo X | tr X '\015'`-# On cygwin, bash can eat \r inside `` if the user requested igncr.-# But we know of no other shell where ac_cr would be empty at this-# point, so we can use a bashism as a fallback.-if test "x$ac_cr" = x; then-  eval ac_cr=\$\'\\r\'-fi-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then-  ac_cs_awk_cr='\\r'-else-  ac_cs_awk_cr=$ac_cr-fi--echo 'BEGIN {' >"$tmp/subs1.awk" &&-_ACEOF---{-  echo "cat >conf$$subs.awk <<_ACEOF" &&-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&-  echo "_ACEOF"-} >conf$$subs.sh ||-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`-ac_delim='%!_!# '-for ac_last_try in false false false false false :; do-  . ./conf$$subs.sh ||-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5--  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`-  if test $ac_delim_n = $ac_delim_num; then-    break-  elif $ac_last_try; then-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5-  else-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "-  fi-done-rm -f conf$$subs.sh--cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&-_ACEOF-sed -n '-h-s/^/S["/; s/!.*/"]=/-p-g-s/^[^!]*!//-:repl-t repl-s/'"$ac_delim"'$//-t delim-:nl-h-s/\(.\{148\}\)..*/\1/-t more1-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/-p-n-b repl-:more1-s/["\\]/\\&/g; s/^/"/; s/$/"\\/-p-g-s/.\{148\}//-t nl-:delim-h-s/\(.\{148\}\)..*/\1/-t more2-s/["\\]/\\&/g; s/^/"/; s/$/"/-p-b-:more2-s/["\\]/\\&/g; s/^/"/; s/$/"\\/-p-g-s/.\{148\}//-t delim-' <conf$$subs.awk | sed '-/^[^""]/{-  N-  s/\n//-}-' >>$CONFIG_STATUS || ac_write_fail=1-rm -f conf$$subs.awk-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-_ACAWK-cat >>"\$tmp/subs1.awk" <<_ACAWK &&-  for (key in S) S_is_set[key] = 1-  FS = ""--}-{-  line = $ 0-  nfields = split(line, field, "@")-  substed = 0-  len = length(field[1])-  for (i = 2; i < nfields; i++) {-    key = field[i]-    keylen = length(key)-    if (S_is_set[key]) {-      value = S[key]-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)-      len += length(value) + length(field[++i])-      substed = 1-    } else-      len += 1 + keylen-  }--  print line-}--_ACAWK-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"-else-  cat-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5-_ACEOF--# VPATH may cause trouble with some makes, so we remove sole $(srcdir),-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and-# trailing colons and then remove the whole line if VPATH becomes empty-# (actually we leave an empty line to preserve line numbers).-if test "x$srcdir" = x.; then-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{-h-s///-s/^/:/-s/[	 ]*$/:/-s/:\$(srcdir):/:/g-s/:\${srcdir}:/:/g-s/:@srcdir@:/:/g-s/^:*//-s/:*$//-x-s/\(=[	 ]*\).*/\1/-G-s/\n//-s/^[^=]*=[	 ]*$//-}'-fi--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-fi # test -n "$CONFIG_FILES"--# Set up the scripts for CONFIG_HEADERS section.-# No need to generate them if there are no CONFIG_HEADERS.-# This happens for instance with `./config.status Makefile'.-if test -n "$CONFIG_HEADERS"; then-cat >"$tmp/defines.awk" <<\_ACAWK ||-BEGIN {-_ACEOF--# Transform confdefs.h into an awk script `defines.awk', embedded as-# here-document in config.status, that substitutes the proper values into-# config.h.in to produce config.h.--# Create a delimiter string that does not exist in confdefs.h, to ease-# handling of long lines.-ac_delim='%!_!# '-for ac_last_try in false false :; do-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`-  if test -z "$ac_t"; then-    break-  elif $ac_last_try; then-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5-  else-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "-  fi-done--# For the awk script, D is an array of macro values keyed by name,-# likewise P contains macro parameters if any.  Preserve backslash-# newline sequences.--ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*-sed -n '-s/.\{148\}/&'"$ac_delim"'/g-t rset-:rset-s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /-t def-d-:def-s/\\$//-t bsnl-s/["\\]/\\&/g-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\-D["\1"]=" \3"/p-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p-d-:bsnl-s/["\\]/\\&/g-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\-D["\1"]=" \3\\\\\\n"\\/p-t cont-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p-t cont-d-:cont-n-s/.\{148\}/&'"$ac_delim"'/g-t clear-:clear-s/\\$//-t bsnlc-s/["\\]/\\&/g; s/^/"/; s/$/"/p-d-:bsnlc-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p-b cont-' <confdefs.h | sed '-s/'"$ac_delim"'/"\\\-"/g' >>$CONFIG_STATUS || ac_write_fail=1--cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-  for (key in D) D_is_set[key] = 1-  FS = ""-}-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {-  line = \$ 0-  split(line, arg, " ")-  if (arg[1] == "#") {-    defundef = arg[2]-    mac1 = arg[3]-  } else {-    defundef = substr(arg[1], 2)-    mac1 = arg[2]-  }-  split(mac1, mac2, "(") #)-  macro = mac2[1]-  prefix = substr(line, 1, index(line, defundef) - 1)-  if (D_is_set[macro]) {-    # Preserve the white space surrounding the "#".-    print prefix "define", macro P[macro] D[macro]-    next-  } else {-    # Replace #undef with comments.  This is necessary, for example,-    # in the case of _POSIX_SOURCE, which is predefined and required-    # on some systems where configure will not decide to define it.-    if (defundef == "undef") {-      print "/*", prefix defundef, macro, "*/"-      next-    }-  }-}-{ print }-_ACAWK-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5-fi # test -n "$CONFIG_HEADERS"---eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "-shift-for ac_tag-do-  case $ac_tag in-  :[FHLC]) ac_mode=$ac_tag; continue;;-  esac-  case $ac_mode$ac_tag in-  :[FHL]*:*);;-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;-  :[FH]-) ac_tag=-:-;;-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;-  esac-  ac_save_IFS=$IFS-  IFS=:-  set x $ac_tag-  IFS=$ac_save_IFS-  shift-  ac_file=$1-  shift--  case $ac_mode in-  :L) ac_source=$1;;-  :[FH])-    ac_file_inputs=-    for ac_f-    do-      case $ac_f in-      -) ac_f="$tmp/stdin";;-      *) # Look for the file first in the build tree, then in the source tree-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,-	 # because $ac_f cannot contain `:'.-	 test -f "$ac_f" ||-	   case $ac_f in-	   [\\/$]*) false;;-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;-	   esac ||-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;-      esac-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac-      as_fn_append ac_file_inputs " '$ac_f'"-    done--    # Let's still pretend it is `configure' which instantiates (i.e., don't-    # use $as_me), people would be surprised to read:-    #    /* config.h.  Generated by config.status.  */-    configure_input='Generated from '`-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'-	`' by configure.'-    if test x"$ac_file" != x-; then-      configure_input="$ac_file.  $configure_input"-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5-$as_echo "$as_me: creating $ac_file" >&6;}-    fi-    # Neutralize special characters interpreted by sed in replacement strings.-    case $configure_input in #(-    *\&* | *\|* | *\\* )-       ac_sed_conf_input=`$as_echo "$configure_input" |-       sed 's/[\\\\&|]/\\\\&/g'`;; #(-    *) ac_sed_conf_input=$configure_input;;-    esac--    case $ac_tag in-    *:-:* | *:-) cat >"$tmp/stdin" \-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;-    esac-    ;;-  esac--  ac_dir=`$as_dirname -- "$ac_file" ||-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$ac_file" : 'X\(//\)[^/]' \| \-	 X"$ac_file" : 'X\(//\)$' \| \-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||-$as_echo X"$ac_file" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-  as_dir="$ac_dir"; as_fn_mkdir_p-  ac_builddir=.--case "$ac_dir" in-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;-*)-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`-  # A ".." for each directory in $ac_dir_suffix.-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`-  case $ac_top_builddir_sub in-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;-  esac ;;-esac-ac_abs_top_builddir=$ac_pwd-ac_abs_builddir=$ac_pwd$ac_dir_suffix-# for backward compatibility:-ac_top_builddir=$ac_top_build_prefix--case $srcdir in-  .)  # We are building in place.-    ac_srcdir=.-    ac_top_srcdir=$ac_top_builddir_sub-    ac_abs_top_srcdir=$ac_pwd ;;-  [\\/]* | ?:[\\/]* )  # Absolute name.-    ac_srcdir=$srcdir$ac_dir_suffix;-    ac_top_srcdir=$srcdir-    ac_abs_top_srcdir=$srcdir ;;-  *) # Relative name.-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix-    ac_top_srcdir=$ac_top_build_prefix$srcdir-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;-esac-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix---  case $ac_mode in-  :F)-  #-  # CONFIG_FILE-  #--_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-# If the template does not know about datarootdir, expand it.-# FIXME: This hack should be removed a few years after 2.60.-ac_datarootdir_hack=; ac_datarootdir_seen=-ac_sed_dataroot='-/datarootdir/ {-  p-  q-}-/@datadir@/p-/@docdir@/p-/@infodir@/p-/@localedir@/p-/@mandir@/p'-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in-*datarootdir*) ac_datarootdir_seen=yes;;-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}-_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-  ac_datarootdir_hack='-  s&@datadir@&$datadir&g-  s&@docdir@&$docdir&g-  s&@infodir@&$infodir&g-  s&@localedir@&$localedir&g-  s&@mandir@&$mandir&g-  s&\\\${datarootdir}&$datarootdir&g' ;;-esac-_ACEOF--# Neutralize VPATH when `$srcdir' = `.'.-# Shell code in configure.ac might set extrasub.-# FIXME: do we really want to maintain this feature?-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-ac_sed_extra="$ac_vpsub-$extrasub-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-:t-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b-s|@configure_input@|$ac_sed_conf_input|;t t-s&@top_builddir@&$ac_top_builddir_sub&;t t-s&@top_build_prefix@&$ac_top_build_prefix&;t t-s&@srcdir@&$ac_srcdir&;t t-s&@abs_srcdir@&$ac_abs_srcdir&;t t-s&@top_srcdir@&$ac_top_srcdir&;t t-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t-s&@builddir@&$ac_builddir&;t t-s&@abs_builddir@&$ac_abs_builddir&;t t-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t-$ac_datarootdir_hack-"-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5--test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'-which seems to be undefined.  Please make sure it is defined" >&5-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'-which seems to be undefined.  Please make sure it is defined" >&2;}--  rm -f "$tmp/stdin"-  case $ac_file in-  -) cat "$tmp/out" && rm -f "$tmp/out";;-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;-  esac \-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5- ;;-  :H)-  #-  # CONFIG_HEADER-  #-  if test x"$ac_file" != x-; then-    {-      $as_echo "/* $configure_input  */" \-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"-    } >"$tmp/config.h" \-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5-$as_echo "$as_me: $ac_file is unchanged" >&6;}-    else-      rm -f "$ac_file"-      mv "$tmp/config.h" "$ac_file" \-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5-    fi-  else-    $as_echo "/* $configure_input  */" \-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \+# Generated by GNU Autoconf 2.69 for Haskell base package 1.0.+#+# Report bugs to <libraries@haskell.org>.+#+#+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.+#+#+# This configure script is free software; the Free Software Foundation+# gives unlimited permission to copy, distribute and modify it.+## -------------------- ##+## M4sh Initialization. ##+## -------------------- ##++# Be more Bourne compatible+DUALCASE=1; export DUALCASE # for MKS sh+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :+  emulate sh+  NULLCMD=:+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which+  # is contrary to our usage.  Disable this feature.+  alias -g '${1+"$@"}'='"$@"'+  setopt NO_GLOB_SUBST+else+  case `(set -o) 2>/dev/null` in #(+  *posix*) :+    set -o posix ;; #(+  *) :+     ;;+esac+fi+++as_nl='+'+export as_nl+# Printing a long string crashes Solaris 7 /usr/bin/printf.+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo+# Prefer a ksh shell builtin over an external printf program on Solaris,+# but without wasting forks for bash or zsh.+if test -z "$BASH_VERSION$ZSH_VERSION" \+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='print -r --'+  as_echo_n='print -rn --'+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='printf %s\n'+  as_echo_n='printf %s'+else+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'+    as_echo_n='/usr/ucb/echo -n'+  else+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'+    as_echo_n_body='eval+      arg=$1;+      case $arg in #(+      *"$as_nl"*)+	expr "X$arg" : "X\\(.*\\)$as_nl";+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;+      esac;+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"+    '+    export as_echo_n_body+    as_echo_n='sh -c $as_echo_n_body as_echo'+  fi+  export as_echo_body+  as_echo='sh -c $as_echo_body as_echo'+fi++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+  PATH_SEPARATOR=:+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||+      PATH_SEPARATOR=';'+  }+fi+++# IFS+# We need space, tab and new line, in precisely that order.  Quoting is+# there to prevent editors from complaining about space-tab.+# (If _AS_PATH_WALK were called with IFS unset, it would disable word+# splitting by setting IFS to empty value.)+IFS=" ""	$as_nl"++# Find who we are.  Look in the path if we contain no directory separator.+as_myself=+case $0 in #((+  *[\\/]* ) as_myself=$0 ;;+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+  done+IFS=$as_save_IFS++     ;;+esac+# We did not find ourselves, most probably we were run as `sh COMMAND'+# in which case we are not to be found in the path.+if test "x$as_myself" = x; then+  as_myself=$0+fi+if test ! -f "$as_myself"; then+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2+  exit 1+fi++# Unset variables that we do not need and which cause bugs (e.g. in+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"+# suppresses any "Segmentation fault" message there.  '((' could+# trigger a bug in pdksh 5.2.14.+for as_var in BASH_ENV ENV MAIL MAILPATH+do eval test x\${$as_var+set} = xset \+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :+done+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+LC_ALL=C+export LC_ALL+LANGUAGE=C+export LANGUAGE++# CDPATH.+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH++# Use a proper internal environment variable to ensure we don't fall+  # into an infinite loop, continuously re-executing ourselves.+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then+    _as_can_reexec=no; export _as_can_reexec;+    # We cannot yet assume a decent shell, so we have to provide a+# neutralization value for shells without unset; and this also+# works around shells that cannot unset nonexistent variables.+# Preserve -v and -x to the replacement shell.+BASH_ENV=/dev/null+ENV=/dev/null+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV+case $- in # ((((+  *v*x* | *x*v* ) as_opts=-vx ;;+  *v* ) as_opts=-v ;;+  *x* ) as_opts=-x ;;+  * ) as_opts= ;;+esac+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}+# Admittedly, this is quite paranoid, since all the known shells bail+# out after a failed `exec'.+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2+as_fn_exit 255+  fi+  # We don't want this to propagate to other subprocesses.+          { _as_can_reexec=; unset _as_can_reexec;}+if test "x$CONFIG_SHELL" = x; then+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :+  emulate sh+  NULLCMD=:+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which+  # is contrary to our usage.  Disable this feature.+  alias -g '\${1+\"\$@\"}'='\"\$@\"'+  setopt NO_GLOB_SUBST+else+  case \`(set -o) 2>/dev/null\` in #(+  *posix*) :+    set -o posix ;; #(+  *) :+     ;;+esac+fi+"+  as_required="as_fn_return () { (exit \$1); }+as_fn_success () { as_fn_return 0; }+as_fn_failure () { as_fn_return 1; }+as_fn_ret_success () { return 0; }+as_fn_ret_failure () { return 1; }++exitcode=0+as_fn_success || { exitcode=1; echo as_fn_success failed.; }+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :++else+  exitcode=1; echo positional parameters were not saved.+fi+test x\$exitcode = x0 || exit 1+test -x / || exit 1"+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1+test \$(( 1 + 1 )) = 2 || exit 1"+  if (eval "$as_required") 2>/dev/null; then :+  as_have_required=yes+else+  as_have_required=no+fi+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :++else+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+as_found=false+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+  as_found=:+  case $as_dir in #(+	 /*)+	   for as_base in sh bash ksh sh5; do+	     # Try only shells that exist, to save several forks.+	     as_shell=$as_dir/$as_base+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :+  CONFIG_SHELL=$as_shell as_have_required=yes+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :+  break 2+fi+fi+	   done;;+       esac+  as_found=false+done+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :+  CONFIG_SHELL=$SHELL as_have_required=yes+fi; }+IFS=$as_save_IFS+++      if test "x$CONFIG_SHELL" != x; then :+  export CONFIG_SHELL+             # We cannot yet assume a decent shell, so we have to provide a+# neutralization value for shells without unset; and this also+# works around shells that cannot unset nonexistent variables.+# Preserve -v and -x to the replacement shell.+BASH_ENV=/dev/null+ENV=/dev/null+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV+case $- in # ((((+  *v*x* | *x*v* ) as_opts=-vx ;;+  *v* ) as_opts=-v ;;+  *x* ) as_opts=-x ;;+  * ) as_opts= ;;+esac+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}+# Admittedly, this is quite paranoid, since all the known shells bail+# out after a failed `exec'.+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2+exit 255+fi++    if test x$as_have_required = xno; then :+  $as_echo "$0: This script requires a shell more modern than all"+  $as_echo "$0: the shells that I found on your system."+  if test x${ZSH_VERSION+set} = xset ; then+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."+  else+    $as_echo "$0: Please tell bug-autoconf@gnu.org and+$0: libraries@haskell.org about your system, including any+$0: error possibly output before this message. Then install+$0: a modern shell, or manually run the script under such a+$0: shell if you do have one."+  fi+  exit 1+fi+fi+fi+SHELL=${CONFIG_SHELL-/bin/sh}+export SHELL+# Unset more variables known to interfere with behavior of common tools.+CLICOLOR_FORCE= GREP_OPTIONS=+unset CLICOLOR_FORCE GREP_OPTIONS++## --------------------- ##+## M4sh Shell Functions. ##+## --------------------- ##+# as_fn_unset VAR+# ---------------+# Portably unset VAR.+as_fn_unset ()+{+  { eval $1=; unset $1;}+}+as_unset=as_fn_unset++# as_fn_set_status STATUS+# -----------------------+# Set $? to STATUS, without forking.+as_fn_set_status ()+{+  return $1+} # as_fn_set_status++# as_fn_exit STATUS+# -----------------+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.+as_fn_exit ()+{+  set +e+  as_fn_set_status $1+  exit $1+} # as_fn_exit++# as_fn_mkdir_p+# -------------+# Create "$as_dir" as a directory, including parents if necessary.+as_fn_mkdir_p ()+{++  case $as_dir in #(+  -*) as_dir=./$as_dir;;+  esac+  test -d "$as_dir" || eval $as_mkdir_p || {+    as_dirs=+    while :; do+      case $as_dir in #(+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(+      *) as_qdir=$as_dir;;+      esac+      as_dirs="'$as_qdir' $as_dirs"+      as_dir=`$as_dirname -- "$as_dir" ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_dir" : 'X\(//\)[^/]' \| \+	 X"$as_dir" : 'X\(//\)$' \| \+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_dir" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+      test -d "$as_dir" && break+    done+    test -z "$as_dirs" || eval "mkdir $as_dirs"+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"+++} # as_fn_mkdir_p++# as_fn_executable_p FILE+# -----------------------+# Test if FILE is an executable regular file.+as_fn_executable_p ()+{+  test -f "$1" && test -x "$1"+} # as_fn_executable_p+# as_fn_append VAR VALUE+# ----------------------+# Append the text in VALUE to the end of the definition contained in VAR. Take+# advantage of any shell optimizations that allow amortized linear growth over+# repeated appends, instead of the typical quadratic growth present in naive+# implementations.+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :+  eval 'as_fn_append ()+  {+    eval $1+=\$2+  }'+else+  as_fn_append ()+  {+    eval $1=\$$1\$2+  }+fi # as_fn_append++# as_fn_arith ARG...+# ------------------+# Perform arithmetic evaluation on the ARGs, and store the result in the+# global $as_val. Take advantage of shells that can avoid forks. The arguments+# must be portable across $(()) and expr.+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :+  eval 'as_fn_arith ()+  {+    as_val=$(( $* ))+  }'+else+  as_fn_arith ()+  {+    as_val=`expr "$@" || test $? -eq 1`+  }+fi # as_fn_arith+++# as_fn_error STATUS ERROR [LINENO LOG_FD]+# ----------------------------------------+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the+# script with STATUS, using 1 if that was 0.+as_fn_error ()+{+  as_status=$1; test $as_status -eq 0 && as_status=1+  if test "$4"; then+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4+  fi+  $as_echo "$as_me: error: $2" >&2+  as_fn_exit $as_status+} # as_fn_error++if expr a : '\(a\)' >/dev/null 2>&1 &&+   test "X`expr 00001 : '.*\(...\)'`" = X001; then+  as_expr=expr+else+  as_expr=false+fi++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then+  as_basename=basename+else+  as_basename=false+fi++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then+  as_dirname=dirname+else+  as_dirname=false+fi++as_me=`$as_basename -- "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+	 X"$0" : 'X\(//\)$' \| \+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X/"$0" |+    sed '/^.*\/\([^/][^/]*\)\/*$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`++# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits+++  as_lineno_1=$LINENO as_lineno_1a=$LINENO+  as_lineno_2=$LINENO as_lineno_2a=$LINENO+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)+  sed -n '+    p+    /[$]LINENO/=+  ' <$as_myself |+    sed '+      s/[$]LINENO.*/&-/+      t lineno+      b+      :lineno+      N+      :loop+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/+      t loop+      s/-\n.*//+    ' >$as_me.lineno &&+  chmod +x "$as_me.lineno" ||+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }++  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have+  # already done that, so ensure we don't try to do so again and fall+  # in an infinite loop.  This has already happened in practice.+  _as_can_reexec=no; export _as_can_reexec+  # Don't try to exec as it changes $[0], causing all sort of problems+  # (the dirname of $[0] is not the place where we might find the+  # original and so on.  Autoconf is especially sensitive to this).+  . "./$as_me.lineno"+  # Exit status is that of the last command.+  exit+}++ECHO_C= ECHO_N= ECHO_T=+case `echo -n x` in #(((((+-n*)+  case `echo 'xy\c'` in+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.+  xy)  ECHO_C='\c';;+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null+       ECHO_T='	';;+  esac;;+*)+  ECHO_N='-n';;+esac++rm -f conf$$ conf$$.exe conf$$.file+if test -d conf$$.dir; then+  rm -f conf$$.dir/conf$$.file+else+  rm -f conf$$.dir+  mkdir conf$$.dir 2>/dev/null+fi+if (echo >conf$$.file) 2>/dev/null; then+  if ln -s conf$$.file conf$$ 2>/dev/null; then+    as_ln_s='ln -s'+    # ... but there are two gotchas:+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.+    # In both cases, we have to default to `cp -pR'.+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||+      as_ln_s='cp -pR'+  elif ln conf$$.file conf$$ 2>/dev/null; then+    as_ln_s=ln+  else+    as_ln_s='cp -pR'+  fi+else+  as_ln_s='cp -pR'+fi+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file+rmdir conf$$.dir 2>/dev/null++if mkdir -p . 2>/dev/null; then+  as_mkdir_p='mkdir -p "$as_dir"'+else+  test -d ./-p && rmdir ./-p+  as_mkdir_p=false+fi++as_test_x='test -x'+as_executable_p=as_fn_executable_p++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"+++test -n "$DJDIR" || exec 7<&0 </dev/null+exec 6>&1++# Name of the host.+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,+# so uname gets run too.+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`++#+# Initializations.+#+ac_default_prefix=/usr/local+ac_clean_files=+ac_config_libobj_dir=.+LIBOBJS=+cross_compiling=no+subdirs=+MFLAGS=+MAKEFLAGS=++# Identity of this package.+PACKAGE_NAME='Haskell base package'+PACKAGE_TARNAME='base'+PACKAGE_VERSION='1.0'+PACKAGE_STRING='Haskell base package 1.0'+PACKAGE_BUGREPORT='libraries@haskell.org'+PACKAGE_URL=''++ac_unique_file="include/HsBase.h"+# Factoring default headers for most tests.+ac_includes_default="\+#include <stdio.h>+#ifdef HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif+#ifdef HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif+#ifdef STDC_HEADERS+# include <stdlib.h>+# include <stddef.h>+#else+# ifdef HAVE_STDLIB_H+#  include <stdlib.h>+# endif+#endif+#ifdef HAVE_STRING_H+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H+#  include <memory.h>+# endif+# include <string.h>+#endif+#ifdef HAVE_STRINGS_H+# include <strings.h>+#endif+#ifdef HAVE_INTTYPES_H+# include <inttypes.h>+#endif+#ifdef HAVE_STDINT_H+# include <stdint.h>+#endif+#ifdef HAVE_UNISTD_H+# include <unistd.h>+#endif"++ac_subst_vars='LTLIBOBJS+LIBOBJS+EXTRA_LIBS+ICONV_LIB_DIRS+ICONV_INCLUDE_DIRS+EGREP+GREP+CPP+OBJEXT+EXEEXT+ac_ct_CC+CPPFLAGS+LDFLAGS+CFLAGS+CC+target_os+target_vendor+target_cpu+target+host_os+host_vendor+host_cpu+host+build_os+build_vendor+build_cpu+build+target_alias+host_alias+build_alias+LIBS+ECHO_T+ECHO_N+ECHO_C+DEFS+mandir+localedir+libdir+psdir+pdfdir+dvidir+htmldir+infodir+docdir+oldincludedir+includedir+localstatedir+sharedstatedir+sysconfdir+datadir+datarootdir+libexecdir+sbindir+bindir+program_transform_name+prefix+exec_prefix+PACKAGE_URL+PACKAGE_BUGREPORT+PACKAGE_STRING+PACKAGE_VERSION+PACKAGE_TARNAME+PACKAGE_NAME+PATH_SEPARATOR+SHELL'+ac_subst_files=''+ac_user_opts='+enable_option_checking+with_cc+enable_largefile+with_iconv_includes+with_iconv_libraries+'+      ac_precious_vars='build_alias+host_alias+target_alias+CC+CFLAGS+LDFLAGS+LIBS+CPPFLAGS+CPP'+++# Initialize some variables set by options.+ac_init_help=+ac_init_version=false+ac_unrecognized_opts=+ac_unrecognized_sep=+# The variables have the same names as the options, with+# dashes changed to underlines.+cache_file=/dev/null+exec_prefix=NONE+no_create=+no_recursion=+prefix=NONE+program_prefix=NONE+program_suffix=NONE+program_transform_name=s,x,x,+silent=+site=+srcdir=+verbose=+x_includes=NONE+x_libraries=NONE++# Installation directory options.+# These are left unexpanded so users can "make install exec_prefix=/foo"+# and all the variables that are supposed to be based on exec_prefix+# by default will actually change.+# Use braces instead of parens because sh, perl, etc. also accept them.+# (The list follows the same order as the GNU Coding Standards.)+bindir='${exec_prefix}/bin'+sbindir='${exec_prefix}/sbin'+libexecdir='${exec_prefix}/libexec'+datarootdir='${prefix}/share'+datadir='${datarootdir}'+sysconfdir='${prefix}/etc'+sharedstatedir='${prefix}/com'+localstatedir='${prefix}/var'+includedir='${prefix}/include'+oldincludedir='/usr/include'+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'+infodir='${datarootdir}/info'+htmldir='${docdir}'+dvidir='${docdir}'+pdfdir='${docdir}'+psdir='${docdir}'+libdir='${exec_prefix}/lib'+localedir='${datarootdir}/locale'+mandir='${datarootdir}/man'++ac_prev=+ac_dashdash=+for ac_option+do+  # If the previous option needs an argument, assign it.+  if test -n "$ac_prev"; then+    eval $ac_prev=\$ac_option+    ac_prev=+    continue+  fi++  case $ac_option in+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;+  *=)   ac_optarg= ;;+  *)    ac_optarg=yes ;;+  esac++  # Accept the important Cygnus configure options, so we can diagnose typos.++  case $ac_dashdash$ac_option in+  --)+    ac_dashdash=yes ;;++  -bindir | --bindir | --bindi | --bind | --bin | --bi)+    ac_prev=bindir ;;+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)+    bindir=$ac_optarg ;;++  -build | --build | --buil | --bui | --bu)+    ac_prev=build_alias ;;+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)+    build_alias=$ac_optarg ;;++  -cache-file | --cache-file | --cache-fil | --cache-fi \+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)+    ac_prev=cache_file ;;+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)+    cache_file=$ac_optarg ;;++  --config-cache | -C)+    cache_file=config.cache ;;++  -datadir | --datadir | --datadi | --datad)+    ac_prev=datadir ;;+  -datadir=* | --datadir=* | --datadi=* | --datad=*)+    datadir=$ac_optarg ;;++  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \+  | --dataroo | --dataro | --datar)+    ac_prev=datarootdir ;;+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)+    datarootdir=$ac_optarg ;;++  -disable-* | --disable-*)+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error $? "invalid feature name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"enable_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval enable_$ac_useropt=no ;;++  -docdir | --docdir | --docdi | --doc | --do)+    ac_prev=docdir ;;+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)+    docdir=$ac_optarg ;;++  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)+    ac_prev=dvidir ;;+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)+    dvidir=$ac_optarg ;;++  -enable-* | --enable-*)+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error $? "invalid feature name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"enable_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval enable_$ac_useropt=\$ac_optarg ;;++  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \+  | --exec | --exe | --ex)+    ac_prev=exec_prefix ;;+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \+  | --exec=* | --exe=* | --ex=*)+    exec_prefix=$ac_optarg ;;++  -gas | --gas | --ga | --g)+    # Obsolete; use --with-gas.+    with_gas=yes ;;++  -help | --help | --hel | --he | -h)+    ac_init_help=long ;;+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)+    ac_init_help=recursive ;;+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)+    ac_init_help=short ;;++  -host | --host | --hos | --ho)+    ac_prev=host_alias ;;+  -host=* | --host=* | --hos=* | --ho=*)+    host_alias=$ac_optarg ;;++  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)+    ac_prev=htmldir ;;+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \+  | --ht=*)+    htmldir=$ac_optarg ;;++  -includedir | --includedir | --includedi | --included | --include \+  | --includ | --inclu | --incl | --inc)+    ac_prev=includedir ;;+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \+  | --includ=* | --inclu=* | --incl=* | --inc=*)+    includedir=$ac_optarg ;;++  -infodir | --infodir | --infodi | --infod | --info | --inf)+    ac_prev=infodir ;;+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)+    infodir=$ac_optarg ;;++  -libdir | --libdir | --libdi | --libd)+    ac_prev=libdir ;;+  -libdir=* | --libdir=* | --libdi=* | --libd=*)+    libdir=$ac_optarg ;;++  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \+  | --libexe | --libex | --libe)+    ac_prev=libexecdir ;;+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \+  | --libexe=* | --libex=* | --libe=*)+    libexecdir=$ac_optarg ;;++  -localedir | --localedir | --localedi | --localed | --locale)+    ac_prev=localedir ;;+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)+    localedir=$ac_optarg ;;++  -localstatedir | --localstatedir | --localstatedi | --localstated \+  | --localstate | --localstat | --localsta | --localst | --locals)+    ac_prev=localstatedir ;;+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)+    localstatedir=$ac_optarg ;;++  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)+    ac_prev=mandir ;;+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)+    mandir=$ac_optarg ;;++  -nfp | --nfp | --nf)+    # Obsolete; use --without-fp.+    with_fp=no ;;++  -no-create | --no-create | --no-creat | --no-crea | --no-cre \+  | --no-cr | --no-c | -n)+    no_create=yes ;;++  -no-recursion | --no-recursion | --no-recursio | --no-recursi \+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)+    no_recursion=yes ;;++  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \+  | --oldin | --oldi | --old | --ol | --o)+    ac_prev=oldincludedir ;;+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)+    oldincludedir=$ac_optarg ;;++  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)+    ac_prev=prefix ;;+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)+    prefix=$ac_optarg ;;++  -program-prefix | --program-prefix | --program-prefi | --program-pref \+  | --program-pre | --program-pr | --program-p)+    ac_prev=program_prefix ;;+  -program-prefix=* | --program-prefix=* | --program-prefi=* \+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)+    program_prefix=$ac_optarg ;;++  -program-suffix | --program-suffix | --program-suffi | --program-suff \+  | --program-suf | --program-su | --program-s)+    ac_prev=program_suffix ;;+  -program-suffix=* | --program-suffix=* | --program-suffi=* \+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)+    program_suffix=$ac_optarg ;;++  -program-transform-name | --program-transform-name \+  | --program-transform-nam | --program-transform-na \+  | --program-transform-n | --program-transform- \+  | --program-transform | --program-transfor \+  | --program-transfo | --program-transf \+  | --program-trans | --program-tran \+  | --progr-tra | --program-tr | --program-t)+    ac_prev=program_transform_name ;;+  -program-transform-name=* | --program-transform-name=* \+  | --program-transform-nam=* | --program-transform-na=* \+  | --program-transform-n=* | --program-transform-=* \+  | --program-transform=* | --program-transfor=* \+  | --program-transfo=* | --program-transf=* \+  | --program-trans=* | --program-tran=* \+  | --progr-tra=* | --program-tr=* | --program-t=*)+    program_transform_name=$ac_optarg ;;++  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)+    ac_prev=pdfdir ;;+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)+    pdfdir=$ac_optarg ;;++  -psdir | --psdir | --psdi | --psd | --ps)+    ac_prev=psdir ;;+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir=$ac_optarg ;;++  -q | -quiet | --quiet | --quie | --qui | --qu | --q \+  | -silent | --silent | --silen | --sile | --sil)+    silent=yes ;;++  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)+    ac_prev=sbindir ;;+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \+  | --sbi=* | --sb=*)+    sbindir=$ac_optarg ;;++  -sharedstatedir | --sharedstatedir | --sharedstatedi \+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \+  | --sharedst | --shareds | --shared | --share | --shar \+  | --sha | --sh)+    ac_prev=sharedstatedir ;;+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \+  | --sha=* | --sh=*)+    sharedstatedir=$ac_optarg ;;++  -site | --site | --sit)+    ac_prev=site ;;+  -site=* | --site=* | --sit=*)+    site=$ac_optarg ;;++  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)+    ac_prev=srcdir ;;+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)+    srcdir=$ac_optarg ;;++  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \+  | --syscon | --sysco | --sysc | --sys | --sy)+    ac_prev=sysconfdir ;;+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)+    sysconfdir=$ac_optarg ;;++  -target | --target | --targe | --targ | --tar | --ta | --t)+    ac_prev=target_alias ;;+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)+    target_alias=$ac_optarg ;;++  -v | -verbose | --verbose | --verbos | --verbo | --verb)+    verbose=yes ;;++  -version | --version | --versio | --versi | --vers | -V)+    ac_init_version=: ;;++  -with-* | --with-*)+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error $? "invalid package name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"with_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval with_$ac_useropt=\$ac_optarg ;;++  -without-* | --without-*)+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error $? "invalid package name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"with_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval with_$ac_useropt=no ;;++  --x)+    # Obsolete; use --with-x.+    with_x=yes ;;++  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \+  | --x-incl | --x-inc | --x-in | --x-i)+    ac_prev=x_includes ;;+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)+    x_includes=$ac_optarg ;;++  -x-libraries | --x-libraries | --x-librarie | --x-librari \+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)+    ac_prev=x_libraries ;;+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)+    x_libraries=$ac_optarg ;;++  -*) as_fn_error $? "unrecognized option: \`$ac_option'+Try \`$0 --help' for more information"+    ;;++  *=*)+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`+    # Reject names that are not valid shell variable names.+    case $ac_envvar in #(+      '' | [0-9]* | *[!_$as_cr_alnum]* )+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;+    esac+    eval $ac_envvar=\$ac_optarg+    export $ac_envvar ;;++  *)+    # FIXME: should be removed in autoconf 3.0.+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"+    ;;++  esac+done++if test -n "$ac_prev"; then+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`+  as_fn_error $? "missing argument to $ac_option"+fi++if test -n "$ac_unrecognized_opts"; then+  case $enable_option_checking in+    no) ;;+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;+  esac+fi++# Check all directory arguments for consistency.+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \+		datadir sysconfdir sharedstatedir localstatedir includedir \+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \+		libdir localedir mandir+do+  eval ac_val=\$$ac_var+  # Remove trailing slashes.+  case $ac_val in+    */ )+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`+      eval $ac_var=\$ac_val;;+  esac+  # Be sure to have absolute directory names.+  case $ac_val in+    [\\/$]* | ?:[\\/]* )  continue;;+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;+  esac+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"+done++# There might be people who depend on the old broken behavior: `$host'+# used to hold the argument of --host etc.+# FIXME: To remove some day.+build=$build_alias+host=$host_alias+target=$target_alias++# FIXME: To remove some day.+if test "x$host_alias" != x; then+  if test "x$build_alias" = x; then+    cross_compiling=maybe+  elif test "x$build_alias" != "x$host_alias"; then+    cross_compiling=yes+  fi+fi++ac_tool_prefix=+test -n "$host_alias" && ac_tool_prefix=$host_alias-++test "$silent" = yes && exec 6>/dev/null+++ac_pwd=`pwd` && test -n "$ac_pwd" &&+ac_ls_di=`ls -di .` &&+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||+  as_fn_error $? "working directory cannot be determined"+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||+  as_fn_error $? "pwd does not report name of working directory"+++# Find the source files, if location was not specified.+if test -z "$srcdir"; then+  ac_srcdir_defaulted=yes+  # Try the directory containing this script, then the parent directory.+  ac_confdir=`$as_dirname -- "$as_myself" ||+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_myself" : 'X\(//\)[^/]' \| \+	 X"$as_myself" : 'X\(//\)$' \| \+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_myself" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+  srcdir=$ac_confdir+  if test ! -r "$srcdir/$ac_unique_file"; then+    srcdir=..+  fi+else+  ac_srcdir_defaulted=no+fi+if test ! -r "$srcdir/$ac_unique_file"; then+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"+fi+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"+ac_abs_confdir=`(+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"+	pwd)`+# When building in place, set srcdir=.+if test "$ac_abs_confdir" = "$ac_pwd"; then+  srcdir=.+fi+# Remove unnecessary trailing slashes from srcdir.+# Double slashes in file names in object file debugging info+# mess up M-x gdb in Emacs.+case $srcdir in+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;+esac+for ac_var in $ac_precious_vars; do+  eval ac_env_${ac_var}_set=\${${ac_var}+set}+  eval ac_env_${ac_var}_value=\$${ac_var}+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}+  eval ac_cv_env_${ac_var}_value=\$${ac_var}+done++#+# Report the --help message.+#+if test "$ac_init_help" = "long"; then+  # Omit some internal or obsolete options to make the list less imposing.+  # This message is too long to be a string in the A/UX 3.1 sh.+  cat <<_ACEOF+\`configure' configures Haskell base package 1.0 to adapt to many kinds of systems.++Usage: $0 [OPTION]... [VAR=VALUE]...++To assign environment variables (e.g., CC, CFLAGS...), specify them as+VAR=VALUE.  See below for descriptions of some of the useful variables.++Defaults for the options are specified in brackets.++Configuration:+  -h, --help              display this help and exit+      --help=short        display options specific to this package+      --help=recursive    display the short help of all the included packages+  -V, --version           display version information and exit+  -q, --quiet, --silent   do not print \`checking ...' messages+      --cache-file=FILE   cache test results in FILE [disabled]+  -C, --config-cache      alias for \`--cache-file=config.cache'+  -n, --no-create         do not create output files+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']++Installation directories:+  --prefix=PREFIX         install architecture-independent files in PREFIX+                          [$ac_default_prefix]+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX+                          [PREFIX]++By default, \`make install' will install all the files in+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify+an installation prefix other than \`$ac_default_prefix' using \`--prefix',+for instance \`--prefix=\$HOME'.++For better control, use the options below.++Fine tuning of the installation directories:+  --bindir=DIR            user executables [EPREFIX/bin]+  --sbindir=DIR           system admin executables [EPREFIX/sbin]+  --libexecdir=DIR        program executables [EPREFIX/libexec]+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]+  --libdir=DIR            object code libraries [EPREFIX/lib]+  --includedir=DIR        C header files [PREFIX/include]+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]+  --infodir=DIR           info documentation [DATAROOTDIR/info]+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]+  --mandir=DIR            man documentation [DATAROOTDIR/man]+  --docdir=DIR            documentation root [DATAROOTDIR/doc/base]+  --htmldir=DIR           html documentation [DOCDIR]+  --dvidir=DIR            dvi documentation [DOCDIR]+  --pdfdir=DIR            pdf documentation [DOCDIR]+  --psdir=DIR             ps documentation [DOCDIR]+_ACEOF++  cat <<\_ACEOF++System types:+  --build=BUILD     configure for building on BUILD [guessed]+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]+  --target=TARGET   configure for building compilers for TARGET [HOST]+_ACEOF+fi++if test -n "$ac_init_help"; then+  case $ac_init_help in+     short | recursive ) echo "Configuration of Haskell base package 1.0:";;+   esac+  cat <<\_ACEOF++Optional Features:+  --disable-option-checking  ignore unrecognized --enable/--with options+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]+  --disable-largefile     omit support for large files++Optional Packages:+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)+C compiler+  --with-iconv-includes   directory containing iconv.h+  --with-iconv-libraries  directory containing iconv library++Some influential environment variables:+  CC          C compiler command+  CFLAGS      C compiler flags+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a+              nonstandard directory <lib dir>+  LIBS        libraries to pass to the linker, e.g. -l<library>+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if+              you have headers in a nonstandard directory <include dir>+  CPP         C preprocessor++Use these variables to override the choices made by `configure' or to help+it to find libraries and programs with nonstandard names/locations.++Report bugs to <libraries@haskell.org>.+_ACEOF+ac_status=$?+fi++if test "$ac_init_help" = "recursive"; then+  # If there are subdirs, report their specific --help.+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue+    test -d "$ac_dir" ||+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||+      continue+    ac_builddir=.++case "$ac_dir" in+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;+*)+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`+  # A ".." for each directory in $ac_dir_suffix.+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`+  case $ac_top_builddir_sub in+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;+  esac ;;+esac+ac_abs_top_builddir=$ac_pwd+ac_abs_builddir=$ac_pwd$ac_dir_suffix+# for backward compatibility:+ac_top_builddir=$ac_top_build_prefix++case $srcdir in+  .)  # We are building in place.+    ac_srcdir=.+    ac_top_srcdir=$ac_top_builddir_sub+    ac_abs_top_srcdir=$ac_pwd ;;+  [\\/]* | ?:[\\/]* )  # Absolute name.+    ac_srcdir=$srcdir$ac_dir_suffix;+    ac_top_srcdir=$srcdir+    ac_abs_top_srcdir=$srcdir ;;+  *) # Relative name.+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix+    ac_top_srcdir=$ac_top_build_prefix$srcdir+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;+esac+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix++    cd "$ac_dir" || { ac_status=$?; continue; }+    # Check for guested configure.+    if test -f "$ac_srcdir/configure.gnu"; then+      echo &&+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive+    elif test -f "$ac_srcdir/configure"; then+      echo &&+      $SHELL "$ac_srcdir/configure" --help=recursive+    else+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2+    fi || ac_status=$?+    cd "$ac_pwd" || { ac_status=$?; break; }+  done+fi++test -n "$ac_init_help" && exit $ac_status+if $ac_init_version; then+  cat <<\_ACEOF+Haskell base package configure 1.0+generated by GNU Autoconf 2.69++Copyright (C) 2012 Free Software Foundation, Inc.+This configure script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it.+_ACEOF+  exit+fi++## ------------------------ ##+## Autoconf initialization. ##+## ------------------------ ##++# ac_fn_c_try_compile LINENO+# --------------------------+# Try to compile conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_compile ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  rm -f conftest.$ac_objext+  if { { ac_try="$ac_compile"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_compile") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    grep -v '^ *+' conftest.err >conftest.er1+    cat conftest.er1 >&5+    mv -f conftest.er1 conftest.err+  fi+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } && {+	 test -z "$ac_c_werror_flag" ||+	 test ! -s conftest.err+       } && test -s conftest.$ac_objext; then :+  ac_retval=0+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++	ac_retval=1+fi+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+  as_fn_set_status $ac_retval++} # ac_fn_c_try_compile++# ac_fn_c_check_type LINENO TYPE VAR INCLUDES+# -------------------------------------------+# Tests whether TYPE exists after having included INCLUDES, setting cache+# variable VAR accordingly.+ac_fn_c_check_type ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+  $as_echo_n "(cached) " >&6+else+  eval "$3=no"+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+if (sizeof ($2))+	 return 0;+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+if (sizeof (($2)))+	    return 0;+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :++else+  eval "$3=yes"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_type++# ac_fn_c_try_cpp LINENO+# ----------------------+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_cpp ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if { { ac_try="$ac_cpp conftest.$ac_ext"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    grep -v '^ *+' conftest.err >conftest.er1+    cat conftest.er1 >&5+    mv -f conftest.er1 conftest.err+  fi+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } > conftest.i && {+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||+	 test ! -s conftest.err+       }; then :+  ac_retval=0+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++    ac_retval=1+fi+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+  as_fn_set_status $ac_retval++} # ac_fn_c_try_cpp++# ac_fn_c_try_run LINENO+# ----------------------+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes+# that executables *can* be run.+ac_fn_c_try_run ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'+  { { case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_try") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; }; then :+  ac_retval=0+else+  $as_echo "$as_me: program exited with status $ac_status" >&5+       $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++       ac_retval=$ac_status+fi+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+  as_fn_set_status $ac_retval++} # ac_fn_c_try_run++# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES+# -------------------------------------------------------+# Tests whether HEADER exists and can be compiled using the include files in+# INCLUDES, setting the cache variable VAR accordingly.+ac_fn_c_check_header_compile ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+#include <$2>+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  eval "$3=yes"+else+  eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_header_compile++# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES+# -------------------------------------------------------+# Tests whether HEADER exists, giving a warning if it cannot be compiled using+# the include files in INCLUDES and setting the cache variable VAR+# accordingly.+ac_fn_c_check_header_mongrel ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if eval \${$3+:} false; then :+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+  $as_echo_n "(cached) " >&6+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+else+  # Is the header compilable?+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5+$as_echo_n "checking $2 usability... " >&6; }+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+#include <$2>+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_header_compiler=yes+else+  ac_header_compiler=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5+$as_echo "$ac_header_compiler" >&6; }++# Is the header present?+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5+$as_echo_n "checking $2 presence... " >&6; }+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <$2>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+  ac_header_preproc=yes+else+  ac_header_preproc=no+fi+rm -f conftest.err conftest.i conftest.$ac_ext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5+$as_echo "$ac_header_preproc" >&6; }++# So?  What about this header?+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((+  yes:no: )+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}+    ;;+  no:yes:* )+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}+( $as_echo "## ------------------------------------ ##+## Report this to libraries@haskell.org ##+## ------------------------------------ ##"+     ) | sed "s/^/$as_me: WARNING:     /" >&2+    ;;+esac+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+  $as_echo_n "(cached) " >&6+else+  eval "$3=\$ac_header_compiler"+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+fi+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_header_mongrel++# ac_fn_c_try_link LINENO+# -----------------------+# Try to link conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_link ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  rm -f conftest.$ac_objext conftest$ac_exeext+  if { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    grep -v '^ *+' conftest.err >conftest.er1+    cat conftest.er1 >&5+    mv -f conftest.er1 conftest.err+  fi+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } && {+	 test -z "$ac_c_werror_flag" ||+	 test ! -s conftest.err+       } && test -s conftest$ac_exeext && {+	 test "$cross_compiling" = yes ||+	 test -x conftest$ac_exeext+       }; then :+  ac_retval=0+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++	ac_retval=1+fi+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would+  # interfere with the next link command; also delete a directory that is+  # left behind by Apple's compiler.  We do this before executing the actions.+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+  as_fn_set_status $ac_retval++} # ac_fn_c_try_link++# ac_fn_c_check_func LINENO FUNC VAR+# ----------------------------------+# Tests whether FUNC exists, setting the cache variable VAR accordingly+ac_fn_c_check_func ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */+#define $2 innocuous_$2++/* System header to define __stub macros and hopefully few prototypes,+    which can conflict with char $2 (); below.+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+    <limits.h> exists even on freestanding compilers.  */++#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif++#undef $2++/* Override any GCC internal prototype to avoid an error.+   Use char because int might match the return type of a GCC+   builtin and then its argument prototype would still apply.  */+#ifdef __cplusplus+extern "C"+#endif+char $2 ();+/* The GNU C library defines this for functions which it implements+    to always fail with ENOSYS.  Some functions are actually named+    something starting with __ and the normal name is an alias.  */+#if defined __stub_$2 || defined __stub___$2+choke me+#endif++int+main ()+{+return $2 ();+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_link "$LINENO"; then :+  eval "$3=yes"+else+  eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext conftest.$ac_ext+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_func++# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES+# --------------------------------------------+# Tries to find the compile-time value of EXPR in a program that includes+# INCLUDES, setting VAR accordingly. Returns whether the value could be+# computed+ac_fn_c_compute_int ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if test "$cross_compiling" = yes; then+    # Depending upon the size, compute the lo and hi bounds.+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) >= 0)];+test_array [0] = 0;+return test_array [0];++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_lo=0 ac_mid=0+  while :; do+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) <= $ac_mid)];+test_array [0] = 0;+return test_array [0];++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_hi=$ac_mid; break+else+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val+			if test $ac_lo -le $ac_mid; then+			  ac_lo= ac_hi=+			  break+			fi+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  done+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) < 0)];+test_array [0] = 0;+return test_array [0];++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_hi=-1 ac_mid=-1+  while :; do+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) >= $ac_mid)];+test_array [0] = 0;+return test_array [0];++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_lo=$ac_mid; break+else+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val+			if test $ac_mid -le $ac_hi; then+			  ac_lo= ac_hi=+			  break+			fi+			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  done+else+  ac_lo= ac_hi=+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+# Binary search between lo and hi bounds.+while test "x$ac_lo" != "x$ac_hi"; do+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) <= $ac_mid)];+test_array [0] = 0;+return test_array [0];++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_hi=$ac_mid+else+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+done+case $ac_lo in #((+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;+'') ac_retval=1 ;;+esac+  else+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+static long int longval () { return $2; }+static unsigned long int ulongval () { return $2; }+#include <stdio.h>+#include <stdlib.h>+int+main ()+{++  FILE *f = fopen ("conftest.val", "w");+  if (! f)+    return 1;+  if (($2) < 0)+    {+      long int i = longval ();+      if (i != ($2))+	return 1;+      fprintf (f, "%ld", i);+    }+  else+    {+      unsigned long int i = ulongval ();+      if (i != ($2))+	return 1;+      fprintf (f, "%lu", i);+    }+  /* Do not output a trailing newline, as this causes \r\n confusion+     on some platforms.  */+  return ferror (f) || fclose (f) != 0;++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0+else+  ac_retval=1+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+rm -f conftest.val++  fi+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+  as_fn_set_status $ac_retval++} # ac_fn_c_compute_int+cat >config.log <<_ACEOF+This file contains any messages produced by compilers while+running configure, to aid debugging if configure makes a mistake.++It was created by Haskell base package $as_me 1.0, which was+generated by GNU Autoconf 2.69.  Invocation command line was++  $ $0 $@++_ACEOF+exec 5>>config.log+{+cat <<_ASUNAME+## --------- ##+## Platform. ##+## --------- ##++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`+uname -m = `(uname -m) 2>/dev/null || echo unknown`+uname -r = `(uname -r) 2>/dev/null || echo unknown`+uname -s = `(uname -s) 2>/dev/null || echo unknown`+uname -v = `(uname -v) 2>/dev/null || echo unknown`++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`++/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`++_ASUNAME++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    $as_echo "PATH: $as_dir"+  done+IFS=$as_save_IFS++} >&5++cat >&5 <<_ACEOF+++## ----------- ##+## Core tests. ##+## ----------- ##++_ACEOF+++# Keep a trace of the command line.+# Strip out --no-create and --no-recursion so they do not pile up.+# Strip out --silent because we don't want to record it for future runs.+# Also quote any args containing shell meta-characters.+# Make two passes to allow for proper duplicate-argument suppression.+ac_configure_args=+ac_configure_args0=+ac_configure_args1=+ac_must_keep_next=false+for ac_pass in 1 2+do+  for ac_arg+  do+    case $ac_arg in+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \+    | -silent | --silent | --silen | --sile | --sil)+      continue ;;+    *\'*)+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;+    esac+    case $ac_pass in+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;+    2)+      as_fn_append ac_configure_args1 " '$ac_arg'"+      if test $ac_must_keep_next = true; then+	ac_must_keep_next=false # Got value, back to normal.+      else+	case $ac_arg in+	  *=* | --config-cache | -C | -disable-* | --disable-* \+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \+	  | -with-* | --with-* | -without-* | --without-* | --x)+	    case "$ac_configure_args0 " in+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;+	    esac+	    ;;+	  -* ) ac_must_keep_next=true ;;+	esac+      fi+      as_fn_append ac_configure_args " '$ac_arg'"+      ;;+    esac+  done+done+{ ac_configure_args0=; unset ac_configure_args0;}+{ ac_configure_args1=; unset ac_configure_args1;}++# When interrupted or exit'd, cleanup temporary files, and complete+# config.log.  We remove comments because anyway the quotes in there+# would cause problems or look ugly.+# WARNING: Use '\'' to represent an apostrophe within the trap.+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.+trap 'exit_status=$?+  # Save into config.log some information that might help in debugging.+  {+    echo++    $as_echo "## ---------------- ##+## Cache variables. ##+## ---------------- ##"+    echo+    # The following way of writing the cache mishandles newlines in values,+(+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do+    eval ac_val=\$$ac_var+    case $ac_val in #(+    *${as_nl}*)+      case $ac_var in #(+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;+      esac+      case $ac_var in #(+      _ | IFS | as_nl) ;; #(+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(+      *) { eval $ac_var=; unset $ac_var;} ;;+      esac ;;+    esac+  done+  (set) 2>&1 |+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(+    *${as_nl}ac_space=\ *)+      sed -n \+	"s/'\''/'\''\\\\'\'''\''/g;+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"+      ;; #(+    *)+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"+      ;;+    esac |+    sort+)+    echo++    $as_echo "## ----------------- ##+## Output variables. ##+## ----------------- ##"+    echo+    for ac_var in $ac_subst_vars+    do+      eval ac_val=\$$ac_var+      case $ac_val in+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;+      esac+      $as_echo "$ac_var='\''$ac_val'\''"+    done | sort+    echo++    if test -n "$ac_subst_files"; then+      $as_echo "## ------------------- ##+## File substitutions. ##+## ------------------- ##"+      echo+      for ac_var in $ac_subst_files+      do+	eval ac_val=\$$ac_var+	case $ac_val in+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;+	esac+	$as_echo "$ac_var='\''$ac_val'\''"+      done | sort+      echo+    fi++    if test -s confdefs.h; then+      $as_echo "## ----------- ##+## confdefs.h. ##+## ----------- ##"+      echo+      cat confdefs.h+      echo+    fi+    test "$ac_signal" != 0 &&+      $as_echo "$as_me: caught signal $ac_signal"+    $as_echo "$as_me: exit $exit_status"+  } >&5+  rm -f core *.core core.conftest.* &&+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&+    exit $exit_status+' 0+for ac_signal in 1 2 13 15; do+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal+done+ac_signal=0++# confdefs.h avoids OS command line length limits that DEFS can exceed.+rm -f -r conftest* confdefs.h++$as_echo "/* confdefs.h */" > confdefs.h++# Predefined preprocessor variables.++cat >>confdefs.h <<_ACEOF+#define PACKAGE_NAME "$PACKAGE_NAME"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_VERSION "$PACKAGE_VERSION"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_STRING "$PACKAGE_STRING"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_URL "$PACKAGE_URL"+_ACEOF+++# Let the site file select an alternate cache file if it wants to.+# Prefer an explicitly selected file to automatically selected ones.+ac_site_file1=NONE+ac_site_file2=NONE+if test -n "$CONFIG_SITE"; then+  # We do not want a PATH search for config.site.+  case $CONFIG_SITE in #((+    -*)  ac_site_file1=./$CONFIG_SITE;;+    */*) ac_site_file1=$CONFIG_SITE;;+    *)   ac_site_file1=./$CONFIG_SITE;;+  esac+elif test "x$prefix" != xNONE; then+  ac_site_file1=$prefix/share/config.site+  ac_site_file2=$prefix/etc/config.site+else+  ac_site_file1=$ac_default_prefix/share/config.site+  ac_site_file2=$ac_default_prefix/etc/config.site+fi+for ac_site_file in "$ac_site_file1" "$ac_site_file2"+do+  test "x$ac_site_file" = xNONE && continue+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5+$as_echo "$as_me: loading site script $ac_site_file" >&6;}+    sed 's/^/| /' "$ac_site_file" >&5+    . "$ac_site_file" \+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "failed to load site script $ac_site_file+See \`config.log' for more details" "$LINENO" 5; }+  fi+done++if test -r "$cache_file"; then+  # Some versions of bash will fail to source /dev/null (special files+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5+$as_echo "$as_me: loading cache $cache_file" >&6;}+    case $cache_file in+      [\\/]* | ?:[\\/]* ) . "$cache_file";;+      *)                      . "./$cache_file";;+    esac+  fi+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5+$as_echo "$as_me: creating cache $cache_file" >&6;}+  >$cache_file+fi++# Check that the precious variables saved in the cache have kept the same+# value.+ac_cache_corrupted=false+for ac_var in $ac_precious_vars; do+  eval ac_old_set=\$ac_cv_env_${ac_var}_set+  eval ac_new_set=\$ac_env_${ac_var}_set+  eval ac_old_val=\$ac_cv_env_${ac_var}_value+  eval ac_new_val=\$ac_env_${ac_var}_value+  case $ac_old_set,$ac_new_set in+    set,)+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}+      ac_cache_corrupted=: ;;+    ,set)+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}+      ac_cache_corrupted=: ;;+    ,);;+    *)+      if test "x$ac_old_val" != "x$ac_new_val"; then+	# differences in whitespace do not lead to failure.+	ac_old_val_w=`echo x $ac_old_val`+	ac_new_val_w=`echo x $ac_new_val`+	if test "$ac_old_val_w" != "$ac_new_val_w"; then+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}+	  ac_cache_corrupted=:+	else+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}+	  eval $ac_var=\$ac_old_val+	fi+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}+      fi;;+  esac+  # Pass precious variables to config.status.+  if test "$ac_new_set" = set; then+    case $ac_new_val in+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;+    *) ac_arg=$ac_var=$ac_new_val ;;+    esac+    case " $ac_configure_args " in+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;+    esac+  fi+done+if $ac_cache_corrupted; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5+fi+## -------------------- ##+## Main body of script. ##+## -------------------- ##++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu++++# Safety check: Ensure that we are in the correct source directory.+++ac_config_headers="$ac_config_headers include/HsBaseConfig.h include/EventConfig.h"+++ac_aux_dir=+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do+  if test -f "$ac_dir/install-sh"; then+    ac_aux_dir=$ac_dir+    ac_install_sh="$ac_aux_dir/install-sh -c"+    break+  elif test -f "$ac_dir/install.sh"; then+    ac_aux_dir=$ac_dir+    ac_install_sh="$ac_aux_dir/install.sh -c"+    break+  elif test -f "$ac_dir/shtool"; then+    ac_aux_dir=$ac_dir+    ac_install_sh="$ac_aux_dir/shtool install -c"+    break+  fi+done+if test -z "$ac_aux_dir"; then+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5+fi++# These three variables are undocumented and unsupported,+# and are intended to be withdrawn in a future Autoconf release.+# They can cause serious problems if a builder's source tree is in a directory+# whose full name contains unusual characters.+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.+++# Make sure we can run config.sub.+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5+$as_echo_n "checking build system type... " >&6; }+if ${ac_cv_build+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_build_alias=$build_alias+test "x$ac_build_alias" = x &&+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`+test "x$ac_build_alias" = x &&+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5+$as_echo "$ac_cv_build" >&6; }+case $ac_cv_build in+*-*-*) ;;+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;+esac+build=$ac_cv_build+ac_save_IFS=$IFS; IFS='-'+set x $ac_cv_build+shift+build_cpu=$1+build_vendor=$2+shift; shift+# Remember, the first character of IFS is used to create $*,+# except with old shells:+build_os=$*+IFS=$ac_save_IFS+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5+$as_echo_n "checking host system type... " >&6; }+if ${ac_cv_host+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test "x$host_alias" = x; then+  ac_cv_host=$ac_cv_build+else+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5+$as_echo "$ac_cv_host" >&6; }+case $ac_cv_host in+*-*-*) ;;+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;+esac+host=$ac_cv_host+ac_save_IFS=$IFS; IFS='-'+set x $ac_cv_host+shift+host_cpu=$1+host_vendor=$2+shift; shift+# Remember, the first character of IFS is used to create $*,+# except with old shells:+host_os=$*+IFS=$ac_save_IFS+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5+$as_echo_n "checking target system type... " >&6; }+if ${ac_cv_target+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test "x$target_alias" = x; then+  ac_cv_target=$ac_cv_host+else+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5+$as_echo "$ac_cv_target" >&6; }+case $ac_cv_target in+*-*-*) ;;+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;+esac+target=$ac_cv_target+ac_save_IFS=$IFS; IFS='-'+set x $ac_cv_target+shift+target_cpu=$1+target_vendor=$2+shift; shift+# Remember, the first character of IFS is used to create $*,+# except with old shells:+target_os=$*+IFS=$ac_save_IFS+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac+++# The aliases save the names the user supplied, while $host etc.+# will get canonicalized.+test -n "$target_alias" &&+  test "$program_prefix$program_suffix$program_transform_name" = \+    NONENONEs,x,x, &&+  program_prefix=${target_alias}-+++# Check whether --with-cc was given.+if test "${with_cc+set}" = set; then :+  withval=$with_cc; CC=$withval+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+if test -n "$ac_tool_prefix"; then+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.+set dummy ${ac_tool_prefix}gcc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_prog_CC="${ac_tool_prefix}gcc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+if test -z "$ac_cv_prog_CC"; then+  ac_ct_CC=$CC+  # Extract the first word of "gcc", so it can be a program name with args.+set dummy gcc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_ac_ct_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$ac_ct_CC"; then+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_prog_ac_ct_CC="gcc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5+$as_echo "$ac_ct_CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi++  if test "x$ac_ct_CC" = x; then+    CC=""+  else+    case $cross_compiling:$ac_tool_warned in+yes:)+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}+ac_tool_warned=yes ;;+esac+    CC=$ac_ct_CC+  fi+else+  CC="$ac_cv_prog_CC"+fi++if test -z "$CC"; then+          if test -n "$ac_tool_prefix"; then+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.+set dummy ${ac_tool_prefix}cc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_prog_CC="${ac_tool_prefix}cc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++  fi+fi+if test -z "$CC"; then+  # Extract the first word of "cc", so it can be a program name with args.+set dummy cc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+  ac_prog_rejected=no+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then+       ac_prog_rejected=yes+       continue+     fi+    ac_cv_prog_CC="cc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++if test $ac_prog_rejected = yes; then+  # We found a bogon in the path, so make sure we never use it.+  set dummy $ac_cv_prog_CC+  shift+  if test $# != 0; then+    # We chose a different compiler from the bogus one.+    # However, it has the same basename, so the bogon will be chosen+    # first if we set CC to just the basename; use the full file name.+    shift+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"+  fi+fi+fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+if test -z "$CC"; then+  if test -n "$ac_tool_prefix"; then+  for ac_prog in cl.exe+  do+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.+set dummy $ac_tool_prefix$ac_prog; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++    test -n "$CC" && break+  done+fi+if test -z "$CC"; then+  ac_ct_CC=$CC+  for ac_prog in cl.exe+do+  # Extract the first word of "$ac_prog", so it can be a program name with args.+set dummy $ac_prog; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_ac_ct_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$ac_ct_CC"; then+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_prog_ac_ct_CC="$ac_prog"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5+$as_echo "$ac_ct_CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++  test -n "$ac_ct_CC" && break+done++  if test "x$ac_ct_CC" = x; then+    CC=""+  else+    case $cross_compiling:$ac_tool_warned in+yes:)+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}+ac_tool_warned=yes ;;+esac+    CC=$ac_ct_CC+  fi+fi++fi+++test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "no acceptable C compiler found in \$PATH+See \`config.log' for more details" "$LINENO" 5; }++# Provide some information about the compiler.+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5+set X $ac_compile+ac_compiler=$2+for ac_option in --version -v -V -qversion; do+  { { ac_try="$ac_compiler $ac_option >&5"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    sed '10a\+... rest of stderr output deleted ...+         10q' conftest.err >conftest.er1+    cat conftest.er1 >&5+  fi+  rm -f conftest.er1 conftest.err+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }+done++cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"+# Try to create an executable without -o first, disregard a.out.+# It will help us diagnose broken compilers, and finding out an intuition+# of exeext.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5+$as_echo_n "checking whether the C compiler works... " >&6; }+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`++# The possible output files:+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"++ac_rmfiles=+for ac_file in $ac_files+do+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;+  esac+done+rm -f $ac_rmfiles++if { { ac_try="$ac_link_default"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link_default") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; then :+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'+# in a Makefile.  We should not override ac_cv_exeext if it was cached,+# so that the user can short-circuit this test for compilers unknown to+# Autoconf.+for ac_file in $ac_files ''+do+  test -f "$ac_file" || continue+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )+	;;+    [ab].out )+	# We found the default executable, but exeext='' is most+	# certainly right.+	break;;+    *.* )+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;+	then :; else+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+	fi+	# We set ac_cv_exeext here because the later test for it is not+	# safe: cross compilers may not add the suffix if given an `-o'+	# argument, so we may need to know it at that point already.+	# Even if this section looks crufty: it has the advantage of+	# actually working.+	break;;+    * )+	break;;+  esac+done+test "$ac_cv_exeext" = no && ac_cv_exeext=++else+  ac_file=''+fi+if test -z "$ac_file"; then :+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+$as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "C compiler cannot create executables+See \`config.log' for more details" "$LINENO" 5; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5+$as_echo "yes" >&6; }+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5+$as_echo_n "checking for C compiler default output file name... " >&6; }+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5+$as_echo "$ac_file" >&6; }+ac_exeext=$ac_cv_exeext++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out+ac_clean_files=$ac_clean_files_save+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5+$as_echo_n "checking for suffix of executables... " >&6; }+if { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; then :+  # If both `conftest.exe' and `conftest' are `present' (well, observable)+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will+# work properly (i.e., refer to `conftest.exe'), while it won't with+# `rm'.+for ac_file in conftest.exe conftest conftest.*; do+  test -f "$ac_file" || continue+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+	  break;;+    * ) break;;+  esac+done+else+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "cannot compute suffix of executables: cannot compile and link+See \`config.log' for more details" "$LINENO" 5; }+fi+rm -f conftest conftest$ac_cv_exeext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5+$as_echo "$ac_cv_exeext" >&6; }++rm -f conftest.$ac_ext+EXEEXT=$ac_cv_exeext+ac_exeext=$EXEEXT+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+int+main ()+{+FILE *f = fopen ("conftest.out", "w");+ return ferror (f) || fclose (f) != 0;++  ;+  return 0;+}+_ACEOF+ac_clean_files="$ac_clean_files conftest.out"+# Check that the compiler produces executables we can run.  If not, either+# the compiler is broken, or we cross compile.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5+$as_echo_n "checking whether we are cross compiling... " >&6; }+if test "$cross_compiling" != yes; then+  { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }+  if { ac_try='./conftest$ac_cv_exeext'+  { { case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_try") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; }; then+    cross_compiling=no+  else+    if test "$cross_compiling" = maybe; then+	cross_compiling=yes+    else+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "cannot run C compiled programs.+If you meant to cross compile, use \`--host'.+See \`config.log' for more details" "$LINENO" 5; }+    fi+  fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5+$as_echo "$cross_compiling" >&6; }++rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out+ac_clean_files=$ac_clean_files_save+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5+$as_echo_n "checking for suffix of object files... " >&6; }+if ${ac_cv_objext+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+rm -f conftest.o conftest.obj+if { { ac_try="$ac_compile"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_compile") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; then :+  for ac_file in conftest.o conftest.obj conftest.*; do+  test -f "$ac_file" || continue;+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`+       break;;+  esac+done+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "cannot compute suffix of object files: cannot compile+See \`config.log' for more details" "$LINENO" 5; }+fi+rm -f conftest.$ac_cv_objext conftest.$ac_ext+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5+$as_echo "$ac_cv_objext" >&6; }+OBJEXT=$ac_cv_objext+ac_objext=$OBJEXT+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }+if ${ac_cv_c_compiler_gnu+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{+#ifndef __GNUC__+       choke me+#endif++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_compiler_gnu=yes+else+  ac_compiler_gnu=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ac_cv_c_compiler_gnu=$ac_compiler_gnu++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5+$as_echo "$ac_cv_c_compiler_gnu" >&6; }+if test $ac_compiler_gnu = yes; then+  GCC=yes+else+  GCC=+fi+ac_test_CFLAGS=${CFLAGS+set}+ac_save_CFLAGS=$CFLAGS+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5+$as_echo_n "checking whether $CC accepts -g... " >&6; }+if ${ac_cv_prog_cc_g+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_save_c_werror_flag=$ac_c_werror_flag+   ac_c_werror_flag=yes+   ac_cv_prog_cc_g=no+   CFLAGS="-g"+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_prog_cc_g=yes+else+  CFLAGS=""+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :++else+  ac_c_werror_flag=$ac_save_c_werror_flag+	 CFLAGS="-g"+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_prog_cc_g=yes+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+   ac_c_werror_flag=$ac_save_c_werror_flag+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5+$as_echo "$ac_cv_prog_cc_g" >&6; }+if test "$ac_test_CFLAGS" = set; then+  CFLAGS=$ac_save_CFLAGS+elif test $ac_cv_prog_cc_g = yes; then+  if test "$GCC" = yes; then+    CFLAGS="-g -O2"+  else+    CFLAGS="-g"+  fi+else+  if test "$GCC" = yes; then+    CFLAGS="-O2"+  else+    CFLAGS=+  fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }+if ${ac_cv_prog_cc_c89+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_cv_prog_cc_c89=no+ac_save_CC=$CC+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdarg.h>+#include <stdio.h>+struct stat;+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */+struct buf { int x; };+FILE * (*rcsopen) (struct buf *, struct stat *, int);+static char *e (p, i)+     char **p;+     int i;+{+  return p[i];+}+static char *f (char * (*g) (char **, int), char **p, ...)+{+  char *s;+  va_list v;+  va_start (v,p);+  s = g (p, va_arg (v,int));+  va_end (v);+  return s;+}++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has+   function prototypes and stuff, but not '\xHH' hex character constants.+   These don't provoke an error unfortunately, instead are silently treated+   as 'x'.  The following induces an error, until -std is added to get+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an+   array size at least.  It's necessary to write '\x00'==0 to get something+   that's true only with -std.  */+int osf4_cc_array ['\x00' == 0 ? 1 : -1];++/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters+   inside strings and character constants.  */+#define FOO(x) 'x'+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];++int test (int i, double x);+struct s1 {int (*f) (int a);};+struct s2 {int (*f) (double a);};+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);+int argc;+char **argv;+int+main ()+{+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];+  ;+  return 0;+}+_ACEOF+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"+do+  CC="$ac_save_CC $ac_arg"+  if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_prog_cc_c89=$ac_arg+fi+rm -f core conftest.err conftest.$ac_objext+  test "x$ac_cv_prog_cc_c89" != "xno" && break+done+rm -f conftest.$ac_ext+CC=$ac_save_CC++fi+# AC_CACHE_VAL+case "x$ac_cv_prog_cc_c89" in+  x)+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5+$as_echo "none needed" >&6; } ;;+  xno)+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5+$as_echo "unsupported" >&6; } ;;+  *)+    CC="$CC $ac_cv_prog_cc_c89"+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;+esac+if test "x$ac_cv_prog_cc_c89" != xno; then :++fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WINDOWS platform" >&5+$as_echo_n "checking for WINDOWS platform... " >&6; }+case $host in+    *mingw32*|*mingw64*|*cygwin*)+        WINDOWS=YES;;+    *)+        WINDOWS=NO;;+esac+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDOWS" >&5+$as_echo "$WINDOWS" >&6; }++# do we have long longs?++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5+$as_echo_n "checking how to run the C preprocessor... " >&6; }+# On Suns, sometimes $CPP names a directory.+if test -n "$CPP" && test -d "$CPP"; then+  CPP=+fi+if test -z "$CPP"; then+  if ${ac_cv_prog_CPP+:} false; then :+  $as_echo_n "(cached) " >&6+else+      # Double quotes because CPP needs to be expanded+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"+    do+      ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+  # Use a header file that comes with gcc, so configuring glibc+  # with a fresh cross-compiler works.+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+  # <limits.h> exists even on freestanding compilers.+  # On the NeXT, cc -E runs the code through the compiler's parser,+  # not just through cpp. "Syntax error" is here to catch this case.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+		     Syntax error+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :++else+  # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.i conftest.$ac_ext++  # OK, works on sane cases.  Now check whether nonexistent headers+  # can be detected and how.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ac_nonexistent.h>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+  # Broken: success on invalid input.+continue+else+  # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.i conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.i conftest.err conftest.$ac_ext+if $ac_preproc_ok; then :+  break+fi++    done+    ac_cv_prog_CPP=$CPP++fi+  CPP=$ac_cv_prog_CPP+else+  ac_cv_prog_CPP=$CPP+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5+$as_echo "$CPP" >&6; }+ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+  # Use a header file that comes with gcc, so configuring glibc+  # with a fresh cross-compiler works.+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+  # <limits.h> exists even on freestanding compilers.+  # On the NeXT, cc -E runs the code through the compiler's parser,+  # not just through cpp. "Syntax error" is here to catch this case.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+		     Syntax error+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :++else+  # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.i conftest.$ac_ext++  # OK, works on sane cases.  Now check whether nonexistent headers+  # can be detected and how.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ac_nonexistent.h>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+  # Broken: success on invalid input.+continue+else+  # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.i conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.i conftest.err conftest.$ac_ext+if $ac_preproc_ok; then :++else+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check+See \`config.log' for more details" "$LINENO" 5; }+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }+if ${ac_cv_path_GREP+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if test -z "$GREP"; then+  ac_path_GREP_found=false+  # Loop through the user's path and test for each of PROGNAME-LIST+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_prog in grep ggrep; do+    for ac_exec_ext in '' $ac_executable_extensions; do+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"+      as_fn_executable_p "$ac_path_GREP" || continue+# Check for GNU ac_path_GREP and select it if it is found.+  # Check for GNU $ac_path_GREP+case `"$ac_path_GREP" --version 2>&1` in+*GNU*)+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;+*)+  ac_count=0+  $as_echo_n 0123456789 >"conftest.in"+  while :+  do+    cat "conftest.in" "conftest.in" >"conftest.tmp"+    mv "conftest.tmp" "conftest.in"+    cp "conftest.in" "conftest.nl"+    $as_echo 'GREP' >> "conftest.nl"+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break+    as_fn_arith $ac_count + 1 && ac_count=$as_val+    if test $ac_count -gt ${ac_path_GREP_max-0}; then+      # Best one so far, save it but keep looking for a better one+      ac_cv_path_GREP="$ac_path_GREP"+      ac_path_GREP_max=$ac_count+    fi+    # 10*(2^10) chars as input seems more than enough+    test $ac_count -gt 10 && break+  done+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;+esac++      $ac_path_GREP_found && break 3+    done+  done+  done+IFS=$as_save_IFS+  if test -z "$ac_cv_path_GREP"; then+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5+  fi+else+  ac_cv_path_GREP=$GREP+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5+$as_echo "$ac_cv_path_GREP" >&6; }+ GREP="$ac_cv_path_GREP"+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5+$as_echo_n "checking for egrep... " >&6; }+if ${ac_cv_path_EGREP+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1+   then ac_cv_path_EGREP="$GREP -E"+   else+     if test -z "$EGREP"; then+  ac_path_EGREP_found=false+  # Loop through the user's path and test for each of PROGNAME-LIST+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_prog in egrep; do+    for ac_exec_ext in '' $ac_executable_extensions; do+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"+      as_fn_executable_p "$ac_path_EGREP" || continue+# Check for GNU ac_path_EGREP and select it if it is found.+  # Check for GNU $ac_path_EGREP+case `"$ac_path_EGREP" --version 2>&1` in+*GNU*)+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;+*)+  ac_count=0+  $as_echo_n 0123456789 >"conftest.in"+  while :+  do+    cat "conftest.in" "conftest.in" >"conftest.tmp"+    mv "conftest.tmp" "conftest.in"+    cp "conftest.in" "conftest.nl"+    $as_echo 'EGREP' >> "conftest.nl"+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break+    as_fn_arith $ac_count + 1 && ac_count=$as_val+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then+      # Best one so far, save it but keep looking for a better one+      ac_cv_path_EGREP="$ac_path_EGREP"+      ac_path_EGREP_max=$ac_count+    fi+    # 10*(2^10) chars as input seems more than enough+    test $ac_count -gt 10 && break+  done+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;+esac++      $ac_path_EGREP_found && break 3+    done+  done+  done+IFS=$as_save_IFS+  if test -z "$ac_cv_path_EGREP"; then+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5+  fi+else+  ac_cv_path_EGREP=$EGREP+fi++   fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5+$as_echo "$ac_cv_path_EGREP" >&6; }+ EGREP="$ac_cv_path_EGREP"+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5+$as_echo_n "checking for ANSI C header files... " >&6; }+if ${ac_cv_header_stdc+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>+#include <stdarg.h>+#include <string.h>+#include <float.h>++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_header_stdc=yes+else+  ac_cv_header_stdc=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++if test $ac_cv_header_stdc = yes; then+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <string.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "memchr" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "free" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.+  if test "$cross_compiling" = yes; then :+  :+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ctype.h>+#include <stdlib.h>+#if ((' ' & 0x0FF) == 0x020)+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))+#else+# define ISLOWER(c) \+		   (('a' <= (c) && (c) <= 'i') \+		     || ('j' <= (c) && (c) <= 'r') \+		     || ('s' <= (c) && (c) <= 'z'))+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))+#endif++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))+int+main ()+{+  int i;+  for (i = 0; i < 256; i++)+    if (XOR (islower (i), ISLOWER (i))+	|| toupper (i) != TOUPPER (i))+      return 2;+  return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :++else+  ac_cv_header_stdc=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5+$as_echo "$ac_cv_header_stdc" >&6; }+if test $ac_cv_header_stdc = yes; then++$as_echo "#define STDC_HEADERS 1" >>confdefs.h++fi++# On IRIX 5.3, sys/types and inttypes.h are conflicting.+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \+		  inttypes.h stdint.h unistd.h+do :+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default+"+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1+_ACEOF++fi++done+++ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"+if test "x$ac_cv_type_long_long" = xyes; then :++cat >>confdefs.h <<_ACEOF+#define HAVE_LONG_LONG 1+_ACEOF+++fi+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5+$as_echo_n "checking for ANSI C header files... " >&6; }+if ${ac_cv_header_stdc+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>+#include <stdarg.h>+#include <string.h>+#include <float.h>++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_header_stdc=yes+else+  ac_cv_header_stdc=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++if test $ac_cv_header_stdc = yes; then+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <string.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "memchr" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "free" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.+  if test "$cross_compiling" = yes; then :+  :+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ctype.h>+#include <stdlib.h>+#if ((' ' & 0x0FF) == 0x020)+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))+#else+# define ISLOWER(c) \+		   (('a' <= (c) && (c) <= 'i') \+		     || ('j' <= (c) && (c) <= 'r') \+		     || ('s' <= (c) && (c) <= 'z'))+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))+#endif++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))+int+main ()+{+  int i;+  for (i = 0; i < 256; i++)+    if (XOR (islower (i), ISLOWER (i))+	|| toupper (i) != TOUPPER (i))+      return 2;+  return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :++else+  ac_cv_header_stdc=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5+$as_echo "$ac_cv_header_stdc" >&6; }+if test $ac_cv_header_stdc = yes; then++$as_echo "#define STDC_HEADERS 1" >>confdefs.h++fi+++# check for specific header (.h) files that we are interested in+for ac_header in ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h+do :+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1+_ACEOF++fi++done+++# Enable large file support. Do this before testing the types ino_t, off_t, and+# rlim_t, because it will affect the result of that test.+# Check whether --enable-largefile was given.+if test "${enable_largefile+set}" = set; then :+  enableval=$enable_largefile;+fi++if test "$enable_largefile" != no; then++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }+if ${ac_cv_sys_largefile_CC+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_cv_sys_largefile_CC=no+     if test "$GCC" != yes; then+       ac_save_CC=$CC+       while :; do+	 # IRIX 6.2 and later do not support large files by default,+	 # so use the C compiler's -n32 option if that helps.+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+	 if ac_fn_c_try_compile "$LINENO"; then :+  break+fi+rm -f core conftest.err conftest.$ac_objext+	 CC="$CC -n32"+	 if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_largefile_CC=' -n32'; break+fi+rm -f core conftest.err conftest.$ac_objext+	 break+       done+       CC=$ac_save_CC+       rm -f conftest.$ac_ext+    fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5+$as_echo "$ac_cv_sys_largefile_CC" >&6; }+  if test "$ac_cv_sys_largefile_CC" != no; then+    CC=$CC$ac_cv_sys_largefile_CC+  fi++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }+if ${ac_cv_sys_file_offset_bits+:} false; then :+  $as_echo_n "(cached) " >&6+else+  while :; do+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_file_offset_bits=no; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#define _FILE_OFFSET_BITS 64+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_file_offset_bits=64; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  ac_cv_sys_file_offset_bits=unknown+  break+done+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }+case $ac_cv_sys_file_offset_bits in #(+  no | unknown) ;;+  *)+cat >>confdefs.h <<_ACEOF+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits+_ACEOF+;;+esac+rm -rf conftest*+  if test $ac_cv_sys_file_offset_bits = unknown; then+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }+if ${ac_cv_sys_large_files+:} false; then :+  $as_echo_n "(cached) " >&6+else+  while :; do+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_large_files=no; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#define _LARGE_FILES 1+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_large_files=1; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  ac_cv_sys_large_files=unknown+  break+done+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5+$as_echo "$ac_cv_sys_large_files" >&6; }+case $ac_cv_sys_large_files in #(+  no | unknown) ;;+  *)+cat >>confdefs.h <<_ACEOF+#define _LARGE_FILES $ac_cv_sys_large_files+_ACEOF+;;+esac+rm -rf conftest*+  fi+++fi+++for ac_header in wctype.h+do :+  ac_fn_c_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default"+if test "x$ac_cv_header_wctype_h" = xyes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_WCTYPE_H 1+_ACEOF+ for ac_func in iswspace+do :+  ac_fn_c_check_func "$LINENO" "iswspace" "ac_cv_func_iswspace"+if test "x$ac_cv_func_iswspace" = xyes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_ISWSPACE 1+_ACEOF++fi+done++fi++done+++for ac_func in lstat+do :+  ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat"+if test "x$ac_cv_func_lstat" = xyes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_LSTAT 1+_ACEOF++fi+done++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }+if ${ac_cv_lib_rt_clock_gettime+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_check_lib_save_LIBS=$LIBS+LIBS="-lrt  $LIBS"+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++/* Override any GCC internal prototype to avoid an error.+   Use char because int might match the return type of a GCC+   builtin and then its argument prototype would still apply.  */+#ifdef __cplusplus+extern "C"+#endif+char clock_gettime ();+int+main ()+{+return clock_gettime ();+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_link "$LINENO"; then :+  ac_cv_lib_rt_clock_gettime=yes+else+  ac_cv_lib_rt_clock_gettime=no+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_LIBRT 1+_ACEOF++  LIBS="-lrt $LIBS"++fi++for ac_func in clock_gettime+do :+  ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"+if test "x$ac_cv_func_clock_gettime" = xyes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_CLOCK_GETTIME 1+_ACEOF++fi+done++for ac_func in getclock getrusage times+do :+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done++for ac_func in _chsize ftruncate+do :+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done+++for ac_func in epoll_ctl eventfd kevent kevent64 kqueue poll+do :+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done+++# event-related fun++if test "$ac_cv_header_sys_epoll_h" = yes -a "$ac_cv_func_epoll_ctl" = yes; then++$as_echo "#define HAVE_EPOLL 1" >>confdefs.h++fi++if test "$ac_cv_header_sys_event_h" = yes -a "$ac_cv_func_kqueue" = yes; then++$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h+++  # The cast to long int works around a bug in the HP C Compiler+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.+# This bug is HP SR number 8606223364.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kev.filter" >&5+$as_echo_n "checking size of kev.filter... " >&6; }+if ${ac_cv_sizeof_kev_filter+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.filter))" "ac_cv_sizeof_kev_filter"        "#include <sys/event.h>+struct kevent kev;+"; then :++else+  if test "$ac_cv_type_kev_filter" = yes; then+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "cannot compute sizeof (kev.filter)+See \`config.log' for more details" "$LINENO" 5; }+   else+     ac_cv_sizeof_kev_filter=0+   fi+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_filter" >&5+$as_echo "$ac_cv_sizeof_kev_filter" >&6; }++++cat >>confdefs.h <<_ACEOF+#define SIZEOF_KEV_FILTER $ac_cv_sizeof_kev_filter+_ACEOF++++  # The cast to long int works around a bug in the HP C Compiler+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.+# This bug is HP SR number 8606223364.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kev.flags" >&5+$as_echo_n "checking size of kev.flags... " >&6; }+if ${ac_cv_sizeof_kev_flags+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.flags))" "ac_cv_sizeof_kev_flags"        "#include <sys/event.h>+struct kevent kev;+"; then :++else+  if test "$ac_cv_type_kev_flags" = yes; then+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "cannot compute sizeof (kev.flags)+See \`config.log' for more details" "$LINENO" 5; }+   else+     ac_cv_sizeof_kev_flags=0+   fi+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_flags" >&5+$as_echo "$ac_cv_sizeof_kev_flags" >&6; }++++cat >>confdefs.h <<_ACEOF+#define SIZEOF_KEV_FLAGS $ac_cv_sizeof_kev_flags+_ACEOF+++fi++if test "$ac_cv_header_poll_h" = yes -a "$ac_cv_func_poll" = yes; then++$as_echo "#define HAVE_POLL 1" >>confdefs.h++fi++# unsetenv+for ac_func in unsetenv+do :+  ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"+if test "x$ac_cv_func_unsetenv" = xyes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_UNSETENV 1+_ACEOF++fi+done+++###  POSIX.1003.1 unsetenv returns 0 or -1 (EINVAL), but older implementations+###  in common use return void.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of unsetenv" >&5+$as_echo_n "checking return type of unsetenv... " >&6; }+if ${fptools_cv_func_unsetenv_return_type+:} false; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "void[      ]+unsetenv" >/dev/null 2>&1; then :+  fptools_cv_func_unsetenv_return_type=void+else+  fptools_cv_func_unsetenv_return_type=int+fi+rm -f conftest*++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_func_unsetenv_return_type" >&5+$as_echo "$fptools_cv_func_unsetenv_return_type" >&6; }+case "$fptools_cv_func_unsetenv_return_type" in+  "void" )++$as_echo "#define UNSETENV_RETURNS_VOID 1" >>confdefs.h++  ;;+esac++++# Check whether --with-iconv-includes was given.+if test "${with_iconv_includes+set}" = set; then :+  withval=$with_iconv_includes; ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval"+else+  ICONV_INCLUDE_DIRS=+fi++++# Check whether --with-iconv-libraries was given.+if test "${with_iconv_libraries+set}" = set; then :+  withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval"+else+  ICONV_LIB_DIRS=+fi++++++# map standard C types and ISO types to Haskell types+++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for char" >&5+$as_echo_n "checking Haskell type for char... " >&6; }+    if ${fptools_cv_htype_char+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_char=yes+        if ac_fn_c_compute_int "$LINENO" "(char)0.2 - (char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_char=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_char=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_char=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_char=LDouble+            else+                fptools_cv_htype_sup_char=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((char)(-1)) < ((char)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(char) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_char=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_char="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_char="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_char" = no+    then++        fptools_cv_htype_char=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_char" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_char" >&5+$as_echo "$fptools_cv_htype_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CHAR $fptools_cv_htype_char+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for signed char" >&5+$as_echo_n "checking Haskell type for signed char... " >&6; }+    if ${fptools_cv_htype_signed_char+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_signed_char=yes+        if ac_fn_c_compute_int "$LINENO" "(signed char)0.2 - (signed char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_signed_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_signed_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_signed_char=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_signed_char=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_signed_char=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_signed_char=LDouble+            else+                fptools_cv_htype_sup_signed_char=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((signed char)(-1)) < ((signed char)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_signed_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_signed_char=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_signed_char="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_signed_char="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_signed_char" = no+    then++        fptools_cv_htype_signed_char=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_signed_char" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_signed_char" >&5+$as_echo "$fptools_cv_htype_signed_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIGNED_CHAR $fptools_cv_htype_signed_char+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned char" >&5+$as_echo_n "checking Haskell type for unsigned char... " >&6; }+    if ${fptools_cv_htype_unsigned_char+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_unsigned_char=yes+        if ac_fn_c_compute_int "$LINENO" "(unsigned char)0.2 - (unsigned char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_char=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_unsigned_char=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_char=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_char=LDouble+            else+                fptools_cv_htype_sup_unsigned_char=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((unsigned char)(-1)) < ((unsigned char)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_char=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_char=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_unsigned_char="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_unsigned_char="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_unsigned_char" = no+    then++        fptools_cv_htype_unsigned_char=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_unsigned_char" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_char" >&5+$as_echo "$fptools_cv_htype_unsigned_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_CHAR $fptools_cv_htype_unsigned_char+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for short" >&5+$as_echo_n "checking Haskell type for short... " >&6; }+    if ${fptools_cv_htype_short+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_short=yes+        if ac_fn_c_compute_int "$LINENO" "(short)0.2 - (short)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_short=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_short=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_short=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_short=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_short=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_short=LDouble+            else+                fptools_cv_htype_sup_short=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((short)(-1)) < ((short)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_short=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(short) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_short=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_short="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_short="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_short" = no+    then++        fptools_cv_htype_short=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_short" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_short" >&5+$as_echo "$fptools_cv_htype_short" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SHORT $fptools_cv_htype_short+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned short" >&5+$as_echo_n "checking Haskell type for unsigned short... " >&6; }+    if ${fptools_cv_htype_unsigned_short+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_unsigned_short=yes+        if ac_fn_c_compute_int "$LINENO" "(unsigned short)0.2 - (unsigned short)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_short=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_short=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_short=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_unsigned_short=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_short=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_short=LDouble+            else+                fptools_cv_htype_sup_unsigned_short=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((unsigned short)(-1)) < ((unsigned short)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_short=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_short=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_unsigned_short="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_unsigned_short="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_unsigned_short" = no+    then++        fptools_cv_htype_unsigned_short=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_unsigned_short" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_short" >&5+$as_echo "$fptools_cv_htype_unsigned_short" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_SHORT $fptools_cv_htype_unsigned_short+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for int" >&5+$as_echo_n "checking Haskell type for int... " >&6; }+    if ${fptools_cv_htype_int+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_int=yes+        if ac_fn_c_compute_int "$LINENO" "(int)0.2 - (int)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_int=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_int=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_int=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_int=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_int=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_int=LDouble+            else+                fptools_cv_htype_sup_int=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((int)(-1)) < ((int)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_int=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(int) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_int=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_int="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_int="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_int" = no+    then++        fptools_cv_htype_int=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_int" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_int" >&5+$as_echo "$fptools_cv_htype_int" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INT $fptools_cv_htype_int+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned int" >&5+$as_echo_n "checking Haskell type for unsigned int... " >&6; }+    if ${fptools_cv_htype_unsigned_int+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_unsigned_int=yes+        if ac_fn_c_compute_int "$LINENO" "(unsigned int)0.2 - (unsigned int)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_int=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_int=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_int=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_unsigned_int=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_int=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_int=LDouble+            else+                fptools_cv_htype_sup_unsigned_int=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((unsigned int)(-1)) < ((unsigned int)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_int=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_int=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_unsigned_int="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_unsigned_int="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_unsigned_int" = no+    then++        fptools_cv_htype_unsigned_int=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_unsigned_int" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_int" >&5+$as_echo "$fptools_cv_htype_unsigned_int" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_INT $fptools_cv_htype_unsigned_int+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long" >&5+$as_echo_n "checking Haskell type for long... " >&6; }+    if ${fptools_cv_htype_long+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_long=yes+        if ac_fn_c_compute_int "$LINENO" "(long)0.2 - (long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_long=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_long=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_long=LDouble+            else+                fptools_cv_htype_sup_long=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((long)(-1)) < ((long)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(long) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_long="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_long="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_long" = no+    then++        fptools_cv_htype_long=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_long" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long" >&5+$as_echo "$fptools_cv_htype_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_LONG $fptools_cv_htype_long+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long" >&5+$as_echo_n "checking Haskell type for unsigned long... " >&6; }+    if ${fptools_cv_htype_unsigned_long+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_unsigned_long=yes+        if ac_fn_c_compute_int "$LINENO" "(unsigned long)0.2 - (unsigned long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_unsigned_long=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_long=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_long=LDouble+            else+                fptools_cv_htype_sup_unsigned_long=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((unsigned long)(-1)) < ((unsigned long)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_unsigned_long="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_unsigned_long="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_unsigned_long" = no+    then++        fptools_cv_htype_unsigned_long=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_unsigned_long" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long" >&5+$as_echo "$fptools_cv_htype_unsigned_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_LONG $fptools_cv_htype_unsigned_long+_ACEOF++    fi+++if test "$ac_cv_type_long_long" = yes; then+++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long long" >&5+$as_echo_n "checking Haskell type for long long... " >&6; }+    if ${fptools_cv_htype_long_long+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_long_long=yes+        if ac_fn_c_compute_int "$LINENO" "(long long)0.2 - (long long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long_long=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_long_long=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_long_long=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_long_long=LDouble+            else+                fptools_cv_htype_sup_long_long=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((long long)(-1)) < ((long long)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(long long) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_long_long=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_long_long="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_long_long="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_long_long" = no+    then++        fptools_cv_htype_long_long=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_long_long" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long_long" >&5+$as_echo "$fptools_cv_htype_long_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_LONG_LONG $fptools_cv_htype_long_long+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long long" >&5+$as_echo_n "checking Haskell type for unsigned long long... " >&6; }+    if ${fptools_cv_htype_unsigned_long_long+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_unsigned_long_long=yes+        if ac_fn_c_compute_int "$LINENO" "(unsigned long long)0.2 - (unsigned long long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long_long=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_unsigned_long_long=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_long_long=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_unsigned_long_long=LDouble+            else+                fptools_cv_htype_sup_unsigned_long_long=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((unsigned long long)(-1)) < ((unsigned long long)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long_long=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_unsigned_long_long=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_unsigned_long_long="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_unsigned_long_long="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_unsigned_long_long" = no+    then++        fptools_cv_htype_unsigned_long_long=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_unsigned_long_long" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long_long" >&5+$as_echo "$fptools_cv_htype_unsigned_long_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_LONG_LONG $fptools_cv_htype_unsigned_long_long+_ACEOF++    fi+++fi+++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for float" >&5+$as_echo_n "checking Haskell type for float... " >&6; }+    if ${fptools_cv_htype_float+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_float=yes+        if ac_fn_c_compute_int "$LINENO" "(float)0.2 - (float)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_float=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_float=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_float=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_float=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_float=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_float=LDouble+            else+                fptools_cv_htype_sup_float=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((float)(-1)) < ((float)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_float=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(float) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_float=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_float="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_float="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_float" = no+    then++        fptools_cv_htype_float=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_float" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_float" >&5+$as_echo "$fptools_cv_htype_float" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_FLOAT $fptools_cv_htype_float+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for double" >&5+$as_echo_n "checking Haskell type for double... " >&6; }+    if ${fptools_cv_htype_double+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_double=yes+        if ac_fn_c_compute_int "$LINENO" "(double)0.2 - (double)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_double=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_double=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_double=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_double=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_double=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_double=LDouble+            else+                fptools_cv_htype_sup_double=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((double)(-1)) < ((double)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_double=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(double) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_double=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_double="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_double="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_double" = no+    then++        fptools_cv_htype_double=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_double" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_double" >&5+$as_echo "$fptools_cv_htype_double" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_DOUBLE $fptools_cv_htype_double+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ptrdiff_t" >&5+$as_echo_n "checking Haskell type for ptrdiff_t... " >&6; }+    if ${fptools_cv_htype_ptrdiff_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_ptrdiff_t=yes+        if ac_fn_c_compute_int "$LINENO" "(ptrdiff_t)0.2 - (ptrdiff_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ptrdiff_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ptrdiff_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ptrdiff_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_ptrdiff_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_ptrdiff_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_ptrdiff_t=LDouble+            else+                fptools_cv_htype_sup_ptrdiff_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((ptrdiff_t)(-1)) < ((ptrdiff_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ptrdiff_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ptrdiff_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_ptrdiff_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_ptrdiff_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_ptrdiff_t" = no+    then++        fptools_cv_htype_ptrdiff_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_ptrdiff_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ptrdiff_t" >&5+$as_echo "$fptools_cv_htype_ptrdiff_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_PTRDIFF_T $fptools_cv_htype_ptrdiff_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for size_t" >&5+$as_echo_n "checking Haskell type for size_t... " >&6; }+    if ${fptools_cv_htype_size_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_size_t=yes+        if ac_fn_c_compute_int "$LINENO" "(size_t)0.2 - (size_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_size_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_size_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_size_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_size_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_size_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_size_t=LDouble+            else+                fptools_cv_htype_sup_size_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((size_t)(-1)) < ((size_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_size_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_size_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_size_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_size_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_size_t" = no+    then++        fptools_cv_htype_size_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_size_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_size_t" >&5+$as_echo "$fptools_cv_htype_size_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIZE_T $fptools_cv_htype_size_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for wchar_t" >&5+$as_echo_n "checking Haskell type for wchar_t... " >&6; }+    if ${fptools_cv_htype_wchar_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_wchar_t=yes+        if ac_fn_c_compute_int "$LINENO" "(wchar_t)0.2 - (wchar_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_wchar_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_wchar_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_wchar_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_wchar_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_wchar_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_wchar_t=LDouble+            else+                fptools_cv_htype_sup_wchar_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((wchar_t)(-1)) < ((wchar_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_wchar_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_wchar_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_wchar_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_wchar_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_wchar_t" = no+    then++        fptools_cv_htype_wchar_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_wchar_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_wchar_t" >&5+$as_echo "$fptools_cv_htype_wchar_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_WCHAR_T $fptools_cv_htype_wchar_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for sig_atomic_t" >&5+$as_echo_n "checking Haskell type for sig_atomic_t... " >&6; }+    if ${fptools_cv_htype_sig_atomic_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_sig_atomic_t=yes+        if ac_fn_c_compute_int "$LINENO" "(sig_atomic_t)0.2 - (sig_atomic_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_sig_atomic_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_sig_atomic_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_sig_atomic_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_sig_atomic_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_sig_atomic_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_sig_atomic_t=LDouble+            else+                fptools_cv_htype_sup_sig_atomic_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((sig_atomic_t)(-1)) < ((sig_atomic_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_sig_atomic_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_sig_atomic_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_sig_atomic_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_sig_atomic_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_sig_atomic_t" = no+    then++        fptools_cv_htype_sig_atomic_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_sig_atomic_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_sig_atomic_t" >&5+$as_echo "$fptools_cv_htype_sig_atomic_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIG_ATOMIC_T $fptools_cv_htype_sig_atomic_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for clock_t" >&5+$as_echo_n "checking Haskell type for clock_t... " >&6; }+    if ${fptools_cv_htype_clock_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_clock_t=yes+        if ac_fn_c_compute_int "$LINENO" "(clock_t)0.2 - (clock_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_clock_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_clock_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_clock_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_clock_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_clock_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_clock_t=LDouble+            else+                fptools_cv_htype_sup_clock_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((clock_t)(-1)) < ((clock_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_clock_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_clock_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_clock_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_clock_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_clock_t" = no+    then++        fptools_cv_htype_clock_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_clock_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clock_t" >&5+$as_echo "$fptools_cv_htype_clock_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CLOCK_T $fptools_cv_htype_clock_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for time_t" >&5+$as_echo_n "checking Haskell type for time_t... " >&6; }+    if ${fptools_cv_htype_time_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_time_t=yes+        if ac_fn_c_compute_int "$LINENO" "(time_t)0.2 - (time_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_time_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_time_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_time_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_time_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_time_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_time_t=LDouble+            else+                fptools_cv_htype_sup_time_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((time_t)(-1)) < ((time_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_time_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_time_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_time_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_time_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_time_t" = no+    then++        fptools_cv_htype_time_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_time_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_time_t" >&5+$as_echo "$fptools_cv_htype_time_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TIME_T $fptools_cv_htype_time_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for useconds_t" >&5+$as_echo_n "checking Haskell type for useconds_t... " >&6; }+    if ${fptools_cv_htype_useconds_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_useconds_t=yes+        if ac_fn_c_compute_int "$LINENO" "(useconds_t)0.2 - (useconds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_useconds_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_useconds_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_useconds_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_useconds_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_useconds_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_useconds_t=LDouble+            else+                fptools_cv_htype_sup_useconds_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((useconds_t)(-1)) < ((useconds_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_useconds_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_useconds_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_useconds_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_useconds_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_useconds_t" = no+    then++        fptools_cv_htype_useconds_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_useconds_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_useconds_t" >&5+$as_echo "$fptools_cv_htype_useconds_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_USECONDS_T $fptools_cv_htype_useconds_t+_ACEOF++    fi++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for suseconds_t" >&5+$as_echo_n "checking Haskell type for suseconds_t... " >&6; }+    if ${fptools_cv_htype_suseconds_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_suseconds_t=yes+        if ac_fn_c_compute_int "$LINENO" "(suseconds_t)0.2 - (suseconds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_suseconds_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_suseconds_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_suseconds_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_suseconds_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_suseconds_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_suseconds_t=LDouble+            else+                fptools_cv_htype_sup_suseconds_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((suseconds_t)(-1)) < ((suseconds_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_suseconds_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_suseconds_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_suseconds_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_suseconds_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_suseconds_t" = no+    then+        if test "$WINDOWS" = "YES"+                          then+                              fptools_cv_htype_suseconds_t=Int32+                              fptools_cv_htype_sup_suseconds_t=yes+                          else+                              as_fn_error $? "type not found" "$LINENO" 5+                          fi+    fi++            if test "$fptools_cv_htype_sup_suseconds_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_suseconds_t" >&5+$as_echo "$fptools_cv_htype_suseconds_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SUSECONDS_T $fptools_cv_htype_suseconds_t+_ACEOF++    fi++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for dev_t" >&5+$as_echo_n "checking Haskell type for dev_t... " >&6; }+    if ${fptools_cv_htype_dev_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_dev_t=yes+        if ac_fn_c_compute_int "$LINENO" "(dev_t)0.2 - (dev_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_dev_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_dev_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_dev_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_dev_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_dev_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_dev_t=LDouble+            else+                fptools_cv_htype_sup_dev_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((dev_t)(-1)) < ((dev_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_dev_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_dev_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_dev_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_dev_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_dev_t" = no+    then++        fptools_cv_htype_dev_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_dev_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_dev_t" >&5+$as_echo "$fptools_cv_htype_dev_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_DEV_T $fptools_cv_htype_dev_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ino_t" >&5+$as_echo_n "checking Haskell type for ino_t... " >&6; }+    if ${fptools_cv_htype_ino_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_ino_t=yes+        if ac_fn_c_compute_int "$LINENO" "(ino_t)0.2 - (ino_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ino_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ino_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ino_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_ino_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_ino_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_ino_t=LDouble+            else+                fptools_cv_htype_sup_ino_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((ino_t)(-1)) < ((ino_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ino_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ino_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_ino_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_ino_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_ino_t" = no+    then++        fptools_cv_htype_ino_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_ino_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ino_t" >&5+$as_echo "$fptools_cv_htype_ino_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INO_T $fptools_cv_htype_ino_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for mode_t" >&5+$as_echo_n "checking Haskell type for mode_t... " >&6; }+    if ${fptools_cv_htype_mode_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_mode_t=yes+        if ac_fn_c_compute_int "$LINENO" "(mode_t)0.2 - (mode_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_mode_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_mode_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_mode_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_mode_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_mode_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_mode_t=LDouble+            else+                fptools_cv_htype_sup_mode_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((mode_t)(-1)) < ((mode_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_mode_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_mode_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_mode_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_mode_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_mode_t" = no+    then++        fptools_cv_htype_mode_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_mode_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_mode_t" >&5+$as_echo "$fptools_cv_htype_mode_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_MODE_T $fptools_cv_htype_mode_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for off_t" >&5+$as_echo_n "checking Haskell type for off_t... " >&6; }+    if ${fptools_cv_htype_off_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_off_t=yes+        if ac_fn_c_compute_int "$LINENO" "(off_t)0.2 - (off_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_off_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_off_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_off_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_off_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_off_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_off_t=LDouble+            else+                fptools_cv_htype_sup_off_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((off_t)(-1)) < ((off_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_off_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_off_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_off_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_off_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_off_t" = no+    then++        fptools_cv_htype_off_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_off_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_off_t" >&5+$as_echo "$fptools_cv_htype_off_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_OFF_T $fptools_cv_htype_off_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for pid_t" >&5+$as_echo_n "checking Haskell type for pid_t... " >&6; }+    if ${fptools_cv_htype_pid_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_pid_t=yes+        if ac_fn_c_compute_int "$LINENO" "(pid_t)0.2 - (pid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_pid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_pid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_pid_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_pid_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_pid_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_pid_t=LDouble+            else+                fptools_cv_htype_sup_pid_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((pid_t)(-1)) < ((pid_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_pid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_pid_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_pid_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_pid_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_pid_t" = no+    then++        fptools_cv_htype_pid_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_pid_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_pid_t" >&5+$as_echo "$fptools_cv_htype_pid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_PID_T $fptools_cv_htype_pid_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for gid_t" >&5+$as_echo_n "checking Haskell type for gid_t... " >&6; }+    if ${fptools_cv_htype_gid_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_gid_t=yes+        if ac_fn_c_compute_int "$LINENO" "(gid_t)0.2 - (gid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_gid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_gid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_gid_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_gid_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_gid_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_gid_t=LDouble+            else+                fptools_cv_htype_sup_gid_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((gid_t)(-1)) < ((gid_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_gid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_gid_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_gid_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_gid_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_gid_t" = no+    then++        fptools_cv_htype_gid_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_gid_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_gid_t" >&5+$as_echo "$fptools_cv_htype_gid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_GID_T $fptools_cv_htype_gid_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uid_t" >&5+$as_echo_n "checking Haskell type for uid_t... " >&6; }+    if ${fptools_cv_htype_uid_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_uid_t=yes+        if ac_fn_c_compute_int "$LINENO" "(uid_t)0.2 - (uid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uid_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_uid_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_uid_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_uid_t=LDouble+            else+                fptools_cv_htype_sup_uid_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((uid_t)(-1)) < ((uid_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uid_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uid_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_uid_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_uid_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_uid_t" = no+    then++        fptools_cv_htype_uid_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_uid_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uid_t" >&5+$as_echo "$fptools_cv_htype_uid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UID_T $fptools_cv_htype_uid_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for cc_t" >&5+$as_echo_n "checking Haskell type for cc_t... " >&6; }+    if ${fptools_cv_htype_cc_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_cc_t=yes+        if ac_fn_c_compute_int "$LINENO" "(cc_t)0.2 - (cc_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_cc_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_cc_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_cc_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_cc_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_cc_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_cc_t=LDouble+            else+                fptools_cv_htype_sup_cc_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((cc_t)(-1)) < ((cc_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_cc_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_cc_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_cc_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_cc_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_cc_t" = no+    then++        fptools_cv_htype_cc_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_cc_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_cc_t" >&5+$as_echo "$fptools_cv_htype_cc_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CC_T $fptools_cv_htype_cc_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for speed_t" >&5+$as_echo_n "checking Haskell type for speed_t... " >&6; }+    if ${fptools_cv_htype_speed_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_speed_t=yes+        if ac_fn_c_compute_int "$LINENO" "(speed_t)0.2 - (speed_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_speed_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_speed_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_speed_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_speed_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_speed_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_speed_t=LDouble+            else+                fptools_cv_htype_sup_speed_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((speed_t)(-1)) < ((speed_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_speed_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_speed_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_speed_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_speed_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_speed_t" = no+    then++        fptools_cv_htype_speed_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_speed_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_speed_t" >&5+$as_echo "$fptools_cv_htype_speed_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SPEED_T $fptools_cv_htype_speed_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for tcflag_t" >&5+$as_echo_n "checking Haskell type for tcflag_t... " >&6; }+    if ${fptools_cv_htype_tcflag_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_tcflag_t=yes+        if ac_fn_c_compute_int "$LINENO" "(tcflag_t)0.2 - (tcflag_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_tcflag_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_tcflag_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_tcflag_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_tcflag_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_tcflag_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_tcflag_t=LDouble+            else+                fptools_cv_htype_sup_tcflag_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((tcflag_t)(-1)) < ((tcflag_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_tcflag_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_tcflag_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_tcflag_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_tcflag_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_tcflag_t" = no+    then++        fptools_cv_htype_tcflag_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_tcflag_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_tcflag_t" >&5+$as_echo "$fptools_cv_htype_tcflag_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TCFLAG_T $fptools_cv_htype_tcflag_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for nlink_t" >&5+$as_echo_n "checking Haskell type for nlink_t... " >&6; }+    if ${fptools_cv_htype_nlink_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_nlink_t=yes+        if ac_fn_c_compute_int "$LINENO" "(nlink_t)0.2 - (nlink_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_nlink_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_nlink_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_nlink_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_nlink_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_nlink_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_nlink_t=LDouble+            else+                fptools_cv_htype_sup_nlink_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((nlink_t)(-1)) < ((nlink_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_nlink_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_nlink_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_nlink_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_nlink_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_nlink_t" = no+    then++        fptools_cv_htype_nlink_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_nlink_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nlink_t" >&5+$as_echo "$fptools_cv_htype_nlink_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_NLINK_T $fptools_cv_htype_nlink_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ssize_t" >&5+$as_echo_n "checking Haskell type for ssize_t... " >&6; }+    if ${fptools_cv_htype_ssize_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_ssize_t=yes+        if ac_fn_c_compute_int "$LINENO" "(ssize_t)0.2 - (ssize_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ssize_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ssize_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ssize_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_ssize_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_ssize_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_ssize_t=LDouble+            else+                fptools_cv_htype_sup_ssize_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((ssize_t)(-1)) < ((ssize_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ssize_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_ssize_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_ssize_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_ssize_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_ssize_t" = no+    then++        fptools_cv_htype_ssize_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_ssize_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ssize_t" >&5+$as_echo "$fptools_cv_htype_ssize_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SSIZE_T $fptools_cv_htype_ssize_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for rlim_t" >&5+$as_echo_n "checking Haskell type for rlim_t... " >&6; }+    if ${fptools_cv_htype_rlim_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_rlim_t=yes+        if ac_fn_c_compute_int "$LINENO" "(rlim_t)0.2 - (rlim_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_rlim_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_rlim_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_rlim_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_rlim_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_rlim_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_rlim_t=LDouble+            else+                fptools_cv_htype_sup_rlim_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((rlim_t)(-1)) < ((rlim_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_rlim_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_rlim_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_rlim_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_rlim_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_rlim_t" = no+    then++        fptools_cv_htype_rlim_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_rlim_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_rlim_t" >&5+$as_echo "$fptools_cv_htype_rlim_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_RLIM_T $fptools_cv_htype_rlim_t+_ACEOF++    fi++++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intptr_t" >&5+$as_echo_n "checking Haskell type for intptr_t... " >&6; }+    if ${fptools_cv_htype_intptr_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_intptr_t=yes+        if ac_fn_c_compute_int "$LINENO" "(intptr_t)0.2 - (intptr_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intptr_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intptr_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intptr_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_intptr_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_intptr_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_intptr_t=LDouble+            else+                fptools_cv_htype_sup_intptr_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((intptr_t)(-1)) < ((intptr_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intptr_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intptr_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_intptr_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_intptr_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_intptr_t" = no+    then++        fptools_cv_htype_intptr_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_intptr_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intptr_t" >&5+$as_echo "$fptools_cv_htype_intptr_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INTPTR_T $fptools_cv_htype_intptr_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintptr_t" >&5+$as_echo_n "checking Haskell type for uintptr_t... " >&6; }+    if ${fptools_cv_htype_uintptr_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_uintptr_t=yes+        if ac_fn_c_compute_int "$LINENO" "(uintptr_t)0.2 - (uintptr_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintptr_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintptr_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintptr_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_uintptr_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_uintptr_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_uintptr_t=LDouble+            else+                fptools_cv_htype_sup_uintptr_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((uintptr_t)(-1)) < ((uintptr_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintptr_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintptr_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_uintptr_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_uintptr_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_uintptr_t" = no+    then++        fptools_cv_htype_uintptr_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_uintptr_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintptr_t" >&5+$as_echo "$fptools_cv_htype_uintptr_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UINTPTR_T $fptools_cv_htype_uintptr_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intmax_t" >&5+$as_echo_n "checking Haskell type for intmax_t... " >&6; }+    if ${fptools_cv_htype_intmax_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_intmax_t=yes+        if ac_fn_c_compute_int "$LINENO" "(intmax_t)0.2 - (intmax_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intmax_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intmax_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intmax_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_intmax_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_intmax_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_intmax_t=LDouble+            else+                fptools_cv_htype_sup_intmax_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((intmax_t)(-1)) < ((intmax_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intmax_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_intmax_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_intmax_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_intmax_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_intmax_t" = no+    then++        fptools_cv_htype_intmax_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_intmax_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intmax_t" >&5+$as_echo "$fptools_cv_htype_intmax_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INTMAX_T $fptools_cv_htype_intmax_t+_ACEOF++    fi+++++++++++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintmax_t" >&5+$as_echo_n "checking Haskell type for uintmax_t... " >&6; }+    if ${fptools_cv_htype_uintmax_t+:} false; then :+  $as_echo_n "(cached) " >&6+else++        fptools_cv_htype_sup_uintmax_t=yes+        if ac_fn_c_compute_int "$LINENO" "(uintmax_t)0.2 - (uintmax_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  HTYPE_IS_INTEGRAL=0+fi++++        if test "$HTYPE_IS_INTEGRAL" -eq 0+        then+            if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(float)" "HTYPE_IS_FLOAT"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintmax_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintmax_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintmax_t=no+fi+++            if test "$HTYPE_IS_FLOAT" -eq 1+            then+                fptools_cv_htype_uintmax_t=Float+            elif test "$HTYPE_IS_DOUBLE" -eq 1+            then+                fptools_cv_htype_uintmax_t=Double+            elif test "$HTYPE_IS_LDOUBLE" -eq 1+            then+                fptools_cv_htype_uintmax_t=LDouble+            else+                fptools_cv_htype_sup_uintmax_t=no+            fi+        else+            if ac_fn_c_compute_int "$LINENO" "((uintmax_t)(-1)) < ((uintmax_t)0)" "HTYPE_IS_SIGNED"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintmax_t=no+fi+++            if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) * 8" "HTYPE_SIZE"        "+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>+"; then :++else+  fptools_cv_htype_sup_uintmax_t=no+fi+++            if test "$HTYPE_IS_SIGNED" -eq 0+            then+                fptools_cv_htype_uintmax_t="Word$HTYPE_SIZE"+            else+                fptools_cv_htype_uintmax_t="Int$HTYPE_SIZE"+            fi+        fi++fi++    if test "$fptools_cv_htype_sup_uintmax_t" = no+    then++        fptools_cv_htype_uintmax_t=NotReallyAType+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++    fi++            if test "$fptools_cv_htype_sup_uintmax_t" = yes; then+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintmax_t" >&5+$as_echo "$fptools_cv_htype_uintmax_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UINTMAX_T $fptools_cv_htype_uintmax_t+_ACEOF++    fi++++# test errno values+for fp_const_name in E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR ENOTSUP+do+as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5+$as_echo_n "checking value of $fp_const_name... " >&6; }+if eval \${$as_fp_Cache+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result"        "#include <stdio.h>+#include <errno.h>+"; then :++else+  fp_check_const_result='-1'+fi+++eval "$as_fp_Cache=\$fp_check_const_result"+fi+eval ac_res=\$$as_fp_Cache+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+cat >>confdefs.h <<_ACEOF+#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`+_ACEOF++done+++# we need SIGINT in TopHandler.lhs+for fp_const_name in SIGINT+do+as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5+$as_echo_n "checking value of $fp_const_name... " >&6; }+if eval \${$as_fp_Cache+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result"        "+#if HAVE_SIGNAL_H+#include <signal.h>+#endif+"; then :++else+  fp_check_const_result='-1'+fi+++eval "$as_fp_Cache=\$fp_check_const_result"+fi+eval ac_res=\$$as_fp_Cache+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+cat >>confdefs.h <<_ACEOF+#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`+_ACEOF++done+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of O_BINARY" >&5+$as_echo_n "checking value of O_BINARY... " >&6; }+if ${fp_cv_const_O_BINARY+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "O_BINARY" "fp_check_const_result"        "#include <fcntl.h>+"; then :++else+  fp_check_const_result=0+fi+++fp_cv_const_O_BINARY=$fp_check_const_result+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fp_cv_const_O_BINARY" >&5+$as_echo "$fp_cv_const_O_BINARY" >&6; }+cat >>confdefs.h <<_ACEOF+#define CONST_O_BINARY $fp_cv_const_O_BINARY+_ACEOF+++# We don't use iconv or libcharset on Windows, but if configure finds+# them then it can cause problems. So we don't even try looking if+# we are on Windows.+# See http://www.haskell.org/pipermail/cvs-ghc/2011-September/065980.html+if test "$WINDOWS" = "NO"+then++# We can't just use AC_SEARCH_LIBS for this, as on OpenBSD the iconv.h+# header needs to be included as iconv_open is #define'd to something+# else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us+# to give prototype text.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv" >&5+$as_echo_n "checking for library containing iconv... " >&6; }+if ${ac_cv_search_iconv+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_func_search_save_LIBS=$LIBS+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++#include <stddef.h>+#include <iconv.h>++int+main ()+{+iconv_t cd;+                      cd = iconv_open("", "");+                      iconv(cd,NULL,NULL,NULL,NULL);+                      iconv_close(cd);+  ;+  return 0;+}+_ACEOF+for ac_lib in '' iconv; do+  if test -z "$ac_lib"; then+    ac_res="none required"+  else+    ac_res=-l$ac_lib+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"+  fi+  if ac_fn_c_try_link "$LINENO"; then :+  ac_cv_search_iconv=$ac_res+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext+  if ${ac_cv_search_iconv+:} false; then :+  break+fi+done+if ${ac_cv_search_iconv+:} false; then :++else+  ac_cv_search_iconv=no+fi+rm conftest.$ac_ext+LIBS=$ac_func_search_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv" >&5+$as_echo "$ac_cv_search_iconv" >&6; }+ac_res=$ac_cv_search_iconv+if test "$ac_res" != no; then :+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"+  EXTRA_LIBS="$EXTRA_LIBS $ac_lib"+else+  as_fn_error $? "iconv is required on non-Windows platforms" "$LINENO" 5+fi++# If possible, we use libcharset instead of nl_langinfo(CODESET) to+# determine the current locale's character encoding.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing locale_charset" >&5+$as_echo_n "checking for library containing locale_charset... " >&6; }+if ${ac_cv_search_locale_charset+:} false; then :+  $as_echo_n "(cached) " >&6+else+  ac_func_search_save_LIBS=$LIBS+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <libcharset.h>+int+main ()+{+const char* charset = locale_charset();+  ;+  return 0;+}+_ACEOF+for ac_lib in '' charset; do+  if test -z "$ac_lib"; then+    ac_res="none required"+  else+    ac_res=-l$ac_lib+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"+  fi+  if ac_fn_c_try_link "$LINENO"; then :+  ac_cv_search_locale_charset=$ac_res+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext+  if ${ac_cv_search_locale_charset+:} false; then :+  break+fi+done+if ${ac_cv_search_locale_charset+:} false; then :++else+  ac_cv_search_locale_charset=no+fi+rm conftest.$ac_ext+LIBS=$ac_func_search_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_locale_charset" >&5+$as_echo "$ac_cv_search_locale_charset" >&6; }+ac_res=$ac_cv_search_locale_charset+if test "$ac_res" != no; then :+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"++$as_echo "#define HAVE_LIBCHARSET 1" >>confdefs.h++     EXTRA_LIBS="$EXTRA_LIBS $ac_lib"+fi++fi++# Hack - md5.h needs HsFFI.h.  Is there a better way to do this?+CFLAGS="-I../../includes $CFLAGS"+# The cast to long int works around a bug in the HP C Compiler+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.+# This bug is HP SR number 8606223364.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct MD5Context" >&5+$as_echo_n "checking size of struct MD5Context... " >&6; }+if ${ac_cv_sizeof_struct_MD5Context+:} false; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct MD5Context))" "ac_cv_sizeof_struct_MD5Context"        "#include \"include/md5.h\"+"; then :++else+  if test "$ac_cv_type_struct_MD5Context" = yes; then+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "cannot compute sizeof (struct MD5Context)+See \`config.log' for more details" "$LINENO" 5; }+   else+     ac_cv_sizeof_struct_MD5Context=0+   fi+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_MD5Context" >&5+$as_echo "$ac_cv_sizeof_struct_MD5Context" >&6; }++++cat >>confdefs.h <<_ACEOF+#define SIZEOF_STRUCT_MD5CONTEXT $ac_cv_sizeof_struct_MD5Context+_ACEOF+++++ac_config_files="$ac_config_files base.buildinfo"+++cat >confcache <<\_ACEOF+# This file is a shell script that caches the results of configure+# tests run on this system so they can be shared between configure+# scripts and configure runs, see configure's option --config-cache.+# It is not useful on other systems.  If it contains results you don't+# want to keep, you may remove or edit it.+#+# config.status only pays attention to the cache file if you give it+# the --recheck option to rerun configure.+#+# `ac_cv_env_foo' variables (set or unset) will be overridden when+# loading this file, other *unset* `ac_cv_foo' will be assigned the+# following values.++_ACEOF++# The following way of writing the cache mishandles newlines in values,+# but we know of no workaround that is simple, portable, and efficient.+# So, we kill variables containing newlines.+# Ultrix sh set writes to stderr and can't be redirected directly,+# and sets the high bit in the cache file unless we assign to the vars.+(+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do+    eval ac_val=\$$ac_var+    case $ac_val in #(+    *${as_nl}*)+      case $ac_var in #(+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;+      esac+      case $ac_var in #(+      _ | IFS | as_nl) ;; #(+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(+      *) { eval $ac_var=; unset $ac_var;} ;;+      esac ;;+    esac+  done++  (set) 2>&1 |+    case $as_nl`(ac_space=' '; set) 2>&1` in #(+    *${as_nl}ac_space=\ *)+      # `set' does not quote correctly, so add quotes: double-quote+      # substitution turns \\\\ into \\, and sed turns \\ into \.+      sed -n \+	"s/'/'\\\\''/g;+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"+      ;; #(+    *)+      # `set' quotes correctly as required by POSIX, so do not add quotes.+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"+      ;;+    esac |+    sort+) |+  sed '+     /^ac_cv_env_/b end+     t clear+     :clear+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/+     t end+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/+     :end' >>confcache+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else+  if test -w "$cache_file"; then+    if test "x$cache_file" != "x/dev/null"; then+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5+$as_echo "$as_me: updating cache $cache_file" >&6;}+      if test ! -f "$cache_file" || test -h "$cache_file"; then+	cat confcache >"$cache_file"+      else+        case $cache_file in #(+        */* | ?:*)+	  mv -f confcache "$cache_file"$$ &&+	  mv -f "$cache_file"$$ "$cache_file" ;; #(+        *)+	  mv -f confcache "$cache_file" ;;+	esac+      fi+    fi+  else+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}+  fi+fi+rm -f confcache++test "x$prefix" = xNONE && prefix=$ac_default_prefix+# Let make expand exec_prefix.+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'++DEFS=-DHAVE_CONFIG_H++ac_libobjs=+ac_ltlibobjs=+U=+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue+  # 1. Remove the extension, and $U if already installed.+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR+  #    will be set to the directory where LIBOBJS objects are built.+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'+done+LIBOBJS=$ac_libobjs++LTLIBOBJS=$ac_ltlibobjs++++: "${CONFIG_STATUS=./config.status}"+ac_write_fail=0+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files $CONFIG_STATUS"+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}+as_write_fail=0+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1+#! $SHELL+# Generated by $as_me.+# Run this file to recreate the current configuration.+# Compiler output produced by configure, useful for debugging+# configure, is in config.log if it exists.++debug=false+ac_cs_recheck=false+ac_cs_silent=false++SHELL=\${CONFIG_SHELL-$SHELL}+export SHELL+_ASEOF+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1+## -------------------- ##+## M4sh Initialization. ##+## -------------------- ##++# Be more Bourne compatible+DUALCASE=1; export DUALCASE # for MKS sh+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :+  emulate sh+  NULLCMD=:+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which+  # is contrary to our usage.  Disable this feature.+  alias -g '${1+"$@"}'='"$@"'+  setopt NO_GLOB_SUBST+else+  case `(set -o) 2>/dev/null` in #(+  *posix*) :+    set -o posix ;; #(+  *) :+     ;;+esac+fi+++as_nl='+'+export as_nl+# Printing a long string crashes Solaris 7 /usr/bin/printf.+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo+# Prefer a ksh shell builtin over an external printf program on Solaris,+# but without wasting forks for bash or zsh.+if test -z "$BASH_VERSION$ZSH_VERSION" \+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='print -r --'+  as_echo_n='print -rn --'+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='printf %s\n'+  as_echo_n='printf %s'+else+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'+    as_echo_n='/usr/ucb/echo -n'+  else+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'+    as_echo_n_body='eval+      arg=$1;+      case $arg in #(+      *"$as_nl"*)+	expr "X$arg" : "X\\(.*\\)$as_nl";+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;+      esac;+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"+    '+    export as_echo_n_body+    as_echo_n='sh -c $as_echo_n_body as_echo'+  fi+  export as_echo_body+  as_echo='sh -c $as_echo_body as_echo'+fi++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+  PATH_SEPARATOR=:+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||+      PATH_SEPARATOR=';'+  }+fi+++# IFS+# We need space, tab and new line, in precisely that order.  Quoting is+# there to prevent editors from complaining about space-tab.+# (If _AS_PATH_WALK were called with IFS unset, it would disable word+# splitting by setting IFS to empty value.)+IFS=" ""	$as_nl"++# Find who we are.  Look in the path if we contain no directory separator.+as_myself=+case $0 in #((+  *[\\/]* ) as_myself=$0 ;;+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+  done+IFS=$as_save_IFS++     ;;+esac+# We did not find ourselves, most probably we were run as `sh COMMAND'+# in which case we are not to be found in the path.+if test "x$as_myself" = x; then+  as_myself=$0+fi+if test ! -f "$as_myself"; then+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2+  exit 1+fi++# Unset variables that we do not need and which cause bugs (e.g. in+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"+# suppresses any "Segmentation fault" message there.  '((' could+# trigger a bug in pdksh 5.2.14.+for as_var in BASH_ENV ENV MAIL MAILPATH+do eval test x\${$as_var+set} = xset \+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :+done+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+LC_ALL=C+export LC_ALL+LANGUAGE=C+export LANGUAGE++# CDPATH.+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH+++# as_fn_error STATUS ERROR [LINENO LOG_FD]+# ----------------------------------------+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the+# script with STATUS, using 1 if that was 0.+as_fn_error ()+{+  as_status=$1; test $as_status -eq 0 && as_status=1+  if test "$4"; then+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4+  fi+  $as_echo "$as_me: error: $2" >&2+  as_fn_exit $as_status+} # as_fn_error+++# as_fn_set_status STATUS+# -----------------------+# Set $? to STATUS, without forking.+as_fn_set_status ()+{+  return $1+} # as_fn_set_status++# as_fn_exit STATUS+# -----------------+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.+as_fn_exit ()+{+  set +e+  as_fn_set_status $1+  exit $1+} # as_fn_exit++# as_fn_unset VAR+# ---------------+# Portably unset VAR.+as_fn_unset ()+{+  { eval $1=; unset $1;}+}+as_unset=as_fn_unset+# as_fn_append VAR VALUE+# ----------------------+# Append the text in VALUE to the end of the definition contained in VAR. Take+# advantage of any shell optimizations that allow amortized linear growth over+# repeated appends, instead of the typical quadratic growth present in naive+# implementations.+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :+  eval 'as_fn_append ()+  {+    eval $1+=\$2+  }'+else+  as_fn_append ()+  {+    eval $1=\$$1\$2+  }+fi # as_fn_append++# as_fn_arith ARG...+# ------------------+# Perform arithmetic evaluation on the ARGs, and store the result in the+# global $as_val. Take advantage of shells that can avoid forks. The arguments+# must be portable across $(()) and expr.+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :+  eval 'as_fn_arith ()+  {+    as_val=$(( $* ))+  }'+else+  as_fn_arith ()+  {+    as_val=`expr "$@" || test $? -eq 1`+  }+fi # as_fn_arith+++if expr a : '\(a\)' >/dev/null 2>&1 &&+   test "X`expr 00001 : '.*\(...\)'`" = X001; then+  as_expr=expr+else+  as_expr=false+fi++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then+  as_basename=basename+else+  as_basename=false+fi++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then+  as_dirname=dirname+else+  as_dirname=false+fi++as_me=`$as_basename -- "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+	 X"$0" : 'X\(//\)$' \| \+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X/"$0" |+    sed '/^.*\/\([^/][^/]*\)\/*$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`++# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits++ECHO_C= ECHO_N= ECHO_T=+case `echo -n x` in #(((((+-n*)+  case `echo 'xy\c'` in+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.+  xy)  ECHO_C='\c';;+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null+       ECHO_T='	';;+  esac;;+*)+  ECHO_N='-n';;+esac++rm -f conf$$ conf$$.exe conf$$.file+if test -d conf$$.dir; then+  rm -f conf$$.dir/conf$$.file+else+  rm -f conf$$.dir+  mkdir conf$$.dir 2>/dev/null+fi+if (echo >conf$$.file) 2>/dev/null; then+  if ln -s conf$$.file conf$$ 2>/dev/null; then+    as_ln_s='ln -s'+    # ... but there are two gotchas:+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.+    # In both cases, we have to default to `cp -pR'.+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||+      as_ln_s='cp -pR'+  elif ln conf$$.file conf$$ 2>/dev/null; then+    as_ln_s=ln+  else+    as_ln_s='cp -pR'+  fi+else+  as_ln_s='cp -pR'+fi+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file+rmdir conf$$.dir 2>/dev/null+++# as_fn_mkdir_p+# -------------+# Create "$as_dir" as a directory, including parents if necessary.+as_fn_mkdir_p ()+{++  case $as_dir in #(+  -*) as_dir=./$as_dir;;+  esac+  test -d "$as_dir" || eval $as_mkdir_p || {+    as_dirs=+    while :; do+      case $as_dir in #(+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(+      *) as_qdir=$as_dir;;+      esac+      as_dirs="'$as_qdir' $as_dirs"+      as_dir=`$as_dirname -- "$as_dir" ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_dir" : 'X\(//\)[^/]' \| \+	 X"$as_dir" : 'X\(//\)$' \| \+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_dir" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+      test -d "$as_dir" && break+    done+    test -z "$as_dirs" || eval "mkdir $as_dirs"+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"+++} # as_fn_mkdir_p+if mkdir -p . 2>/dev/null; then+  as_mkdir_p='mkdir -p "$as_dir"'+else+  test -d ./-p && rmdir ./-p+  as_mkdir_p=false+fi+++# as_fn_executable_p FILE+# -----------------------+# Test if FILE is an executable regular file.+as_fn_executable_p ()+{+  test -f "$1" && test -x "$1"+} # as_fn_executable_p+as_test_x='test -x'+as_executable_p=as_fn_executable_p++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"+++exec 6>&1+## ----------------------------------- ##+## Main body of $CONFIG_STATUS script. ##+## ----------------------------------- ##+_ASEOF+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# Save the log message, to keep $0 and so on meaningful, and to+# report actual input values of CONFIG_FILES etc. instead of their+# values after options handling.+ac_log="+This file was extended by Haskell base package $as_me 1.0, which was+generated by GNU Autoconf 2.69.  Invocation command line was++  CONFIG_FILES    = $CONFIG_FILES+  CONFIG_HEADERS  = $CONFIG_HEADERS+  CONFIG_LINKS    = $CONFIG_LINKS+  CONFIG_COMMANDS = $CONFIG_COMMANDS+  $ $0 $@++on `(hostname || uname -n) 2>/dev/null | sed 1q`+"++_ACEOF++case $ac_config_files in *"+"*) set x $ac_config_files; shift; ac_config_files=$*;;+esac++case $ac_config_headers in *"+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;+esac+++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+# Files that config.status was made for.+config_files="$ac_config_files"+config_headers="$ac_config_headers"++_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+ac_cs_usage="\+\`$as_me' instantiates files and other configuration actions+from templates according to the current configuration.  Unless the files+and actions are specified as TAGs, all are instantiated by default.++Usage: $0 [OPTION]... [TAG]...++  -h, --help       print this help, then exit+  -V, --version    print version number and configuration settings, then exit+      --config     print configuration, then exit+  -q, --quiet, --silent+                   do not print progress messages+  -d, --debug      don't remove temporary files+      --recheck    update $as_me by reconfiguring in the same conditions+      --file=FILE[:TEMPLATE]+                   instantiate the configuration file FILE+      --header=FILE[:TEMPLATE]+                   instantiate the configuration header FILE++Configuration files:+$config_files++Configuration headers:+$config_headers++Report bugs to <libraries@haskell.org>."++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"+ac_cs_version="\\+Haskell base package config.status 1.0+configured by $0, generated by GNU Autoconf 2.69,+  with options \\"\$ac_cs_config\\"++Copyright (C) 2012 Free Software Foundation, Inc.+This config.status script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it."++ac_pwd='$ac_pwd'+srcdir='$srcdir'+test -n "\$AWK" || AWK=awk+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# The default lists apply if the user does not specify any file.+ac_need_defaults=:+while test $# != 0+do+  case $1 in+  --*=?*)+    ac_option=`expr "X$1" : 'X\([^=]*\)='`+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`+    ac_shift=:+    ;;+  --*=)+    ac_option=`expr "X$1" : 'X\([^=]*\)='`+    ac_optarg=+    ac_shift=:+    ;;+  *)+    ac_option=$1+    ac_optarg=$2+    ac_shift=shift+    ;;+  esac++  case $ac_option in+  # Handling of the options.+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)+    ac_cs_recheck=: ;;+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )+    $as_echo "$ac_cs_version"; exit ;;+  --config | --confi | --conf | --con | --co | --c )+    $as_echo "$ac_cs_config"; exit ;;+  --debug | --debu | --deb | --de | --d | -d )+    debug=: ;;+  --file | --fil | --fi | --f )+    $ac_shift+    case $ac_optarg in+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;+    '') as_fn_error $? "missing file argument" ;;+    esac+    as_fn_append CONFIG_FILES " '$ac_optarg'"+    ac_need_defaults=false;;+  --header | --heade | --head | --hea )+    $ac_shift+    case $ac_optarg in+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;+    esac+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"+    ac_need_defaults=false;;+  --he | --h)+    # Conflict between --help and --header+    as_fn_error $? "ambiguous option: \`$1'+Try \`$0 --help' for more information.";;+  --help | --hel | -h )+    $as_echo "$ac_cs_usage"; exit ;;+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \+  | -silent | --silent | --silen | --sile | --sil | --si | --s)+    ac_cs_silent=: ;;++  # This is an error.+  -*) as_fn_error $? "unrecognized option: \`$1'+Try \`$0 --help' for more information." ;;++  *) as_fn_append ac_config_targets " $1"+     ac_need_defaults=false ;;++  esac+  shift+done++ac_configure_extra_args=++if $ac_cs_silent; then+  exec 6>/dev/null+  ac_configure_extra_args="$ac_configure_extra_args --silent"+fi++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+if \$ac_cs_recheck; then+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion+  shift+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6+  CONFIG_SHELL='$SHELL'+  export CONFIG_SHELL+  exec "\$@"+fi++_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+exec 5>>config.log+{+  echo+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX+## Running $as_me. ##+_ASBOX+  $as_echo "$ac_log"+} >&5++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1++# Handling of arguments.+for ac_config_target in $ac_config_targets+do+  case $ac_config_target in+    "include/HsBaseConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/HsBaseConfig.h" ;;+    "include/EventConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/EventConfig.h" ;;+    "base.buildinfo") CONFIG_FILES="$CONFIG_FILES base.buildinfo" ;;++  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;+  esac+done+++# If the user did not use the arguments to specify the items to instantiate,+# then the envvar interface is used.  Set only those that are not.+# We use the long form for the default assignment because of an extremely+# bizarre bug on SunOS 4.1.3.+if $ac_need_defaults; then+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers+fi++# Have a temporary directory for convenience.  Make it in the build tree+# simply because there is no reason against having it here, and in addition,+# creating and moving files from /tmp can sometimes cause problems.+# Hook for its removal unless debugging.+# Note that there is a small window in which the directory will not be cleaned:+# after its creation but before its name has been assigned to `$tmp'.+$debug ||+{+  tmp= ac_tmp=+  trap 'exit_status=$?+  : "${ac_tmp:=$tmp}"+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status+' 0+  trap 'as_fn_exit 1' 1 2 13 15+}+# Create a (secure) tmp directory for tmp files.++{+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&+  test -d "$tmp"+}  ||+{+  tmp=./conf$$-$RANDOM+  (umask 077 && mkdir "$tmp")+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5+ac_tmp=$tmp++# Set up the scripts for CONFIG_FILES section.+# No need to generate them if there are no CONFIG_FILES.+# This happens for instance with `./config.status config.h'.+if test -n "$CONFIG_FILES"; then+++ac_cr=`echo X | tr X '\015'`+# On cygwin, bash can eat \r inside `` if the user requested igncr.+# But we know of no other shell where ac_cr would be empty at this+# point, so we can use a bashism as a fallback.+if test "x$ac_cr" = x; then+  eval ac_cr=\$\'\\r\'+fi+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then+  ac_cs_awk_cr='\\r'+else+  ac_cs_awk_cr=$ac_cr+fi++echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&+_ACEOF+++{+  echo "cat >conf$$subs.awk <<_ACEOF" &&+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&+  echo "_ACEOF"+} >conf$$subs.sh ||+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`+ac_delim='%!_!# '+for ac_last_try in false false false false false :; do+  . ./conf$$subs.sh ||+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5++  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`+  if test $ac_delim_n = $ac_delim_num; then+    break+  elif $ac_last_try; then+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5+  else+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "+  fi+done+rm -f conf$$subs.sh++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&+_ACEOF+sed -n '+h+s/^/S["/; s/!.*/"]=/+p+g+s/^[^!]*!//+:repl+t repl+s/'"$ac_delim"'$//+t delim+:nl+h+s/\(.\{148\}\)..*/\1/+t more1+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/+p+n+b repl+:more1+s/["\\]/\\&/g; s/^/"/; s/$/"\\/+p+g+s/.\{148\}//+t nl+:delim+h+s/\(.\{148\}\)..*/\1/+t more2+s/["\\]/\\&/g; s/^/"/; s/$/"/+p+b+:more2+s/["\\]/\\&/g; s/^/"/; s/$/"\\/+p+g+s/.\{148\}//+t delim+' <conf$$subs.awk | sed '+/^[^""]/{+  N+  s/\n//+}+' >>$CONFIG_STATUS || ac_write_fail=1+rm -f conf$$subs.awk+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+_ACAWK+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&+  for (key in S) S_is_set[key] = 1+  FS = ""++}+{+  line = $ 0+  nfields = split(line, field, "@")+  substed = 0+  len = length(field[1])+  for (i = 2; i < nfields; i++) {+    key = field[i]+    keylen = length(key)+    if (S_is_set[key]) {+      value = S[key]+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)+      len += length(value) + length(field[++i])+      substed = 1+    } else+      len += 1 + keylen+  }++  print line+}++_ACAWK+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"+else+  cat+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5+_ACEOF++# VPATH may cause trouble with some makes, so we remove sole $(srcdir),+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and+# trailing colons and then remove the whole line if VPATH becomes empty+# (actually we leave an empty line to preserve line numbers).+if test "x$srcdir" = x.; then+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{+h+s///+s/^/:/+s/[	 ]*$/:/+s/:\$(srcdir):/:/g+s/:\${srcdir}:/:/g+s/:@srcdir@:/:/g+s/^:*//+s/:*$//+x+s/\(=[	 ]*\).*/\1/+G+s/\n//+s/^[^=]*=[	 ]*$//+}'+fi++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+fi # test -n "$CONFIG_FILES"++# Set up the scripts for CONFIG_HEADERS section.+# No need to generate them if there are no CONFIG_HEADERS.+# This happens for instance with `./config.status Makefile'.+if test -n "$CONFIG_HEADERS"; then+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||+BEGIN {+_ACEOF++# Transform confdefs.h into an awk script `defines.awk', embedded as+# here-document in config.status, that substitutes the proper values into+# config.h.in to produce config.h.++# Create a delimiter string that does not exist in confdefs.h, to ease+# handling of long lines.+ac_delim='%!_!# '+for ac_last_try in false false :; do+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`+  if test -z "$ac_tt"; then+    break+  elif $ac_last_try; then+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5+  else+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "+  fi+done++# For the awk script, D is an array of macro values keyed by name,+# likewise P contains macro parameters if any.  Preserve backslash+# newline sequences.++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*+sed -n '+s/.\{148\}/&'"$ac_delim"'/g+t rset+:rset+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /+t def+d+:def+s/\\$//+t bsnl+s/["\\]/\\&/g+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\+D["\1"]=" \3"/p+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p+d+:bsnl+s/["\\]/\\&/g+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\+D["\1"]=" \3\\\\\\n"\\/p+t cont+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p+t cont+d+:cont+n+s/.\{148\}/&'"$ac_delim"'/g+t clear+:clear+s/\\$//+t bsnlc+s/["\\]/\\&/g; s/^/"/; s/$/"/p+d+:bsnlc+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p+b cont+' <confdefs.h | sed '+s/'"$ac_delim"'/"\\\+"/g' >>$CONFIG_STATUS || ac_write_fail=1++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+  for (key in D) D_is_set[key] = 1+  FS = ""+}+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {+  line = \$ 0+  split(line, arg, " ")+  if (arg[1] == "#") {+    defundef = arg[2]+    mac1 = arg[3]+  } else {+    defundef = substr(arg[1], 2)+    mac1 = arg[2]+  }+  split(mac1, mac2, "(") #)+  macro = mac2[1]+  prefix = substr(line, 1, index(line, defundef) - 1)+  if (D_is_set[macro]) {+    # Preserve the white space surrounding the "#".+    print prefix "define", macro P[macro] D[macro]+    next+  } else {+    # Replace #undef with comments.  This is necessary, for example,+    # in the case of _POSIX_SOURCE, which is predefined and required+    # on some systems where configure will not decide to define it.+    if (defundef == "undef") {+      print "/*", prefix defundef, macro, "*/"+      next+    }+  }+}+{ print }+_ACAWK+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5+fi # test -n "$CONFIG_HEADERS"+++eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "+shift+for ac_tag+do+  case $ac_tag in+  :[FHLC]) ac_mode=$ac_tag; continue;;+  esac+  case $ac_mode$ac_tag in+  :[FHL]*:*);;+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;+  :[FH]-) ac_tag=-:-;;+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;+  esac+  ac_save_IFS=$IFS+  IFS=:+  set x $ac_tag+  IFS=$ac_save_IFS+  shift+  ac_file=$1+  shift++  case $ac_mode in+  :L) ac_source=$1;;+  :[FH])+    ac_file_inputs=+    for ac_f+    do+      case $ac_f in+      -) ac_f="$ac_tmp/stdin";;+      *) # Look for the file first in the build tree, then in the source tree+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,+	 # because $ac_f cannot contain `:'.+	 test -f "$ac_f" ||+	   case $ac_f in+	   [\\/$]*) false;;+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;+	   esac ||+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;+      esac+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac+      as_fn_append ac_file_inputs " '$ac_f'"+    done++    # Let's still pretend it is `configure' which instantiates (i.e., don't+    # use $as_me), people would be surprised to read:+    #    /* config.h.  Generated by config.status.  */+    configure_input='Generated from '`+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'+	`' by configure.'+    if test x"$ac_file" != x-; then+      configure_input="$ac_file.  $configure_input"+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5+$as_echo "$as_me: creating $ac_file" >&6;}+    fi+    # Neutralize special characters interpreted by sed in replacement strings.+    case $configure_input in #(+    *\&* | *\|* | *\\* )+       ac_sed_conf_input=`$as_echo "$configure_input" |+       sed 's/[\\\\&|]/\\\\&/g'`;; #(+    *) ac_sed_conf_input=$configure_input;;+    esac++    case $ac_tag in+    *:-:* | *:-) cat >"$ac_tmp/stdin" \+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;+    esac+    ;;+  esac++  ac_dir=`$as_dirname -- "$ac_file" ||+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$ac_file" : 'X\(//\)[^/]' \| \+	 X"$ac_file" : 'X\(//\)$' \| \+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$ac_file" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+  as_dir="$ac_dir"; as_fn_mkdir_p+  ac_builddir=.++case "$ac_dir" in+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;+*)+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`+  # A ".." for each directory in $ac_dir_suffix.+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`+  case $ac_top_builddir_sub in+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;+  esac ;;+esac+ac_abs_top_builddir=$ac_pwd+ac_abs_builddir=$ac_pwd$ac_dir_suffix+# for backward compatibility:+ac_top_builddir=$ac_top_build_prefix++case $srcdir in+  .)  # We are building in place.+    ac_srcdir=.+    ac_top_srcdir=$ac_top_builddir_sub+    ac_abs_top_srcdir=$ac_pwd ;;+  [\\/]* | ?:[\\/]* )  # Absolute name.+    ac_srcdir=$srcdir$ac_dir_suffix;+    ac_top_srcdir=$srcdir+    ac_abs_top_srcdir=$srcdir ;;+  *) # Relative name.+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix+    ac_top_srcdir=$ac_top_build_prefix$srcdir+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;+esac+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix+++  case $ac_mode in+  :F)+  #+  # CONFIG_FILE+  #++_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# If the template does not know about datarootdir, expand it.+# FIXME: This hack should be removed a few years after 2.60.+ac_datarootdir_hack=; ac_datarootdir_seen=+ac_sed_dataroot='+/datarootdir/ {+  p+  q+}+/@datadir@/p+/@docdir@/p+/@infodir@/p+/@localedir@/p+/@mandir@/p'+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in+*datarootdir*) ac_datarootdir_seen=yes;;+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}+_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+  ac_datarootdir_hack='+  s&@datadir@&$datadir&g+  s&@docdir@&$docdir&g+  s&@infodir@&$infodir&g+  s&@localedir@&$localedir&g+  s&@mandir@&$mandir&g+  s&\\\${datarootdir}&$datarootdir&g' ;;+esac+_ACEOF++# Neutralize VPATH when `$srcdir' = `.'.+# Shell code in configure.ac might set extrasub.+# FIXME: do we really want to maintain this feature?+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ac_sed_extra="$ac_vpsub+$extrasub+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+:t+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b+s|@configure_input@|$ac_sed_conf_input|;t t+s&@top_builddir@&$ac_top_builddir_sub&;t t+s&@top_build_prefix@&$ac_top_build_prefix&;t t+s&@srcdir@&$ac_srcdir&;t t+s&@abs_srcdir@&$ac_abs_srcdir&;t t+s&@top_srcdir@&$ac_top_srcdir&;t t+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t+s&@builddir@&$ac_builddir&;t t+s&@abs_builddir@&$ac_abs_builddir&;t t+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t+$ac_datarootdir_hack+"+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \+      "$ac_tmp/out"`; test -z "$ac_out"; } &&+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'+which seems to be undefined.  Please make sure it is defined" >&5+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'+which seems to be undefined.  Please make sure it is defined" >&2;}++  rm -f "$ac_tmp/stdin"+  case $ac_file in+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;+  esac \+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5+ ;;+  :H)+  #+  # CONFIG_HEADER+  #+  if test x"$ac_file" != x-; then+    {+      $as_echo "/* $configure_input  */" \+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"+    } >"$ac_tmp/config.h" \+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5+$as_echo "$as_me: $ac_file is unchanged" >&6;}+    else+      rm -f "$ac_file"+      mv "$ac_tmp/config.h" "$ac_file" \+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5+    fi+  else+    $as_echo "/* $configure_input  */" \+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \       || as_fn_error $? "could not create -" "$LINENO" 5   fi  ;;
configure.ac view
@@ -5,17 +5,23 @@  AC_CONFIG_HEADERS([include/HsBaseConfig.h include/EventConfig.h]) +AC_CANONICAL_BUILD+AC_CANONICAL_HOST+AC_CANONICAL_TARGET+ AC_ARG_WITH([cc],             [C compiler],             [CC=$withval]) AC_PROG_CC() -case `uname -s` in-    MINGW*|CYGWIN*)+AC_MSG_CHECKING(for WINDOWS platform)+case $host in+    *mingw32*|*mingw64*|*cygwin*)         WINDOWS=YES;;     *)         WINDOWS=NO;; esac+AC_MSG_RESULT($WINDOWS)  # do we have long longs? AC_CHECK_TYPES([long long])@@ -63,6 +69,22 @@   AC_DEFINE([HAVE_POLL], [1], [Define if you have poll support.]) fi +# unsetenv+AC_CHECK_FUNCS([unsetenv])++###  POSIX.1003.1 unsetenv returns 0 or -1 (EINVAL), but older implementations+###  in common use return void.+AC_CACHE_CHECK([return type of unsetenv], fptools_cv_func_unsetenv_return_type,+  [AC_EGREP_HEADER(changequote(<, >)<void[      ]+unsetenv>changequote([, ]),+                   stdlib.h,+                   [fptools_cv_func_unsetenv_return_type=void],+                   [fptools_cv_func_unsetenv_return_type=int])])+case "$fptools_cv_func_unsetenv_return_type" in+  "void" )+    AC_DEFINE([UNSETENV_RETURNS_VOID], [1], [Define if stdlib.h declares unsetenv to return void.])+  ;;+esac+ dnl-------------------------------------------------------------------- dnl * Deal with arguments telling us iconv is somewhere odd dnl--------------------------------------------------------------------@@ -133,7 +155,7 @@ FPTOOLS_CHECK_HTYPE(uintmax_t)  # test errno values-FP_CHECK_CONSTS([E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR], [#include <stdio.h>+FP_CHECK_CONSTS([E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR ENOTSUP], [#include <stdio.h> #include <errno.h>])  # we need SIGINT in TopHandler.lhs
include/CTypes.h view
@@ -8,201 +8,37 @@ #ifndef CTYPES__H #define CTYPES__H -#include "Typeable.h"- {- // As long as there is no automatic derivation of classes for newtypes we resort // to extremely dirty cpp-hackery.   :-P   Some care has to be taken when the // macros below are modified, otherwise the layout rule will bite you. -} ---  // A hacked version for GHC follows the Haskell 98 version...-#ifndef __GLASGOW_HASKELL__--#define ARITHMETIC_TYPE(T,C,S,B) \-newtype T = T B deriving (Eq, Ord) ; \-INSTANCE_NUM(T) ; \-INSTANCE_REAL(T) ; \-INSTANCE_READ(T,B) ; \-INSTANCE_SHOW(T,B) ; \-INSTANCE_ENUM(T) ; \-INSTANCE_STORABLE(T) ; \-INSTANCE_TYPEABLE0(T,C,S) ;--#define INTEGRAL_TYPE(T,C,S,B) \-ARITHMETIC_TYPE(T,C,S,B) ; \-INSTANCE_BOUNDED(T) ; \-INSTANCE_INTEGRAL(T) ; \-INSTANCE_BITS(T)--#define FLOATING_TYPE(T,C,S,B) \-ARITHMETIC_TYPE(T,C,S,B) ; \-INSTANCE_FRACTIONAL(T) ; \-INSTANCE_FLOATING(T) ; \-INSTANCE_REALFRAC(T) ; \-INSTANCE_REALFLOAT(T)--#ifndef __GLASGOW_HASKELL__-#define fakeMap map-#endif--#define INSTANCE_READ(T,B) \-instance Read T where { \-   readsPrec p s = fakeMap (\(x, t) -> (T x, t)) (readsPrec p s) }--#define INSTANCE_SHOW(T,B) \-instance Show T where { \-   showsPrec p (T x) = showsPrec p x }--#define INSTANCE_NUM(T) \-instance Num T where { \-   (T i) + (T j) = T (i + j) ; \-   (T i) - (T j) = T (i - j) ; \-   (T i) * (T j) = T (i * j) ; \-   negate  (T i) = T (negate i) ; \-   abs     (T i) = T (abs    i) ; \-   signum  (T i) = T (signum i) ; \-   fromInteger x = T (fromInteger x) }--#define INSTANCE_BOUNDED(T) \-instance Bounded T where { \-   minBound = T minBound ; \-   maxBound = T maxBound }--#define INSTANCE_ENUM(T) \-instance Enum T where { \-   succ           (T i)             = T (succ i) ; \-   pred           (T i)             = T (pred i) ; \-   toEnum               x           = T (toEnum x) ; \-   fromEnum       (T i)             = fromEnum i ; \-   enumFrom       (T i)             = fakeMap T (enumFrom i) ; \-   enumFromThen   (T i) (T j)       = fakeMap T (enumFromThen i j) ; \-   enumFromTo     (T i) (T j)       = fakeMap T (enumFromTo i j) ; \-   enumFromThenTo (T i) (T j) (T k) = fakeMap T (enumFromThenTo i j k) }--#define INSTANCE_REAL(T) \-instance Real T where { \-   toRational (T i) = toRational i }--#define INSTANCE_INTEGRAL(T) \-instance Integral T where { \-   (T i) `quot`    (T j) = T (i `quot` j) ; \-   (T i) `rem`     (T j) = T (i `rem`  j) ; \-   (T i) `div`     (T j) = T (i `div`  j) ; \-   (T i) `mod`     (T j) = T (i `mod`  j) ; \-   (T i) `quotRem` (T j) = let (q,r) = i `quotRem` j in (T q, T r) ; \-   (T i) `divMod`  (T j) = let (d,m) = i `divMod`  j in (T d, T m) ; \-   toInteger (T i)       = toInteger i }--#define INSTANCE_BITS(T) \-instance Bits T where { \-  (T x) .&.     (T y)   = T (x .&.   y) ; \-  (T x) .|.     (T y)   = T (x .|.   y) ; \-  (T x) `xor`   (T y)   = T (x `xor` y) ; \-  complement    (T x)   = T (complement x) ; \-  shift         (T x) n = T (shift x n) ; \-  unsafeShiftL  (T x) n = T (unsafeShiftL x n) ; \-  unsafeShiftR  (T x) n = T (unsafeShiftR x n) ; \-  rotate        (T x) n = T (rotate x n) ; \-  bit                 n = T (bit n) ; \-  setBit        (T x) n = T (setBit x n) ; \-  clearBit      (T x) n = T (clearBit x n) ; \-  complementBit (T x) n = T (complementBit x n) ; \-  testBit       (T x) n = testBit x n ; \-  bitSize       (T x)   = bitSize x ; \-  isSigned      (T x)   = isSigned x ; \-  popCount      (T x)   = popCount x }--#define INSTANCE_FRACTIONAL(T) \-instance Fractional T where { \-   (T x) / (T y)  = T (x / y) ; \-   recip   (T x)  = T (recip x) ; \-   fromRational r = T (fromRational r) }--#define INSTANCE_FLOATING(T) \-instance Floating T where { \-   pi                    = pi ; \-   exp   (T x)           = T (exp   x) ; \-   log   (T x)           = T (log   x) ; \-   sqrt  (T x)           = T (sqrt  x) ; \-   (T x) **        (T y) = T (x ** y) ; \-   (T x) `logBase` (T y) = T (x `logBase` y) ; \-   sin   (T x)           = T (sin   x) ; \-   cos   (T x)           = T (cos   x) ; \-   tan   (T x)           = T (tan   x) ; \-   asin  (T x)           = T (asin  x) ; \-   acos  (T x)           = T (acos  x) ; \-   atan  (T x)           = T (atan  x) ; \-   sinh  (T x)           = T (sinh  x) ; \-   cosh  (T x)           = T (cosh  x) ; \-   tanh  (T x)           = T (tanh  x) ; \-   asinh (T x)           = T (asinh x) ; \-   acosh (T x)           = T (acosh x) ; \-   atanh (T x)           = T (atanh x) }--#define INSTANCE_REALFRAC(T) \-instance RealFrac T where { \-   properFraction (T x) = let (m,y) = properFraction x in (m, T y) ; \-   truncate (T x) = truncate x ; \-   round    (T x) = round x ; \-   ceiling  (T x) = ceiling x ; \-   floor    (T x) = floor x }--#define INSTANCE_REALFLOAT(T) \-instance RealFloat T where { \-   floatRadix     (T x) = floatRadix x ; \-   floatDigits    (T x) = floatDigits x ; \-   floatRange     (T x) = floatRange x ; \-   decodeFloat    (T x) = decodeFloat x ; \-   encodeFloat m n      = T (encodeFloat m n) ; \-   exponent       (T x) = exponent x ; \-   significand    (T x) = T (significand  x) ; \-   scaleFloat n   (T x) = T (scaleFloat n x) ; \-   isNaN          (T x) = isNaN x ; \-   isInfinite     (T x) = isInfinite x ; \-   isDenormalized (T x) = isDenormalized x ; \-   isNegativeZero (T x) = isNegativeZero x ; \-   isIEEE         (T x) = isIEEE x ; \-   (T x) `atan2`  (T y) = T (x `atan2` y) }--#define INSTANCE_STORABLE(T) \-instance Storable T where { \-   sizeOf    (T x)       = sizeOf x ; \-   alignment (T x)       = alignment x ; \-   peekElemOff a i       = liftM T (peekElemOff (castPtr a) i) ; \-   pokeElemOff a i (T x) = pokeElemOff (castPtr a) i x }--#else /* __GLASGOW_HASKELL__ */- --  // GHC can derive any class for a newtype, so we make use of that here... -#define ARITHMETIC_CLASSES  Eq,Ord,Num,Enum,Storable,Real-#define INTEGRAL_CLASSES Bounded,Integral,Bits+#define ARITHMETIC_CLASSES  Eq,Ord,Num,Enum,Storable,Real,Typeable+#define INTEGRAL_CLASSES Bounded,Integral,Bits,FiniteBits #define FLOATING_CLASSES Fractional,Floating,RealFrac,RealFloat -#define ARITHMETIC_TYPE(T,C,S,B) \+#define ARITHMETIC_TYPE(T,B) \ newtype T = T B deriving (ARITHMETIC_CLASSES); \ INSTANCE_READ(T,B); \-INSTANCE_SHOW(T,B); \-INSTANCE_TYPEABLE0(T,C,S) ;+INSTANCE_SHOW(T,B); -#define INTEGRAL_TYPE(T,C,S,B) \+#define INTEGRAL_TYPE(T,B) \ newtype T = T B deriving (ARITHMETIC_CLASSES, INTEGRAL_CLASSES); \ INSTANCE_READ(T,B); \-INSTANCE_SHOW(T,B); \-INSTANCE_TYPEABLE0(T,C,S) ;+INSTANCE_SHOW(T,B); -#define INTEGRAL_TYPE_WITH_CTYPE(T,THE_CTYPE,C,S,B) \+#define INTEGRAL_TYPE_WITH_CTYPE(T,THE_CTYPE,B) \ newtype {-# CTYPE "THE_CTYPE" #-} T = T B deriving (ARITHMETIC_CLASSES, INTEGRAL_CLASSES); \ INSTANCE_READ(T,B); \-INSTANCE_SHOW(T,B); \-INSTANCE_TYPEABLE0(T,C,S) ;+INSTANCE_SHOW(T,B); -#define FLOATING_TYPE(T,C,S,B) \+#define FLOATING_TYPE(T,B) \ newtype T = T B deriving (ARITHMETIC_CLASSES, FLOATING_CLASSES); \ INSTANCE_READ(T,B); \-INSTANCE_SHOW(T,B); \-INSTANCE_TYPEABLE0(T,C,S) ;+INSTANCE_SHOW(T,B);  #define INSTANCE_READ(T,B) \ instance Read T where { \@@ -214,7 +50,5 @@    showsPrec            = unsafeCoerce# (showsPrec :: Int -> B -> ShowS); \    show                 = unsafeCoerce# (show :: B -> String); \    showList             = unsafeCoerce# (showList :: [B] -> ShowS); }--#endif /* __GLASGOW_HASKELL__ */  #endif
− include/EventConfig.h
@@ -1,92 +0,0 @@-/* include/EventConfig.h.  Generated from EventConfig.h.in by configure.  */-/* include/EventConfig.h.in.  Generated from configure.ac by autoheader.  */--/* Define if you have epoll support. */-#define HAVE_EPOLL 1--/* Define to 1 if you have the `epoll_create1' function. */-/* #undef HAVE_EPOLL_CREATE1 */--/* Define to 1 if you have the `epoll_ctl' function. */-#define HAVE_EPOLL_CTL 1--/* Define to 1 if you have the `eventfd' function. */-#define HAVE_EVENTFD 1--/* Define to 1 if you have the <inttypes.h> header file. */-#define HAVE_INTTYPES_H 1--/* Define to 1 if you have the `kevent' function. */-/* #undef HAVE_KEVENT */--/* Define to 1 if you have the `kevent64' function. */-/* #undef HAVE_KEVENT64 */--/* Define if you have kqueue support. */-/* #undef HAVE_KQUEUE */--/* Define to 1 if you have the <memory.h> header file. */-#define HAVE_MEMORY_H 1--/* Define if you have poll support. */-#define HAVE_POLL 1--/* Define to 1 if you have the <poll.h> header file. */-#define HAVE_POLL_H 1--/* Define to 1 if you have the <signal.h> header file. */-#define HAVE_SIGNAL_H 1--/* Define to 1 if you have the <stdint.h> header file. */-#define HAVE_STDINT_H 1--/* Define to 1 if you have the <stdlib.h> header file. */-#define HAVE_STDLIB_H 1--/* Define to 1 if you have the <strings.h> header file. */-#define HAVE_STRINGS_H 1--/* Define to 1 if you have the <string.h> header file. */-#define HAVE_STRING_H 1--/* Define to 1 if you have the <sys/epoll.h> header file. */-#define HAVE_SYS_EPOLL_H 1--/* Define to 1 if you have the <sys/eventfd.h> header file. */-#define HAVE_SYS_EVENTFD_H 1--/* Define to 1 if you have the <sys/event.h> header file. */-/* #undef HAVE_SYS_EVENT_H */--/* Define to 1 if you have the <sys/stat.h> header file. */-#define HAVE_SYS_STAT_H 1--/* Define to 1 if you have the <sys/types.h> header file. */-#define HAVE_SYS_TYPES_H 1--/* Define to 1 if you have the <unistd.h> header file. */-#define HAVE_UNISTD_H 1--/* Define to the address where bug reports for this package should be sent. */-#define PACKAGE_BUGREPORT "libraries@haskell.org"--/* Define to the full name of this package. */-#define PACKAGE_NAME "Haskell base package"--/* Define to the full name and version of this package. */-#define PACKAGE_STRING "Haskell base package 1.0"--/* Define to the one symbol short name of this package. */-#define PACKAGE_TARNAME "base"--/* Define to the version of this package. */-#define PACKAGE_VERSION "1.0"--/* Define to 1 if you have the ANSI C header files. */-#define STDC_HEADERS 1--/* The size of `kev.filter', as computed by sizeof. */-/* #undef SIZEOF_KEV_FILTER */--/* The size of `kev.flags', as computed by sizeof. */-/* #undef SIZEOF_KEV_FLAGS */
+ include/EventConfig.h.in view
@@ -0,0 +1,91 @@+/* include/EventConfig.h.in.  Generated from configure.ac by autoheader.  */++/* Define if you have epoll support. */+#undef HAVE_EPOLL++/* Define to 1 if you have the `epoll_create1' function. */+#undef HAVE_EPOLL_CREATE1++/* Define to 1 if you have the `epoll_ctl' function. */+#undef HAVE_EPOLL_CTL++/* Define to 1 if you have the `eventfd' function. */+#undef HAVE_EVENTFD++/* Define to 1 if you have the <inttypes.h> header file. */+#undef HAVE_INTTYPES_H++/* Define to 1 if you have the `kevent' function. */+#undef HAVE_KEVENT++/* Define to 1 if you have the `kevent64' function. */+#undef HAVE_KEVENT64++/* Define if you have kqueue support. */+#undef HAVE_KQUEUE++/* Define to 1 if you have the <memory.h> header file. */+#undef HAVE_MEMORY_H++/* Define if you have poll support. */+#undef HAVE_POLL++/* Define to 1 if you have the <poll.h> header file. */+#undef HAVE_POLL_H++/* Define to 1 if you have the <signal.h> header file. */+#undef HAVE_SIGNAL_H++/* Define to 1 if you have the <stdint.h> header file. */+#undef HAVE_STDINT_H++/* Define to 1 if you have the <stdlib.h> header file. */+#undef HAVE_STDLIB_H++/* Define to 1 if you have the <strings.h> header file. */+#undef HAVE_STRINGS_H++/* Define to 1 if you have the <string.h> header file. */+#undef HAVE_STRING_H++/* Define to 1 if you have the <sys/epoll.h> header file. */+#undef HAVE_SYS_EPOLL_H++/* Define to 1 if you have the <sys/eventfd.h> header file. */+#undef HAVE_SYS_EVENTFD_H++/* Define to 1 if you have the <sys/event.h> header file. */+#undef HAVE_SYS_EVENT_H++/* Define to 1 if you have the <sys/stat.h> header file. */+#undef HAVE_SYS_STAT_H++/* Define to 1 if you have the <sys/types.h> header file. */+#undef HAVE_SYS_TYPES_H++/* Define to 1 if you have the <unistd.h> header file. */+#undef HAVE_UNISTD_H++/* Define to the address where bug reports for this package should be sent. */+#undef PACKAGE_BUGREPORT++/* Define to the full name of this package. */+#undef PACKAGE_NAME++/* Define to the full name and version of this package. */+#undef PACKAGE_STRING++/* Define to the one symbol short name of this package. */+#undef PACKAGE_TARNAME++/* Define to the version of this package. */+#undef PACKAGE_VERSION++/* Define to 1 if you have the ANSI C header files. */+#undef STDC_HEADERS++/* The size of `kev.filter', as computed by sizeof. */+#undef SIZEOF_KEV_FILTER++/* The size of `kev.flags', as computed by sizeof. */+#undef SIZEOF_KEV_FLAGS
include/HsBase.h view
@@ -9,11 +9,7 @@ #ifndef __HSBASE_H__ #define __HSBASE_H__ -#ifdef __NHC__-# include "Nhc98BaseConfig.h"-#else #include "HsBaseConfig.h"-#endif  /* ultra-evil... */ #undef PACKAGE_BUGREPORT@@ -141,6 +137,7 @@ #if defined(__MINGW32__) /* in Win32Utils.c */ extern void maperrno (void);+extern int maperrno_func(DWORD dwErrorCode); extern HsWord64 getMonotonicUSec(void); #endif @@ -155,10 +152,6 @@ #include <sys/select.h> #endif -#if HAVE_SYS_EVENT_H-#include <sys/event.h>-#endif- /* in inputReady.c */ extern int fdReady(int fd, int write, int msecs, int isSock); @@ -312,10 +305,6 @@ #endif } -#if __GLASGOW_HASKELL__--#endif /* __GLASGOW_HASKELL__ */- #if defined(__MINGW32__) // We want the versions of stat/fstat/lseek that use 64-bit offsets, // and you have to ask for those explicitly.  Unfortunately there@@ -544,15 +533,6 @@ 	return open(file,how,mode); } #endif--#ifdef HAVE_KEVENT-INLINE int __hscore_kevent(int kq, const struct kevent *changelist,-                           size_t nchanges, struct kevent *eventlist,-                           size_t nevents, const struct timespec *timeout) {-	return kevent(kq, changelist, nchanges, eventlist, nevents, timeout);-}-#endif-  #if darwin_HOST_OS // You should not access _environ directly on Darwin in a bundle/shared library.
− include/HsBaseConfig.h
@@ -1,611 +0,0 @@-/* include/HsBaseConfig.h.  Generated from HsBaseConfig.h.in by configure.  */-/* include/HsBaseConfig.h.in.  Generated from configure.ac by autoheader.  */--/* The value of E2BIG. */-#define CONST_E2BIG 7--/* The value of EACCES. */-#define CONST_EACCES 13--/* The value of EADDRINUSE. */-#define CONST_EADDRINUSE 98--/* The value of EADDRNOTAVAIL. */-#define CONST_EADDRNOTAVAIL 99--/* The value of EADV. */-#define CONST_EADV 68--/* The value of EAFNOSUPPORT. */-#define CONST_EAFNOSUPPORT 97--/* The value of EAGAIN. */-#define CONST_EAGAIN 11--/* The value of EALREADY. */-#define CONST_EALREADY 114--/* The value of EBADF. */-#define CONST_EBADF 9--/* The value of EBADMSG. */-#define CONST_EBADMSG 74--/* The value of EBADRPC. */-#define CONST_EBADRPC -1--/* The value of EBUSY. */-#define CONST_EBUSY 16--/* The value of ECHILD. */-#define CONST_ECHILD 10--/* The value of ECOMM. */-#define CONST_ECOMM 70--/* The value of ECONNABORTED. */-#define CONST_ECONNABORTED 103--/* The value of ECONNREFUSED. */-#define CONST_ECONNREFUSED 111--/* The value of ECONNRESET. */-#define CONST_ECONNRESET 104--/* The value of EDEADLK. */-#define CONST_EDEADLK 35--/* The value of EDESTADDRREQ. */-#define CONST_EDESTADDRREQ 89--/* The value of EDIRTY. */-#define CONST_EDIRTY -1--/* The value of EDOM. */-#define CONST_EDOM 33--/* The value of EDQUOT. */-#define CONST_EDQUOT 122--/* The value of EEXIST. */-#define CONST_EEXIST 17--/* The value of EFAULT. */-#define CONST_EFAULT 14--/* The value of EFBIG. */-#define CONST_EFBIG 27--/* The value of EFTYPE. */-#define CONST_EFTYPE -1--/* The value of EHOSTDOWN. */-#define CONST_EHOSTDOWN 112--/* The value of EHOSTUNREACH. */-#define CONST_EHOSTUNREACH 113--/* The value of EIDRM. */-#define CONST_EIDRM 43--/* The value of EILSEQ. */-#define CONST_EILSEQ 84--/* The value of EINPROGRESS. */-#define CONST_EINPROGRESS 115--/* The value of EINTR. */-#define CONST_EINTR 4--/* The value of EINVAL. */-#define CONST_EINVAL 22--/* The value of EIO. */-#define CONST_EIO 5--/* The value of EISCONN. */-#define CONST_EISCONN 106--/* The value of EISDIR. */-#define CONST_EISDIR 21--/* The value of ELOOP. */-#define CONST_ELOOP 40--/* The value of EMFILE. */-#define CONST_EMFILE 24--/* The value of EMLINK. */-#define CONST_EMLINK 31--/* The value of EMSGSIZE. */-#define CONST_EMSGSIZE 90--/* The value of EMULTIHOP. */-#define CONST_EMULTIHOP 72--/* The value of ENAMETOOLONG. */-#define CONST_ENAMETOOLONG 36--/* The value of ENETDOWN. */-#define CONST_ENETDOWN 100--/* The value of ENETRESET. */-#define CONST_ENETRESET 102--/* The value of ENETUNREACH. */-#define CONST_ENETUNREACH 101--/* The value of ENFILE. */-#define CONST_ENFILE 23--/* The value of ENOBUFS. */-#define CONST_ENOBUFS 105--/* The value of ENOCIGAR. */-#define CONST_ENOCIGAR -1--/* The value of ENODATA. */-#define CONST_ENODATA 61--/* The value of ENODEV. */-#define CONST_ENODEV 19--/* The value of ENOENT. */-#define CONST_ENOENT 2--/* The value of ENOEXEC. */-#define CONST_ENOEXEC 8--/* The value of ENOLCK. */-#define CONST_ENOLCK 37--/* The value of ENOLINK. */-#define CONST_ENOLINK 67--/* The value of ENOMEM. */-#define CONST_ENOMEM 12--/* The value of ENOMSG. */-#define CONST_ENOMSG 42--/* The value of ENONET. */-#define CONST_ENONET 64--/* The value of ENOPROTOOPT. */-#define CONST_ENOPROTOOPT 92--/* The value of ENOSPC. */-#define CONST_ENOSPC 28--/* The value of ENOSR. */-#define CONST_ENOSR 63--/* The value of ENOSTR. */-#define CONST_ENOSTR 60--/* The value of ENOSYS. */-#define CONST_ENOSYS 38--/* The value of ENOTBLK. */-#define CONST_ENOTBLK 15--/* The value of ENOTCONN. */-#define CONST_ENOTCONN 107--/* The value of ENOTDIR. */-#define CONST_ENOTDIR 20--/* The value of ENOTEMPTY. */-#define CONST_ENOTEMPTY 39--/* The value of ENOTSOCK. */-#define CONST_ENOTSOCK 88--/* The value of ENOTTY. */-#define CONST_ENOTTY 25--/* The value of ENXIO. */-#define CONST_ENXIO 6--/* The value of EOPNOTSUPP. */-#define CONST_EOPNOTSUPP 95--/* The value of EPERM. */-#define CONST_EPERM 1--/* The value of EPFNOSUPPORT. */-#define CONST_EPFNOSUPPORT 96--/* The value of EPIPE. */-#define CONST_EPIPE 32--/* The value of EPROCLIM. */-#define CONST_EPROCLIM -1--/* The value of EPROCUNAVAIL. */-#define CONST_EPROCUNAVAIL -1--/* The value of EPROGMISMATCH. */-#define CONST_EPROGMISMATCH -1--/* The value of EPROGUNAVAIL. */-#define CONST_EPROGUNAVAIL -1--/* The value of EPROTO. */-#define CONST_EPROTO 71--/* The value of EPROTONOSUPPORT. */-#define CONST_EPROTONOSUPPORT 93--/* The value of EPROTOTYPE. */-#define CONST_EPROTOTYPE 91--/* The value of ERANGE. */-#define CONST_ERANGE 34--/* The value of EREMCHG. */-#define CONST_EREMCHG 78--/* The value of EREMOTE. */-#define CONST_EREMOTE 66--/* The value of EROFS. */-#define CONST_EROFS 30--/* The value of ERPCMISMATCH. */-#define CONST_ERPCMISMATCH -1--/* The value of ERREMOTE. */-#define CONST_ERREMOTE -1--/* The value of ESHUTDOWN. */-#define CONST_ESHUTDOWN 108--/* The value of ESOCKTNOSUPPORT. */-#define CONST_ESOCKTNOSUPPORT 94--/* The value of ESPIPE. */-#define CONST_ESPIPE 29--/* The value of ESRCH. */-#define CONST_ESRCH 3--/* The value of ESRMNT. */-#define CONST_ESRMNT 69--/* The value of ESTALE. */-#define CONST_ESTALE 116--/* The value of ETIME. */-#define CONST_ETIME 62--/* The value of ETIMEDOUT. */-#define CONST_ETIMEDOUT 110--/* The value of ETOOMANYREFS. */-#define CONST_ETOOMANYREFS 109--/* The value of ETXTBSY. */-#define CONST_ETXTBSY 26--/* The value of EUSERS. */-#define CONST_EUSERS 87--/* The value of EWOULDBLOCK. */-#define CONST_EWOULDBLOCK 11--/* The value of EXDEV. */-#define CONST_EXDEV 18--/* The value of O_BINARY. */-#define CONST_O_BINARY 0--/* The value of SIGINT. */-#define CONST_SIGINT 2--/* Define to 1 if you have the `clock_gettime' function. */-#define HAVE_CLOCK_GETTIME 1--/* Define to 1 if you have the <ctype.h> header file. */-#define HAVE_CTYPE_H 1--/* Define if you have epoll support. */-#define HAVE_EPOLL 1--/* Define to 1 if you have the `epoll_ctl' function. */-#define HAVE_EPOLL_CTL 1--/* Define to 1 if you have the <errno.h> header file. */-#define HAVE_ERRNO_H 1--/* Define to 1 if you have the `eventfd' function. */-#define HAVE_EVENTFD 1--/* Define to 1 if you have the <fcntl.h> header file. */-#define HAVE_FCNTL_H 1--/* Define to 1 if you have the `ftruncate' function. */-#define HAVE_FTRUNCATE 1--/* Define to 1 if you have the `getclock' function. */-/* #undef HAVE_GETCLOCK */--/* Define to 1 if you have the `getrusage' function. */-#define HAVE_GETRUSAGE 1--/* Define to 1 if you have the <inttypes.h> header file. */-#define HAVE_INTTYPES_H 1--/* Define to 1 if you have the `iswspace' function. */-#define HAVE_ISWSPACE 1--/* Define to 1 if you have the `kevent' function. */-/* #undef HAVE_KEVENT */--/* Define to 1 if you have the `kevent64' function. */-/* #undef HAVE_KEVENT64 */--/* Define if you have kqueue support. */-/* #undef HAVE_KQUEUE */--/* Define to 1 if you have the <langinfo.h> header file. */-#define HAVE_LANGINFO_H 1--/* Define to 1 if you have libcharset. */-/* #undef HAVE_LIBCHARSET */--/* Define to 1 if you have the `rt' library (-lrt). */-#define HAVE_LIBRT 1--/* Define to 1 if you have the <limits.h> header file. */-#define HAVE_LIMITS_H 1--/* Define to 1 if the system has the type `long long'. */-#define HAVE_LONG_LONG 1--/* Define to 1 if you have the `lstat' function. */-#define HAVE_LSTAT 1--/* Define to 1 if you have the <memory.h> header file. */-#define HAVE_MEMORY_H 1--/* Define if you have poll support. */-#define HAVE_POLL 1--/* Define to 1 if you have the <poll.h> header file. */-#define HAVE_POLL_H 1--/* Define to 1 if you have the <signal.h> header file. */-#define HAVE_SIGNAL_H 1--/* Define to 1 if you have the <stdint.h> header file. */-#define HAVE_STDINT_H 1--/* Define to 1 if you have the <stdlib.h> header file. */-#define HAVE_STDLIB_H 1--/* Define to 1 if you have the <strings.h> header file. */-#define HAVE_STRINGS_H 1--/* Define to 1 if you have the <string.h> header file. */-#define HAVE_STRING_H 1--/* Define to 1 if you have the <sys/epoll.h> header file. */-#define HAVE_SYS_EPOLL_H 1--/* Define to 1 if you have the <sys/eventfd.h> header file. */-#define HAVE_SYS_EVENTFD_H 1--/* Define to 1 if you have the <sys/event.h> header file. */-/* #undef HAVE_SYS_EVENT_H */--/* Define to 1 if you have the <sys/resource.h> header file. */-#define HAVE_SYS_RESOURCE_H 1--/* Define to 1 if you have the <sys/select.h> header file. */-#define HAVE_SYS_SELECT_H 1--/* Define to 1 if you have the <sys/stat.h> header file. */-#define HAVE_SYS_STAT_H 1--/* Define to 1 if you have the <sys/syscall.h> header file. */-#define HAVE_SYS_SYSCALL_H 1--/* Define to 1 if you have the <sys/timeb.h> header file. */-#define HAVE_SYS_TIMEB_H 1--/* Define to 1 if you have the <sys/timers.h> header file. */-/* #undef HAVE_SYS_TIMERS_H */--/* Define to 1 if you have the <sys/times.h> header file. */-#define HAVE_SYS_TIMES_H 1--/* Define to 1 if you have the <sys/time.h> header file. */-#define HAVE_SYS_TIME_H 1--/* Define to 1 if you have the <sys/types.h> header file. */-#define HAVE_SYS_TYPES_H 1--/* Define to 1 if you have the <sys/utsname.h> header file. */-#define HAVE_SYS_UTSNAME_H 1--/* Define to 1 if you have the <sys/wait.h> header file. */-#define HAVE_SYS_WAIT_H 1--/* Define to 1 if you have the <termios.h> header file. */-#define HAVE_TERMIOS_H 1--/* Define to 1 if you have the `times' function. */-#define HAVE_TIMES 1--/* Define to 1 if you have the <time.h> header file. */-#define HAVE_TIME_H 1--/* Define to 1 if you have the <unistd.h> header file. */-#define HAVE_UNISTD_H 1--/* Define to 1 if you have the <utime.h> header file. */-#define HAVE_UTIME_H 1--/* Define to 1 if you have the <wctype.h> header file. */-#define HAVE_WCTYPE_H 1--/* Define to 1 if you have the <windows.h> header file. */-/* #undef HAVE_WINDOWS_H */--/* Define to 1 if you have the <winsock.h> header file. */-/* #undef HAVE_WINSOCK_H */--/* Define to 1 if you have the `_chsize' function. */-/* #undef HAVE__CHSIZE */--/* Define to Haskell type for cc_t */-#define HTYPE_CC_T Word8--/* Define to Haskell type for char */-#define HTYPE_CHAR Int8--/* Define to Haskell type for clock_t */-#define HTYPE_CLOCK_T Int64--/* Define to Haskell type for dev_t */-#define HTYPE_DEV_T Word64--/* Define to Haskell type for double */-#define HTYPE_DOUBLE Double--/* Define to Haskell type for float */-#define HTYPE_FLOAT Float--/* Define to Haskell type for gid_t */-#define HTYPE_GID_T Word32--/* Define to Haskell type for ino_t */-#define HTYPE_INO_T Word64--/* Define to Haskell type for int */-#define HTYPE_INT Int32--/* Define to Haskell type for intmax_t */-#define HTYPE_INTMAX_T Int64--/* Define to Haskell type for intptr_t */-#define HTYPE_INTPTR_T Int64--/* Define to Haskell type for long */-#define HTYPE_LONG Int64--/* Define to Haskell type for long long */-#define HTYPE_LONG_LONG Int64--/* Define to Haskell type for mode_t */-#define HTYPE_MODE_T Word32--/* Define to Haskell type for nlink_t */-#define HTYPE_NLINK_T Word64--/* Define to Haskell type for off_t */-#define HTYPE_OFF_T Int64--/* Define to Haskell type for pid_t */-#define HTYPE_PID_T Int32--/* Define to Haskell type for ptrdiff_t */-#define HTYPE_PTRDIFF_T Int64--/* Define to Haskell type for rlim_t */-#define HTYPE_RLIM_T Word64--/* Define to Haskell type for short */-#define HTYPE_SHORT Int16--/* Define to Haskell type for signed char */-#define HTYPE_SIGNED_CHAR Int8--/* Define to Haskell type for sig_atomic_t */-#define HTYPE_SIG_ATOMIC_T Int32--/* Define to Haskell type for size_t */-#define HTYPE_SIZE_T Word64--/* Define to Haskell type for speed_t */-#define HTYPE_SPEED_T Word32--/* Define to Haskell type for ssize_t */-#define HTYPE_SSIZE_T Int64--/* Define to Haskell type for suseconds_t */-#define HTYPE_SUSECONDS_T Int64--/* Define to Haskell type for tcflag_t */-#define HTYPE_TCFLAG_T Word32--/* Define to Haskell type for time_t */-#define HTYPE_TIME_T Int64--/* Define to Haskell type for uid_t */-#define HTYPE_UID_T Word32--/* Define to Haskell type for uintmax_t */-#define HTYPE_UINTMAX_T Word64--/* Define to Haskell type for uintptr_t */-#define HTYPE_UINTPTR_T Word64--/* Define to Haskell type for unsigned char */-#define HTYPE_UNSIGNED_CHAR Word8--/* Define to Haskell type for unsigned int */-#define HTYPE_UNSIGNED_INT Word32--/* Define to Haskell type for unsigned long */-#define HTYPE_UNSIGNED_LONG Word64--/* Define to Haskell type for unsigned long long */-#define HTYPE_UNSIGNED_LONG_LONG Word64--/* Define to Haskell type for unsigned short */-#define HTYPE_UNSIGNED_SHORT Word16--/* Define to Haskell type for useconds_t */-#define HTYPE_USECONDS_T Word32--/* Define to Haskell type for wchar_t */-#define HTYPE_WCHAR_T Int32--/* Define to the address where bug reports for this package should be sent. */-#define PACKAGE_BUGREPORT "libraries@haskell.org"--/* Define to the full name of this package. */-#define PACKAGE_NAME "Haskell base package"--/* Define to the full name and version of this package. */-#define PACKAGE_STRING "Haskell base package 1.0"--/* Define to the one symbol short name of this package. */-#define PACKAGE_TARNAME "base"--/* Define to the home page for this package. */-#define PACKAGE_URL ""--/* Define to the version of this package. */-#define PACKAGE_VERSION "1.0"--/* The size of `kev.filter', as computed by sizeof. */-/* #undef SIZEOF_KEV_FILTER */--/* The size of `kev.flags', as computed by sizeof. */-/* #undef SIZEOF_KEV_FLAGS */--/* The size of `struct MD5Context', as computed by sizeof. */-#define SIZEOF_STRUCT_MD5CONTEXT 88--/* Define to 1 if you have the ANSI C header files. */-#define STDC_HEADERS 1--/* Number of bits in a file offset, on hosts where this is settable. */-/* #undef _FILE_OFFSET_BITS */--/* Define for large files, on AIX-style hosts. */-/* #undef _LARGE_FILES */
+ include/HsBaseConfig.h.in view
@@ -0,0 +1,624 @@+/* include/HsBaseConfig.h.in.  Generated from configure.ac by autoheader.  */++/* The value of E2BIG. */+#undef CONST_E2BIG++/* The value of EACCES. */+#undef CONST_EACCES++/* The value of EADDRINUSE. */+#undef CONST_EADDRINUSE++/* The value of EADDRNOTAVAIL. */+#undef CONST_EADDRNOTAVAIL++/* The value of EADV. */+#undef CONST_EADV++/* The value of EAFNOSUPPORT. */+#undef CONST_EAFNOSUPPORT++/* The value of EAGAIN. */+#undef CONST_EAGAIN++/* The value of EALREADY. */+#undef CONST_EALREADY++/* The value of EBADF. */+#undef CONST_EBADF++/* The value of EBADMSG. */+#undef CONST_EBADMSG++/* The value of EBADRPC. */+#undef CONST_EBADRPC++/* The value of EBUSY. */+#undef CONST_EBUSY++/* The value of ECHILD. */+#undef CONST_ECHILD++/* The value of ECOMM. */+#undef CONST_ECOMM++/* The value of ECONNABORTED. */+#undef CONST_ECONNABORTED++/* The value of ECONNREFUSED. */+#undef CONST_ECONNREFUSED++/* The value of ECONNRESET. */+#undef CONST_ECONNRESET++/* The value of EDEADLK. */+#undef CONST_EDEADLK++/* The value of EDESTADDRREQ. */+#undef CONST_EDESTADDRREQ++/* The value of EDIRTY. */+#undef CONST_EDIRTY++/* The value of EDOM. */+#undef CONST_EDOM++/* The value of EDQUOT. */+#undef CONST_EDQUOT++/* The value of EEXIST. */+#undef CONST_EEXIST++/* The value of EFAULT. */+#undef CONST_EFAULT++/* The value of EFBIG. */+#undef CONST_EFBIG++/* The value of EFTYPE. */+#undef CONST_EFTYPE++/* The value of EHOSTDOWN. */+#undef CONST_EHOSTDOWN++/* The value of EHOSTUNREACH. */+#undef CONST_EHOSTUNREACH++/* The value of EIDRM. */+#undef CONST_EIDRM++/* The value of EILSEQ. */+#undef CONST_EILSEQ++/* The value of EINPROGRESS. */+#undef CONST_EINPROGRESS++/* The value of EINTR. */+#undef CONST_EINTR++/* The value of EINVAL. */+#undef CONST_EINVAL++/* The value of EIO. */+#undef CONST_EIO++/* The value of EISCONN. */+#undef CONST_EISCONN++/* The value of EISDIR. */+#undef CONST_EISDIR++/* The value of ELOOP. */+#undef CONST_ELOOP++/* The value of EMFILE. */+#undef CONST_EMFILE++/* The value of EMLINK. */+#undef CONST_EMLINK++/* The value of EMSGSIZE. */+#undef CONST_EMSGSIZE++/* The value of EMULTIHOP. */+#undef CONST_EMULTIHOP++/* The value of ENAMETOOLONG. */+#undef CONST_ENAMETOOLONG++/* The value of ENETDOWN. */+#undef CONST_ENETDOWN++/* The value of ENETRESET. */+#undef CONST_ENETRESET++/* The value of ENETUNREACH. */+#undef CONST_ENETUNREACH++/* The value of ENFILE. */+#undef CONST_ENFILE++/* The value of ENOBUFS. */+#undef CONST_ENOBUFS++/* The value of ENOCIGAR. */+#undef CONST_ENOCIGAR++/* The value of ENODATA. */+#undef CONST_ENODATA++/* The value of ENODEV. */+#undef CONST_ENODEV++/* The value of ENOENT. */+#undef CONST_ENOENT++/* The value of ENOEXEC. */+#undef CONST_ENOEXEC++/* The value of ENOLCK. */+#undef CONST_ENOLCK++/* The value of ENOLINK. */+#undef CONST_ENOLINK++/* The value of ENOMEM. */+#undef CONST_ENOMEM++/* The value of ENOMSG. */+#undef CONST_ENOMSG++/* The value of ENONET. */+#undef CONST_ENONET++/* The value of ENOPROTOOPT. */+#undef CONST_ENOPROTOOPT++/* The value of ENOSPC. */+#undef CONST_ENOSPC++/* The value of ENOSR. */+#undef CONST_ENOSR++/* The value of ENOSTR. */+#undef CONST_ENOSTR++/* The value of ENOSYS. */+#undef CONST_ENOSYS++/* The value of ENOTBLK. */+#undef CONST_ENOTBLK++/* The value of ENOTCONN. */+#undef CONST_ENOTCONN++/* The value of ENOTDIR. */+#undef CONST_ENOTDIR++/* The value of ENOTEMPTY. */+#undef CONST_ENOTEMPTY++/* The value of ENOTSOCK. */+#undef CONST_ENOTSOCK++/* The value of ENOTSUP. */+#undef CONST_ENOTSUP++/* The value of ENOTTY. */+#undef CONST_ENOTTY++/* The value of ENXIO. */+#undef CONST_ENXIO++/* The value of EOPNOTSUPP. */+#undef CONST_EOPNOTSUPP++/* The value of EPERM. */+#undef CONST_EPERM++/* The value of EPFNOSUPPORT. */+#undef CONST_EPFNOSUPPORT++/* The value of EPIPE. */+#undef CONST_EPIPE++/* The value of EPROCLIM. */+#undef CONST_EPROCLIM++/* The value of EPROCUNAVAIL. */+#undef CONST_EPROCUNAVAIL++/* The value of EPROGMISMATCH. */+#undef CONST_EPROGMISMATCH++/* The value of EPROGUNAVAIL. */+#undef CONST_EPROGUNAVAIL++/* The value of EPROTO. */+#undef CONST_EPROTO++/* The value of EPROTONOSUPPORT. */+#undef CONST_EPROTONOSUPPORT++/* The value of EPROTOTYPE. */+#undef CONST_EPROTOTYPE++/* The value of ERANGE. */+#undef CONST_ERANGE++/* The value of EREMCHG. */+#undef CONST_EREMCHG++/* The value of EREMOTE. */+#undef CONST_EREMOTE++/* The value of EROFS. */+#undef CONST_EROFS++/* The value of ERPCMISMATCH. */+#undef CONST_ERPCMISMATCH++/* The value of ERREMOTE. */+#undef CONST_ERREMOTE++/* The value of ESHUTDOWN. */+#undef CONST_ESHUTDOWN++/* The value of ESOCKTNOSUPPORT. */+#undef CONST_ESOCKTNOSUPPORT++/* The value of ESPIPE. */+#undef CONST_ESPIPE++/* The value of ESRCH. */+#undef CONST_ESRCH++/* The value of ESRMNT. */+#undef CONST_ESRMNT++/* The value of ESTALE. */+#undef CONST_ESTALE++/* The value of ETIME. */+#undef CONST_ETIME++/* The value of ETIMEDOUT. */+#undef CONST_ETIMEDOUT++/* The value of ETOOMANYREFS. */+#undef CONST_ETOOMANYREFS++/* The value of ETXTBSY. */+#undef CONST_ETXTBSY++/* The value of EUSERS. */+#undef CONST_EUSERS++/* The value of EWOULDBLOCK. */+#undef CONST_EWOULDBLOCK++/* The value of EXDEV. */+#undef CONST_EXDEV++/* The value of O_BINARY. */+#undef CONST_O_BINARY++/* The value of SIGINT. */+#undef CONST_SIGINT++/* Define to 1 if you have the `clock_gettime' function. */+#undef HAVE_CLOCK_GETTIME++/* Define to 1 if you have the <ctype.h> header file. */+#undef HAVE_CTYPE_H++/* Define if you have epoll support. */+#undef HAVE_EPOLL++/* Define to 1 if you have the `epoll_ctl' function. */+#undef HAVE_EPOLL_CTL++/* Define to 1 if you have the <errno.h> header file. */+#undef HAVE_ERRNO_H++/* Define to 1 if you have the `eventfd' function. */+#undef HAVE_EVENTFD++/* Define to 1 if you have the <fcntl.h> header file. */+#undef HAVE_FCNTL_H++/* Define to 1 if you have the `ftruncate' function. */+#undef HAVE_FTRUNCATE++/* Define to 1 if you have the `getclock' function. */+#undef HAVE_GETCLOCK++/* Define to 1 if you have the `getrusage' function. */+#undef HAVE_GETRUSAGE++/* Define to 1 if you have the <inttypes.h> header file. */+#undef HAVE_INTTYPES_H++/* Define to 1 if you have the `iswspace' function. */+#undef HAVE_ISWSPACE++/* Define to 1 if you have the `kevent' function. */+#undef HAVE_KEVENT++/* Define to 1 if you have the `kevent64' function. */+#undef HAVE_KEVENT64++/* Define if you have kqueue support. */+#undef HAVE_KQUEUE++/* Define to 1 if you have the <langinfo.h> header file. */+#undef HAVE_LANGINFO_H++/* Define to 1 if you have libcharset. */+#undef HAVE_LIBCHARSET++/* Define to 1 if you have the `rt' library (-lrt). */+#undef HAVE_LIBRT++/* Define to 1 if you have the <limits.h> header file. */+#undef HAVE_LIMITS_H++/* Define to 1 if the system has the type `long long'. */+#undef HAVE_LONG_LONG++/* Define to 1 if you have the `lstat' function. */+#undef HAVE_LSTAT++/* Define to 1 if you have the <memory.h> header file. */+#undef HAVE_MEMORY_H++/* Define if you have poll support. */+#undef HAVE_POLL++/* Define to 1 if you have the <poll.h> header file. */+#undef HAVE_POLL_H++/* Define to 1 if you have the <signal.h> header file. */+#undef HAVE_SIGNAL_H++/* Define to 1 if you have the <stdint.h> header file. */+#undef HAVE_STDINT_H++/* Define to 1 if you have the <stdlib.h> header file. */+#undef HAVE_STDLIB_H++/* Define to 1 if you have the <strings.h> header file. */+#undef HAVE_STRINGS_H++/* Define to 1 if you have the <string.h> header file. */+#undef HAVE_STRING_H++/* Define to 1 if you have the <sys/epoll.h> header file. */+#undef HAVE_SYS_EPOLL_H++/* Define to 1 if you have the <sys/eventfd.h> header file. */+#undef HAVE_SYS_EVENTFD_H++/* Define to 1 if you have the <sys/event.h> header file. */+#undef HAVE_SYS_EVENT_H++/* Define to 1 if you have the <sys/resource.h> header file. */+#undef HAVE_SYS_RESOURCE_H++/* Define to 1 if you have the <sys/select.h> header file. */+#undef HAVE_SYS_SELECT_H++/* Define to 1 if you have the <sys/stat.h> header file. */+#undef HAVE_SYS_STAT_H++/* Define to 1 if you have the <sys/syscall.h> header file. */+#undef HAVE_SYS_SYSCALL_H++/* Define to 1 if you have the <sys/timeb.h> header file. */+#undef HAVE_SYS_TIMEB_H++/* Define to 1 if you have the <sys/timers.h> header file. */+#undef HAVE_SYS_TIMERS_H++/* Define to 1 if you have the <sys/times.h> header file. */+#undef HAVE_SYS_TIMES_H++/* Define to 1 if you have the <sys/time.h> header file. */+#undef HAVE_SYS_TIME_H++/* Define to 1 if you have the <sys/types.h> header file. */+#undef HAVE_SYS_TYPES_H++/* Define to 1 if you have the <sys/utsname.h> header file. */+#undef HAVE_SYS_UTSNAME_H++/* Define to 1 if you have the <sys/wait.h> header file. */+#undef HAVE_SYS_WAIT_H++/* Define to 1 if you have the <termios.h> header file. */+#undef HAVE_TERMIOS_H++/* Define to 1 if you have the `times' function. */+#undef HAVE_TIMES++/* Define to 1 if you have the <time.h> header file. */+#undef HAVE_TIME_H++/* Define to 1 if you have the <unistd.h> header file. */+#undef HAVE_UNISTD_H++/* Define to 1 if you have the `unsetenv' function. */+#undef HAVE_UNSETENV++/* Define to 1 if you have the <utime.h> header file. */+#undef HAVE_UTIME_H++/* Define to 1 if you have the <wctype.h> header file. */+#undef HAVE_WCTYPE_H++/* Define to 1 if you have the <windows.h> header file. */+#undef HAVE_WINDOWS_H++/* Define to 1 if you have the <winsock.h> header file. */+#undef HAVE_WINSOCK_H++/* Define to 1 if you have the `_chsize' function. */+#undef HAVE__CHSIZE++/* Define to Haskell type for cc_t */+#undef HTYPE_CC_T++/* Define to Haskell type for char */+#undef HTYPE_CHAR++/* Define to Haskell type for clock_t */+#undef HTYPE_CLOCK_T++/* Define to Haskell type for dev_t */+#undef HTYPE_DEV_T++/* Define to Haskell type for double */+#undef HTYPE_DOUBLE++/* Define to Haskell type for float */+#undef HTYPE_FLOAT++/* Define to Haskell type for gid_t */+#undef HTYPE_GID_T++/* Define to Haskell type for ino_t */+#undef HTYPE_INO_T++/* Define to Haskell type for int */+#undef HTYPE_INT++/* Define to Haskell type for intmax_t */+#undef HTYPE_INTMAX_T++/* Define to Haskell type for intptr_t */+#undef HTYPE_INTPTR_T++/* Define to Haskell type for long */+#undef HTYPE_LONG++/* Define to Haskell type for long long */+#undef HTYPE_LONG_LONG++/* Define to Haskell type for mode_t */+#undef HTYPE_MODE_T++/* Define to Haskell type for nlink_t */+#undef HTYPE_NLINK_T++/* Define to Haskell type for off_t */+#undef HTYPE_OFF_T++/* Define to Haskell type for pid_t */+#undef HTYPE_PID_T++/* Define to Haskell type for ptrdiff_t */+#undef HTYPE_PTRDIFF_T++/* Define to Haskell type for rlim_t */+#undef HTYPE_RLIM_T++/* Define to Haskell type for short */+#undef HTYPE_SHORT++/* Define to Haskell type for signed char */+#undef HTYPE_SIGNED_CHAR++/* Define to Haskell type for sig_atomic_t */+#undef HTYPE_SIG_ATOMIC_T++/* Define to Haskell type for size_t */+#undef HTYPE_SIZE_T++/* Define to Haskell type for speed_t */+#undef HTYPE_SPEED_T++/* Define to Haskell type for ssize_t */+#undef HTYPE_SSIZE_T++/* Define to Haskell type for suseconds_t */+#undef HTYPE_SUSECONDS_T++/* Define to Haskell type for tcflag_t */+#undef HTYPE_TCFLAG_T++/* Define to Haskell type for time_t */+#undef HTYPE_TIME_T++/* Define to Haskell type for uid_t */+#undef HTYPE_UID_T++/* Define to Haskell type for uintmax_t */+#undef HTYPE_UINTMAX_T++/* Define to Haskell type for uintptr_t */+#undef HTYPE_UINTPTR_T++/* Define to Haskell type for unsigned char */+#undef HTYPE_UNSIGNED_CHAR++/* Define to Haskell type for unsigned int */+#undef HTYPE_UNSIGNED_INT++/* Define to Haskell type for unsigned long */+#undef HTYPE_UNSIGNED_LONG++/* Define to Haskell type for unsigned long long */+#undef HTYPE_UNSIGNED_LONG_LONG++/* Define to Haskell type for unsigned short */+#undef HTYPE_UNSIGNED_SHORT++/* Define to Haskell type for useconds_t */+#undef HTYPE_USECONDS_T++/* Define to Haskell type for wchar_t */+#undef HTYPE_WCHAR_T++/* Define to the address where bug reports for this package should be sent. */+#undef PACKAGE_BUGREPORT++/* Define to the full name of this package. */+#undef PACKAGE_NAME++/* Define to the full name and version of this package. */+#undef PACKAGE_STRING++/* Define to the one symbol short name of this package. */+#undef PACKAGE_TARNAME++/* Define to the home page for this package. */+#undef PACKAGE_URL++/* Define to the version of this package. */+#undef PACKAGE_VERSION++/* The size of `kev.filter', as computed by sizeof. */+#undef SIZEOF_KEV_FILTER++/* The size of `kev.flags', as computed by sizeof. */+#undef SIZEOF_KEV_FLAGS++/* The size of `struct MD5Context', as computed by sizeof. */+#undef SIZEOF_STRUCT_MD5CONTEXT++/* Define to 1 if you have the ANSI C header files. */+#undef STDC_HEADERS++/* Define if stdlib.h declares unsetenv to return void. */+#undef UNSETENV_RETURNS_VOID++/* Enable large inode numbers on Mac OS X 10.5.  */+#ifndef _DARWIN_USE_64_BIT_INODE+# define _DARWIN_USE_64_BIT_INODE 1+#endif++/* Number of bits in a file offset, on hosts where this is settable. */+#undef _FILE_OFFSET_BITS++/* Define for large files, on AIX-style hosts. */+#undef _LARGE_FILES
+ include/OldTypeable.h view
@@ -0,0 +1,29 @@+{- --------------------------------------------------------------------------+// Macros to help make Typeable instances.+//+// INSTANCE_TYPEABLEn(tc,tcname,"tc") defines+//+//	instance Typeable/n/ tc+//	instance Typeable a => Typeable/n-1/ (tc a)+//	instance (Typeable a, Typeable b) => Typeable/n-2/ (tc a b)+//	...+//	instance (Typeable a1, ..., Typeable an) => Typeable (tc a1 ... an)+// --------------------------------------------------------------------------+-}++#ifndef TYPEABLE_H+#define TYPEABLE_H++--  // For GHC, we can use DeriveDataTypeable + StandaloneDeriving to+--  // generate the instances.++#define INSTANCE_TYPEABLE0(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE1(tycon,tcname,str) deriving instance Typeable1 tycon+#define INSTANCE_TYPEABLE2(tycon,tcname,str) deriving instance Typeable2 tycon+#define INSTANCE_TYPEABLE3(tycon,tcname,str) deriving instance Typeable3 tycon+#define INSTANCE_TYPEABLE4(tycon,tcname,str) deriving instance Typeable4 tycon+#define INSTANCE_TYPEABLE5(tycon,tcname,str) deriving instance Typeable5 tycon+#define INSTANCE_TYPEABLE6(tycon,tcname,str) deriving instance Typeable6 tycon+#define INSTANCE_TYPEABLE7(tycon,tcname,str) deriving instance Typeable7 tycon++#endif
include/Typeable.h view
@@ -14,110 +14,18 @@ #ifndef TYPEABLE_H #define TYPEABLE_H -#ifdef __GLASGOW_HASKELL__+#warning <Typeable.h> is obsolete and will be removed in GHC 7.10  --  // For GHC, we can use DeriveDataTypeable + StandaloneDeriving to --  // generate the instances.  #define INSTANCE_TYPEABLE0(tycon,tcname,str) deriving instance Typeable tycon-#define INSTANCE_TYPEABLE1(tycon,tcname,str) deriving instance Typeable1 tycon-#define INSTANCE_TYPEABLE2(tycon,tcname,str) deriving instance Typeable2 tycon-#define INSTANCE_TYPEABLE3(tycon,tcname,str) deriving instance Typeable3 tycon-#define INSTANCE_TYPEABLE4(tycon,tcname,str) deriving instance Typeable4 tycon-#define INSTANCE_TYPEABLE5(tycon,tcname,str) deriving instance Typeable5 tycon-#define INSTANCE_TYPEABLE6(tycon,tcname,str) deriving instance Typeable6 tycon-#define INSTANCE_TYPEABLE7(tycon,tcname,str) deriving instance Typeable7 tycon--#else /* !__GLASGOW_HASKELL__ */--#define INSTANCE_TYPEABLE0(tycon,tcname,str) \-tcname :: TyCon; \-tcname = mkTyCon str; \-instance Typeable tycon where { typeOf _ = mkTyConApp tcname [] }--#define INSTANCE_TYPEABLE1(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable1 tycon where { typeOf1 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable (tycon a) where { typeOf = typeOfDefault }--#define INSTANCE_TYPEABLE2(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable2 tycon where { typeOf2 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable1 (tycon a) where { \-  typeOf1 = typeOf1Default }; \-instance (Typeable a, Typeable b) => Typeable (tycon a b) where { \-  typeOf = typeOfDefault }--#define INSTANCE_TYPEABLE3(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable3 tycon where { typeOf3 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable2 (tycon a) where { \-  typeOf2 = typeOf2Default }; \-instance (Typeable a, Typeable b) => Typeable1 (tycon a b) where { \-  typeOf1 = typeOf1Default }; \-instance (Typeable a, Typeable b, Typeable c) => Typeable (tycon a b c) where { \-  typeOf = typeOfDefault }--#define INSTANCE_TYPEABLE4(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable4 tycon where { typeOf4 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable3 (tycon a) where { \-  typeOf3 = typeOf3Default }; \-instance (Typeable a, Typeable b) => Typeable2 (tycon a b) where { \-  typeOf2 = typeOf2Default }; \-instance (Typeable a, Typeable b, Typeable c) => Typeable1 (tycon a b c) where { \-  typeOf1 = typeOf1Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable (tycon a b c d) where { \-  typeOf = typeOfDefault }--#define INSTANCE_TYPEABLE5(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable5 tycon where { typeOf5 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable4 (tycon a) where { \-  typeOf4 = typeOf4Default }; \-instance (Typeable a, Typeable b) => Typeable3 (tycon a b) where { \-  typeOf3 = typeOf3Default }; \-instance (Typeable a, Typeable b, Typeable c) => Typeable2 (tycon a b c) where { \-  typeOf2 = typeOf2Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable1 (tycon a b c d) where { \-  typeOf1 = typeOf1Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) => Typeable (tycon a b c d e) where { \-  typeOf = typeOfDefault }--#define INSTANCE_TYPEABLE6(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable6 tycon where { typeOf6 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable5 (tycon a) where { \-  typeOf5 = typeOf5Default }; \-instance (Typeable a, Typeable b) => Typeable4 (tycon a b) where { \-  typeOf4 = typeOf4Default }; \-instance (Typeable a, Typeable b, Typeable c) => Typeable3 (tycon a b c) where { \-  typeOf3 = typeOf3Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable2 (tycon a b c d) where { \-  typeOf2 = typeOf2Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) => Typeable1 (tycon a b c d e) where { \-  typeOf1 = typeOf1Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable f) => Typeable (tycon a b c d e f) where { \-  typeOf = typeOfDefault }--#define INSTANCE_TYPEABLE7(tycon,tcname,str) \-tcname = mkTyCon str; \-instance Typeable7 tycon where { typeOf7 _ = mkTyConApp tcname [] }; \-instance Typeable a => Typeable6 (tycon a) where { \-  typeOf6 = typeOf6Default }; \-instance (Typeable a, Typeable b) => Typeable5 (tycon a b) where { \-  typeOf5 = typeOf5Default }; \-instance (Typeable a, Typeable b, Typeable c) => Typeable4 (tycon a b c) where { \-  typeOf4 = typeOf4Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable3 (tycon a b c d) where { \-  typeOf3 = typeOf3Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) => Typeable2 (tycon a b c d e) where { \-  typeOf2 = typeOf2Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable f) => Typeable1 (tycon a b c d e f) where { \-  typeOf1 = typeOf1Default }; \-instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable f, Typeable g) => Typeable (tycon a b c d e f g) where { \-  typeOf = typeOfDefault }--#endif /* !__GLASGOW_HASKELL__ */+#define INSTANCE_TYPEABLE1(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE2(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE3(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE4(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE5(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE6(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE7(tycon,tcname,str) deriving instance Typeable tycon  #endif
+ include/ieee-flpt.h view
@@ -0,0 +1,35 @@+/* this file is #included into both C (.c and .hc) and Haskell files */++    /* IEEE format floating-point */+#define IEEE_FLOATING_POINT 1++   /* Radix of exponent representation */+#ifndef FLT_RADIX+# define FLT_RADIX 2+#endif++   /* Number of base-FLT_RADIX digits in the significand of a float */+#ifndef FLT_MANT_DIG+# define FLT_MANT_DIG 24+#endif+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */+#ifndef FLT_MIN_EXP+#  define FLT_MIN_EXP (-125)+#endif+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */+#ifndef FLT_MAX_EXP+# define FLT_MAX_EXP 128+#endif++   /* Number of base-FLT_RADIX digits in the significand of a double */+#ifndef DBL_MANT_DIG+# define DBL_MANT_DIG 53+#endif+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */+#ifndef DBL_MIN_EXP+#  define DBL_MIN_EXP (-1021)+#endif+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */+#ifndef DBL_MAX_EXP+# define DBL_MAX_EXP 1024+#endif
include/md5.h view
@@ -13,10 +13,10 @@ 	word32 in[16]; }; -void MD5Init(struct MD5Context *context);-void MD5Update(struct MD5Context *context, byte const *buf, int len);-void MD5Final(byte digest[16], struct MD5Context *context);-void MD5Transform(word32 buf[4], word32 const in[16]);+void __hsbase_MD5Init(struct MD5Context *context);+void __hsbase_MD5Update(struct MD5Context *context, byte const *buf, int len);+void __hsbase_MD5Final(byte digest[16], struct MD5Context *context);+void __hsbase_MD5Transform(word32 buf[4], word32 const in[16]);  #endif /* _MD5_H */ 
install-sh view
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-10-14.15+scriptversion=2011-11-20.07; # UTC  # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the@@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent-# `make' implicit rules from creating a file called install from it+# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written@@ -48,7 +48,7 @@ # set DOITPROG to echo to test this script  # Don't use :- since 4.3BSD and earlier shells don't like it.-doit="${DOITPROG-}"+doit=${DOITPROG-} if test -z "$doit"; then   doit_exec=exec else@@ -58,34 +58,49 @@ # Put in absolute file names if you don't have them in your path; # or use environment vars. -mvprog="${MVPROG-mv}"-cpprog="${CPPROG-cp}"-chmodprog="${CHMODPROG-chmod}"-chownprog="${CHOWNPROG-chown}"-chgrpprog="${CHGRPPROG-chgrp}"-stripprog="${STRIPPROG-strip}"-rmprog="${RMPROG-rm}"-mkdirprog="${MKDIRPROG-mkdir}"+chgrpprog=${CHGRPPROG-chgrp}+chmodprog=${CHMODPROG-chmod}+chownprog=${CHOWNPROG-chown}+cmpprog=${CMPPROG-cmp}+cpprog=${CPPROG-cp}+mkdirprog=${MKDIRPROG-mkdir}+mvprog=${MVPROG-mv}+rmprog=${RMPROG-rm}+stripprog=${STRIPPROG-strip} -posix_glob=+posix_glob='?'+initialize_posix_glob='+  test "$posix_glob" != "?" || {+    if (set -f) 2>/dev/null; then+      posix_glob=+    else+      posix_glob=:+    fi+  }+'+ posix_mkdir=  # Desired mode of installed file. mode=0755 +chgrpcmd= chmodcmd=$chmodprog chowncmd=-chgrpcmd=-stripcmd=+mvcmd=$mvprog rmcmd="$rmprog -f"-mvcmd="$mvprog"+stripcmd=+ src= dst= dir_arg=-dstarg=+dst_arg=++copy_on_change=false no_target_directory= -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE+usage="\+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE    or: $0 [OPTION]... SRCFILES... DIRECTORY    or: $0 [OPTION]... -t DIRECTORY SRCFILES...    or: $0 [OPTION]... -d DIRECTORIES...@@ -95,65 +110,59 @@ In the 4th, create DIRECTORIES.  Options:--c         (ignored)--d         create directories instead of installing files.--g GROUP   $chgrpprog installed files to GROUP.--m MODE    $chmodprog installed files to MODE.--o USER    $chownprog installed files to USER.--s         $stripprog installed files.--t DIRECTORY  install into DIRECTORY.--T         report an error if DSTFILE is a directory.---help     display this help and exit.---version  display version info and exit.+     --help     display this help and exit.+     --version  display version info and exit. +  -c            (ignored)+  -C            install only if different (preserve the last data modification time)+  -d            create directories instead of installing files.+  -g GROUP      $chgrpprog installed files to GROUP.+  -m MODE       $chmodprog installed files to MODE.+  -o USER       $chownprog installed files to USER.+  -s            $stripprog installed files.+  -t DIRECTORY  install into DIRECTORY.+  -T            report an error if DSTFILE is a directory.+ Environment variables override the default commands:-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG+  RMPROG STRIPPROG "  while test $# -ne 0; do   case $1 in-    -c) shift-        continue;;+    -c) ;; -    -d) dir_arg=true-        shift-        continue;;+    -C) copy_on_change=true;; +    -d) dir_arg=true;;+     -g) chgrpcmd="$chgrpprog $2"-        shift-        shift-        continue;;+	shift;;      --help) echo "$usage"; exit $?;;      -m) mode=$2-        shift-        shift 	case $mode in 	  *' '* | *'	'* | *' '*	  | *'*'* | *'?'* | *'['*) 	    echo "$0: invalid mode: $mode" >&2 	    exit 1;; 	esac-        continue;;+	shift;;      -o) chowncmd="$chownprog $2"-        shift-        shift-        continue;;+	shift;; -    -s) stripcmd=$stripprog-        shift-        continue;;+    -s) stripcmd=$stripprog;; -    -t) dstarg=$2-	shift-	shift-	continue;;+    -t) dst_arg=$2+	# Protect names problematic for 'test' and other utilities.+	case $dst_arg in+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;+	esac+	shift;; -    -T) no_target_directory=true-	shift-	continue;;+    -T) no_target_directory=true;;      --version) echo "$0 $scriptversion"; exit $?;; @@ -165,21 +174,26 @@      *)  break;;   esac+  shift done -if test $# -ne 0 && test -z "$dir_arg$dstarg"; then+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then   # When -d is used, all remaining arguments are directories to create.   # When -t is used, the destination is already specified.   # Otherwise, the last argument is the destination.  Remove it from $@.   for arg   do-    if test -n "$dstarg"; then+    if test -n "$dst_arg"; then       # $@ is not empty: it contains at least $arg.-      set fnord "$@" "$dstarg"+      set fnord "$@" "$dst_arg"       shift # fnord     fi     shift # arg-    dstarg=$arg+    dst_arg=$arg+    # Protect names problematic for 'test' and other utilities.+    case $dst_arg in+      -* | [=\(\)!]) dst_arg=./$dst_arg;;+    esac   done fi @@ -188,13 +202,17 @@     echo "$0: no input file specified." >&2     exit 1   fi-  # It's OK to call `install-sh -d' without argument.+  # It's OK to call 'install-sh -d' without argument.   # This can happen when creating conditional directories.   exit 0 fi  if test -z "$dir_arg"; then-  trap '(exit $?); exit' 1 2 13 15+  do_exit='(exit $ret); exit $ret'+  trap "ret=129; $do_exit" 1+  trap "ret=130; $do_exit" 2+  trap "ret=141; $do_exit" 13+  trap "ret=143; $do_exit" 15    # Set umask so as not to create temps with too-generous modes.   # However, 'strip' requires both read and write access to temps.@@ -222,9 +240,9 @@  for src do-  # Protect names starting with `-'.+  # Protect names problematic for 'test' and other utilities.   case $src in-    -*) src=./$src ;;+    -* | [=\(\)!]) src=./$src;;   esac    if test -n "$dir_arg"; then@@ -242,22 +260,17 @@       exit 1     fi -    if test -z "$dstarg"; then+    if test -z "$dst_arg"; then       echo "$0: no destination specified." >&2       exit 1     fi--    dst=$dstarg-    # Protect names starting with `-'.-    case $dst in-      -*) dst=./$dst ;;-    esac+    dst=$dst_arg      # If destination is a directory, append the input filename; won't work     # if double slashes aren't ignored.     if test -d "$dst"; then       if test -n "$no_target_directory"; then-	echo "$0: $dstarg: Is a directory" >&2+	echo "$0: $dst_arg: Is a directory" >&2 	exit 1       fi       dstdir=$dst@@ -341,7 +354,7 @@ 	      if test -z "$dir_arg" || { 		   # Check for POSIX incompatibilities with -m. 		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or-		   # other-writeable bit of parent directory when it shouldn't.+		   # other-writable bit of parent directory when it shouldn't. 		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 		   ls_ld_tmpdir=`ls -ld "$tmpdir"` 		   case $ls_ld_tmpdir in@@ -378,33 +391,26 @@       # directory the slow way, step by step, checking for races as we go.        case $dstdir in-	/*) prefix=/ ;;-	-*) prefix=./ ;;-	*)  prefix= ;;+	/*) prefix='/';;+	[-=\(\)!]*) prefix='./';;+	*)  prefix='';;       esac -      case $posix_glob in-        '')-	  if (set -f) 2>/dev/null; then-	    posix_glob=true-	  else-	    posix_glob=false-	  fi ;;-      esac+      eval "$initialize_posix_glob"        oIFS=$IFS       IFS=/-      $posix_glob && set -f+      $posix_glob set -f       set fnord $dstdir       shift-      $posix_glob && set +f+      $posix_glob set +f       IFS=$oIFS        prefixes=        for d       do-	test -z "$d" && continue+	test X"$d" = X && continue  	prefix=$prefix$d 	if test -d "$prefix"; then@@ -459,42 +465,55 @@     # ignore errors from any of these, just make sure not to ignore     # errors from the above "$doit $cpprog $src $dsttmp" command.     #-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \-      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && -    # Now rename the file to the real destination.-    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \-      || {-	   # The rename failed, perhaps because mv can't rename something else-	   # to itself, or perhaps because mv is so ancient that it does not-	   # support -f.+    # If -C, don't bother to copy if it wouldn't change the file.+    if $copy_on_change &&+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` && -	   # Now remove or move aside any old file at destination location.-	   # We try this two ways since rm can't unlink itself on some-	   # systems and the destination file might be busy for other-	   # reasons.  In this case, the final cleanup might fail but the new-	   # file should still install successfully.-	   {-	     if test -f "$dst"; then-	       $doit $rmcmd -f "$dst" 2>/dev/null \-	       || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \-		     && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\-	       || {-		 echo "$0: cannot unlink or rename $dst" >&2-		 (exit 1); exit 1-	       }-	     else-	       :-	     fi-	   } &&+       eval "$initialize_posix_glob" &&+       $posix_glob set -f &&+       set X $old && old=:$2:$4:$5:$6 &&+       set X $new && new=:$2:$4:$5:$6 &&+       $posix_glob set +f && -	   # Now rename the file to the real destination.-	   $doit $mvcmd "$dsttmp" "$dst"-	 }-    } || exit 1+       test "$old" = "$new" &&+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1+    then+      rm -f "$dsttmp"+    else+      # Rename the file to the real destination.+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || +      # The rename failed, perhaps because mv can't rename something else+      # to itself, or perhaps because mv is so ancient that it does not+      # support -f.+      {+	# Now remove or move aside any old file at destination location.+	# We try this two ways since rm can't unlink itself on some+	# systems and the destination file might be busy for other+	# reasons.  In this case, the final cleanup might fail but the new+	# file should still install successfully.+	{+	  test ! -f "$dst" ||+	  $doit $rmcmd -f "$dst" 2>/dev/null ||+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }+	  } ||+	  { echo "$0: cannot unlink or rename $dst" >&2+	    (exit 1); exit 1+	  }+	} &&++	# Now rename the file to the real destination.+	$doit $mvcmd "$dsttmp" "$dst"+      }+    fi || exit 1+     trap '' 0   fi done@@ -503,5 +522,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H"-# time-stamp-end: "$"+# time-stamp-time-zone: "UTC"+# time-stamp-end: "; # UTC" # End: